I've been hunting around the forums for information on adding Adsense code to my Coppermine 1.4.9 site. I think I've worked it out myself.
Adding the actual code:
On the main page, I used xplicit's excellent advise: http://forum.coppermine-gallery.net/index.php?topic=29265.0 (http://forum.coppermine-gallery.net/index.php?topic=29265.0)
On the thumbnail pages, I added the code using Mini-CMS (click the 'source' button and paste the adsense code in)
Relevance:
The ads which are being served are all for Photo Printing, gallery hosting etc which is not what my site is about. The Adsense help pages at Google suggest adding
<!-- google_ad_section_start -->
and <!-- google_ad_section_end -->
tags around relevant content to increase the weighting of that content. Apparently it takes a few days for the change to take effect though.
In order to add these tags around every caption, open include/functions.inc.php and make the following change.
Search for
if ($CONFIG['caption_in_thumbview']){
$caption .= $row['caption'] ? "<span class=\"thumb_caption\">".strip_tags(bb_decode($row['caption']))."</span>" : '';
Replace with
if ($CONFIG['caption_in_thumbview']){
$caption .= $row['caption'] ? "<span class=\"thumb_caption\"><!-- google_ad_section_start -->".strip_tags(bb_decode($row['caption']))."<!-- google_ad_section_end --></span>" : '';
Everywhere your caption appears it will now have the Adsense tags around it.
I hope this saves someone some time - I'll let you know when if the relevant ads start showing up!
You can see it in action at http://www.thepoltergeist.com (http://www.thepoltergeist.com)
It's taken 2 and a half days to make any difference, but I'm now not getting (so many) ads for photo printing services and gallery hosts. The ads look much better targeted to the sort of interests visitors to my site would have. Just need to get rid of the splash page and I'll be pretty happy with my site!
Thank you very much! I'm going to try it right now..