Removing ads from login and register pages only

Started by sajidicma, October 13, 2015, 11:00:41 AM

Previous topic - Next topic

sajidicma

Hi,
I am using Ad Management 3.2 mod for showing adsense ads on my website: userviews.net [nofollow] . Currently I am showing ads on every page on top and bottom. However, I want to remove ads from login and register pages only because it seems against the terms and conditions of google. Please help with any ideas.

Illori

then you should post in that mods support topic so the author of the mod can help you.

sajidicma

Ok I change my question. How can I show ads on my website on all pages except login and register page? Please ignore any mods while replying. thanks.

margarett

Exactly as vbgamer told you in the MOD support topic. Check if the current action isn't login/login2/register/register2 and, if so, show the Ads ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

sajidicma


margarett

Yeah, sure. ;)

Let's say you have a simple echo statement which is your ad in index.template.php:
echo '<img src="http://www.my-ad-path.com/img.png" />';

Before that you need to create an array with your excluded actions
$excluded_actions = array('login','login2','register','register2');
Then issue a conditional to show your add or not, eg:
if (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], $excluded_actions))
    echo '<img src="http://www.my-ad-path.com/img.png" />';

So it will show everywhere but in these pages ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: