PDA

View Full Version : Rotating Ad Scripts



webkahuna
10-07-2006, 07:20 PM
I am looking for a script that will allow me to rotate banner ads. For example, everytime someone visits my site, they will see a different banner ad at random. Got any suggestions.

ddadmin
10-08-2006, 12:24 AM
You'll want to use a server side script for this, assuming you want to do any sort of tracking on the ads (impressions, clicks etc). Phpadsnew (http://www.phpadsnew.com)is the best free ad rotation script I know (PHP required)>

gkissi
10-09-2006, 02:05 AM
Below is a script I used for my own banners. Of course you'll need to change the links and images to yours and also change the array size to much the number of banners:

<!-- Rotating Banner -->

<SCRIPT LANGUAGE="JavaScript">
<!--

//add your banner image links

var imgs = new Array ("http://www.trafficoasis.com/images/banner1.gif","http://www.sendfree.com/images/abansf1.gif","http://www.gditeambuilder.ws/Tutorials/gdi_468_3.gif","http://www.justarticlesvip.com/images/banner468-60.gif","http://www.payitforward4profits.com/members/images/banner_468x60.jpg")

//add each corresponding affiliate site
var lnks = new Array ("http://www.trafficoasis.com/index.php?133835","http://www.sendfree.com/affref/93791","http://www.gditeambuilder.ws/index.php?refid=gkissi","http://www.justarticlesvip.com/amember/go.php?r=152&i=b0","http://www.payitforward4profits.com/gkissi")
var altimg = new Array ("UltimateMLMLeads","Signup with SendFree Now!","Are you part of GDI Yet?","Just Articles VIP Club","Funded Sponsoring Franchise!")
var currentAd = 0
var imgCt = 5 //change this to match the number of images
function cycle() {
currentAd++
if (currentAd == imgCt) {
currentAd=0
}
document.adBanner.src=imgs[currentAd]
document.adBanner.alt=altimg[currentAd]
adLink.href=lnks[currentAd]
setTimeout("cycle()",10 * 1000) //banner changes every 10 sec
}
//-->
</SCRIPT>

//the first banner that appears
<a href="http://www.trafficoasis.com/index.php?133835" name="adLink" target="_blank"><img src="http://www.trafficoasis.com/images/banner1.gif" name="adBanner" border="0" width="468" height="60"></a>

<SCRIPT LANGUAGE="JavaScript">
<!--
cycle()
//-->
</SCRIPT>

I hope this helps.

George