The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Cannot parse if function in Custom BBCode's Replacement
Hi all,
Ok, here's the problem, I wanna make some conditions within the new bbcode I made so I added <if condition...blah blah in the Replacement box in the Add New BB Code and submitted it. But when I turned out and checked it, only the other html elements worked, but if. Ie. I put <if condition="2 < 1">Yeah, 1 is greater than 2<else />Nop 2 is still greater</if> in the Replacement and the text came out as "Yeah, 1 is greater than 2 Nop 2 is still greater" :speechless:. Any replies would be appreciated. Thanks |
#2
|
||||
|
||||
the if conditions are handled in the template parser, which is run while saving a new template.
if you want to be able to run conditions in bbcode as well, you have to modify the parse_bbcode2 function |
#3
|
||||
|
||||
I tried to disable and remove the REMOVE HTML CODES section in parse_bbcode2 functions but the weird thing still came up, can you be more specific about what to modify, that would be great Xenon, thanks.
|
#4
|
||||
|
||||
not really
i mean it's not a one liner, you would have to add an if condition parser into the bbcode parsing function... |
#5
|
||||
|
||||
Hmmm, I thought if condition is a html function and it gotta be trimmed somewhere because all the other html functions work but if? :/ So actually what do I need to modify/add? Can you help me out Xenon?
|
#6
|
||||
|
||||
nope, the if function is written by the developers into the template parser.
it just looks like a normal html code, but it isn't i'd say to take a look at logicians conditional hacks, to see the general way of how such things are coded |
#7
|
||||
|
||||
Hmmm, I've looked at the dynamic annoucement by him and I'd say he just tried to find the if conditional in the text message and then parse it through parse_bbcode2, the point is $dohtml is to 1 in his function, then is that the one I'm looking for? As normal, text message's bbcode is parse through parse_bbcode and then it transfers itself to parse_bbcode2, but I have no idea where $dohtml is defined? Is it a constant or something?
|
#8
|
||||
|
||||
Better yet, look at any code dealing with the quote function and copy if for the new tag. Then just make a template.
|
#9
|
||||
|
||||
@Link14716 - I did, make it all the way like the QUOTE bbcode with function and tag...but when I put it up in the forum, try to open a post with the tag and nothing parse, the tag was just as I typed in. :\
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|