Log in

View Full Version : Template Variable Question


Gratisites
07-29-2007, 04:31 PM
I have 5 different header images. 1 Global One, and 4 that I want to show on each of their respective forums.

Will vBulletin let me do that without having to make a whole new style for each forum? I'm guessing there's a way with <if> <else> tags, but I'm not sure how to go about doing that.

Could anyone shed some light?

Kirk Y
07-29-2007, 05:39 PM
<if condition="in_array($GLOBALS[forumid], 5,6,7,8">
<img src="/path/to/header_$GLOBALS[forumid].gif" />
<else />
<img src="/path/to/global_header.gif" />
</if>So what you need to do is rename the 4 forum-specific headers you have to "header_X", where X is the Forum ID where each header should be displayed.

Replace 5,6,7,8 with the Forum IDs that you'd like the specific headers displayed in.

Gratisites
07-29-2007, 05:48 PM
Awesome, thanks man :D

By the way, in case any bystander stumbles upon this with the same problem, I had to modify the above code to work, it's:

<if condition="in_array($GLOBALS[forumid], array(5,6,7,8))">
<img src="/path/to/header_$GLOBALS[forumid].gif" />
<else />
<img src="/path/to/global_header.gif" />
</if>

King Kovifor
07-29-2007, 06:24 PM
in array needs an array as the second variable, so 5,6,7,8 needs to be array(5,6,7,8)!

Kirk Y
07-29-2007, 07:21 PM
Ah, I forgot the array, lol. Sorry about that. :p