Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Banner Code


  • Please log in to reply

#1
Paradox924X

Paradox924X

    Member

  • Member
  • PipPipPip
  • 208 posts
Hello G2G community! Wondering if you guys can help me out here...
I need a good baner script for my school's website...
I need a script that can be linked to remotely.. like so every page doesn't have to be changed every time I want to make an edit...
Basically like have a .js file that it refers to...
Also, I want to be able to set the interval in seconds between each change in banner....
and have the banners appear in any random order from our img directory..
and have each banner be a link to a website set by us...
  • 0

Advertisements


#2
lil_cat_luver

lil_cat_luver

    Member

  • Member
  • PipPipPip
  • 296 posts
I don't know if you're still looking for the script, but I found something that you might be able to use

<script language="JavaScript">

<!-- Begin
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
url="http://LINK1";
alt="Alt Text";
banner="BUTTONURL1";
width="88";
height="31";
}
if (ad==2) {
url="http://LINK2";
alt="Alt Text";
banner="BUTTONURL2";
width="88";
height="31";
}
if (ad==3) {
url="http://LINK3";
alt="Alt Text";
banner="BUTTONURL3f";
width="88";
height="31";
}

document.write('<a href=\"' + url + '\" target=\"_blank\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0></a>');
// End -->
</script> 

Here are the directions that came along with it:

At the very top you see it says "how_many_ads = 3" Change ONLY the number 3, because that is how many buttons you have on your button rotation, that is how many I have for this one, but if you have 20, more or less, then change it.

Then you will see "http://LINK1" and "Alt Text" and also "BUTTONURL", you must change those 3 so they match up with each button your adding to the rotation

The buttons I am using on this tutorial are all 88x31, but you can use any size or type of button you like, just specify the size where you see "width='88" height="31"" with the size you want.

If you want to add more than 3 then just add this code, after the last one:

if (ad==3) { 
url="http://LINK3"; 
alt="Alt Text"; 
banner="BUTTONURL3f"; 
width="88"; 
height="31"; }

(I assume you would need to change ad==3 to ad==4)
  • 0

#3
Paradox924X

Paradox924X

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 208 posts
Oh wow, thanks a lot! I WAS still looking for it! You really helped me :) Thanks a lot.
:tazz:
  • 0

#4
lil_cat_luver

lil_cat_luver

    Member

  • Member
  • PipPipPip
  • 296 posts
No problem. Hope it works
  • 0

#5
admin

admin

    Founder Geek

  • Community Leader
  • 24,639 posts
phpAdsNew :tazz:

It's what we use for the header here.
  • 0

#6
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Seems like this script is very popular. :tazz: I've used it on several of my sites and it's fun and easy to set up. Wish I had known about GTG years ago as you guys do come up with some good stuff!

Ron
  • 0

#7
Paradox924X

Paradox924X

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 208 posts
Wow.. extreme dead post revival dude.. I didnt know this post was still alive.. I thought itd be gone around Dec 10th~15th.. lol
Next time, check the date on it :tazz:
Not to be mean or anything..
  • 0

#8
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
No one ever means to be mean, but since it is hard to catch or keep up with these old open posts that should have been closed, I make a reply. Besides, revival is good for the soul!

Why are you still subscribe to this post?

Your post helped to revive it even more...not to be mean, dude!

Ron
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP