I want to add a bbcode that requires a PHP script. I figured it out on vBulletin, but is it doable on MyBB?
Can you explain a bit further?
This is code discussion, so I'll move it to the right section of this forum...
Like, I have a certain bbcode called [mana]. It processes the string entered in the tags, and if it matches certain characters it produces a certain image. And I have the PHP code needed for it in base form, I just need to figure out how to connect it to MyBB.
I imagine I could do it with MyCode and regex, but that would be insanely tedious and I'm not sure how to work in an if-statement.
I think you would have to add a custom MyCode.
You need to program a plugin using the parse_message hook.
Something like this may be what you want:
Regular Expression:
\[mana\](char1|something else|blah)\[/mana\]
Replacement:
<img src="images/mana/$1.png" alt="" />
In the above, users can enter "char1", "something else" or "blah" to point to the relevant image. Hope you understand the above.
What does that mean in the code bars?
@tecchie: little more info?
"|" refers to multiple possibilities.
For the above, a user could enter:
[mana]char1[/mana]
or
[mana]something else[/mana]
for example.
Aaaand necro.
Can anyone help me with this? It's an issue again...