To install Coppermine you need PHP, MySQL, and ImageMagick or the GD Graphics Library, and web server software such as Apache. Instead of auto installer from Hosting company you should install latest version from sourceforge. The direct link is https://sourceforge.net/projects/coppermine/files/Coppermine/1.5.x/cpg1.5.16.zip/download. Currently in the market you have 1.5.16 version is available as of writing this article. It can be easily integrated 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.
With integration of adsense you can also earn a good amount of money from the gallery and ads. Now I will show how to place adsense codes in header. The default theme of Coppermine is curve. You can edit it and make template for you. You can get all themes in "themes" folder. You can get active one from admin user interface. In case of curve theme open the file "themes/curve/template.html". You will get code like,
<div id="cpg_logo_block_name">
<h1>{GAL_NAME}</h1>
<h3>{GAL_DESCRIPTION}</h3>
</div>
<div class="clearer"></div>
</div>
</div>
<div id="cpg_header_block_outer">
<div class="cpg_header_block_inner">
Replace it by,<div id="cpg_logo_block_name">
<h1>{GAL_NAME}</h1>
<h3>{GAL_DESCRIPTION}</h3>
</div>
<div class="clearer"></div>
</div>
</div>
{Adsense Codes goes here}
<div id="cpg_header_block_outer">
<div class="cpg_header_block_inner">
If you want under admin menu/ user menu then replace following codes,<div id="main_menu">
{SYS_MENU}
{SUB_MENU}
{ADMIN_MENU}
</div>
by,<div id="main_menu">
{SYS_MENU}
{SUB_MENU}
{ADMIN_MENU}<br/>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top">
{Adsense Codes goes here.}
</td>
</tr>
</table>
</div>
If you want to display your ads beside main photo, then open "include/themes.inc.php" file. Search for "HTML template for intermediate image display". You will see like,
// HTML template for intermediate image display
$template_display_media = <<<EOT
<tr>
<td align="center" class="display_media" nowrap="nowrap">
<table width="100%" cellspacing="2" cellpadding="0">
<tr>
<td align="center" style="{SLIDESHOW_STYLE}">
{IMAGE}
</td>
</tr>
</table>
</td>
</tr>
Replace above by,// HTML template for intermediate image display
$template_display_media = <<<EOT
<tr>
<td align="center" class="display_media" nowrap="nowrap">
<table width="100%" cellspacing="2" cellpadding="0">
<tr>
<td align="center">{Adsense Codes goes here} </td>
<td align="center" style="{SLIDESHOW_STYLE}">
{IMAGE}
</td>
<td align="center">{Adsense Codes goes here}</td>
</tr>
</table>
</td>
</tr>