Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-18-2004, 08:31 AM
Intex Intex is offline
 
Join Date: Apr 2002
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vB.org Banner Rotation

I have a number of banners that I'd like to display and would like to know whether anybody knows how to make it change on page refresh between 2-3 just like at the top of vB.org.
Reply With Quote
  #2  
Old 06-18-2004, 10:43 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

actually very easy.

all you need is to edit phpinclude_start template and add something like:
PHP Code:
// ############## Headerimage and text rotating #########
switch(intval(time() / 2) % 3)
{
    case 
0:
    
$banner 'img1.jpg';
    break;
    case 
1:
    
$banner 'img2.jpg';
    break;
    case 
2:
    
$banner 'img3.jpg';
    break;

then just put $banner into the place of your img tag of the header
Reply With Quote
  #3  
Old 06-18-2004, 05:24 PM
Intex Intex is offline
 
Join Date: Apr 2002
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Xenon- thanks a lot for that. If you're banner consists of multiple slices, can that be integrated into the above code?
Reply With Quote
  #4  
Old 06-19-2004, 05:27 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well, you can assing more html code to a variable and put it into the header then as well.

that's not a problem, above is just the technique to make an rotating banner
Reply With Quote
  #5  
Old 07-26-2004, 07:19 AM
basskiller basskiller is offline
 
Join Date: Jan 2003
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how would make the banners clickable
IE adding a hyperlink
Reply With Quote
  #6  
Old 07-26-2004, 07:30 AM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by basskiller
how would make the banners clickable
IE adding a hyperlink
PHP Code:
// ############## Headerimage and text rotating #########
switch(intval(time() / 2) % 3)
{
    case 
0:
    
$banner 'img1.jpg';
    
$banner_url 'www.mysite.com';
    break;
    case 
1:
    
$banner 'img2.jpg';
    
$banner_url 'www.mysite2.com';
    break;
    case 
2:
    
$banner 'img3.jpg';
    
$banner_url 'www.mysite3.com';
    break;

Then use this in the template

HTML Code:
<a href="$banner_url"><img src="$banner" border="0" /></a>
Reply With Quote
  #7  
Old 07-26-2004, 07:40 AM
Michael Morris's Avatar
Michael Morris Michael Morris is offline
 
Join Date: Nov 2003
Location: Knoxville TN
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Intex
Xenon- thanks a lot for that. If you're banner consists of multiple slices, can that be integrated into the above code?
As brad pointed out there's no real limit to the number of variables you can assign in each case. Hence...

PHP Code:
case 0
    
$banner_slice1 'img1_slice1.jpg';
    
$banner_slice2 'img2_slice2.jpg';
    
$banner_url 'www.mysite.com'
And so on for however many slices you need to define. You then call them in your table as normal.
Reply With Quote
  #8  
Old 07-26-2004, 07:53 AM
basskiller basskiller is offline
 
Join Date: Jan 2003
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks guys.. !!!!!
Reply With Quote
  #9  
Old 07-26-2004, 08:27 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ah this is a very good lession for novice like me ^^
Reply With Quote
  #10  
Old 08-26-2004, 03:57 PM
cyclical cyclical is offline
 
Join Date: Jun 2003
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what about assigning a specific banner depending on what style you have chosen?

i.e. I have a light style and a dark style each with their own background color.
Reply With Quote
Reply


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 06:24 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04205 seconds
  • Memory Usage 2,256KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_html
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete