PDA

View Full Version : Which Language Does Support This if Statement?


Come2Daddy
12-18-2008, 05:19 AM
Hello there,

Actually I always find this kind of condition statements in the vbulletin templates,
it's like this:
<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...
<if condition="$x AND $y == 15">

Come2Daddy
12-20-2008, 11:02 AM
Thanx Dismounted

So this condition is true syntactically?

<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 :)