Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Beta Releases
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools
Details »»

Version: 1.00, by Stoned Gecko Stoned Gecko is offline
Developer Last Online: Feb 2005 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 02-08-2002 Last Update: Never Installs: 1
Is in Beta Stage  
No support by the author.

Preface:
I wanted to display the actual timezone text on the forum in addition to the GMT offset. Since I couldn't find anything here, I did it myself. Now I'm sure there is an easier way of doing this, however I have never touched PHP before. So this is the only way I could figure out how to do this. However since I managed to do it, I thought I'd share it .

What it does:
This basically creates a $timezonetext variable that can be used in templates. The variable contains the text for the appropriate timezone the user selected. For example if the user selected GMT -8, $timezone would contain "US/Pacific Time (US & Canada)".

What it looks like:
The contents of the timezone template:


The text generated by that (sorry, live demo is not up yet )



What to do:

Edit global.php. Find this text:

PHP Code:
$timediff='';
if (
$bbuserinfo['timezoneoffset']!=0) {
  if (
abs($bbuserinfo['timezoneoffset'])==1) {
    
$timediff=$bbuserinfo[timezoneoffset] hour";
  } else {
    
$timediff=$bbuserinfo[timezoneoffset] hours";
  }

Then right below that add this:

PHP Code:
switch ($bbuserinfo['timezoneoffset']) {

    case (-
12):
        
$timezonetext="Eniwetok, Kwajalein";
    break;

    case (-
11):
        
$timezonetext="Midway Island, Samoa";
    break;

    case (-
10):
        
$timezonetext="US-Hawaii";
    break;

    case (-
9):
        
$timezonetext="US-Alaska";
    break;

    case (-
8):
        
$timezonetext="US/Pacific Time (US & Canada)";
    break;

    case (-
7):
        
$timezonetext="US/Mountain Time (US & Canada)";
    break;

    case (-
6):
        
$timezonetext="US/Central Time (US & Canada), Mexico City";
    break;

    case (-
5):
        
$timezonetext="US/Eastern Time (US & Canada)";
    break;

    case (-
4):
        
$timezonetext="Atlantic Time (Canada), Caracas, La Paz";
    break;

    case (-
3.5):
        
$timezonetext="Newfoundland";

    case (-
3):
        
$timezonetext="Brazil, Buenos Aires, Georgetown";
    break;

    case (-
2):
        
$timezonetext="Mid-Atlantic";
    break;

    case (-
1):
        
$timezonetext="Azores, Cape Verde Islands";
    break;

    case (
0):
        
$timezonetext="Western Europe Time, London, Casablanca";
    break;

    case (
1):
        
$timezonetext="Central Europe Time, Brussels, Copenhagen, Paris";
    break;

    case (
2):
        
$timezonetext="Eastern Europe Time, Kaliningrad, South Africa";
    break;

    case (
3):
        
$timezonetext="Moscow, St. Petersburg, Baghdad, Kuwait";
    break;

    case (
3.5):
        
$timezonetext="Tehran";
    break;

    case (
4):
        
$timezonetext="Muscat, Baku, Tbilisi";
    break;

    case (
4.5):
        
$timezonetext="Kabul";
    break;

    case (
5):
        
$timezonetext="Ekaterinburg, Islamabad";
    break;

    case (
5.5):
        
$timezonetext="Bombay, New Delhi";
    break;

    case (
6):
        
$timezonetext="Almaty, Dhaka";
    break;

    case (
7):
        
$timezonetext="Bangkok, Hanoi";
    break;

    case (
8):
        
$timezonetext="Beijing, Perth, Singapore, Hong Kong";

    case (
9):
        
$timezonetext="Tokyo, Seoul, Osaka";
    break;

    case (
9.5):
        
$timezonetext="Adelaide, Darwin";
    break;

    case (
10):
        
$timezonetext="Eastern Australian Standard, Guam, Papua New Guinea, Vladivostok";
    break;

    case (
11):
        
$timezonetext="Magadan, Solomon Islands";
    break;

    case (
12):
        
$timezonetext="Auckland, Wellington, Fiji, Kamchatka";
    break;


Hope someone finds this usefull besides me.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-10-2002, 01:09 AM
LuBi LuBi is offline
 
Join Date: Oct 2001
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sounds good, have an ss?
Reply With Quote
  #3  
Old 02-10-2002, 01:40 AM
Stoned Gecko's Avatar
Stoned Gecko Stoned Gecko is offline
 
Join Date: Feb 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What's an SS?
Reply With Quote
  #4  
Old 02-10-2002, 08:58 AM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

SS (ScreenShot)
Reply With Quote
  #5  
Old 02-13-2002, 12:53 AM
Stoned Gecko's Avatar
Stoned Gecko Stoned Gecko is offline
 
Join Date: Feb 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry for the lag. Screen shots are on the top post.
Reply With Quote
 


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 05:15 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.03988 seconds
  • Memory Usage 2,268KB
  • Queries Executed 20 (?)
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
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete