vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Mini Mods - Random logo! (https://vborg.vbsupport.ru/showthread.php?t=210435)

MarkFoster 04-05-2009 10:00 PM

Random logo!
 
1 Attachment(s)
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>

You edit the urls to what images you want.
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>

In the url part 0-3 is for the image that will go on the left side and 4-7 is for the image that will go right, they will both be centered thought.

Then wherever you want the images to display add this:
Code:

<SCRIPT LANGUAGE="JavaScript">
showImage();
</script>

Then you can additionally add new links to the codes by adding a new line with the same information, you only have to change the number name.

ahmed-samara 04-06-2009 11:27 AM

first one :)

great work man installed

Jasem 04-06-2009 01:06 PM

Nice work, thank you!

Installed

John Henry 04-28-2009 11:22 AM

plz, plz... make something like that but in php... there are addons for browsers that block js and so the images won't change...

simurgs 10-02-2009 11:05 PM

Hello,

Nice work, how can i add links to the images ?

ZEHH 11-19-2009 12:03 AM

simurgs,

Acho que se deve adicionar a url de suas imagens aqui:

Code:

theImages [0] = 'URL'
theImages [1] = 'URL'



All times are GMT. The time now is 07:36 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01249 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete