PDA

View Full Version : [SOLVED] HELP - Two values in conditionals


Duckface
04-15-2015, 04:11 PM
<vb:if condition="$post[userid] == 19">
<a href="#" target="_blank"><img class="inline" src="{vb:stylevar imgdir_button}/ip.gif" alt="Shekii says no no" title="Shekii says no no" /></a>

<!--KAI HIDE-->
<vb:elseif condition="$post[userid] == 1" />
a href="#" target="_blank"><img class="inline" src="{vb:stylevar imgdir_button}/ip.gif" alt="Shekii says no no" title="Shekii says no no" /></a>

<!--TREVOR HIDE-->
<vb:elseif condition="$post[userid] == 140" />
<a href="#" target="_blank"><img class="inline" src="{vb:stylevar imgdir_button}/ip.gif" alt="Shekii says no no" title="Shekii says no no" /></a>
</vb:if>

I tried using this:

<vb:if condition="$post[userid] == 19,1,140"> but it gave an error.

How can I have this in one statement instead of hard ridiculous code?

kh99
04-15-2015, 04:17 PM
One way would be like this:
<vb:if condition="in_array($post[userid], array(19,1,140))">

Duckface
04-15-2015, 04:23 PM
Thank you, just solved it myself testing. Apparently this works:

<vb:if condition="$post[userid] == 19 AND 1 AND 140">