vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Profile Enhancements - vB3.5 Local time and date in post and profile (https://vborg.vbsupport.ru/showthread.php?t=94869)

Boofo 08-22-2005 10:00 PM

vB3.5 Local time and date in post and profile
 
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)

bleodler 08-22-2005 11:21 PM

Installed and working great on my test board. :)

Boofo 08-22-2005 11:29 PM

You had doubts? LOL

bleodler 08-22-2005 11:34 PM

lol, actually maybe I spoke to soon or it's probably something on my end, but the times are 4 hours earlier than they should be.

Boofo 08-22-2005 11:44 PM

Make sure your Default Time Zone Offset in the Date and Time settings in the vBulletin Options is set at your true server time. ;)

bleodler 08-23-2005 12:03 AM

Quote:

Originally Posted by Boofo
Make sure your Default Time Zone Offset in the Date and Time settings in the vBulletin Options is set at your true server time. ;)

They are the same unless DST is messing it up.

http://www.britfugees.com/vb.jpg

http://www.britfugees.com/server.jpg

wilky49 08-23-2005 12:28 AM

Also make sure that the time zone is correct in your user settings

User CP / Edit options

Boofo 08-23-2005 12:44 AM

Is it off both in the postbit AND the profile?

bleodler 08-23-2005 01:01 AM

Quote:

Originally Posted by Boofo
Is it off both in the postbit AND the profile?

Yes, they are both behind by 4 hours.

Boofo 08-23-2005 01:03 AM

Does the time show right in the footer?

bleodler 08-23-2005 01:09 AM

Quote:

Originally Posted by Boofo
Does the time show right in the footer?

Yes

I could pm you the info to access my test board if you would like.

Scooterpig 08-23-2005 04:28 AM

Well my test one is behind by 10 hours...yes footer time is right and usercp & admincp times r the same..:(

GrendelKhan{TSU 08-23-2005 06:34 AM

Seems to work when using ENGLISH,
but it gives me weird percentage things when I switch to KOREAN (my default language pack):

Quote:

Local Time: %0:%Aug %p
Local Date: %24-%08-%2005
:/

thoughts suggestions?

GrendelKhan{TSU 08-23-2005 06:46 AM

hmmm...
very useful, but I have to uninstall for now.

I got the wrong time too. (it SEEMS to be adding the forum default time and the USER CP settings time).

also, as I said, above it seems to break when using a different language pack (important for me cause I have a multilanguage site.)

but DEFININTELY will install again when that get sorted out. good idea!! :D ^^ :D

Gizmo5h1t3 08-23-2005 08:09 AM

my time is out with this as well...
mine is set at GMT, yet in the postbit, its GMT +1

on the index, the time displays correctly however....

Xplorer4x4 08-23-2005 09:08 AM

*instaled* BUT I only instaled the templeate mod for memberinfo. It will clutter up the postbits IMO.

Boofo 08-23-2005 09:26 AM

Quote:

Originally Posted by Gizmo5h1t3
my time is out with this as well...
mine is set at GMT, yet in the postbit, its GMT +1

on the index, the time displays correctly however....

Sounds like a DST setting problem for you. Check the setting in the User CP.

Boofo 08-23-2005 09:26 AM

Quote:

Originally Posted by Xplorer4x4
*instaled* BUT I only instaled the templeate mod for memberinfo. It will clutter up the postbits IMO.

Is the time working right for you?

GrendelKhan{TSU 08-24-2005 01:27 AM

any ideas why this is happening?

Quote:

Local Time: %0:%Aug %p
Local Date: %24-%08-%2005
?

weirdness

Gizmo5h1t3 08-24-2005 06:16 AM

Quote:

Originally Posted by Boofo
Sounds like a DST setting problem for you. Check the setting in the User CP.

nope, read all the posts before my original one, started changing the DST settings, and it makes no difference....

if i set my user cp settings to the same as the board...ie....GMT...and set the DST setting to whatever option, it makes no difference..
trust me, it doesnt work..

always stays 1 hour ahead of the correct time....

Scooterpig 08-24-2005 06:31 AM

Sorry Boofo can't work it out at all, still big time difference so had to remove.

Gizmo5h1t3 08-24-2005 06:40 AM

Seems like everyones having the problem mate....

we cant ALL be getting the settings incorrect????

*EDIT*

REMOVED

Boofo 08-24-2005 09:05 AM

Think about that statement, not everyone is having the same problem. Only those that are having a problem reported it here. Myself and a few others are not having any problem at all, so there must be an answer somewhere and I will find it. ;)

Is anyone having problems using Windows on their server? We have to start somewhere, I guess.

Gizmo5h1t3 08-25-2005 06:18 AM

jeez man, dont have babies!!

im not critizing it at all, i appreciate the work u do on here...

if i didnt post, then u wouldnt be aware of the problem....

aethro 08-25-2005 06:21 AM

Same problems as others are having, VB Reports correct time in footer however your addon shows it 8 hours off what it's susposed to be. My webserver's running FreeBSD.

Da Chang Gang 08-25-2005 02:02 PM

You should at least put a specific place where to put it in the Postbit and Postbit legacy.

Boofo 08-25-2005 02:22 PM

Everybody's postbit is not the same as mine. It is up to you where you want to use it.

concreteweb 08-25-2005 03:15 PM

Hi Boofo,

Yes, same here. We are 7 hours off. All settings correct on the server and user control panel.

Boofo 08-25-2005 03:17 PM

This is wierd. It works right for me and some others and doesn't for the rest of you. I am stumped, although I'm sure I will get it figured out.

mcyates 08-26-2005 01:35 PM

Yes i have the same problem as evryone else

mcyates 08-26-2005 01:43 PM

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.

Xplorer4x4 08-28-2005 06:20 AM

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.

Boofo 08-28-2005 06:33 AM

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?

mcyates 08-28-2005 06:38 PM

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?

mcyates 08-28-2005 06:40 PM

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!!

Boofo 08-28-2005 07:27 PM

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.

Paul M 08-28-2005 07:32 PM

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. :)

Boofo 08-28-2005 07:34 PM

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. ;)

Paul M 08-28-2005 08:10 PM

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 :)

mcyates 08-29-2005 05:48 AM

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.


All times are GMT. The time now is 07:57 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.01336 seconds
  • Memory Usage 1,816KB
  • 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
  • (2)bbcode_code_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete