Hi everyone. I have a banner rotator at the top of my phpBB2 forum that I use for advertising. It worked once upon a time but apparently I got a little carried away in doing some upgrades that I messed it up. Right now it currently shows all of the images but does not rotate between advertisers any more unless you click of to another link on the page. Secondly, the images no longer link you to the advertisers info. Instead they just take you back to my home page. I have tried everything I know how to do but I'm not having any luck. Any help with this would be greatly appreciated. I've listed the codes below for you all to look at.
This is the loader that has been attached to the bottom portion of my overal_header.tpl file
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getRandomNum(lbound, ubound) {
return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
}
// End -->
</script>
<SCRIPT LANGUAGE="JavaScript" src="/forums/banners/banners.js">
</SCRIPT>
<script language="JavaScript">
if (parent.frames.length == 0)
{
var link="<table width=\"100%\" align=\"center\" bgcolor=\"white\" cellpadding=\"2\" cellspacing=\"0\"><tr><td><img src=\"/forums/banners/images/1x1.jpg\"></td><td align=center><a href=\"http://www.steadyracing.net\" name=\"adLink\"><img src=\"/banners/these-banner.jpg\" name=\"adBanner\" border=\"0\" width=\"468\" height=\"60\" target=\"new\" align=\"center\"></a></td></tr></table>";
document.write(link);
cycle();
}
</script>
Here is the banner information file
var lnks = new Array("http://steadyracing.net/forums/viewforum.php?f=12","http://www.toplinecoating.com","http://www.chrisnitelive.com","http://www.credit2nv.com","http://www.660photos.com","http://www.gearheadsperformance.com")
var imgs = new Array("/forums/banners/images/Proforma-AdvertisingBanner.jpg","/forums/banners/images/toplinecoatings.jpg","/forums/banners/images/81xcnl.gif","/forums/banners/images/C2NV468x60.jpg","/forums/banners/images/660photosbanner2.jpg","/forums/banners/images/gearheadsbanner.jpg")
var imgCt = 6
var currentAd = getRandomNum(0,imgCt-1);
function cycle()
{
currentAd++
if (currentAd == imgCt) {
currentAd = 0
}
document.adBanner.src=imgs[currentAd]
adLink.href=lnks[currentAd]
setTimeout("cycle()",7 * 1000)
This is the loader that has been attached to the bottom portion of my overal_header.tpl file
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getRandomNum(lbound, ubound) {
return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
}
// End -->
</script>
<SCRIPT LANGUAGE="JavaScript" src="/forums/banners/banners.js">
</SCRIPT>
<script language="JavaScript">
if (parent.frames.length == 0)
{
var link="<table width=\"100%\" align=\"center\" bgcolor=\"white\" cellpadding=\"2\" cellspacing=\"0\"><tr><td><img src=\"/forums/banners/images/1x1.jpg\"></td><td align=center><a href=\"http://www.steadyracing.net\" name=\"adLink\"><img src=\"/banners/these-banner.jpg\" name=\"adBanner\" border=\"0\" width=\"468\" height=\"60\" target=\"new\" align=\"center\"></a></td></tr></table>";
document.write(link);
cycle();
}
</script>
Here is the banner information file
var lnks = new Array("http://steadyracing.net/forums/viewforum.php?f=12","http://www.toplinecoating.com","http://www.chrisnitelive.com","http://www.credit2nv.com","http://www.660photos.com","http://www.gearheadsperformance.com")
var imgs = new Array("/forums/banners/images/Proforma-AdvertisingBanner.jpg","/forums/banners/images/toplinecoatings.jpg","/forums/banners/images/81xcnl.gif","/forums/banners/images/C2NV468x60.jpg","/forums/banners/images/660photosbanner2.jpg","/forums/banners/images/gearheadsbanner.jpg")
var imgCt = 6
var currentAd = getRandomNum(0,imgCt-1);
function cycle()
{
currentAd++
if (currentAd == imgCt) {
currentAd = 0
}
document.adBanner.src=imgs[currentAd]
adLink.href=lnks[currentAd]
setTimeout("cycle()",7 * 1000)