Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Automatic Timezone Setting Correction Details »»
Automatic Timezone Setting Correction
Version: 1.00, by N!ck N!ck is offline
Developer Last Online: Oct 2008 Show Printable Version Email this Page

Version: 2.3.x Rating:
Released: 03-28-2003 Last Update: Never Installs: 10
 
No support by the author.

I have eliminated the only strange error I could find with this, so I am moving it to full releases.

What This Does
If your users pay as little attention to their options as mine do, this might be just what you need. It uses a JavaScript to detect when a user has their timezone setting set different than their computer's clock. If the computer time does not match, the user is given a JavaScript prompt on your main page asking whether he/she would like to adjust their timezone setting. If they select yes, a new window will pop up, make the change, and close. EXCEPTION: This will yield very unsatisfactory results for users in strange timezones whose offsets are not whole numbers (i.e. Newfoundland is GMT-3.5). I haven't figured out how to do this yet, but I will update this hack if I do figure it out. You may want to just remove those options from your registration/profile options.

Scroll down for screenshots.

Let me know how it works out, and, as always, click INSTALL if you use it, please!

Enjoy!

Download: here

Show Your Support

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

Comments
  #32  
Old 04-01-2003, 06:23 AM
Smoothie Smoothie is offline
 
Join Date: Oct 2001
Location: New York
Posts: 1,834
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 03:08 AM Boofo said this in Post #29
I know. I thought DST was a world wide thing happening at the same time.
Nope!
Reply With Quote
  #33  
Old 04-01-2003, 06:26 AM
Smoothie Smoothie is offline
 
Join Date: Oct 2001
Location: New York
Posts: 1,834
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

for example, Sydney:
DST ended on Sunday, March 30, 2003, at 3:00:00 AM local daylight time
DST starts on Sunday, October 26, 2003, at 2:00:00 AM local standard time
Reply With Quote
  #34  
Old 05-11-2003, 01:45 AM
ElmGoodie ElmGoodie is offline
 
Join Date: Mar 2003
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Iv'e istalled it, but nothing happenes.... nothnig! no JS no nothing...
why?
Reply With Quote
  #35  
Old 05-11-2003, 02:42 AM
N!ck N!ck is offline
 
Join Date: Mar 2002
Location: Lake Havasu City, AZ
Posts: 886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You probably missed a step.
Reply With Quote
  #36  
Old 05-11-2003, 09:07 AM
ElmGoodie ElmGoodie is offline
 
Join Date: Mar 2003
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nope, did all of the steps that are written in the timezonehack file...
Reply With Quote
  #37  
Old 05-11-2003, 10:35 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack works very well. Thanks.

I've made a small mod.

Instead of adding the code to your global.php (and save yourself a PHP file edit and headaches when you upgrade), you can add this to the bottom of your phpinclude template:

PHP Code:
if ($dotimezonecheck AND ($bbuserinfo[usergroupid] == OR $bbuserinfo[usergroupid] == OR $bbuserinfo[usergroupid] == OR $bbuserinfo[usergroupid] == 7)) {
  
$nowhours=vbdate("H",time());
  eval(
"\$timezonecheck = \"".gettemplate('hi_timezone')."\";");

I changed the code a bit to make it so that only registered members and staff will get the popup to update the timezone. Members awaiting email registration, banned members etc. will not get it. I didn't want members still waiting email registration to get the timezone update, as they are not meant to be able to access their user CP as such.
Reply With Quote
  #38  
Old 05-11-2003, 11:04 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A small bug:

If your server time is 10:01 but your computer time is 9:59 (ie. a difference of 2 minutes) the timezone hack thinks that you are off by 1 hour, and will activate, and move your time back by 1 hour by mistake. You then have to manually change the timezone back. This only happens when the small difference goes from 1 hour to the next.

Not sure how you can fix it.
Reply With Quote
  #39  
Old 05-12-2003, 12:38 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, I've had to remove this. It added an extra query each time a member visits forumhome to check the timezone, and it really didn't work when there was a few minutes difference, and the time changes over the hour. Maybe make it so that any minutes with 50-59 or 01-09 were excluded, so that the 10 minutes before or after the hour change, the timezone won't be checked, for computers which are just off by a few minutes.
Reply With Quote
  #40  
Old 06-03-2003, 09:30 PM
N!ck N!ck is offline
 
Join Date: Mar 2002
Location: Lake Havasu City, AZ
Posts: 886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, don't sweat it. Even I removed it.
Reply With Quote
Reply

Thread Tools

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 03:16 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.04432 seconds
  • Memory Usage 2,291KB
  • Queries Executed 24 (?)
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)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)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
  • (9)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