View Full Version: [S] Banner Changer Code

RPG-Directory > Solved Support Topics > [S] Banner Changer Code



Title: [S] Banner Changer Code


HoshigakiKisame - April 26, 2008 05:37 PM (GMT)
Is there a code that allows the banner the change? If so, can you post the code?

Here is an example: http://z6.invisionfree.com/NinjaVillage/index.php

See how the banner changes once in awhile.

Gowd - April 26, 2008 05:38 PM (GMT)
I found a real good one you may like. ^_^





Mod Name: Different logo per forum/url v2
Description: Have different logos , for different forums/topics/subforums/pages !
Preview/Screenshot In Use:

http://s9.invisionfree.com/UltimateHacks6/index.php?
http://s9.invisionfree.com/UltimateHacks6/...php?showforum=1

Password: test
Username: test


Admin Cp >> Board Wrappers >> Footer


CODE
<script type="text/javascript">
// Different logo per forum/url v2
// created by Ryan Fan
// [URL=http://www.ifsz.com]http://www.ifsz.com[/URL] , 2005
function customiLogo(customiUrl, customiImage)
{
if(location.href.match(customiUrl))
{
var x = document.getElementsByTagName('div')
for(y=0;y<x.length;y++){
if(x[y].id == "logostrip"){
x[y].innerHTML = "<img src='" + customiImage + "' alt='' border='0' />"
}}}}
customiLogo("URL PART", 'LOGO URL')
</script>


QUOTE
customiLogo("URL PART", 'LOGO URL')


To add more, just add:

QUOTE
customiLogo("URL PART", 'LOGO URL')


Under the other one. ^_^

So part is where you want the new one to appear. Soo... lets say, you want the "Rules topic"'s banner to say "Rules" then make one with "Rules" or somthing and make a rules banner and put it there. ^_^ I've not tested this myself... if you have any problems, the maker can be found in this topic. : Here

[EDIT] Upps, wrapped in a code - sorry!

HoshigakiKisame - April 26, 2008 05:55 PM (GMT)
QUOTE (Gowd @ Apr 26 2008, 05:38 PM)
i found one where every time you refresh is does it. I will post in soon, tea time XD Just letting you know that there is one. ^_^

That will do wonderfully. Thank you. Take your time! =]

Gowd - April 26, 2008 07:20 PM (GMT)
Okay, edited my first post. Hope thats okay, if not ask and i will keep looking. ^_^

HoshigakiKisame - April 27, 2008 03:11 PM (GMT)
Not exactly the code I'm looking for but thanks.

Rokkan - April 27, 2008 03:44 PM (GMT)
Looking at the source code for that site, I have absolutely no idea how they have a changing banner [or even if they do]

Maybe you're looking for a code like the one on my test forum. Each time you click onto a new page, a random banner is shown.

The code for that one is

QUOTE
<script language="JavaScript"><!--

images = new Array(#)

images[0] = "<img src=http://img.photobucket.com/xxx>";

images[1] = "<img src=http://img.photobucket.com/xxx>";

images[2] = "<img src=http://img.photobucket.com/xxx>";

images[3] = "<img src=http://img.photobucket.com/xxx>";

images[4] = "<img src=http://img.photobucket.com/xxx>";

images[5] = "<img src=http://img.photobucket.com/xxx>";

images[6] = "<img src=http://img.photobucket.com/xxx>";

images[7] = "<img src=http://img.photobucket.com/xxx>";

images[8] = "<img src=http://img.photobucket.com/xxx>";

index = Math.floor(Math.random() * images.length);

document.write(images[index]);
--></script>


the # needs to be changed to the number of your last image +1 [so if you have banners numbered 0-4, # = 5; banners 0-7, #=8 and so on]

and obviously the URLs for the images would need edditing to fit the banners you had.


Hope this helps.


EDIT: I didn't create this code, I'm merely passing it on. Can't remember who created it though...

HoshigakiKisame - April 27, 2008 08:46 PM (GMT)
Where in the board wrappers does that code go?

Rokkan - April 27, 2008 08:50 PM (GMT)
QUOTE (HoshigakiKisame @ Apr 27 2008, 09:46 PM)
Where in the board wrappers does that code go?

It goes in the logo macro in images, usually.

HoshigakiKisame - April 27, 2008 09:18 PM (GMT)
CODE
<script language="JavaScript"><!--

images = new Array(4)

images[0] = "<http://i248.photobucket.com/albums/gg168/Sharky_Kisame/finsihedwe2.png>";

images[1] = "<img src=<http://i248.photobucket.com/albums/gg168/Sharky_Kisame/42632085.png>";

images[2] = "<img src=<http://i248.photobucket.com/albums/gg168/Sharky_Kisame/shinobibanner.png>";

index = Math.floor(Math.random() * images.length);

document.write(images[index]);
--></script>


I have that in the Logo part in images and it doesn't seem to be working.

Rokkan - April 27, 2008 09:55 PM (GMT)
you only have 3 images, so the array number should be 3, not 4

Gowd - April 29, 2008 04:35 PM (GMT)
QUOTE (Rokkan @ Apr 27 2008, 03:44 PM)
Looking at the source code for that site, I have absolutely no idea how they have a changing banner [or even if they do]

Maybe you're looking for a code like the one on my test forum. Each time you click onto a new page, a random banner is shown.

The code for that one is

QUOTE
<script language="JavaScript"><!--

images = new Array(#)

images[0] = "<img src=http://img.photobucket.com/xxx>";

images[1] = "<img src=http://img.photobucket.com/xxx>";

images[2] = "<img src=http://img.photobucket.com/xxx>";

images[3] = "<img src=http://img.photobucket.com/xxx>";

images[4] = "<img src=http://img.photobucket.com/xxx>";

images[5] = "<img src=http://img.photobucket.com/xxx>";

images[6] = "<img src=http://img.photobucket.com/xxx>";

images[7] = "<img src=http://img.photobucket.com/xxx>";

images[8] = "<img src=http://img.photobucket.com/xxx>";

index = Math.floor(Math.random() * images.length);

document.write(images[index]);
--></script>


the # needs to be changed to the number of your last image +1 [so if you have banners numbered 0-4, # = 5; banners 0-7, #=8 and so on]

and obviously the URLs for the images would need edditing to fit the banners you had.


Hope this helps.


EDIT: I didn't create this code, I'm merely passing it on. Can't remember who created it though...

Also happens every time you refresh, lol, i will be using that also.. *shifty*. Can i ask who made the Member legend? i love it... *has been looking for one*

ShinLi - June 26, 2008 09:55 AM (GMT)
Your topic has been solved and moved to the 'Solved Support Topics' forum! Still have a question, or something isn't clear yet? Open up a new topic, but be sure to be more specific this time!




Hosted for free by InvisionFree