vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Which Language Does Support This if Statement? (https://vborg.vbsupport.ru/showthread.php?t=199148)

Come2Daddy 12-18-2008 05:19 AM

Which Language Does Support This if Statement?
 
Hello there,

Actually I always find this kind of condition statements in the vbulletin templates,
it's like this:
PHP Code:

<if condition="anyConditionGoesHere">
any fragment of code
</if> 

but I never encountered it in any tutorial resource, and I don't know which language does support this syntax

so I would love to know what language does support this, so I can read more about, such as how to use "and", "or" operaters in case of multible conditions

thanks in advanced

Dismounted 12-18-2008 10:00 AM

Template conditionals are converted into the PHP ternary format, and then eval()'d.

Come2Daddy 12-20-2008 08:47 AM

Hello again,

thank you very much for your replay, actully I would love 2 knoe how to use more than one condition with the "&&" operator or the word "and", and the same is with the "||" operator or the word "or" ..... any details about it would make me glad

Dismounted 12-20-2008 09:18 AM

Just put it in there...
Code:

<if condition="$x AND $y == 15">

Come2Daddy 12-20-2008 11:02 AM

Thanx Dismounted

So this condition is true syntactically?

Code:

<if condition="$userinfo[userid] != 1 AND $userinfo[userid] != 5">

Dismounted 12-20-2008 11:04 AM

You should quote array keys that are strings. (Don't do this in templates outside of the conditional though!)

Come2Daddy 12-20-2008 11:24 AM

Well, actually I'm not very good with arrays specially associative arrays

so I'm going to postpone it, till I have time to dig in it, but I also would like to say thank you, Dismounted :)


All times are GMT. The time now is 06:59 AM.

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.01002 seconds
  • Memory Usage 1,718KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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