Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Help to Ad Adsense  (Read 7789 times)

0 Members and 1 Guest are viewing this topic.

AngelC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
    • Fotos de San Sebastián - Imagenes de Donosti
Help to Ad Adsense
« on: May 20, 2006, 08:18:47 pm »

I search in this forum but i dont find that i need. I will like put google adsense in my cpg . I will like to put google adsense codes in this sites:

1:
[Edit GauGau] Replaced hotlinked image with attachment adsense14gs.jpg [/Edit]

2:
[Edit GauGau] Replaced hotlinked image with attachment adsense20cg.jpg [/Edit]

thx a lot

« Last Edit: May 23, 2008, 05:55:55 pm by Joachim Müller »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Logged

AngelC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
    • Fotos de San Sebastián - Imagenes de Donosti
Re: Help to Ad Adsense
« Reply #2 on: May 21, 2006, 11:06:36 pm »

i know to put the code in the template but not in the sitesthat i choose....

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Help to Ad Adsense
« Reply #3 on: May 22, 2006, 07:14:49 am »

you can't insert the AdSense code into template.html, you'll have to edit themes/yourtheme/theme.php. Find
Code: [Select]
// HTML template for the album list. If it doesn't exist in your custom theme, copy the corresponding section from themes/sample/theme.php. In this case, copy
Code: [Select]
// HTML template for the album list
$template_album_list_cat = <<<EOT

<!-- BEGIN c_stat_row -->
        <tr>
                <td colspan="{COLUMNS}" class="tableh1" align="center"><span class="statlink"><b>{STATISTICS}</b></span></td>
        </tr>
<!-- END c_stat_row -->
<!-- BEGIN c_header -->
        <tr>
<!-- END c_header -->
<!-- BEGIN c_album_cell -->
        <td width="{COL_WIDTH}%" valign="top">
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td colspan="3" height="1" valign="top" class="tableh2">
                        <span class="alblink"><a href="{ALB_LINK_TGT}"><b>{ALBUM_TITLE}</b></a></span>
                </td>
        </tr>
        <tr>
                <td colspan="3">
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
                </td>
        </tr>
        <tr>
                <td align="center" valign="middle" class="thumbnails">
                        <img src="images/spacer.gif" width="{THUMB_CELL_WIDTH}" height="1" class="image" style="margin-top: 0px; margin-bottom: 0px; border: none;" alt="" /><br />
                        <a href="{ALB_LINK_TGT}" class="albums">{ALB_LINK_PIC}<br /></a>
                </td>
                <td>
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" />
                </td>
                <td width="100%" valign="top" class="tableb_compact">
                        {ADMIN_MENU}
                        <p>{ALB_DESC}</p>
                        <p class="album_stat">{ALB_INFOS}</p>
                </td>
        </tr>
        </table>
        </td>
<!-- END c_album_cell -->
<!-- BEGIN c_empty_cell -->
        <td width="{COL_WIDTH}%" valign="top">
        <table width="100%" cellspacing="0" cellpadding="0" >
        <tr>
                <td height="1" valign="top" class="tableh2">
                        <b>&nbsp;</b>
                </td>
        </tr>
        <tr>
                <td>
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
                </td>
        </tr>
        <tr>
                <td width="100%" valign="top" class="tableb_compact" >
                      <div class="thumbnails" style="background-color:transparent"><img src="images/spacer.gif" width="1" height="{SPACER}" border="0" class="image" style="border:0;margin-top:1px;margin-bottom:0" alt="" /></div>
                </td>
        </tr>
        </table>
        </td>
<!-- END c_empty_cell -->
<!-- BEGIN c_row_separator -->
        </tr>
        <tr>
<!-- END c_row_separator -->
<!-- BEGIN c_footer -->
        </tr>
<!-- END c_footer -->
<!-- BEGIN c_tabs -->
        <tr>
                <td colspan="{COLUMNS}" style="padding: 0px;">
                        <table width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                       {TABS}
                                </tr>
                        </table>
                </td>
        </tr>
<!-- END c_tabs -->
<!-- BEGIN c_spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END c_spacer -->

EOT;
and paste it into themes/yourtheme/theme.php into a new line before
Code: [Select]
?>
Then edit it accordingly, i.e. find
Code: [Select]
// HTML template for the album list
$template_album_list_cat = <<<EOT

<!-- BEGIN c_stat_row -->
        <tr>
                <td colspan="{COLUMNS}" class="tableh1" align="center"><span class="statlink"><b>{STATISTICS}</b></span></td>
        </tr>
