vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Random Logos (https://vborg.vbsupport.ru/showthread.php?t=106113)

Reece^B 01-23-2006 04:25 PM

Random Logos
 
Hey guys,
whats the code to make random logos appear?
Thanks
Reece

is it just a simple code?
Cheers

can anyone tell me?
I need to find out by friday.

rudiviss1 01-24-2006 08:25 PM

Try JavaScript Random Image Code, should be able to find easy enough :)

Reece^B 01-25-2006 02:41 PM

Rudi, LOL, i've fixed it. and you knew i had to code.

For all members:

Code:

<script language="JavaScript">
<!--
// Create arrays to contain all the values
// for image locations

image = new Array

image[1]="http://us.yimg.com/images/yahoo.gif"
image[2]="http://www.excite.com/mesp/images/excite/new_logo-180.gif"
image[3]="http://a284.g.akamai.net/7/284/987/000/lygo.com/ly/i/lyguide.gif"
image[4]="http://cnet.com/Images/Headers/cnet-1-title.gif"
image[5]="http://webcrawler.com/img/web/hdr/home_header.gif"

// Create a random number between 1 and five
random_num = (Math.round((Math.random()*4)+1))


// Write the image tag with a random array element
document.write("<img src=\"" + image[random_num] + "\">");

-->
</script>

Insert Code Into "Header"

bada_bing 01-25-2006 02:43 PM

Quote:

Originally Posted by Reece_B
Rudi, LOL, i've fixed it. and you knew i had to code.

For all members:

Code:

<script language="JavaScript">
<!--
// Create arrays to contain all the values
// for image locations

image = new Array

image[1]="http://us.yimg.com/images/yahoo.gif"
image[2]="http://www.excite.com/mesp/images/excite/new_logo-180.gif"
image[3]="http://a284.g.akamai.net/7/284/987/000/lygo.com/ly/i/lyguide.gif"
image[4]="http://cnet.com/Images/Headers/cnet-1-title.gif"
image[5]="http://webcrawler.com/img/web/hdr/home_header.gif"

// Create a random number between 1 and five
random_num = (Math.round((Math.random()*4)+1))


// Write the image tag with a random array element
document.write("<img src=\"" + image[random_num] + "\">");

-->
</script>


Where and how to I apply this code? I have been wanting to do this? Also how can yo do this for certain usergroups?

Just wanted to get an update

Just want to get an update to my reply

rudiviss1 01-25-2006 05:05 PM

Quote:

Originally Posted by bada_bing
Where and how to I apply this code? I have been wanting to do this? Also how can yo do this for certain usergroups?

Just wanted to get an update

Just want to get an update to my reply

Ok, the code goes in the header template, replace the current image URLs with the images of your logos, can be used with as many or as little images as you want ;) But remember to change the random number array to comply with the image amount :)

eg.
2 images
Code:

// Create a random number between 1 and five
random_num = (Math.round((Math.random()*1)+1))

Notice the bold change.

Another small thing...

To remove the borders of the images, replace
Code:

document.write("<img src=\"" + image[random_num] + "\">");
with
Code:

document.write("<img src=\"" + image[random_num] + "\"border="0">");

Reece^B 01-26-2006 05:15 AM

Yeah Rudi it's pretty much straight fodward.
If you have any worries, PM me.

Reece


All times are GMT. The time now is 02:26 PM.

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.01061 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
  • (5)bbcode_code_printable
  • (2)bbcode_quote_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