|
Random logo!
This mod I created with a friend for a small project on my site, it's a remake of This mod but we created it ourselves.
It works with vBulletin 3.5 up to 3.8.2 from what I know, it probably works with older versions as well. This allows you to have random logo's anywhere on your site. First you place this code anywhere in your header (Top is a good place): 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] = 'url'
theImages[1] = 'url'
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"><img src="'+theImages[whichImage]+'" border="0" alt="$vboptions[bbtitle]" /></a></div>');
}
// End -->
</script>
Now if you have large images (The reason we created this mod) then use this code: 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
<!-- Edit the url images to match yours
theImages[0] = 'URL'
theImages[1] = 'URL'
theImages[2] = 'URL'
theImages[3] = 'URL'
theImages[4] = 'URL'
theImages[5] = 'URL'
theImages[6] = 'URL'
theImages[7] = 'URL'
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-5));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'" border="0" alt="$vboptions[bbtitle]" /></a><img src="'+theImages[whichImage+4]+'" border="0" alt="$vboptions[bbtitle]" /></a></div>');
}
// End -->
</script>
Then wherever you want the images to display add this: Code:
<SCRIPT LANGUAGE="JavaScript"> showImage(); </script> Download No files for download. |
|||||||||
Similar Mods
| Random Logo in Header | vBulletin 3.5 Template Modifications |