PDA

View Full Version : Forum Home Enhancements - UKBL ~ Timed Rotating Ad Banners


UKBusinessLive
16 Jan 2009, 15:33
UKBL ~ Timed Rotating Ad Banners

Live Demo http://www.ukbusinesslive.co.uk/forum

I've been wanting to display some banners on my site but i didn't just want the same banner just showing until you go to another page or hit the refresh button, Some people may stay on the forum home for quite some time, This is not the ideal way to display banners, as they'll only see the one ad in all that time.

Well thats about to change with UKBL ~ Timed Rotating Ad Banners :D

Now as Admin you'll be able to make some serious money by showing a wider variety of banners which change after so many seconds, as opposed to changing on refreshes.

You can sign up to a number of affiliate sites and download banners to your forums, a list of affiliate sites to help you is at the end of this post.

https://www.vbulletin.org/forum/external/2009/01/41.png

To install this to your forums is so easy

First you need to edit the code to suit your requirements
Copy the following code to a text editor like notepad or word



<html>
<head>
<title>UKBL ~ 10 Second Banner Rotator</title>
</head>
<body>
<DIV ALIGN=CENTER>
<script language="JavaScript">
<!--
function adArray() {
for (i=0; i*2<adArray.arguments.length; i++) {
this[i] = new Object();
this[i].src = adArray.arguments[i*2];
this[i].href = adArray.arguments[i*2+1];
}
this.length = i;
}
function getAdNum() {
dat = new Date();
dat = (dat.getTime()+"").charAt(8);
if (dat.length == 1)
ad_num = dat%ads.length;
else
ad_num = 0;
return ad_num;
}
var ads = new adArray(
"http://i475.photobucket.com/albums/rr114/ukbusinesslive/1-3.gif",
"http://aavaninsurance.at/ukbusinesslive",
"http://i475.photobucket.com/albums/rr114/ukbusinesslive/banner11.jpg",
"http://www.ukbusinesslive.co.uk/forum",
"http://i475.photobucket.com/albums/rr114/ukbusinesslive/2-2.gif",
"http://tradebusiness.at/ukbusinesslive",
"http://i475.photobucket.com/albums/rr114/ukbusinesslive/7-2.gif",
"http://skytv.at/ukbusinesslive"
);

var ad_num = getAdNum();

document.write('<table cellpadding=0 cellspacing=1 border=0><tr><td '
+'align="left">'
+'<A href="'+ads[ad_num].href+'"><IMG SRC="'+ads[ad_num].src+'" '
+'height="60" width="468" border="0" name="js_ad"></a></td></tr></table>');

link_num = document.links.length-1;

function rotateBanner() {
if (document.images) {
ad_num = (ad_num+1)%ads.length;
document.js_ad.src = ads[ad_num].src;
document.links[link_num].href = ads[ad_num].href;
setTimeout("rotateBanner()",10000);
}
}
setTimeout("rotateBanner()",10000);

// -->
</script>
</DIV>
</body>
</html>



The look for the following....

"http://i475.photobucket.com/albums/rr114/ukbusinesslive/1-3.gif",
"http://aavaninsurance.at/ukbusinesslive",


Basically what you see is what you get, the top line is the url of your image, you can save it to forums/images/misc or even photobucket, like my example above, The second line is the url to the site, Thats its just repeat this for all the ad banners you have and write up the code. Easy. You can use 2 banners or 200 the choice is yours

https://www.vbulletin.org/forum/
https://www.vbulletin.org/forum/external/2009/01/20.gif
https://www.vbulletin.org/forum/external/2009/08/14.gif
https://www.vbulletin.org/forum/

Then once you've edited your banners and their URL's you need to scroll down to..

setTimeout("rotateBanner()",10000);
}
}
setTimeout("rotateBanner()",10000);



Now you need to change the time delay, its in milliseconds, don't forget that, so if you want your ads to change every 10 seconds like the code above, you leave it on 10000, if you want 8 seconds, you need to change the code to 8000 in both lines, likewise 5 seconds = 5000

Then just save the file :D

To install to your Site.

For ease of application i've installed it in the header, right at the end, so heres what to do...

ACP> Style Manager > Your site's style > header

Just copy and paste the entire code that you've just edited and paste it at the very end of the header template, Click save. Thats its

if you experiment you can add these banners to the footer, in the posts and in different forums, Try and see what works for you the most

If you want to try the code first i've included a few banner gif's in the zipped file so you can try.

Affiliate Schemes that Pay YOU!! Some are UK based but have US section too

Commision Junction = http://www.cj.com/
Buy.at = http://buy.at/ (UK) http://www.advertising.com/buyat/ (US)

Plus loads more and details on the zip file :D

Give it a go and see if it works for you, remember to leave a comment and if i can help at all, i will.

If you only want to show banners to un registered members or guests then you could add a condition at the begining like this

<if condition="is_member_of($bbuserinfo, X,X)">


With X the id of the usergoup that you want to show the banners to, don forget the add the </if> tag at the end of the script :cool:

