View Full Version : Banner rotator
Does anyone know where I can get some kind of thing that rotates a load of different banners on a site please?
thanks
Here you go:
<SCRIPT LANGUAGE="JavaScript">
var how_many_ads = 4;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
txt="";
url="http://www.YOURSITE.com";
alt="Your Alt Text";
banner="http://www.WHERE_YOUR_BANNER_IS_LOCATED.gif";
width="468";
height="60";
}
if (ad==2) {
txt="";
url="http://www.YOURSITE.com";
alt="Your Alt Text";
banner="http://www.WHERE_YOUR_BANNER_IS_LOCATED.gif";
width="468";
height="60";
}
if (ad==3) {
txt="";
url="http://www.YOURSITE.com";
alt="Your Alt Text";
banner="http://www.WHERE_YOUR_BANNER_IS_LOCATED.gif";
width="468";
height="60";
}
if (ad==4) {
txt="";
url="http://www.YOURSITE.com";
alt="Your Alt Text";
banner="http://www.WHERE_YOUR_BANNER_IS_LOCATED.gif";
width="468";
height="60";
}
document.write('<center>');
document.write('<a href=\"' + url + '\" target=\"_top\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0><br>');
document.write('<small>' + txt + '</small></a>');
document.write('</center>'); </SCRIPT>
You can add as many as you like just change the "var how_many_ads = 4;" to the amount you want and then just add "(ad==2)" for each.
The banners rotate on every refresh.
Ahh man your a top bloke
nice one
obviously you could just install phpAdsNew (http://phpadsnew.com/two/)
have you got msn or icq geezer?
Oh even better thanks -HF :)
where do i put the script? Where the banner is going to go???
Or in the head???
where do i put the script? Where the banner is going to go???
Or in the head???
you talking about Geezer's code now or phpAdsNew ?
AdsNew you isntall on a server and it will serve banner as well as text ad campaigns to any site you want.
its okay I'v sussed it now
vBulletin® v3.7.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.