The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Question about Conditionals
I'm trying to get adsense integrated into my forum. I only want the ads showing in showthread displays and forumdisplays and I want to exclude certain (non-public) forums. I've used the following:
Code:
<if condition="THIS_SCRIPT == 'showthread' || THIS_SCRIPT == 'forumdisplay'"> <if condition="(f <> 6) && (f <> 7)"> ad here </if> </if> thanks, basil |
#2
|
||||
|
||||
you'll have to use $f for sure, but I would use $forumid instead. Or even $foruminfo[forumid]
|
#3
|
||||
|
||||
Quote:
PHP Code:
Meanwhile, back in whatever template is getting this ad simply put HTML Code:
<if conditional="$display_ad">ad</if> Footnote, the f=# you see on the top bar isn't a variable, but it is contained in one; $_GET. You shouldn't go calling $_GET inside your templates though - it might leave your setup vulnerable to certain hacks. |
#4
|
|||
|
|||
Quote:
PHP Code:
On a side note - You had me pulling my hair out trying to get your code to work. Looked like it should have worked great. Problem was that the ad was showing on EVERY page not even all forum diplay pages. Turns out that in you code above you put "conditionAL". That made it look like $display_ad was true every time. Once I cleared out the AL it worked great. Thanks again. basil |
#5
|
|||
|
|||
I did make one final change before I put on the production site, changed the PHPSTART code to:
PHP Code:
Thanks again for responses, basil |
#6
|
||||
|
||||
Quote:
|
#7
|
|||
|
|||
I have tried to set this up but for some reason the ads are being displayed on forums I choose to omit....is this what you ended up putting in production?
Thanks, Todd |
#8
|
|||
|
|||
Nevermind, it's actually showing on everypage.....back to the drawing board.
Thanks, Todd |
#9
|
||||
|
||||
Kinda related to this, so this looks like a good place to ask.
Anyone know the syntax to replace a lot of OR's with something like: IF THIS_SCRIPT IN ('name1','name2','name3') Instead of: Code:
<if condition="THIS_SCRIPT == 'showthread' OR THIS_SCRIPT == 'forumdisplay' OR THIS_SCRIPT == 'index' OR THIS_SCRIPT == 'member' OR THIS_SCRIPT == 'memberlist' OR THIS_SCRIPT == 'search'"> |
#10
|
|||
|
|||
Quote:
What if I have 2 different codes that need to be omitted? Thanks for your help in advance? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|