PDA

View Full Version : Why doesn't this work?


Warlord
06-12-2009, 01:09 AM
<if condition="$forumid != '97' OR '46' OR '70' OR '72'">

do this

<else />

do that

</if>

Working in the templates (navbar template specifically if that matters), can I not specify more than one forumid in each if statement?

--------------- Added 1244772848 at 1244772848 ---------------

Thought I figured it out when I just tried this...

<if condition="$forumid != '97' OR $forumid != '46' OR $forumid != '70' OR $forumid != '72'">

do this

<else />

do that

</if>
But that didn't work either. :(

--------------- Added 1244773074 at 1244773074 ---------------

Dang... thought I had it again, but this didn't work either....

<if condition="$forumid != '97'" OR condition="$forumid != '46'" OR condition="$forumid != '70'" OR condition="$forumid != '72'">

do this

<else />

do that

</if>

That gave me an error when I tried to save the template and told me to go back... GRRRR

MarkPW
06-12-2009, 03:08 AM
change OR to AND...

<if condition="$forumid != 97 AND $forumid != 46 AND $forumid != 70 AND $forumid != 72">

Or you could use !in_array()...

<if condition="!in_array($forumid, array(97,46,70,72))">

Warlord
06-12-2009, 11:05 AM
Awesome, thanks! :D