Log in

View Full Version : conditions


paulyy
04-18-2005, 04:40 PM
Is there an if condition that detects the current script?

Theoretically it would be <if condition="THIS_SCRIPT['index']">content</if>

It would also be useful to create an AND or OR statement using this, something like <if condition="THIS_SCRIPT['index'] AND THIS_SCRIPT['usercp']">content<else />all other pages content</if>

It's in my understanding this doesn't exist in vB currently, so I decided to use PHP in the phpinclude_start template. The only problem with this is, it fails to execute any other if conditions placed in there, for example;

$var = '<if condition="$show['registerbutton']">register</a>

Does anyone have a solution?

Colin F
04-18-2005, 04:50 PM
THIS_SCRIPT isn't actually an array, so you can't use THIS_SCRIPT[index].

THIS_SCRIPT is a constant. Check it like this: <if condition="THIS_SCRIPT == 'forumdisplay'">foo</if>

Of course you can use AND as well as OR in there too.

paulyy
04-18-2005, 04:52 PM
Thank you! I'll try this out now :)

Worked a charm, thanks!