Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vB3.5 Local time and date in post and profile Details »»
vB3.5 Local time and date in post and profile
Version: 1.0.1, by Boofo Boofo is offline
Developer Last Online: Jun 2012 Show Printable Version Email this Page

Category: Profile Enhancements - Version: 3.5.8 Rating:
Released: 08-22-2005 Last Update: 09-05-2005 Installs: 77
Uses Plugins Template Edits
 
No support by the author.

vB3.5 Local time and date in post and profile
Version 1.0.1
(By Boofo)

What does this product do?
This product will add the local time and date of users in the posts and profile. That way you will know what the time and date is where they are located. I use this on my site so I will have an idea if it is the middle of the night, where they are at, or daytime. With your users living in all corners of the globe, this hack is a nice gauge of the different time zones without having to figure out each one in your head.

Credits:
Thanks goes out to KirbyDE for pointing me in the right direction for the profile time and helping to verify the code. And everyone who chipped in at vbulletin.org to help me figure out vB3.5's new ways of doing things. A special thanks goes out to Chen Avinadav for making the first local time hack for vB2 and allowing me to release it for vB3 and vB3.5.

Version Information:
Version 1.0.0 --Initial release
Version 1.0.1 --Fixed time where it didn't show right for many people. Thanks to Kirby for the fix.

Installation overview:
Templates to edit: (3)
--postbit
--postbit_legacy
--memberinfo
Products to install: (1)

Show Your Support

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

Comments
  #32  
Old 08-26-2005, 01:43 PM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it just seems to be showing the server time which is -4 GMT I have set this on the settings, and in my options i have put GMT with day light savings active. It doesn't work.
Reply With Quote
  #33  
Old 08-28-2005, 06:20 AM
Xplorer4x4 Xplorer4x4 is offline
 
Join Date: Apr 2005
Posts: 938
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope Boofo, it is not working. I set the default time to eastern time seeing as my servers are located in New York. I checked with one of my mbers and his time is listed as 9:18PM when it is 3:18 there. As I said before I only installed this in my meber info tepmplate.
Reply With Quote
  #34  
Old 08-28-2005, 06:33 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mcyates
it just seems to be showing the server time which is -4 GMT I have set this on the settings, and in my options i have put GMT with day light savings active. It doesn't work.
You lost me. You have GMT set as your time in the User CP?
Reply With Quote
  #35  
Old 08-28-2005, 06:38 PM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
You lost me. You have GMT set as your time in the User CP?
sorry that was very confusing. In admin cp the Default Time Zone Offset is on GMT. But the server is 4 hours behind. So if my time was 12:00 then it would be showing 08:00 on the local time. So its always 4 hours behind, Unless you change your setting to GMT +4 then the time will be correct.

For example its 18:00 and my setting is on GMT, my local time is showing 14:00. I then go into usercp and change my setting from GMT to GMT+4 my time now shows 18:00 which is the correct time BUT my settings are not correct, they are set to GMT+4 when i live in UK which is GMT.

Doe this help?
Reply With Quote
  #36  
Old 08-28-2005, 06:40 PM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So basically to get the time to show correctly I have to put my settings 4 hours ahead of what they actually are as my server is 4 hours behind. But now the time at the bottom of the vbuklletin pages are 4 hours ahead. lol!!
Reply With Quote
  #37  
Old 08-28-2005, 07:27 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The setting in my vBulletin Options are what the server time is at. My server is set at GMT, although I am in CST (USA). So I set my vBulletion Options time at GMT, which is the actual server time. Try setting the vB options setting to your actual sever time and see if that makes it right then.
Reply With Quote
  #38  
Old 08-28-2005, 07:32 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The time is probably 4 hours out because the code does not take into account the local servers timezone. It needs to be extracted using date('Z', TIMENOW) and applied as a correction.

I would also consider removing this from the code ;

Code:
  if (substr($userinfo['tzoffset'], 0, 1) != '-') 
  { 
   // recorrect so that it has + sign, if necessary 
   $userinfo['tzoffset'] = '+' . $userinfo['tzoffset']; 
  }
It's purely for display purposes and not really required for the calculations in this hack.
Reply With Quote
  #39  
Old 08-28-2005, 07:34 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M
The time is probably 4 hours out because the code does not take into account the local servers timezone. It needs to be extracted using date('Z', TIMENOW) and applied as a correction.

I would also consider removing this from the code ;

Code:
 if (substr($userinfo['tzoffset'], 0, 1) != '-') 
{ 
// recorrect so that it has + sign, if necessary 
$userinfo['tzoffset'] = '+' . $userinfo['tzoffset']; 
}
It's purely for display purposes and not really required for the calculations in this hack.
I'm not sure I understand what you are getting at. Please PM me with the details if you would, sir.
Reply With Quote
  #40  
Old 08-28-2005, 08:10 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
I'm not sure I understand what you are getting at. Please PM me with the details if you would, sir.
PM ? Okay
Reply With Quote
  #41  
Old 08-29-2005, 05:48 AM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
The setting in my vBulletin Options are what the server time is at. My server is set at GMT, although I am in CST (USA). So I set my vBulletion Options time at GMT, which is the actual server time. Try setting the vB options setting to your actual sever time and see if that makes it right then.
No it still makes no change, the times are still 4 hour s behind.
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 10:32 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.04530 seconds
  • Memory Usage 2,311KB
  • Queries Executed 25 (?)
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_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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