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: Adsense in Coppermine  (Read 8859 times)

0 Members and 1 Guest are viewing this topic.

jeroenisblij

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Adsense in Coppermine
« on: December 03, 2005, 03:08:04 pm »

Hello. i love coppermine, i use it to share pictures from my friends, family, clubs, etc. I would like to add some google ads to win back the hosting costs. Im a worthless coder myself... is there a plugin availeble that adds google ads in a nice way to every page?
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Adsense in Coppermine
« Reply #1 on: December 03, 2005, 03:50:39 pm »

You could try "Master_Template" over at cpg-contrib.org.

But if you are not changing templates often, you can merely modify the theme of your choice to display them on every page.  Depending upon where you want to put them, you can use the relevant code from the "sample" theme which includes all the template features in one place.  If you find another theme with an image or text in the place you want your Google Ads, go to that theme, find the image or text and you'll know where to put it in your custom theme.  Remember that it's best to create a new theme when customizing a theme (by copying the folder of the one that's closest).
Logged

jeroenisblij

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Adsense in Coppermine
« Reply #2 on: December 03, 2005, 10:05:24 pm »

i've been trying too add a row to a table it to the theme.php but i cant get it to display nicely. If i add it somewhere in the first half of the theme.php it displays above the album but if i add it in the starttable function it gets displayted multiple times: http://www.snekerstappers.nl/coppermine/blabla12.JPG // http://pastebin.com/447610
I would like to display it only between the categorie navigation and picture navigation where should i insert code so it displays only there?
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Adsense in Coppermine
« Reply #3 on: December 03, 2005, 10:14:08 pm »

why don't you just put it in a div in anycontent.php and add anycontent to your content of the main page?
Logged

jeroenisblij

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Adsense in Coppermine
« Reply #4 on: December 04, 2005, 02:49:05 pm »

why don't you just put it in a div in anycontent.php and add anycontent to your content of the main page?
this sounds very logical but ive no idea how to put a div in anycontent.php or how to add anycontent to my main page...
any chance you could paste an example code on pastebin.com?
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Adsense in Coppermine
« Reply #5 on: December 04, 2005, 04:22:07 pm »

The file anycontent.php is in your main Coppermine directory.  To add it to your main page, go to Config - Album List View - Content of Main Page and put 'anycontent' wherever you like.  I have "breadcrumb/catlist/anycontent/alblist/random,1/lastup,1".  Then modify anycontent.php to your heart's desire. 

donnoman's suggestion to use a <div> was so you can style it and place it however and wherever you like.  For example in anycontent.php (after the top comment stuff):
Code: [Select]
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
?>
<style>
div.GoogleAds {
position:absolute;
left:15px;
top:15px;
}
</style>
<div class="GoogleAds">GoogleAds</div>

This will position "GoogleAds" on top of the page in the top left corner.  Of course you'll have to make some room or organize things in a reasonable way.  Here's a reference for <div>: http://www.w3.org/TR/REC-html40/struct/global.html#h-7.5.4.  To find more information about styling <div>, search for "div dhtml".
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Adsense in Coppermine
« Reply #6 on: December 04, 2005, 07:42:53 pm »

If you want it on every page, you could use the custom_header or custom_footer as well.

Doing it is almost the same as anycontent.php except that you use a different filename, and you put the path relative to coppermine to that file, in the matching config option.
Logged

jeroenisblij

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Adsense in Coppermine
« Reply #7 on: December 10, 2005, 02:04:07 am »

If you want it on every page, you could use the custom_header or custom_footer as well.
Doing it is almost the same as anycontent.php except that you use a different filename, and you put the path relative to coppermine to that file, in the matching config option.
Ive tried putting it in the anycontent.php. This looks very nice, i can easily place it anywhere on the frontpage, but it is only shown on the frontpage. I would like it on every page. Is there a way to add anycontent to the displayimage window?
 Ive also tried putting the code in the 'custom header' field but this is very ugly. It gets shown on every page, but on the total top of the page, even above the title and logo which makes the site look very messy. dunno if this is how you meant it, didnt quite understand what you mean with 'put the path relative to coppermine to that file, in the matching config option.'
I would like it to display on every page, preferebly either between the categorie navigation and picture navigation bar, or next to the image in the displayimage window. Any other options? tnx again :D
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Adsense in Coppermine
« Reply #8 on: December 10, 2005, 09:44:09 am »

I don't get it - why are you trying to make things so complicated? Just add your adsense code to themes/yourtheme/template.html (anywhere you like) and you're done.
Logged

Wabz

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Adsense in Coppermine
« Reply #9 on: February 03, 2006, 09:26:07 pm »

I understand what the guy likes to do.  As I'm after a rather similar thing.

I'd like to replace the Text next to the Coppermine logo with Googles adsense.  On everypage.

Which code would I have to change in the default template?  I'm not to good with php as I'm just basically a network operator. 
Logged

Nibbler

  • Guest
Re: Adsense in Coppermine
« Reply #10 on: February 03, 2006, 09:30:10 pm »

Just paste the adsense code into your template.html, no php required.
Logged

Wabz

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Adsense in Coppermine
« Reply #11 on: February 03, 2006, 09:40:42 pm »

Cool :)

What do I replace the

Code: [Select]
<td width="100%" align="center">
              <h1>{GAL_NAME}</h1>
              <h3>{GAL_DESCRIPTION}</h3><br />
              {SYS_MENU} <br /> {SUB_MENU}
            </td>

With my adsense code ?
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Adsense in Coppermine
« Reply #12 on: February 03, 2006, 10:14:56 pm »

Paste, not replace.  Add it in.  Then, after you see Google Adsense on your page, if you want to delete anything (like the Coppermine logo), find it and delete it.

You do have to understand HTML to edit template.html.  If you don't, please search the web for a simple HTML tutorial.
Logged
Pages: [1]   Go Up
 

Page created in 0.075 seconds with 19 queries.