Welcome Guest [Log In] [Register]
This board has been archived and is no longer accepting new questions. If you have a support question for your ZetaBoard, please visit us at the new support board. Registration is free and easy.


Visit the NEW ZetaBoards Support forum!

Username:   Password:
Add Reply
Random Banner for each Skin
Topic Started: Mar 21 2008, 12:07 PM (2,657 Views)
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
This code allows you to have a random banner which changes on each page view. You can change the banners for each skin.

Code: HTML
 
<script type="text/javascript">
//<![CDATA[
logoPics=[];l=0
logoPics[l++]=["http://209.85.62.24/static/acp/settings.png","<center>","</center>"];
logoPics[l++]=["http://209.85.62.24/static/acp/acplogo.png","",""];
var place=Math.floor(Math.random()*logoPics.length);
$("#logo").html(logoPics[place][1]+"<img src='"+logoPics[place][0]+"'/>"+logoPics[place][2]);
//]]>
</script>


Code: HTML
 
logoPics[l++]=["http://209.85.62.24/static/acp/settings.png","<center>","</center>"];


Keep adding that for another banner. Change the URL to the image. Change <center> to what should be before the image, and </center> to what should be after the image.

This goes Below the board. If you want it for different skins remove it from Below the Board. Then add it to your Themes layout.
Offline Profile Quote Post Goto Top
 
davadude
Member Avatar
GuildWars addict :P
[ *  *  * ]
very nice viral!
Offline Profile Quote Post Goto Top
 
s. smith fan
Member Avatar
±╣δè@╡π↓╬∞┬♫~╨:
[ * ]
That could be very helpful if you have a skin randomizer to make the banner match ever theme great code.
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
It does.
Offline Profile Quote Post Goto Top
 
DAEnaya
Member Avatar
Member
[ * ]
Needed this. Thanks Viral!
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
No problem :) .
Offline Profile Quote Post Goto Top
 
yellowdartx
Member Avatar
Zombie!!!
[ *  * ]
Another great code by viral, Thanks man!
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
No problem :) .
Offline Profile Quote Post Goto Top
 
Ingram
Member
[ * ]
Is it possible to change this so it doesn't remove the default image set in the Theme Settings and places this with it as well. I'm trying to have a 2 part banner in the logo section with one image randomly changing.
Offline Profile Quote Post Goto Top
 
Randomman
Member
[ * ]
Not to bug anyone, but there is 1 issue I feel I should point out. These banners don't link back to the main site. To fix this, you can use this right next to the first div tag:
Code:
 

<a href='insert url here'>

and this next to the second:
Code:
 

</a>

Just be sure to use only single quotation marks, or the code seems to get messed up.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · User Created Codes · Next Topic »
Add Reply