The Arcive of vBulletin Modifications Site. |
|
-Alpha- Banner Rotation Script Details »»
|
|||||||||||||||||||||||||
I know it's been posted by someone else for the banner rotation controlable by the acp, etc...but this is my own little version with only 1 template to edit...
First this was originally made by Reece on www.GamesXposed.com to generate cash to support the server costs.... Time to start the mod.. ##########Edit headinclude########## ##Find## Code:
<script type="text/javascript" src="clientscript/vbulletin_global.js"></script> <if condition="$show['popups']"><script type="text/javascript" src="clientscript/vbulletin_menu.js"></script></if> Code:
<SCRIPT LANGUAGE="javascript">
<!-- Copyright
//
function banner(img_source,url,alt,chance) {
this.img_source = img_source;
this.url = url;
this.alt = alt;
this.chance = chance;
}
function display() {
with (this) document.write("<A HREF=" + url + "><IMG SRC='" + img_source + "' WIDTH=468 HEIGHT=60 BORDER=0 ALT='" + alt + "'></A>");
}
banner.prototype.display = display;
banners = new Array();
banners[0] = new banner("http://canaca.com/Banner10.gif",
"http://www.canaca.com/affiliate/link.php?ref=173&productid=1 target='_blank'",
"Canaca Inc",
10);
banners[1] = new banner("http://gamesxposed.com/cheat.gif",
"http://www.cheatnexus.net/ target='_blank'",
"Cheat Nexus",
10);
sum_of_all_chances = 0;
for (i = 0; i < banners.length; i++) {
sum_of_all_chances += banners[i].chance;
}
function display_banner() {
chance_limit = 0;
randomly_selected_chance = Math.round((sum_of_all_chances - 1) * Math.random()) + 1;
for (i = 0; i < banners.length; i++) {
chance_limit += banners[i].chance;
if (randomly_selected_chance <= chance_limit) {
document.write("<A HREF=" + banners[i].url + "><IMG SRC='" + banners[i].img_source + "' WIDTH=468 HEIGHT=60 BORDER=0 ALT='" + banners[i].alt + "'></A>");
return banners[i];
break;
}
}
}
//-->
</SCRIPT>
-Explnation- obviously on Code:
banners[0] = new banner("http://mysite.com/bannerlocation.jpg",
"http://advertiserurllocation.com target='_blank''",
"Advertiser's Name",
10);
banners[1] = new banner("http://mysite.com/bannerlocation.gif",
"http://advertiserurllocation.com target='_blank'",
"Advertiser's Name",
10);
Code:
banners[1] = new banner("http://mysite.com/bannerlocation.gif",
"http://advertiserurllocation.com target='_blank'",
"Advertiser's Name",
10);
Will possibly come back with acp options and build it into the acp to make it easier for users to change it awithout diving in the template system.. Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
It's always helpful to have screenshots and to have the coding in a downloadable format. Nice hack.
|
|
#3
|
|||
|
|||
|
post deleted by et2u
|
|
#4
|
||||
|
||||
|
For whatever reason, this doesn't work for me, I copied the code into the headinclude and it does nothing, should there be anything anywhere in some other code? I suppose it could be the template I'm using.
Thanks, cracking hack, hopefully will get it working ![]() Jason |
|
#5
|
||||
|
||||
|
for when this hack will become Full Release?
I think it's agood hack and I was actually looking for something like this |
|
#6
|
|||
|
|||
|
jasonwilliams not sure what your prob is man..
mind copying your headerinclude code here so i can look and compare whats what.. Also i will probably not release another version of this ever for vBulletin.. I'm moving to phpBB 2.0.12 by the end of the weekend and abandoning vBulletin due to there unfair practices with linking off my server to questionable content So see you guys on phpBB.com 's official community boards.. May vBulletin rot in hell. |
|
#7
|
||||
|
||||
|
so does thi work?
|
|
#8
|
|||
|
|||
|
Quote:
|
|
#9
|
|||
|
|||
|
hack did nothing...
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|