Not logged in. · Lost password · Register
Forum: General Help and Support Development RSS
My Syntax plugin appears to not run... Help?
Page:  previous  1  2 
Avatar
LarsDW223 #16
Member since Sep 2014 · 313 posts · Location: Paderborn
Group memberships: Members
Show profile · Link to this post
In reply to post ID 60238
@MidgardApps: I saw lines like ... = & new ... in your plugin code. Do not use & before new. It will run with older PHP versions but it is an error since PHP7 and will cause crashes/blank pages. I sent you a PR to fix it.
Avatar
MidgardApps #17
User title: Director, Lead Developer
Member since Apr 2018 · 10 posts
Group memberships: Members
Show profile · Link to this post
Quote by LarsDW223:
@MidgardApps: I saw lines like ... = & new ... in your plugin code. Do not use & before new. It will run with older PHP versions but it is an error since PHP7 and will cause crashes/blank pages. I sent you a PR to fix it.

Awesome, saw that. The environment I dev'd it in was at work which uses 5.6, and I thought my personal wiki was running 7.0 but apparently not! I'll merge in your PR to rectify the issue. Cheers!
Avatar
turnermm (Moderator) #18
Member since Oct 2009 · 4292 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
I looked over your syntax.php.  I think there is a simpler solution than re-writing parts of the parser to handle the links and parse the plugin syntax.  The addSpecialPattern mode is primarily designed for simple substitutions. If you use the entry and exit patterns, you can use dokuwiki to parse and format your links in the DOKU_LEXER_UNMATCHED data.  Then all you have to think about constructing your info box.  Your problem with the links puzzled me.  I've written a  lot of plugins for dw but never had encountered the links issue.  It turns out that in fact, it is only in the DOKU_LEXER_UNMATCHED mode that you can get formatted links.  I wrote the attached version of your syntax plugin as an exercise to see how dw processed links for plugins.  It constructs the basic table without any styling.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
The author has attached one file to this post:
syntax.zip 1,028 Bytes
You have no permission to open this file.
Avatar
turnermm (Moderator) #19
Member since Oct 2009 · 4292 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
<navbox>
nb-title TITLE 1
nbg-title Group 1
nbg-items [[:start]], [[playground:cell_properties|Cell table Stuff]]
nbg-title Group 2
nbg-items [[:start2]], [[playground:cell_properties|Cell table Stuff]]
nbg-title Group 3
nbg-items [[playground:cell_properties|Cell table Stuff]], [[:orderform|]]
</navbox>
Above is the test syntax I used. Note the commas in the nbg-items list.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
MidgardApps #20
User title: Director, Lead Developer
Member since Apr 2018 · 10 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #18
That is an incredibly elegant version of my code!

I'll definitely be adapting my existing to that format, I'll add the commas as separators too for the list items.
Avatar
turnermm (Moderator) #21
Member since Oct 2009 · 4292 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
Thanks.  It took a while to get to this, since in everything else I tried the links ended up outside the table.  While I have some suspicions as to why, I am not entirely sure.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page:  previous  1  2 
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2018-09-20, 11:09:51 (UTC +02:00)