The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Local time and date in post, pm, usernotes and profile v1.5 Details »» | |||||||||||||||||||||||||||
Local time and date in post, pm, usernotes and profile v1.5
Developer Last Online: Jun 2012
Local time and date in post, pm, usernotes and profile
Version 1.5 (By Boofo) This hack will add the local time and date of users in the posts, pms, usernotes 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. Thanks goes out to Link14716 for pointing me in the right direction for the pm time and helping to verify the code. And everyone who chipped in at vbulletin.com to help me figure out vB3'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. Version Information: Version 1.0 --Initial release Version 1.1 --Fixed bug where the User CP DST setting was not being accounted for. Thanks goes out to squall14716 for the fix. Version 1.2 --Fixed bug where a few people's time was off by an hour or two in the showthread, but right on target everywhere else. Moved the code from the showthread.php into the functions_showthread.php, where it should have been in the first place. Thanks Natch, for all of your hard work in helping me track this down. Version 1.3 --Fixed bug where local time and date was not showing up in a member's profile when the "Additional Information" box was empty due to them not entering any personal information in their profile. It would only show an N/A. Version 1.4 --Added ability to have the local time and date to also show up in the showpost. Version 1.5 --Fixed last known bug where the User CP DST setting was not being automatically accounted for when the DST changed. The Version 1.1 fix seemed to be only temporary and not a total solution. This should take care of it. Files to edit: 4 functions_showthread.php private.php usernote.php member.php Templates to edit: 3 postbit postbit_legacy memberinfo If you find this hack useful, please click the install button. Show Your Support
|
Comments |
#92
|
|||
|
|||
Quote:
Thanks! |
#93
|
||||
|
||||
I'm not sure. I've never tried it. Try it and let me know what happens. If it doesn't work, we'll get it to work for you. How's that for support?
And please click the install button. |
#94
|
|||
|
|||
Quote:
if ($UserTime[0]=='0') {$UserTime = substr( $UserTime, 1);} if ($pmbox[lastvisittime][0]=='0') {$pmbox[lastvisittime] = substr( $pmbox[lastvisittime], 1);} Something that occurs to me would be to impliment the same approach for Last Visited date and time for consistancy. On my current 'staging' area I have in my header: Welcome: LarryEitel From: La Asunci?n de Bel?n Heredia Costa Rica Your time: 03-18-2004 (10:24 PM) You last visited: Today at: 8:01 PM Since I'm so close to my actual server time zone, no big prob. But what if they see their local time and then the last time they visited majorly skewed? By the way, I realize that your hack was intended for showing the local time the POST was made. I will install this when vB goes Gold. I am trying to promote users to revise their timezone by showing their local time and then if they see it is incorrect, they are 'encouraged' to revise. |
#95
|
|||
|
|||
I have adapted your hack to show a user HIS local time. For some reason, although I have verified server time AND my timezone, I continue to show one hour ahead.
Is anyone else doing this on their site? If so, what am I doing wrong? Thanks! // Local Date and Time $bbuserinfo['tzoffset'] = $bbuserinfo['timezoneoffset']; if ($bbuserinfo['dstonoff']) { // DST is on, add an hour $bbuserinfo['tzoffset']++; } $UserTime = date($vboptions['timeformat'], TIMENOW+($bbuserinfo['tzoffset']-$vboptions['timeoffset'])*3600); $UserDate = date($vboptions['dateformat'], TIMENOW+($bbuserinfo['tzoffset']-$vboptions['timeoffset'])*3600); // Local Date and Time if ($UserTime[0]=='0') {$UserTime = substr( $UserTime, 1);} |
#96
|
||||
|
||||
Have you checked to make sure this setting in the Date and Time Options in the vBulletin Settings is set correctly?
Enable Daylight Savings |
#97
|
|||
|
|||
Thanks for replying. I verified that they are enabled. I looked at another vB2x version and it uses the same formula. Strange. I could hard-wire minus one hour I suppose.
|
#98
|
||||
|
||||
Where are you located? In the US here DST is NOT enabled right now. That would be the rpoblem if you have it enabled in the Admin CP.
|
#99
|
|||
|
|||
I just turned OFF DST. And although at the present moment, I have hard-wired minus one hour, my local time is still the same. It makes me question the time on the server.
I have a dedicated server at ServerMatrix. I believe it is actually in Dallas. Server control panel has way to sync correct time. So it is difficult to point the finger at the time on the server. In the meantime, I'll leave it hardwired to make up for the one hour difference. |
#100
|
||||
|
||||
Well, the only way the time is correct with this hack is the server time has to be correct with what time the server is set at. It won't work any other way. I am in the process of re-writing this hack to ignore the server time and always go off of GMT, so bear with me while I sort this out and we will get it working for you like the time does now in vB3 Gold.
|
#101
|
||||
|
||||
This hack doesn't seem to be working for me, the time shown is 8 hours ahead of the real time (when checking my own post 'Local Time').
Also, shouldn't this hack have support for phrases? I think this hack belongs in the Beta Hacks forum still, until it gets fixed |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|