The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Prevent AdSense on not_logged_no_permission pages?
If for example a guest is trying to access a thread posted on a members-only forum he will get an error message that says:
Quote:
|
#2
|
|||
|
|||
The problem is that the ad templates (and header and footer templates) are rendered before you know if there is a permission problem. I suppose it's possible to re-render those templates in the case of an error (maybe using the error_nopermission hook), but it might take some code. At the minimum you'd need a "global" statement for any variables that the header or footer uses.
I guess another approach would be to do a str_replace() on the $header or $footer variables to remove the AdSense, but you'd have to figure out what you could match to do that. |
Благодарность от: | ||
chefy |
#3
|
|||
|
|||
Thanks God I'm not using the ad templates, the AdSense code is directly attached to the navbar template. Is there any conditional I can use there against not_logged_no_permission pages?
|
#4
|
|||
|
|||
You might be able to create a plugin using hook error_nopermission and code like:
Code:
$show['hide_adsense'] = true; Code:
<if condition="!$show['hide_adsense']"> // adsense code </if> |
#6
|
|||
|
|||
Quote:
Quote:
I'm trying to do this in the navbar template, vBulletin 3.8.5 |
#8
|
|||
|
|||
It works, thank you very much man - you rock!
|
#9
|
||||
|
||||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|