PDA

View Full Version : What can I test using template <if condition> ?


richy96
01-19-2011, 08:56 PM
Hi

Having done a lot of playing around with vbulletin php files I'm now having a good go at messing about with templates ;)

I'm Sorry if this has been asked before but the forum search will not allow two character search for 'if condition' so it is hard to find the information I am looking for and this stuff is probably very basic

So can someone tell me what conditions I can check in a template using <if condition>

For example can I do things like

<if condition $post[blahblah]=="something"> <tr><td>$somevariable</td></tr></if>
<if condition $post[blahblah]=="something else"> <tr><td>$someothervariable</td></tr></if>


Also is there some construct like <if condition> do this <else if condition> do that </if> available to me

Finally can I embed php in templates using.......
<?php .
do all this crazy stuff
?> tags

...... and use the embedded php to manipulate globals or other variables and arrays that were available in the vbulletin php file at the time the template was called, then output the results - to save editing the php file itself?

Cheers

Rich

Lynne
01-19-2011, 09:15 PM
Check the articles forums and look for an article with the word "condition*" (note the wildcard!) in the title.

richy96
01-20-2011, 08:42 AM
Spot on

Thanks