Please Remember to click installed :D

UKBusinessLive
16 Jan 2009, 15:34
:) Reserved :rolleyes:

Rene Kriest
17 Jan 2009, 00:49
Well done once again. :)

Did you outsource addon coding to India or how do you manage to produce almost every week a quality addon? ;)

UKBusinessLive
17 Jan 2009, 06:40
Well done once again. :)

Did you outsource addon coding to India or how do you manage to produce almost every week a quality addon? ;)

Thanks Rene ;)

A lot of it is problem solving and seeing what can be improved within VBulletin, I had help from a friend who wanted this done on his forums see here http://www.vbulletin.org/forum/showthread.php?t=201895

Together we sorted out a solution, With a bit of ready made javascript and a couple of extra additions we 're able to come up with a solution to the idea. Main thing being is to do a search on Vb.org and see if this idea has be done before if not then expand on it.

Next is the Instructions, They look quite technical but its just so simple, you need to show in every way how best to use this idea and how people can benefit from it. The Hack alone is quite simple, but its how you present it that counts.

I have another idea in the pipeline too!! Its not only women that can multi task :D

Take care ;)

vbplusme
17 Jan 2009, 12:00
You might want to check why you have a <div> tag before your opening html tag...

UKBusinessLive
17 Jan 2009, 15:20
You might want to check why you have a <div> tag before your opening html tag...

Apologies Sir, I have now corrected it:D

Wizardjv
22 Jan 2009, 21:58
What if you wanted to use something like adsense with this? Would that be possible or against the tos? I am just curious

UKBusinessLive
22 Jan 2009, 23:05
What if you wanted to use something like adsense with this? Would that be possible or against the tos? I am just curious

I think that with adsense you cannot show more than 3 adsense ads on the page in any one time, your best bet might be to read through their tos, but personally i don't see a problem. ;)

honken
06 Feb 2009, 16:00
javascript isn't really my kind of language but is it possible to get the banner links to open in a new window?

UKBusinessLive
06 Feb 2009, 17:12
javascript isn't really my kind of language but is it possible to get the banner links to open in a new window?

Not on this version but i will be adding that shortly ;)

honken
06 Feb 2009, 17:30
Not on this version but i will be adding that shortly ;)

thanks, looking forward to that one then.

CFodder
28 Feb 2009, 00:57
Great little mod thanks UK. We don't have ads on our site but I've used it to rotate a few piccies :).

UKBusinessLive
28 Feb 2009, 11:27
Great little mod thanks UK. We don't have ads on our site but I've used it to rotate a few piccies :).

Great idea ;)

mrtroybaker
06 Mar 2009, 22:10
Been looking for this exact thing. Thanks

UKBusinessLive
07 Mar 2009, 05:53
Been looking for this exact thing. Thanks

hope it works for you :up:

BGObsession
30 May 2009, 03:39
This seems to work extremely well. Very simple and easy to use. Only problem I'm having is that I'm trying to use it on a right side module of my CMPS page, not as a 'banner rotator', but to rotate images advertising other sites we have a relationship with. I set the module up as a php module, and its working fine in terms of rotating the images. I did have to select the 'clean file output' option to get it to show in the right column. My problem is, although the images rotate fine and look good in the right hand column module, my footer and footer navbar links are now messed up. Any idea what I need to tweak so that the footer formatting doesnt get messed up?

UKBusinessLive
30 May 2009, 11:17
This seems to work extremely well. Very simple and easy to use. Only problem I'm having is that I'm trying to use it on a right side module of my CMPS page, not as a 'banner rotator', but to rotate images advertising other sites we have a relationship with. I set the module up as a php module, and its working fine in terms of rotating the images. I did have to select the 'clean file output' option to get it to show in the right column. My problem is, although the images rotate fine and look good in the right hand column module, my footer and footer navbar links are now messed up. Any idea what I need to tweak so that the footer formatting doesnt get messed up?

If your using it in your CMPS page then you might be better off using this http://www.vbulletin.org/forum/showthread.php?t=209005

Its an Iframe based HTMl coded Rotating banner mod which you could use for your sponsors or any advertising. Might be better in your CMPS box as opposed to a javascript hack.

Let us know how you got on :D

jkcerda
16 Aug 2009, 03:44
reserved

ElizeF
18 Oct 2009, 12:13
UKBusinessLive, I followed all the instructions as explained and I can not get my banners to work - I do not even see my banners. :confused:
Any suggestions where I can look to see what I did wrong:o
Thanks

FuegoMCS
07 Feb 2010, 16:51
n00b question - Is this something that I could drop into a module to be displayed on our CMPS homepage? We have a number of club sponsoring vendors and would like to have a non-header/sidebar module on our homepage that rotates through sponsor logos (linked)

Mary303
17 Apr 2010, 15:19
UKBusinessLive, I followed all the instructions as explained and I can not get my banners to work - I do not even see my banners. :confused:
Any suggestions where I can look to see what I did wrong:o
ThanksAny feedback on this? :)