Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: How to apply Google Adsense to your gallery.  (Read 7202 times)

0 Members and 1 Guest are viewing this topic.

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
How to apply Google Adsense to your gallery.
« on: September 26, 2007, 06:40:52 pm »

Hello,

DEVS, you may wish to sticky/FAQ or make this a mod.

After struggling with this for a while and finally finding solutions i thought i would post them all here.

To see some in action see this demo

Contents:

- Adsense below the main menu
- Adsense above the main menu
- Adsense Below Image
- Adsense Above Image
- Adsense above the statistics (inside category section)
- Tips


Firstly, backup your files.




Adsense below main menu:

Open theme.html

find:

Code: [Select]
<td align="center" width="100%">{SYS_MENU}<br />
                                                                        {SUB_MENU} </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                            </div>

And after
Code: [Select]
</div> paste your adsense code.

Adsense Above the main menu:

Open theme.html

find:
Code: [Select]
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
                                                    <tbody>


                                                        <tr>
                                                            <td class="row1" width="75%">
                                                            <div align="center">
                                                            <table cellspacing="0" cellpadding="0" width="100%" border="0">
                                                                <tbody>
                                                                    <tr>
                                                                        <td align="center" width="100%">{SYS_MENU}<font color="#ffffff">::</font> <a onmouseover="dropdownmenu(this, event, menu1, '150px')" onclick="return clickreturnvalue()" onmouseout="delayhidemenu()" href="default.htm">External Links</a> <br />
                                                                        {SUB_MENU} </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>

Paste your adsense code after the
Code: [Select]
<tbody>


Adsense Below Image:

Open theme.php

Find:

Code: [Select]
<!-- BEGIN title -->
 

                                <tr>
                                        <td class="tableb"><center><b>
                                                {TITLE}
                                        </b></center></td>
                                </tr>
<!-- END title -->

And after
Code: [Select]
<!-- BEGIN title --> paste your adsense code.

Adsense above image:

Open theme.php

Find:

Code: [Select]
// 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}

And after:

Code: [Select]
<td align="center" class="display_media" nowrap="nowrap">
                        <table cellspacing="2" cellpadding="0" class="imageborder">

Paste your Adsense code.

Adsense above the statistics (inside category section):

Open theme.php

Find:

Code: [Select]
<!-- BEGIN catrow -->
        <tr>
                <td class="catrow" align="left"><img src="themes/Ti2000/images/folder.gif" border="0" width="25" height="25" alt="" align="left" /><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
                <td class="catrow" align="center">{ALB_COUNT}</td>
                <td class="catrow" align="center">{PIC_COUNT}</td>
        </tr>
        <tr>
            <td class="tableb" colspan="3">{CAT_ALBUMS}</td>
                     
        </tr>

<!-- END catrow -->
               
<!-- BEGIN footer -->



       
        <tr>
 
                <td colspan="3" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
        </tr>

 
<!-- END footer -->

After
Code: [Select]
<!-- BEGIN footer -->
paste:

Code: [Select]
<tr>
<td>
ADSENSE CODE HERE
</td>
</tr>

Substitute "ADSENSE CODE HERE" for your adsense code.

Tips:

To position your ads to the left, right and center ou can do the following.

Code: [Select]
<div align="center">
ADSENSE CODE HERE
</div>

You can change "center" to left and right too.

I hope this helps you, thanks to all of the threads which helped me get some of the information required for this this thread.

Good Luck!

just_some_guy

« Last Edit: October 19, 2007, 06:18:38 pm by GauGau »
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: How to apply Google Adsense to your gallery.
« Reply #1 on: September 26, 2007, 06:44:33 pm »

Hi Just_some_guy. I'm not a dev but thanks anyway for contributing to cpg.  ;D
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: How to apply Google Adsense to your gallery.
« Reply #2 on: September 26, 2007, 06:48:03 pm »

No problem, im happy to help and i hope this proves useful to other users.
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Nibbler

  • Guest
Re: How to apply Google Adsense to your gallery.
« Reply #3 on: September 26, 2007, 07:01:13 pm »

1) No such file as theme.html
2) Many of your suggestions are not valid HTML.
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: How to apply Google Adsense to your gallery.
« Reply #4 on: September 26, 2007, 07:28:58 pm »

sorry, i meant template.html. Which code is not valid?

sorry + thanks,
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

thejflo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Female
  • Posts: 75
    • Juicy Flawless
Re: How to apply Google Adsense to your gallery.
« Reply #5 on: September 27, 2007, 12:18:55 am »

I'm curious. Why would one have to back up their files in order to do this? I thought it was just simple as pasting the code [where ever you want] in the template and thats it..
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: How to apply Google Adsense to your gallery.
« Reply #6 on: September 27, 2007, 02:49:11 am »

