PDA

View Full Version : Disable Adsense to certain forum ID's?


thestaton
05-20-2008, 09:26 PM
I would like to disable Ad Sense to the areas of my forum that are not allowed per googles acceptable use.

How do you go about doing this?

veenuisthebest
05-20-2008, 09:29 PM
what areas do you want to disable adsense on ??

thestaton
05-20-2008, 09:41 PM
The areas that are NOT allowed per googles terms of use for ad sense.

veenuisthebest
05-20-2008, 09:45 PM
The areas that are NOT allowed per googles terms of use for ad sense.

so what areas are not allowed by google .. make it clear..

Jase2
05-20-2008, 09:47 PM
You've added them, so I'm sure you can remove them ;)

veenuisthebest
05-20-2008, 09:55 PM
okayy... i read somewhere here that google disallows displaying ads on pages that have forms, right ??

To block certain pages from displaying ads for eg. newreply.php, open newreply.php and look for

define('THIS_SCRIPT', 'newreply');

newreply is what we are looking for.

Wrap your ad code like this in the conditional:-

if condition="!in_array(THIS_SCRIPT, array('newreply', 'register'))">

YOUR
AD CODE
HERE


</if>


I hope this is what you are looking for !!

thestaton
05-20-2008, 09:56 PM
You've added them, so I'm sure you can remove them ;)

That's not the problem. If I remove them then they are gone for the entire forum. I'm just trying to figure out how to do it per forum ID's...

I found a IF statement but it's not working...

veenuisthebest
05-20-2008, 10:00 PM
if you wanna block certain forumID's.. use this conditional..

<if condition="!in_array($forumid, array(1,2,3,6))">

YOUR
AD
CODE HERE

</if>


also.. check out a template conditionals list in my signature, will help you ..

thestaton
05-20-2008, 10:11 PM
if you wanna block certain forumID's.. use this conditional..

<if condition="!in_array($forumid, array(1,2,3,6))">

YOUR
AD
CODE HERE

</if>


also.. check out a template conditionals list in my signature, will help you ..

Thank you very much, that did the trick :)