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 |
#42
|
|||
|
|||
Perfect!
|
#43
|
|||
|
|||
very nice
|
#44
|
|||
|
|||
Quote:
A few typos. This worked, though: Code:
function randImage() { var images = new Array(); var links = new Array(); images[0] = 'http://www.mysite.com/graphics/23.jpg'; links[0] = 'http://www.appleinsider.com'; images[1] = 'http://www.mysite.com/graphics/20.jpg'; links[1] = 'http://macrumors.com'; var randIndex = Math.round(Math.random()*(images.length-1)); document.write('<a href="' + links[randIndex] + '"><img src="' + images[randIndex] + '" border="0"></a>'); return true; } |
#45
|
||||
|
||||
Quote:
|
#46
|
|||
|
|||
|
#47
|
|||
|
|||
pretty cool... all I am wondering is how would you get it to replace the forum logo?
http://forums.probe-enthusiast.com/ that is my forum... since my forum logo is routed into the heading, where would I put it? I got lazy and instead of changing the coding for my forum banner to be displayed, I just changed the filename so that it replaced the original logo. Let me know... |
#48
|
|||
|
|||
Nice mod...what if i want to have random lgo in my header ?
can someone help me in this ? |
#49
|
|||
|
|||
Nothing in the vbull documentation, nothing in search, certainly nothing in the admincp under vbull options or any other logical category I can think of. The only reference to javascript whatsoever has to do with external data sydication ie. including vbull data as html in an external document.
|
#50
|
||||
|
||||
Quote:
Quote:
Code:
<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
<td align="$stylevar[right]">
</td>
</tr>
</table>
<!-- /logo -->
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> <!-- output logo --> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin showImage(); <!-- end --> </script> |
#51
|
||||
|
||||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|