vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   random logos (https://vborg.vbsupport.ru/showthread.php?t=88921)

imported_badblu01 04-12-2004 11:24 AM

random logos
 
Hello

I was wondering if there was code or a program for random logos i have about 4 diffrent title logos i want to use and i want a new one to load each time the forum is visited.

And i was also wondering if there was such a code or hack will it work with vbadvance homepage?

Tony G 04-12-2004 11:28 AM

Moving to Modification Requests, please don't ask questions in modification submission only forums. Thanks. :)

Brad 04-12-2004 12:23 PM

Heres a simple un-tested script that will produce a random image on page load, stick this anywhere on a new line in your phpinclude_start template and see what it dose for you.

PHP Code:

// # Brad's random banners
// get a number between 1 and 4
$image_id rand(1,4);

// we got a id, now figure out the name of the image
switch($image_id)
{
          
// if the random number is one display
          
case '1':
          
$banner_name 'banner1';
          break;
          
// or if two is the scripts thing
          
case '2':
          
$banner_name 'banner2';
          break;
          
// Mabey it prefers three
          
case '3':
          
$banner_name 'banner3';
          break;
          
// Must be four...
          
case '4':
          
$banner_name 'banner4';
          break;
          
// The script could'nt generate a random number for some reason, so we wil use this fail safe image
          
default:
          
$banner_name 'banner_failsafe';
          break;
}
// end banner generator 

Now you just type the normal html in the header template (or where ever else you want, as long as the script is using vBulletin's global.php). But you will use $banner_name in place of the image name. So
HTML Code:

<img src="banner.gif">
would become
HTML Code:

<img src="$banner_name.gif">
Also remember you will need to edit $banner_name (all 5 times it appers) in the php code to match the image names of your banners. There are 5 because the last one is a fail safe, incase for some reason php can not produce a random number but can still display the rest of the page.

imported_badblu01 04-13-2004 06:32 AM

thanks for your help

imported_Diggin 04-14-2004 01:13 AM

works great, thanks

Auron 08-17-2005 09:30 PM

many thanks was looking for a script exactly like this


All times are GMT. The time now is 12:28 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.01104 seconds
  • Memory Usage 1,727KB
  • 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
  • (2)bbcode_html_printable
  • (1)bbcode_php_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