PDA

View Full Version : <if> statement based on forum ID?


Rukas
09-24-2008, 03:59 PM
Is it possible to do an if statement based on forum ID?

I want to add an image to postbit dependent on the forum the thread was posted in.

So basically Id like it to be

IF thread is in Forum 1
Use 1.gif
IF thread is in Forum 2
Use 2.jpg
Else use 3.gif

Can anyone help me out?

Thanks.

Lynne
09-24-2008, 04:10 PM
<if condition="$forumid==1">
Use 1.gif
<else />
<if condition="$forumid==2">
Use 2.jpg
<else />
use 3.gif
</if>
</if>
I think that should do it. If $forumid doesn't work, try one of these instead:

$forum[forumid]
$foruminfo[forumid]
$thread[forumid]
$threadinfo[forumid]
$GLOBAL[forumid]

theOZer
09-24-2008, 04:11 PM
Display Information On a Per Forum Basis
--------------------------------------------------
This conditional allows you to display information on a per forum basis. This can be helpful if you wish to display different advertisements depending on what forum that the user is in. You would simply replace X with the forum id that you wish the information to appear in.
HTML Code:
<if condition="$forum[forumid] == X"></if>
and on the other hand you can use the ! to do the opposite and display the information in every forum but the id you list
HTML Code:
<if condition="$forum[forumid] != X"></if>
or if you have multiple forums you wish to include something with you can use an array such as this
HTML Code:
<if condition="in_array($forum['forumid'], array(1,2,3,6))"></if>

I found this information on vBulletinSetup, thread:
http://forum.vbulletinsetup.com/f18/vbulletin-template-conditionals-list-2185.html

~OZ