vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Miscellaneous Hacks - Timebased Header Image (https://vborg.vbsupport.ru/showthread.php?t=236726)

cory_booth 02-23-2010 10:00 PM

Timebased Header Image
 
1 Attachment(s)
Header Image rotates based on time. This script can also possibly awaken ideas for other script generated images for use throughout VB4.

OK this hack is based on two others I saw here long ago...
1. One hack generated images on the fly.
2. One hack rotated title (header) images based on the user's time.
I dug and dug and can't seem to find them again, so if anyone remembers where the ideas came from please let me know.

This hack will provide a bit of fun for your site and demonstrate the appearance of updates/changes. To begin, you must have atleast two images for use with your header.

I have a title image for morning, afternoon, and night. I used photoshop and adjusted red/green/blue varibles and added some elements for each period. Other than the color adjusts, my images are identical.

Included in the zip are two php files. The purpose of these files is to replace your header image and your background image. So title.php should call your header title image while titleb.php should call the repeating background image. Obviously if you don't have different colors for the background, you may not need to use titleb.php.

Besides inserting the images in the code, you may need to adjust one other portion.
This is in the final few lines and sets the output type.
PHP Code:

header('Content-type: image/png'); 

(i.e. image/jpeg or image/gif)

Once you have title and titleb adjusted, upload to your server and run the files, you should see the image displayed. If all is well, procede to adjust your style vars to call the new images. (see attached images)

The main reason for this release is to stir some ideas with image handling within VB4.

Feel free to use/hack/slash this code for your own needs.


TO USE:

Make changes to title.php
PHP Code:

if ( $sevenam $currentusertime)
{
    
//between 12am and 5am
$img 'http://1.png';
}
else if ( ( 
$sevenam <= $currentusertime ) && ( $twopm $currentusertime ) )
{
    
//it is between 5am and 12pm
$img 'http://2.png';
}
else if ( ( 
$twopm <= $currentusertime ) && ( $eightpm $currentusertime ) )
{
    
//It is between 12pm and 6pm
$img 'http://3.png';
}
else if ( 
$eightpm <= $currentusertime)
{
    
//It is greater then 6pm
$img 'http://1.png';



If using different backgrounds, make changes to titleb.php
PHP Code:

if ( $sevenam $currentusertime)
{
    
//between 12am and 5am
$img 'http://1bg.png';
}
else if ( ( 
$sevenam <= $currentusertime ) && ( $twopm $currentusertime ) )
{
    
//it is between 5am and 12pm
$img 'http://2bg.png';
}
else if ( ( 
$twopm <= $currentusertime ) && ( $eightpm $currentusertime ) )
{
    
//It is between 12pm and 6pm
$img 'http://3bg.png';
}
else if ( 
$eightpm <= $currentusertime)
{
    
//It is greater then 6pm
$img 'http://1bg.png';


If you are not using png format:
Make change to header ('Content')

Upload files to where ever you wish.

Change the varible areas in admincp as indicated in the thumbnails below.

Jassem 02-23-2010 11:09 PM

installed
Thanks Man
,,,

ToNetU 02-23-2010 11:38 PM

interesting mod! tagged for now.
thanks

forumsonsuz 02-24-2010 01:32 PM

installed

abdobasha2004 02-24-2010 07:48 PM

nice idea, thanks

Reef Man 04-23-2010 04:38 PM

any demo?

J6488EEA8E90 04-24-2010 05:26 AM

cool idea. A demo would be good.


All times are GMT. The time now is 11:22 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.01007 seconds
  • Memory Usage 1,731KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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