Log in

View Full Version : Using double if condition (v3.0.3)


MikaK
08-12-2006, 08:44 AM
How should I formulate an if condition based template snippet where two if conditions should be true?

I've tried the following, but it doesn't seem to work:
<if condition="$userinfo[field26]=='Yes'" AND "in_array($bbuserinfo['userid'], $mybuddies)">
Conditions true
</else>
Conditions false
</if>

Thanks for any ideas!
-Mika

Code Monkey
08-12-2006, 01:09 PM
<else />

condition="$userinfo[field26]=='Yes' AND in_array($bbuserinfo['userid'], $mybuddies)"

You need both statements within the same quotes. You had seperate ones "for" "each" which will not work "they both" need to be in the quotes to evaluate as part of that condition.

MikaK
08-12-2006, 03:02 PM
<else />

condition="$userinfo[field26]=='Yes' AND in_array($bbuserinfo['userid'], $mybuddies)"

You need both statements within the same quotes. You had seperate ones "for" "each" which will not work "they both" need to be in the quotes to evaluate as part of that condition.

Hi Code Monkey,

I feel such a... noob! lol.

Code Monkey
08-12-2006, 03:05 PM
Hi Code Monkey,

I feel such a... noob! lol.

Bah, everyone starts out a noob when it comes to the vBulletin template system.