The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Fix vbShout Timezone problem Details »» | |||||||||||||||||||||||||
This vbShout plugin: http://www.vbhackers.com/f76/ajax-fl...ut-2-1-a-4536/
Has a serious bug with Time Zone changing to that of the last person to post in the shout box. Here is a fix so that each user will see the time in their local timezone correctly. 1. Open template forumhome_vbshout_shout Find this (should be at the very beginning): Code:
<tr> Code:
<td nowrap align="left" valign="top"> <font size="1"> <date>{$Shout['time']}</date> </font> </td> 2. Open template forumhome_vbshout Find: Code:
Shouts.innerHTML = '<table cellpadding="1" cellspacing="3" border="0" width="95%" align="left">' + ShoutRequest.handler.responseText + '</table>' Code:
var formatMe = ShoutRequest.handler.responseText formatMe = replaceDates(formatMe); Shouts.innerHTML = '<table cellpadding="1" cellspacing="0" border="0" width="100%" align="left">' + formatMe + '</table>' Find this: Code:
function sb_CollectHV(sbForm) Code:
// replaces <date> tags function replaceDates(s) { var ret = ""; var matches = s.match(/<date>\d+<\/date>/g); for(var i = 0; matches != null && i < matches.length; i++) { var utc = matches[i].match(/\d+/); var date = new Date(utc * 1000); ret = ret + s.substr(0, s.indexOf(matches[i])); ret = ret + (date.getMonth()+1) + "/" + date.getDate() + "/" + date.getFullYear() + " " + date.getHours() + ":" + ((date.getMinutes() < 10) ? "0" : "") + date.getMinutes() + ":" + ((date.getSeconds() < 10) ? "0" : "") + date.getSeconds() + " "; s = s.substr(s.indexOf(matches[i]) + matches[i].length); } ret = ret + s; return ret; } 3. Open file vbshout.php FInd this (There are similar code blocks, this should be in the function rewrite_shoutbox_flatfile() around line 226): Code:
$Shout['time'] = buildTime($Shout['s_time']); $Shout['s_shout'] = bbcodeparser($Shout['s_shout']); $Shout['style'] = ''; $Shout['data'] = unserialize($Shout['s_data']); $Shout['username'] = fetch_musername($Shout, 'usergroupid'); if (preg_match("#(\#)?0099FF#i", $Shout['data']['color']) && $Shout['s_by'] != 1) { $Shout['data']['color'] = ''; } Code:
// $Shout['time'] = buildTime($Shout['s_time']); $Shout['time'] = $Shout['s_time']; $Shout['s_shout'] = bbcodeparser($Shout['s_shout']); $Shout['style'] = ''; $Shout['data'] = unserialize($Shout['s_data']); $Shout['username'] = fetch_musername($Shout, 'usergroupid'); if (preg_match("#(\#)?0099FF#i", $Shout['data']['color']) && $Shout['s_by'] != 1) { $Shout['data']['color'] = ''; } This should now pass the date as UTC and JavaScript will convert it on the client side to the appropriate date. Show Your Support
|
Comments |
#42
|
|||
|
|||
Now this one had me totally baffled...
I have just a few users who are using eastern time zone, both that I know about have DST set in their profile. They are both showing an hour behind. It's not on their end as I have logged in as them and it's shows incorrectly to me as well. However I have other users with EST and they are fine. All the settings are the same. I have people from Britan, Greece, France, Japan and of course all over the states and only these couple that I know about so far are an issue... |
#43
|
||||
|
||||
Quote:
Select: DST CORRECTION ALWAYS ON. |
#44
|
|||
|
|||
Cool. Thanks rj! I have not seen any of these problems. As I say, the conversion all happens with javascript, (everyone gets the same UTC value sent to their client) so I would guess any problems with conversion are somehow related to the users own local timezone settings or their javascript settings. I don't know how vBulletin's user cp/Edit Options/Date effects the client. Is there a cookie being set or something? That might explain things??
|
#45
|
||||
|
||||
Quote:
This problem drove me insane for three days. I contacted everyone Jelsoft my host reinstalled VB to no avail. Just messing around with some users accounts I set the DST to always and BOOM everything worked. So I have no idea to be honest. One answer I got from Jelsoft was that maybe the server was not reporting the right time. But whatever may cause it My trick worked to fix it I would like to know the cause tho Seeing how not everyone is affected by it. One other thing I will mention is if People have not updated their windows with ms updates for the DST then they also have this issue. |
#46
|
|||
|
|||
I use a MAC and Firefox so I missed seeing this till someone took a pic for me. For users of IE7 there is now a scroll bar at the bottom, just above the input line that is not showing in Firefox either PC or MAC.
Anyone else seeing this? |
#47
|
|||
|
|||
Quote:
You could try removing the td tags from the first step in the mod and instead place the Code:
<date>...</date> |
#48
|
|||
|
|||
I believe the issue is with this code
PHP Code:
PHP Code:
|
#49
|
|||
|
|||
Quote:
|
#50
|
||||
|
||||
when i installed it i didnt get any time with the shout how can i add the time ???
|
#51
|
|||
|
|||
Great hack, so thanx. works a treat :up:
-PB |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|