[img=http://img299.imageshack.us/img299/849/adszjk3.th.jpg] (http://img299.imageshack.us/my.php?image=adszjk3.jpg)
here is my ss.
i want to add google adsense where i show at the picture.could you please help me where i must insert the google codes ?
In the future, please search (http://forum.coppermine-gallery.net/index.php?action=search2;search=adsense) before posting, as this has been asked and answered often already.
Edit themes/yourtheme/theme.php, find// HTML template for intermediate image display
and edit as suggested below. If the search string doesn't exist in your theme, copy the corresponding section// HTML template for intermediate image display
$template_display_media = <<<EOT
<tr>
<td align="center" class="display_media" nowrap="nowrap">
<table cellspacing="2" cellpadding="0" class="imageborder">
<tr>
<td align="center">
{IMAGE}
</td>
</tr>
</table>
</td></tr>
<tr><td>
<table width="100%" cellspacing="2" cellpadding="0" class="tableb">
<tr>
<td align="center">
{ADMIN_MENU}
</td>
</tr>
</table>
<!-- BEGIN img_desc -->
<table cellpadding="0" cellspacing="0" class="tableb" width="100%">
<!-- BEGIN title -->
<tr>
<td class="tableb"><center><b>
{TITLE}
</b></center></td>
</tr>
<!-- END title -->
<!-- BEGIN caption -->
<tr>
<td class="tableb"><center>
{CAPTION}
</center></td>
</tr>
<!-- END caption -->
</table>
<!-- END img_desc -->
</td>
</tr>
EOT;
from themes/sample/theme.php into themes/yourtheme/theme.php (into a new line before ?>).
Then modify like this:// HTML template for intermediate image display
$template_display_media = <<<EOT
<tr>
<td align="center" class="display_media" nowrap="nowrap">
<table cellspacing="2" cellpadding="0" class="imageborder">
<tr>
<td align="center">
{IMAGE}
</td>
</tr>
<tr>
<td align="center">
YOUR AD SENSE CODE GOES HERE
</td>
</tr>
</table>
</td></tr>
<tr><td>
<table width="100%" cellspacing="2" cellpadding="0" class="tableb">
<tr>
<td align="center">
{ADMIN_MENU}
</td>
</tr>
</table>
<!-- BEGIN img_desc -->
<table cellpadding="0" cellspacing="0" class="tableb" width="100%">
<!-- BEGIN title -->
<tr>
<td class="tableb"><center><b>
{TITLE}
</b></center></td>
</tr>
<!-- END title -->
<!-- BEGIN caption -->
<tr>
<td class="tableb"><center>
{CAPTION}
</center></td>
</tr>
<!-- END caption -->
</table>
<!-- END img_desc -->
</td>
</tr>
EOT;
This hack works very good. But I would like to have some albums without ads. How to do this?
Depending on what logic? Particular albums or just random albums?
Quote from: GauGau on December 11, 2006, 08:00:19 AM
Depending on what logic? Particular albums or just random albums?
Particular albums!
cheers.
Try this:// HTML template for intermediate image display
$template_display_media = <<<EOT
<tr>
<td align="center" class="display_media" nowrap="nowrap">
<table cellspacing="2" cellpadding="0" class="imageborder">
<tr>
<td align="center">
{IMAGE}
</td>
</tr>
<tr>
<td align="center">
EOT;
if ($aid !=3 && $aid != 5 && $aid != 8) {
$template_display_media .= <<<EOT
YOUR AD SENSE CODE GOES HERE
EOT;
}
$template_display_media .= <<<EOT
</td>
</tr>
</table>
</td></tr>
<tr><td>
<table width="100%" cellspacing="2" cellpadding="0" class="tableb">
<tr>
<td align="center">
{ADMIN_MENU}
</td>
</tr>
</table>
<!-- BEGIN img_desc -->
<table cellpadding="0" cellspacing="0" class="tableb" width="100%">
<!-- BEGIN title -->
<tr>
<td class="tableb"><center><b>
{TITLE}
</b></center></td>
</tr>
<!-- END title -->
<!-- BEGIN caption -->
<tr>
<td class="tableb"><center>
{CAPTION}
</center></td>
</tr>
<!-- END caption -->
</table>
<!-- END img_desc -->
</td>
</tr>
EOT;
Above code will exclude the albums 3, 5, and 8 from showing adsense. Modify the line if ($aid !=3 && $aid != 5 && $aid != 8) { accordingly to fit your needs.