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: Adding ads?  (Read 4522 times)

0 Members and 1 Guest are viewing this topic.

Raisingdad

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Adding ads?
« on: August 24, 2007, 07:05:53 am »

Hello,

I have modified theme.php to get ads from my custom CMS and its working, it gets the ad from the flatfile and its stored in a variable ... now I just need to get it to shown in my gallery through theme.html and I don't know how to.

The variable contains HTML code only, I've already edited template.html to add my site design but that was plain HTML.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Adding ads?
« Reply #1 on: August 24, 2007, 08:28:19 am »

There is no file named theme.html.
Hard to advise anything, as my mindreader capabilities are limited. Post a link to your gallery and describe where the ads are supposed to show up. Zip your custom theme and then attach it to your posting (using "additional options").
Logged

Raisingdad

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Adding ads?
« Reply #2 on: August 25, 2007, 07:04:20 am »

Sorry theme.php and template.html

Here is a link to my gallery, http://the8rules.co.uk/Gallery/ , I want the ads to go where they are now ... the problem is I'm serving them via iframe and its not a great way to do it, Google ads for one don't work very well that way.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Adding ads?
« Reply #3 on: August 25, 2007, 09:09:06 am »

Any particular reason for not doing as I suggested:
Zip your custom theme and then attach it to your posting (using "additional options").
Logged

Raisingdad

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Adding ads?
« Reply #4 on: August 26, 2007, 05:44:44 am »

Here you go ... its the water_drop theme but I added my header and footer around it.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Adding ads?
« Reply #5 on: August 26, 2007, 10:39:21 am »

edit themes/yourtheme/template.html, find the (improperly done) iframe definition
Code: [Select]
<iframe src="http://the8rules.co.uk/adserve/Leader/" width="728" height="90" align="center" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" name="I1">
Your browser does not support the IFRAME tag - you can't see our ads then, that makes us sad. </iframe>
      </iframe>
and replace with the actual contant of the iframe
Code: [Select]
<!-- BEGIN RICH-MEDIA Burst Network CODE -->
<script type="text/javascript" language="JavaScript">
rnum=Math.round(Math.random() * 100000);
ts=String.fromCharCode(60);
if (window.self != window.top) {nf=''} else {nf='NF/'};
document.write(ts+'script src="http://www.burstnet.com/cgi-bin/ads/ad11427a.cgi/v=2.3S/sz=728x90A/'+rnum+'/'+nf+'RETURN-CODE/JS/">'+ts+'/script>');
</script><noscript><a href="http://www.burstnet.com/ads/ad11427a-map.cgi/ns/v=2.3S/sz=728x90A/" target="_top">
<img src="http://www.burstnet.com/cgi-bin/ads/ad11427a.cgi/ns/v=2.3S/sz=728x90A/" border="0" alt="Click Here" /></a>
</noscript>
<!-- END Burst Network CODE -->
That's all. Plain HTML, no particular Coppermine magic.
Logged

Raisingdad

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Adding ads?
« Reply #6 on: August 26, 2007, 11:42:03 am »

The problem is I have more than one ad network in use, I can't just add the ad code, which is why I am using the iframe for now to get the ad from my script. I've gotten Coppermine to get the ad from my management system, in theme.php;
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Adding ads?
« Reply #7 on: August 26, 2007, 12:03:03 pm »

So you need some PHP logic that determines what ad to pick? And that logic already resides in http://the8rules.co.uk/adserve/Leader/index.php ? Then just use the custom_header feature: edit themes/yourtheme/template.html, cut the token {CUSTOM_HEADER} from where it currently is and paste it at the place where your ad is suppossed to show up (replacing the ifram crap). Then go to coppermine's config and specify the path to your ad selector page in the field "Path to custom header include". In your case, it would be
Quote
../adserve/Leader/index.php
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 19 queries.