PDA

View Full Version : if condition..


Trasion
01-09-2010, 04:06 PM
I want to do a if condition, where...

<td class="alt2 smallfont"><img src="images/misc/controller.png"></td>

I want it so that if:

Forum ID is larger than (>) 1, then it adds a:

style="border-bottom:1px solid #4E4E4E;"

In the code for the td. And if it's equal to 1, it doesn't show it. How can I do this? I'm good with doing if conditions with the equal sign, but I'm wondering how to do the larger than.

JamesC70
01-10-2010, 02:06 AM
Negate the equals sign with a not ("!"):


<td class="alt2 smallfont" &nbsp;
<if condition="$foruminfo['forumid'] != 0">
{ style="border-bottom:1px solid #4E4E4E;"
}
</if>
><img src="images/misc/controller.png"></td>


The nbsp; code is to keep the style statement from crashing into the class statement. If the style statement isn't sent to the user, then the user's browser will ignore it.

Though, I wonder why you specify a forum number > 1, when there's no such "0 forum" in vBulletin. :confused:

Maybe you just want this to display in forums numbered, say, 25 and higher?
<if condition="in_array($forum['forumid'], array(25,26,27,28))">

Code is off the top of my head, it may need tweaking.