I'm curious. Why would one have to back up their files in order to do this? I thought it was just simple as pasting the code [where ever you want] in the template and thats it..
It's just good practice to back up files when editing files in case there are any mistakes.
Logged

sm3287

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: How to apply Google Adsense to your gallery.
« Reply #7 on: October 19, 2007, 05:30:37 pm »

Hey, I'm trying to insert my adsense code under the stats like you have on your website "Sponsored Links". I cant for the life of me find any part of the code you listed.. Here is my template.html i also looked around theme.php and couldn't find nothing in there either. Any suggestions?
Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{LANG_DIR}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
<title>{TITLE}</title>
<link rel="stylesheet" type="text/css" href="themes/hardwired/style.css" />
{META}
<script type="text/javascript" src="scripts.js" ></script>
<!-- $Id: template.html 2808 2006-02-05 22:35:48Z gaugau $ -->
</head>
<body>
{CUSTOM_HEADER}
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr valign="top">
    <td width="53" rowspan="3" id="far-left"><img

src="themes/hardwired/images/far-left.gif" width="54" height="14" alt="" /></td>
    <td width="18" class="middle-left"><img src="themes/hardwired/images/middle-left.gif"

width="18" height="14" alt="" /></td>
    <td height="62" class="right-banner">
        <div class="left-banner">
        <div class="gal_name">{GAL_NAME}</div>
        <div class="gal_description">{GAL_DESCRIPTION}</div>
        </div>
    </td>
    <td width="19" class="middle-right"><img src="themes/hardwired/images/middle-right.gif"

width="19" height="14" alt="" /></td>
    <td width="53" rowspan="3" class="far-right"><img

src="themes/hardwired/images/far-right.gif" width="53" height="14" alt="" /></td>
  </tr>
  <tr>
    <td width="18" class="middle-left">&nbsp;</td>
    <td class="gallery"><div align="right" class="topmenu"> {SYS_MENU}</div>
      <br />
      <div align="left" class="topmenu">{SUB_MENU} <br><script type="text/javascript"><!--
google_ad_client = "pub-2518340886650978";
google_ad_width = 468;
google_ad_height = 15;
google_ad_format = "468x15_0ads_al_s";
google_ad_channel = "";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div> <br />
      <div align="center"> {THEME_SELECT_LIST} {LANGUAGE_SELECT_LIST} </div>
      <br />
      {ADMIN_MENU} {GALLERY}</td>
    <td width="19" class="middle-right">&nbsp;</td>
  </tr>
  <tr valign="baseline">
    <td width="18" class="middle-left"><img src="themes/hardwired/images/bottom-left.gif"

width="18" height="31" alt="" /></td>
    <td class="bottom-middle">&nbsp;</td>
    <td width="19" class="middle-right"><img src="themes/hardwired/images/bottom-right.gif"

width="19" height="31" alt="" /></td>
  </tr>
</table>
<br />
<div align="center"> {LANGUAGE_SELECT_FLAGS} <br />
  <br />
</div>
{CUSTOM_FOOTER}
{VANITY}
</body>
</html>
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to apply Google Adsense to your gallery.
« Reply #8 on: October 19, 2007, 06:18:25 pm »

@sm3287: the instructions in the initial posting of this thread are somewhat misleading and inacurate (that's why this thread hasn't been moved into the mods section as intended by the thread starter; there are better postings that explain how to add adsense or any other piece of static HTML/JavaScript to your Coppermine-driven pages). If a particular section (function or variable definition) doesn't exist in your custom theme, copy it (the missing section) from themes/sample/theme.php into a new line before
Code: [Select]
?>of the file themes/yourtheme/theme.php, then edit as suggested in the initial posting of this thread.

@all: I suggest searching the board for the search term "adsense" - there are loads of postings that explain how to add adsense - many of them have better instructions and are more complete. If you still can't find what you're looking for, start a new thread for your issue, posting a link to your gallery. Additionally, zip the content of your custom theme folder and attach it to your new thread (using "additional options" when composing your message). If you want detailed answers, attach a screenshot of your gallery as well that highlights the section where you want your adsense code to show up. As these instructions (searching the board, starting a new thread with the required information) applies not only to you, but everyone who is looking for a similar thing, I will now close and lock this thread. Everyone who's looking to accomplish a similar thing should do as I suggested above.

@just_some_guy: please don't get me wrong: I appreciate your readiness to share your insight with others. However, your instructions can only be carried out by people with intermediate skills in coppermine - those who have those skills probably won't need instructions anyway. You're of course welcome to come up with a newbie-proof instructions in another thread.

Joachim
Logged
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 19 queries.