vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Cannot parse if function in Custom BBCode's Replacement (https://vborg.vbsupport.ru/showthread.php?t=73857)

AnhTuanCool 01-06-2005 03:15 AM

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

Xenon 01-06-2005 12:04 PM

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

AnhTuanCool 01-06-2005 08:54 PM

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.

Xenon 01-07-2005 12:04 PM

not really

i mean it's not a one liner, you would have to add an if condition parser into the bbcode parsing function...

AnhTuanCool 01-07-2005 09:45 PM

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?

Xenon 01-08-2005 12:03 PM

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

AnhTuanCool 01-13-2005 10:36 PM

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?

Link14716 01-14-2005 01:26 AM

Better yet, look at any code dealing with the quote function and copy if for the new tag. Then just make a template.

AnhTuanCool 01-14-2005 07:58 PM

@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. :\


All times are GMT. The time now is 01:32 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01588 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete