Timezone MOD - Posted (4738 Views)
Senior Member
MarkJH
Posts: 1722
1722
Every other forum software I know has a section in the user's profile where they can change the time displayed to match their timezone. Now, isn't it about time that we had something like this for Snitz?
It would be just a dropdown box in the profile that gave a -12/+12 from GMT (or whatever) and when the clocks went back or forth it would be completely down to the user to adjust the time in their profile.
That's all it needs. No complicated equations to calculate daylight savings etc.
Please tell me if I'm over-simplifying things. smile<
Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Senior Member
MarkJH
Posts: 1722
1722
Anything on this, Cripto? I know you're busy with the quiz MOD but I was just wondering if you'd taken a look at the code.<
Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Posted
Senior Member
MarkJH
Posts: 1722
1722
I don't think that registration works with your changes, Cripto.
Just tried to register and got this error:

Code:
Microsoft OLE DB Provider for SQL Server error '80040e14' 

Invalid column name 'M_TIME_ADJUST'.

/forum/register.asp, line 804

I'll have to remove the code for the time being. sad<
Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Posted
Average Member
cripto9t
Posts: 881
881
Run this through mod set up
Code:
[ALTER]
MEMBERS_PENDING
ADD#M_TIME_ADJUST#varchar(4)##0
ADD#M_DST_ADJUST#smallint##0
[END]
I'm hoping you had e-mail validation turned on when you got the error and that this will fix it.
I finally got a day off today and I'll give the yesterday/today thing a look. <
    _-/Cripto9t\-_
Posted
Average Member
cripto9t
Posts: 881
881
Mark, I threw this together and it seems to be working pretty good for the today part. I don't have post to check the yesterday part. It's more of a hack than anything. It basically hijacks the chkDate() function if the last post is less than 2 days old. I thought I had kwhipps mod down somewhere but I couldn't find it. I did find some of my old stuff that converts last post to a "1 hr 2 mins ago" like format, if your interested.
in the time adjust code in inc_func_common.asp

right after these lines
Code:
                        rsMemTime.close
set rsMemTime = nothing
end if
Add this
Code:
                        'yesterday/today hack pt. 1
strUserFriendlyDate = true '$$ on/off switch - true for on / false for off

if strUserFriendlyDate then
if chkUFD(fDate) = 1 then
if trim(getUFD(fDate,fTime)) <> "" then
chkDate = getUFD(fDate,fTime)
exit function
end if
end if
end if

'$$ end pt 1
And right after the chkDate() function add this
Code:
'$$ yesterday/today hack pt. 2
function chkUFD(fDate)
dim tmpDate

tmpDate = StrToDate(fDate)

if DateDiff("d",tmpDate,Date) < 2 then
chkUFD = 1
else
chkUFD = 0
end if
end function

function getUFD(fDate,fTime)
dim thisDate,tmpDate

thisDate = StrToDate(fDate)
tmpDate = ""
if DateDiff("d",thisDate,Date) = 0 then
tmpDate = tmpDate & "Today"
elseif DateDiff("d",thisDate,Date) = 1 then
tmpDate = tmpDate & "Yesterday"
end if

if fTime then
tmpDate = tmpDate & " at " & chkTime(fDate)
end if

getUFD = tmpDate
end function

'$$ end pt. 2




<
    _-/Cripto9t\-_
Posted
Senior Member
MarkJH
Posts: 1722
1722
Sorry about the late reply. I've been too busy to have a good look and test of this.
Right... smile
Run this through mod set up

[ALTER] MEMBERS_PENDING
ADD#M_TIME_ADJUST#varchar(4)##0
ADD#M_DST_ADJUST#smallint##0
[END]
I'm hoping you had e-mail validation turned on when you got the error and that this will fix it.
It fixed it good. smile Created a test account, changed the time to -1 GMT in my registration profile, logged on... -1 GMT. Excellent! smile
As to your today/yesterday fix, I found another way of doing it which is much simpler and kept the formatting intact - here. Haven't tested whether or not it works past midnight okay but I'll see tonight.
Thanks for all the work you've done with this, Cripto9t. Hopefully, that's all the bugs ironed out now. smile<
Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Posted
Senior Member
MarkJH
Posts: 1722
1722
Haven't tested whether or not it works past midnight okay but I'll see tonight.
Passed. bigsmile<
Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Posted
Starting Member
lovduv
Posts: 40
40
Ok call me stupid, but I am confused. I installed this and it is working. However, I am not setting things correctly:
The server time is EST, which is what I had it set on before, with correct time. I now have it set to GMT 0:00 (London, etc.), which shows the time for EST, and when I adjust my timezone to EST in my profile it sets it to GMT -5:00.
So what settings do I need, so that my members can adjust the post times to their time zone? Server is in the EST timezone and so am I.<
Posted
Starting Member
lovduv
Posts: 40
40
Got it .... TY<
You Must enter a message