The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Random Logo in Header Details »» | |||||||||||||||||||||||||
What This Does
This will make a random logo which you select appear on the top of your board. You must have JavaScript enabled. Now let's get started, shall we? Go to your admincp and open up the "header" template. At the very begining of your header template, add: Code:
<SCRIPT LANGUAGE="JavaScript"> <!-- Begin Random Logo In Header Script var theImages = new Array() // do not change this <!-- Edit the url images to match yours theImages[0] = 'http://www.yoursite.com/forum/images/banner1.gif' theImages[1] = 'http://www.yoursite.com/forum/images/banner2.gif' var j = 0 var p = theImages.length; var preBuffer = new Array() for (i = 0; i < p; i++){ preBuffer[i] = new Image() preBuffer[i].src = theImages[i] } var whichImage = Math.round(Math.random()*(p-1)); function showImage(){ document.write('<div align="center"><a href="index.php"><img src="'+theImages[whichImage]+'" border="0" alt="$vboptions[bbtitle]" /></a></div>'); } // End --> </script> Code:
<a name="top"></a> <table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center"> <tr> <td align="$stylevar[left]" class="logobg"><a href="$vboptions[forumhome].php?$session[sessionurl]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td> </tr> </table> Code:
<SCRIPT LANGUAGE="JavaScript"> <!-- Begin showImage(); // End --></script> To add more images, go back to: Code:
theImages[1] = 'http://www.yoursite.com/forum/images/banner2.gif' Code:
theImages[2] = 'http://www.yoursite.com/forum/images/banner3.gif' I know this can be done with a plugin or some sort of installer, but since I have no idea on how to do that, I suppose there won't be one unless someone creates one, or until I figure out how. If you would like to recieve updates on this modification, please click the 'Install' button. Daniel www.mmoccforum.com Show Your Support
|
Comments |
#22
|
|||
|
|||
I LOVE THIS HACK!!! My only question is... how do I center the headers? As soon as I figure out how to center them the install button will be happily clicked!
|
#23
|
||||
|
||||
This is a great hack Daniel. But the only problem I had with it was that you could not click on the banner and have it bring you to the web site that you were advertising. All it did was display a banner. Most people that user banners using them to advertise and they want users to go the advertisors web site. You can not do this unless you have the banner as a active link.
I created this little hack here that seems to do it all. This hack may have room for improvement but it is basic and the banners rotate and are active links. https://vborg.vbsupport.ru/showthread.php?t=106682 |
#24
|
||||
|
||||
i can't seem to find the first bit..
im using element skin. Find: Code:
<a name="top"></a> <table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center"> <tr> <td align="$stylevar[left]" class="logobg"><a href="$vboptions[forumhome].php?$session[sessionurl]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td> </tr> </table> And replace it with: Code:
<SCRIPT LANGUAGE="JavaScript"> <!-- Begin showImage(); // End --></script> |
#25
|
||||
|
||||
anyhelp?
|
#26
|
||||
|
||||
Quote:
Code:
<!-- Begin showImage(); // End --> |
#27
|
|||
|
|||
Quote:
|
#28
|
|||
|
|||
I changed the line
document.write('<img src="'+theImages[whichImage]+'">'); to document.write('<center><img src="'+theImages[whichImage]+'"></center>'); I don't know if thats the cleanest way to do it but thats what I did. |
#29
|
|||
|
|||
Quote:
|
#30
|
|||
|
|||
One comment. I found that when you don't have javascript enabled it shows no image at all. So what I have done is found:
Code:
<SCRIPT LANGUAGE="JavaScript"> <!-- Begin showImage(); // End --></script> Code:
<no script> <center><img src='/images/put_your_default_image_name_here'></center> </no script> |
#31
|
||||
|
||||
Nice idea, thanks for sharing.
And thanks tbaleno for helping out. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|