The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Prevent AdSense on Specified Threads
Running vBulletin 3.8, and utilizing AIN - Advanced Google Adsense ( https://vborg.vbsupport.ru/showthread.php?t=205713 ).
I'm seeking a way to prevent specified threads from having adsense ads displayed on them. Does anyone know how this can be accomplished? Thank you in advance. |
#2
|
|||
|
|||
Bump.
|
#3
|
||||
|
||||
If you had the code in an ad location template you could do this easily with a template conditional, something like:
Code:
<if condition="$thread[threadid] != XXXX"> Ad code here </if> |
#4
|
|||
|
|||
Thank you very much for the reply.
I decided to abandon the mod and just rely on template edits, using your idea of conditionals, which at first was working great. I setup my first ad block flawlessly (after much trial and error). Then I move down to the footer, and suddenly it is as if vBulletin is unable to read IDs. That is, if I set a conditional to show the ad only if certain conditions are met, it NEVER displays the ad. If I set the conditional to show the ads with exceptions, it displays the ads EVERYWHERE regardless of the exceptions. For example... Using this to show my ads on forum 2: Quote:
Using this to prevent my ads from showing on forum 2, 3, 4, 5: Quote:
This carries over into other conditionals such as usergroup and threadid. So to reiterate, one set of conditionals = working flawlessly. Other set appears to ignore IDs. Why would this be happening? And how would I resolve it? Thanks in advance. |
#5
|
||||
|
||||
Try $GLOBALS['forumid'] instead.
|
#6
|
|||
|
|||
You are a scholar and a saint, that worked perfect! Thank you very much!
I'm a bit curious though, why is it that my first set of conditionals worked, yet the second set required this different variable? Is it an issue with my template? I'm not complaining by any means as I'm very happy to have a solution, I'm just very curious. |
#7
|
||||
|
||||
Different templates have access to different variables... Templates like header and footer are on every page, they need the "$GLOBALS" templates that are just on showthread might work with $thread or $threadinfo, templates that are just on forumdisplay make work with $forum or $forumdisplay.
|
#8
|
|||
|
|||
Is it possible to use "AND" with a conditional?
For example: IF usergroup 3 AND forum id 2 then.... or IF usergroup 3 AND NOT forum id 4 then .... I've tried a few variations with no luck. |
#9
|
||||
|
||||
AND, yes... NOT is !
Code:
<if condition="is_member_of($bbuserinfo, 3) AND $GLOBALS[forumid] == 2"> <if condition="is_member_of($bbuserinfo, 3) AND $GLOBALS[forumid] != 4"> |
Благодарность от: | ||
TommyC |
#10
|
|||
|
|||
Thank you very much!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|