So I have a multiple step question. Part of it is BBcode esque.
I also want custom PHP code to show up in between the two tags. This can change rather drastically based upon what the user has entered in another post.
So say for example, in post 0 there was a
[spoiler=settings]Settingsstring[/spoiler]
tag present.
When a user presses reply the tagnnamehere button on a reply, it would take Settingsstring and do some stuff with it and then create a string called "Output" which could be something like
Code: Select all
[b]AMAZING OUTPUT[/b]
It's a similar idea to how the "Bold" tag works.
What I've tried to do is add my own constant in constants.php and set it to match the BBcode ID that has my html
Added an entry into the case statement for following the same logic
Added a bbcode_tagnameheere function to message_parser.php
Added a case switch to bbcode_init for tagname here.
Cleaned the cache multiple times.
However the code seems to think this tag is still "custom" and doesn't try to use the PHP sections so therefore I'm not getting an error or anything to resolve.
So my question is twofold:
1) Is this the best way to do this? There is very strict whitelisting only of the data from the post 0 of the thread. If it doesn't match then an error string would be output.
2) If not, what is the suggested way to perform a similar function to add this text to the posting box to where the user can press preview, see it and then continue on?
Please excuse my poor artwork but this is what I want to achieve:
Also apologies if this is in the wrong place, this seems like the right one. Should I be in the wrong place, I would appreciate you to redirect me and tell me where it went and what I could do better.
Thanks again for reading this and I hope for lots of fun replies.