coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: izmitli4141 on November 09, 2006, 07:33:34 PM

Title: is it possible to add google adsense there
Post by: izmitli4141 on November 09, 2006, 07:33:34 PM
[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 ?
Title: Re: is it possible to add google adsense there
Post by: Joachim Müller on November 10, 2006, 07:28:11 AM
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 displayand 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;
Title: Re: is it possible to add google adsense there
Post by: olti on December 11, 2006, 12:12:16 AM
This hack works very good. But I would like to have some albums without ads. How to do this?
Title: Re: is it possible to add google adsense there
Post by: Joachim Müller on December 11, 2006, 08:00:19 AM
Depending on what logic? Particular albums or just random albums?
Title: Re: is it possible to add google adsense there
Post by: olti on December 11, 2006, 08:41:05 AM
Quote from: GauGau on December 11, 2006, 08:00:19 AM
Depending on what logic? Particular albums or just random albums?

Particular albums!

cheers.
Title: Re: is it possible to add google adsense there
Post by: Joachim Müller on December 11, 2006, 09:02:49 AM
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.