Banner Ads

that is simple HTML and javascript ๐Ÿ™‚ though you have to ask MhW permission before you use it ๐Ÿ˜‰
 
I guess i'll wait till he posts in this thread then, thanks for the help NewKirk. ๐Ÿ˜‰
 
Just google search "Banner Rotation Script" you'll find a few that will work ๐Ÿ˜‰.
 
Nathan would this code work?

Code:
<SCRIPT language=JavaScript>

var img_width = "468";
var img_height = "60";
var img_title = "click here"

var links=new Array()
var pic=new Array()

//insert here your images src
pib[0]='img_Link';
//insert here your links
links[0]='forums_links';

var xy=Math.floor(Math.random()*ad.length);//generates a random //digit and then makes it a whole number
document.write('<a href="" links[xy] "" target="_blank"><img src="" pic[xy] "" width="" img_width "" height="" img_height "" alt"" img_title "">
</a>');
</SCRIPT>

And if it is where do I edit it in my theme?
 
With these alterations it should be fine:

Code:
    <script language="JavaScript">

    var img_width = "468";
    var img_height = "60";
    var img_title = "click here"

    var links=new Array()
    var pic=new Array()

    //insert here your images src
    pib[0]='img_Link';
    //insert here your links
    links[0]='forums_links';

    var xy=Math.floor(Math.random()*ad.length);//generates a random //digit and then makes it a whole number
    document.write('<a href="" links[xy] "" target="_blank"><img src="" pic[xy] "" width="" img_width "" height="" img_height "" alt"" img_title "">
    </a>');
    </SCRIPT>

I don't know how many links you can store with that one as i don't see the actual trigger myself as i haven't seen or even used the script before.

I think if you add pib[1]='img_Link'; and links[1]='forums_links'; then just changing the numbers it will have more.

About where to put it, it really depends on where you want the banners to show, if you want it only on the index page add it to styles/yourstyle/template/index_body.html and where ever you want to put it ๐Ÿ˜‰.
 
Nope, does not work it ends up making my forums disappear, but I fixed it...but the banner ad code posted above. ^ Just makes my forums disappears. ๐Ÿ™
 
I have a free banner rotator you can download here:

http://www.spyka.net/scripts/javascript ... er-rotator

Features include:

- Unlimited banners
- Can assign banners to different locations, so you can have two rotators at the top and bottom of your forum with different banners
- Lots of options to style the banner rotator your way
- Will remove banner after a set date (ideal for promotion forums)
- Can refresh the banner locations without reloading the page
- Very lightweight
- Easy to code, none of this "image1, width1, width2," etc, just a single line for each banner

Here is a simple demo: http://www.spyka.net/files/simple-banne ... basic.html
 
Well then yes i suggest Spyka's banner ads script, it works great and is easy to use ๐Ÿ™‚.

That one you posted didn't look like it'd work properly anyways ๐Ÿ˜‰.
 
Spyka I just need the code, by the way when I downloaded the file it said read the install.html there was no install.html in the folder. ๐Ÿ˜› I just need the code really, it would be alot easier to edit. ๐Ÿ™‚
 
Google is your friend ๐Ÿ˜€

I found this code for ya:

Code:
<script type="text/javascript">
var imgs1 = new Array();
var alt1 = new Array();
var currentAd1 = 0;
var imgCt1 = 1;
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]
  currentAd1++;
}
  window.setInterval("cycle1()",10000);
</script>
<img src= id="adBanner1" border="0" width="468" height="60"></a>
 
I have the code used here for you, and no you dont need MhW's permission, I am sure there is the same code somewhere else ๐Ÿ˜€
Code:
<script type="text/javascript">
<!-- Begin
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function rand(number) {
	var result = Math.ceil(rnd()*number);
	if (!result)result++;
        return result
};
var ad_cnt1 = 10;
var ad1 = rand(ad_cnt1);
var link1;
var adBanner1;
var width1
var height1

if (ad1==1) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="1";
}

if (ad1==2) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="2";
}

if (ad1==3) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="3";
}

if (ad1==4) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="5";
}

if (ad1==5) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="5";
}

if (ad1==6) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="6";
}



if (ad1==7) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="7";
}

if (ad1==8) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="8";
}


if (ad1==9) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="9";
}

if (ad1==10) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="10";
}

document.write('<script type="text/javascript" src="http://www.forumpromotion.net/banners/banner.js"></scr'+'ipt>');
// End -->
</script>

The only part you should edit are the lines of code that have wdith, height, link and pic link. To add more banners to the rotation, you can pretty much see the pattern. Put this script under </head> in overall_header.html
 
The Pimped Papaya said:
I have the code used here for you, and no you dont need MhW's permission, I am sure there is the same code somewhere else ๐Ÿ˜€
Code:
<script type="text/javascript">
<!-- Begin
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function rand(number) {
	var result = Math.ceil(rnd()*number);
	if (!result)result++;
        return result
};
var ad_cnt1 = 10;
var ad1 = rand(ad_cnt1);
var link1;
var adBanner1;
var width1
var height1

if (ad1==1) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="1";
}

if (ad1==2) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="2";
}

if (ad1==3) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="3";
}

if (ad1==4) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="5";
}

if (ad1==5) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="5";
}

if (ad1==6) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="6";
}



if (ad1==7) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="7";
}

if (ad1==8) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="8";
}


if (ad1==9) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="9";
}

if (ad1==10) {
link1="LINK HERE";
adBanner1="PIC LINK HERE";
width1="WIDTH GOES HERE";
height1="HEIGHT GOES HERE";
alt1="10";
}

document.write('<script type="text/javascript" src="http://www.forumpromotion.net/banners/banner.js"></scr'+'ipt>');
// End -->
</script>

The only part you should edit are the lines of code that have wdith, height, link and pic link. To add more banners to the rotation, you can pretty much see the pattern. Put this script under </head> in overall_header.html

Thanks mate! ๐Ÿ˜‰
 
You better check it's not MhW's code, if it is then you need to ask permission.
 
Back
Top Bottom