PHP/HTML : Simple Ad Poll Code

Status
Not open for further replies.

Pyro

Banned
Banned
142
2009
0
0
With this simple advert code you can easly
add adverts into your website/forum
and the best thing about it is that its
Ad Pool so you can add loads of adverts to it
and you wont have to place loads on your site
just 1 ad space and you can have loads of adverts
in it i recommend having 3 + 1 Begginging advert

KEY:

How Fast They Show:
window.setInterval("cycle1()",5000);
Controls How Fast the adverts will show
just change the 5000 (5 seconds) to what you want

Basically each advert has a:
"Image Url"
"Site Url"
"Site Name"
and you cant put them wherever you want they
all have to be in order
i.e.
IMAGE-URL-OF-SITE-1ST = Banner Image of your first site advert
URL-OF-SITE-1ST = Url to your first site advert
NAME-OF-SITE-1ST = Name to your first site advert

ALL ADVERTS MUST BE COORDINATED LIKE:
First Advert:
IMAGE-URL-OF-SITE-1ST
URL-OF-SITE-1ST
NAME-OF-SITE-1ST

Second Advert:
IMAGE-URL-OF-SITE-2ND
URL-OF-SITE-2ND
NAME-OF-SITE-2ND

How to change Advert Size:
Just Change width="468" height="60"
to what you need it to be

Code:
<center>
<script type="text/javascript">
var imgs1 = new Array("IMAGE-URL-OF-SITE-1ST","IMAGE-URL-OF-SITE-2ND","IMAGE-URL-OF-SITE-3RD");
var lnks1 = new Array("URL-OF-SITE-1ST","URL-OF-SITE-2ND","URL-OF-SITE-3RD");
var alt1 = new Array("NAME-OF-SITE-1ST","NAME-OF-SITE-2ND","NAME-OF-SITE-3RD");
var currentAd1 = 0;
var imgCt1 = 3;
function cycle1() {
  if (currentAd1 == imgCt1) {
    currentAd1 = 0;
  }
var banner1 = document.getElementById('adBanner1');
var link1 = document.getElementById('adLink1');
  banner1.src=imgs1[currentAd1]
  banner1.alt=alt1[currentAd1]
  document.getElementById('adLink1').href=lnks1[currentAd1]
  currentAd1++;
}
  window.setInterval("cycle1()",5000);
</script>
<a href=""URL-OF-SITE-SHOWS-ONCE"" id="adLink1" target="_blank">
<img src="IMAGE-URL-OF-SITE-SHOWS-ONCE" id="adBanner1" border="0" width="468" height="60"></a>
      </center>
 
4 comments
Status
Not open for further replies.
Back
Top