Pulling in ad banners via javascript - based on node, etc,

craigiri

Well-known member
I run a banner rotation program which allows me to define urls to access the program - such as:
http://www.hearth.com/cgi-bin/forumbottom14.pl?
Which then brings in various rotations of specific banners and google ads.....

The URL above, if you select it and refresh, will bring in ads which go in our Wood Pellet Forum at the bottom....for instance.

I'm setting this up now in XF and using some JS from my old setup - and it seems to be acting a little strange :
http://www.hearth.com/talk/forums/the-hearth-room-wood-stoves-and-fireplaces.6/
(works OK....but sometimes does not come up...maybe cache issues)
http://www.hearth.com/talk/threads/thinking-about-trying-a-new-pellet-this-year.84541/
(Edit - I think this is fixed )

I think I have at least two issues.....here is how I build the call to banner program:
Code:
<xen:hook name="ad_below_bottom_breadcrumb" />
 
<xen:if is="{$forum.node_id} > 0">
 
<div style="text-align: center;">
 
<script type="text/javascript">
 
function staticLoadScript(url)
{
  document.write('<script src="', url, '" type="text/JavaScript"><\/script>');
}
 
staticLoadScript("http://hearth.com/cgi-bin/forumbottom" + {$forum.node_id} + '.' + "pl?jscript");
 
</script>
 
</div>
</xen:if>

Can anyone give me a more modern method of pulling in the result of a URL call? Or is this part OK?

The second issue may be caching. That may relate to the call or otherwise - but is there anything which can be done to assure that this loads up better?

There may be some issues related to the ancient ad banner program I use - but I can either fix these or replace it with another program (later)...it's worked for me for many years, though.

Any advice welcome.....oh, the banner program gives me the option of loading the banners up in various ways - the above uses a jscript method, but the program allows for 3 ways to call:
SSI
IFRAME
Jscript
as listed here:
http://awsd.com/scripts/webadverts/using-webadverts/

Edit - addition....
I think I fixed some perl and naming problems - things are better, but still want advice if the code is a decent way of pulling in a banner....thanks!
 
Top Bottom