Version: 1.0.1, by Boofo
Developer Last Online: Jun 2012
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.
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.
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.
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?
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.
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!!
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.
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.
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.
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.