Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 04-12-2004, 11:24 AM
imported_badblu01 imported_badblu01 is offline
 
Join Date: Feb 2004
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 04-12-2004, 11:28 AM
Tony G's Avatar
Tony G Tony G is offline
 
Join Date: Nov 2001
Location: Melbourne, Australia
Posts: 8,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Moving to Modification Requests, please don't ask questions in modification submission only forums. Thanks.
Reply With Quote
  #3  
Old 04-12-2004, 12:23 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 04-13-2004, 06:32 AM
imported_badblu01 imported_badblu01 is offline
 
Join Date: Feb 2004
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for your help
Reply With Quote
  #5  
Old 04-14-2004, 01:13 AM
imported_Diggin imported_Diggin is offline
 
Join Date: Jan 2003
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works great, thanks
Reply With Quote
  #6  
Old 08-17-2005, 09:30 PM
Auron Auron is offline
 
Join Date: Oct 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

many thanks was looking for a script exactly like this
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:54 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.04128 seconds
  • Memory Usage 2,209KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete