The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Conditional display of banners
Hi folks:
I believe this should be straightforward for experienced vBulletin hands, but I've been unable to figure it out. We rotate banners from a number of advertisers across our forum at www.rfidtalk.com. But we have one forum in particular that has a fixed advertiser. To display just the banner from that advertiser, we need to use a different banner-display code snippet than the standard one. So, what I want to do is put in the header template a simple condition that will display the normal banner-display code snippet by default, or the fixed advertiser's code snippet otherwise. Like so: If (forum = "Employment Forum") { Display fixed-advertiser snippet } Else { Display standard code } Any ideas? Thanks! Will |
#2
|
|||
|
|||
<if condition="$forum[forumid] == X"></if>
|
#3
|
||||
|
||||
BTW, you can't use php in templates
|
#4
|
|||
|
|||
<if condition="$forum[forumid] == X"></if><else>do something else</else>
to expand onto that. |
#5
|
|||
|
|||
<if condition="$forum[forumid] != 1">everywhere except 1</if>
<if condition="$forum[forumid] == 1">only in 1</if> |
#6
|
|||
|
|||
Thank you everyone for your responses.
I have tried your suggestions, but unfortunately it doesn't appear to be working. Only the ELSE part of the condition is ever executed, even when I'm in the forum whose forumid is specified in the IF condition. Here is the code I'm using in the header template: Code:
<!-- banner --> <br /> <div align="center"> <if condition="$forum[forumid] == 10"><iframe ad="special" width="728" height="90" ... more HTML ad code ... ></iframe></if> <else><iframe ad="normal" width="728" height="90" ... more HTML ad code ... ></iframe></else> </div> <!-- /banner --> So basically, even when I am in forum 10, the condition does not evaluate to true. As another clue, using the HTML code below I attempted to display the $forum[forumid] variable in the header template to see what it's value was. But no value displays, leading me to believe that $forum[forumid] is null. Could it be that $forum[forumid] is not being set? Code:
<strong>Forum:</strong> $forum[forumid] |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|