Adding ads? Adding ads?
 

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]

Main Menu

Adding ads?

Started by Raisingdad, August 24, 2007, 07:05:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Raisingdad

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.

Joachim Müller

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").

Raisingdad

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.

Joachim Müller

Any particular reason for not doing as I suggested:
Quote from: GauGau on August 24, 2007, 08:28:19 AM
Zip your custom theme and then attach it to your posting (using "additional options").

Raisingdad

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

Joachim Müller

edit themes/yourtheme/template.html, find the (improperly done) iframe definition<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<!-- 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.

Raisingdad

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;

Joachim Müller

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