abhishek kumar

June 2nd, 2008 at 7:17 pm

How to use Adsense with Coppermine Gallery ?

photogallery-coppermine.jpgThese days Photo Galleries have become integral part of big portals. There are many open source PHP scripts that you can use for integrating photo gallery with your website. For example, we have Gallery, Coppermine, 4Images etc. Out of these I prefer to use CopperMine Photo Gallery. It is the best Photo Gallery PHP script available on internet. For proper installation, it requires PHP, MySQL, and ImageMagick or the GD Graphics Library, and web server software such as Apache. It can be easily integrated with Coppermine Photo Gallery has interfaces with other popular content management systems like e107, Invision Power Board, Joomla!, Mambo, phpBB, PostNuke, PunBB, Simple Machines Forum, vBulletin, Woltlab Burning Board, and YaBB SE. It is an open-source software and is licensed under the GNU General Public License.

But for using coppermine, you must have to add a “Powered by Coppermine” link in your photo gallery. Overall, Coppermine Gallery is a good gallery software. It’s really easy to use, bug free and integrates easily to many popular open source forums. But it is not easy to customize its code, as layout and functions are not properly separated.

You can easily earn a good amount of money through using adsense in your photo gallery. Today I will tell you how to place google adsense codes in your Coppermine photo gallery.

1: Below Header

Below_Header.JPG

For adding 728×90 adsense ad just below the header, you have to find “{ADMIN_MENU}” in the template.html file of your Coppermine template. Then add this piece of code just after “{ADMIN_MENU}”.

<table width=”100%” border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″>
<tr>
<td align=”left” valign=”top”> {ADMIN_MENU}
<table width=”100%” border=”0″ align=”center” cellpadding=”25″ cellspacing=”0″>
<tr>
<td align=”center” valign=”top”>
Your Google Adsense Code
</td>
</tr>
</table>

2 : Adsense Ad around the image.

Adsense_images.JPG

For adding adsense ads around images, you have to edit “themes.inc” file. This file is located in “include” folder of the Coppermine directory.

// HTML template for intermediate image display
if (!isset($template_display_media)) { //{THEMES}
$template_display_media = <<<EOT
<tr>
<td align=”center” class=”display_media” nowrap=”nowrap”>
<table cellspacing=”2″ cellpadding=”0″ class=”imageborder”>
<tr>
<td align=”center”>Your Adsense Code</td>
<td align=”center”>{IMAGE}</td>
<td align=”center”>Your Adsense Code</td>
</tr>
</table>

Find comment containing “intermediate image display”. Just compare the code with the code written above and add “<td align=”center”>Your Adsense Code</td>” just above and below “<td align=”center”>{IMAGE}</td>”.

So, in this way you can easily integrate Adsense with you Coppermine Photo Gallery and monetize your photo website. In case of any confusion, feel free to contact me. You can see the demo of Coppermine on my blog’s photogallery.

To know more about Coppermine and to download it visit http://coppermine-gallery.net/

==> If you liked this post, then why not buy me a beer so I can cool off?


Enter your email address:



abhisays Music Edition


abhisays Music Edition
12
  • 1

    THANK YOU so much for this! I’ve been searching for a way to add adsense around images in my coppermine gallery and always came up empty. Thanks to you now I’ll be able to do what I wanted. Thanks

    Chris on September 13th, 2008
  • 2

    Thank you for that advice. I used it to put the StumbleUpon button at my page top.

    Midas on October 9th, 2008
  • 3

    I am new to php coding, and could not find anywhere that gave a tutorial on how to ad the google adsense to my coppermine gallery theme. This was perfect! I had to do a little moding of the code and now it is perfect and I have you to thank!!! :D As soon as I get the new gallery online, stop by and see the results! http://www.OkunenAnime.com/gallery/index.php

    Kaiya on October 10th, 2008
  • 4

    The adsense below the header didn’t work for me. When I just added by adsense code after {ADMIN_MENU} it worked but showed the banner on the left side. Then I tried with the code you published and it messed up my coppermine template. I think I’ll settle to just using the banner on the left side

    http://www.easygoingkenya.com

    John on November 24th, 2008
  • 5

    Really many thanks! Finally i can ad adsense to my gallery! :)

    Marti on February 2nd, 2009
  • 6

    When I tried to add the 1. Below Header code, I too had problems. When I just added the code after {ADMIN MENU} I was able to get Google Ads to show. I just wanted to say Thanks as your information gave me enough to make this work.

    Pablo on February 22nd, 2009
  • 7

    Great Tutorial. Thanks.

    http://www.zagao.com/imagegallery1

    Zagao on April 3rd, 2009
  • 8

    Nice info. Thanks.
    But, can I use two adsense ads adjacent to photos? What about TOR?

    Xn on April 13th, 2009
  • 9

    Terms of Service I mean. The one that does not allow you to post photos adjacent to adsense

    Xn on April 13th, 2009
  • 10

    The second one doesn’t work. Please help me! http://www.injoon.com/wallpapers

    injoon on September 27th, 2009
  • 11

    Thanks for the tutorial. Worked perfectly :) My only slight concern is that it’s on what Google would consider to be non content pages (ie; the upload section/search etc), but I don’t think it will be too much of an issue. I’ll just remove if they ask me to.

    Julia on October 28th, 2009
  • 12

    Thanks a lot , Kindly check this site http://www.youbulb.com and tell me how it looks like , Thanks a lot again buddy

    youbulb on November 4th, 2009

 

RSS feed for comments on this post | TrackBack URI