Any way to disable Google Adsense for specific galleries?

TimChuma

Joined: 2011-04-24
Posts: 21
Posted: Mon, 2012-12-17 11:27

I am using the Google Adsense module with Gallery 3 and was wondering if there was any way to disable the code to specific galleries as sometimes the photos have captions that set off Google's warning messages and I have to delete the code from that page or face losing Adsense for my entire site.

On my old HTML site it was just a matter of doing a search and replace to delete the code, but I am not sure what is involved with the module.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2012-12-17 14:41

Are you using the module or adding it manually to a specific .html.php page in your theme?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
TimChuma

Joined: 2011-04-24
Posts: 21
Posted: Tue, 2012-12-18 10:23

Using the module.

It is the standard one available
http://codex.gallery2.org/Gallery3:Modules:adsense

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2012-12-18 17:10

One way (there is a bunch of different ways) would be to edit the view file of the module, adding a bunch of if statements.

<? if ($item->title == "Test"): ?>
existing code from view file
<? endif ?>

That would only show the code on the Test album.
or

<? if (!$item->title == "Test"): ?>
if the album is not test show this code.
<? endif ?>

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
TimChuma

Joined: 2011-04-24
Posts: 21
Posted: Sat, 2012-12-22 15:49

Thanks, I will check it out.

 
TimChuma

Joined: 2011-04-24
Posts: 21
Posted: Thu, 2013-05-16 11:26

Can't think of any way to do it without having to modify the code for the whole gallery as well to have a True/False condition if a gallery uses Google Adsense. I may have to just remove the Adsense code for the entire site if any of the galleries are reported by Google.