<!-- END c_stat_row -->
and replace with
Code: [Select]
// HTML template for the album list
$template_album_list_cat = <<<EOT

        <tr>
                <td colspan="{COLUMNS}" class="tableb">
                <!-- YOUR ADSENSE CODE GOES HERE -->
                </td>
        </tr>
<!-- BEGIN c_stat_row -->
        <tr>
                <td colspan="{COLUMNS}" class="tableh1" align="center"><span class="statlink"><b>{STATISTICS}</b></span></td>
        </tr>
<!-- END c_stat_row -->




A similar thing needs to be done for displaying adsense (or any other custom HTML) on the screen that shows an individual image: find
Code: [Select]
// HTML template for intermediate image display, paste the corresponding section from the sample theme into your custom theme if it doesn't exist, then add your custom code to it. In your case, paste
Code: [Select]
// HTML template for intermediate image display
$template_display_media = <<<EOT
        <tr>
                <td align="center" class="display_media" nowrap="nowrap">
                        <table cellspacing="2px" cellpadding="0px" class="imageborder">
                                <tr>
                                        <td align="center">
                                                {IMAGE}

                                        </td>
                                </tr>
                        </table>
                </td></tr>
                <tr><td>
                                                <table width="100%" cellspacing="2px" cellpadding="0px" class="tableb">
                                <tr>
                                        <td align="center">

                                                {ADMIN_MENU}
                                        </td>
                                </tr>
                                <tr>
                                        <td align="center">
                                                <!-- YOUR CUSTOM CODE HERE -->
                                        </td>
                                </tr>
                        </table>





<!-- BEGIN img_desc -->
                        <table cellpadding="0px" cellspacing="0px" 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;
into your theme.



Some of the threads that can be found when searching for the term "Adsense" would have told you so as well, not all say to edit template.html. It's mandatory that you understand what you're doing, that's why I haven't pasted code into this posting that is ready for copy'n paste.
Logged

AngelC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
    • Fotos de San Sebastián - Imagenes de Donosti
Re: Help to Ad Adsense
« Reply #4 on: May 22, 2006, 07:58:27 pm »

Thx a lot :D i will try now

snadowitz

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Help to Ad Adsense
« Reply #5 on: July 21, 2006, 03:23:26 pm »

Thx a lot :D i will try now

Hi AngelC - seems you got it to work. I cannot :( - any chance you can send me a copy of your theme.php?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Help to Ad Adsense
« Reply #6 on: July 22, 2006, 11:02:32 am »

What's wrong with my instructions? We don't believe in just giving users code they don't understand and just apply. We prefer to educate them to make them understand what they're doing and enable them to apply future changes on their own. This is what you should do: show us what you currently have by posting a link to your coppermine-driven gallery and zip up your custom theme and attach it to your posting using the "additional options" link at the bottom of the page when composing your message.
Logged

snadowitz

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Help to Ad Adsense
« Reply #7 on: July 22, 2006, 02:32:12 pm »

HI - I did copy your instructions to the letter - I don't actually want to insert adsense but some other custom code from commission junction. I modified the theme file as you said and it had no discernable effect on the page whatsoever.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Help to Ad Adsense
« Reply #8 on: July 22, 2006, 04:27:24 pm »

What's the use of your reply? I told you what to do if you want help. Anyway, as this thread deals with adding adsense code, you shouldn't have tried to hijack it in the first place. Start a new thread, providing the information needed as per my suggestion above.
Logged

bobby131313

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
    • Coin Community Family
Re: Help to Ad Adsense
« Reply #9 on: July 23, 2006, 11:35:31 pm »


GauGau, I found your help excellent.

Studying your code changes made the big light bulb over my head go off. It's actually pretty simple if your somewhat familiar with coding, I just needed a kick towards where to find it.

You basically just look at theme.php in the sample folder which has all the section templates, import the section you want to edit from there if you don't have it already in you current theme.php, and edit away. Basic html, cool stuff!

Thank you, GauGau!

Does the order that the sections are in theme.php make a difference? I've just been adding them at the end so far and nothing has exploded yet. Maybe I've just been lucky though?

Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Help to Ad Adsense
« Reply #10 on: July 23, 2006, 11:47:00 pm »

The order shouldn't matter. Adding it to the end is a good way to make sure the code doesn't get inserted in the wrong place.
Logged
Pages: [1]   Go Up
 

Page created in 0.028 seconds with 19 queries.