Author |
Topic |
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 04 April 2001 : 15:02:38
|
Timezone Display Mod v1.0 by HuwR
Developed for use with Snitz Forums 2000 v3.2 alpha 6 (should work with older versions but line numbers may be slightly different)
Notes on usage
Whenever you display a date/time on a forum page, you should use the function chkDate(myDate) and chkTime(myDate) to display the Date/time in the correct user Timezone
If you are displaying a date without a Time, you should use the new function DisplayDate(myDate) this will display the date without daylight saving (if your store a date with no time, it defaults to midnight, and does not display correctly if you pass it throught chkDate() ).
Also, to show a date/time in forum time, use the DisplayDate & DisplayTime functions
Limitations
This mod does not format the 'Edited by' string that is inserted int a message when it is edited, this would require further modification to the forum code.
Link to Files
****************************************************************** Please read everything in the enclosed readme.txt before Installing ******************************************************************
Enjoy
|
|
rick7165
Senior Member
USA
1094 Posts |
Posted - 04 April 2001 : 17:44:24
|
HuwR... Got it installed... wow lots of coding.. LOL
Only thing that is not working right is if you edit the profile I only see 1 time zone, but I can scroll down like there are all there as in the font is white and the background is white.
Any clues? I've gone over the installation a couple times to make sure it was right.
I can see all the time zones when I go into admin options and set the time zone.
Rick
Test Site www.eastpasco.com Running on HuwR's SR4 release. Colors and Graphic scheme done by Richard Kinser.
Edited by - rick7165 on 04 April 2001 17:57:01 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 04 April 2001 : 17:59:00
|
Check the Z_NAME field in FORUM_TIMEZONE, make sure it has values.
Check the code you added to inc_profile, this is where it displays the dropdown
|
|
|
rick7165
Senior Member
USA
1094 Posts |
Posted - 04 April 2001 : 18:07:50
|
It's all there in the DB. The drop down works.. Just only shows one zone... But you can scroll like they are all there. When I do pick one of the blank ones.. I get this: Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression '34(GMT+02:00)'.
/forums/pop_profile.asp, line 1273
Test Site www.eastpasco.com Running on HuwR's SR4 release. Colors and Graphic scheme done by Richard Kinser.
Edited by - rick7165 on 04 April 2001 18:09:02 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 04 April 2001 : 18:29:50
|
can you mail me your inc_profile
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 04 April 2001 : 18:35:14
|
Ooops, just discovered a problem, although it sets the last posted date in the topic when you edit, it is writing the users Timezone into the message, working on quick fix for this.
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 04 April 2001 : 18:54:42
|
Ok, fixed bug, and updated readme with changes, for those of you who already started, you need to do two things.
In inc_functions.asp, where you replaced the chkdate and chkTime functions, insert the following
function DisplayTime(fTime) if strTimeType = 12 then if cint(Mid(fTime, 9,2)) > 12 then DisplayTime = DisplayTime & " " & _ (cint(Mid(fTime, 9,2)) -12) & ":" & _ Mid(fTime, 11,2) & ":" & _ Mid(fTime, 13,2) & " " & "PM" elseif cint(Mid(fTime, 9,2)) = 12 then DisplayTime = DisplayTime & " " & _ cint(Mid(fTime, 9,2)) & ":" & _ Mid(fTime, 11,2) & ":" & _ Mid(fTime, 13,2) & " " & "PM" elseif cint(Mid(fTime, 9,2)) = 0 then DisplayTime = DisplayTime & " " & _ (cint(Mid(fTime, 9,2)) +12) & ":" & _ Mid(fTime, 11,2) & ":" & _ Mid(fTime, 13,2) & " " & "AM" else DisplayTime = DisplayTime & " " & _ Mid(fTime, 9,2) & ":" & _ Mid(fTime, 11,2) & ":" & _ Mid(fTime, 13,2) & " " & "AM" end if else DisplayTime = DisplayTime & " " & _ Mid(fTime, 9,2) & ":" & _ Mid(fTime, 11,2) & ":" & _ Mid(fTime, 13,2) end if end function
Then in post_info.asp, look for this line
txtMessage = txtMessage & ChkString(STRdbntUserName, "display") & " on " & chkDate(DateToStr(strForumTimeAdjust)) & " " & chkDate(DateToStr(strForumTimeAdjust))
and change it to
txtMessage = txtMessage & ChkString(STRdbntUserName, "display") & " on " & displayDate(DateToStr(strForumTimeAdjust)) & " " & displayTime(DateToStr(strForumTimeAdjust))
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 04 April 2001 : 20:17:52
|
Teaser till tomorrow, just completed the Addon to this which gives you a last edited field for TOPICS and reply, so they are displayed in User timezone aswell.
Demo here http://www.magicmushroom.org.uk
|
|
|
Martha2Mary
Junior Member
New Zealand
250 Posts |
Posted - 04 April 2001 : 20:22:59
|
Hi Huw,
I seem to have a number of problems implementing this one - no doubt my own errors though.
Firstly, when I go to Admin Home to set the Server Date/Time, a lot of the options listed seem to be listed more than once (doubled up). Then, after I submit the new config, it writes this:
UPDATE FORUM_CONFIG SET C_STRSERVERBIAS = -60, C_STRFORUMBIAS = -720 WHERE CONFIG_ID = 1
Secondly, when I got to edit my Profile to set my preferred time zone, the 'Date/Time Adjust' selector menu is empty, and not offering me any options to choose from. Then when I click the submit button anyway, I get this error message:
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression '65(GMT+13:00)'.
/forum/pop_profile.asp, line 956
Also, I am a little unclear about something. In your readme you state the following:
Whenever you display a date/time on a forum page, you should use the function chkDate(myDate) and chkTime(myDate) to display the Date/time in the correct Timezone
Does this mean that I need to edit my forum.asp, topic.asp and possibly default.asp to make sure they are using the right functions?
Thanks!
*If Knowledge is Power, and Power Corrupts, what hope is there for Mankind * |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 04 April 2001 : 20:44:41
|
quote:
Firstly, when I go to Admin Home to set the Server Date/Time, a lot of the options listed seem to be listed more than once (doubled up). Then, after I submit the new config, it writes this:
UPDATE FORUM_CONFIG SET C_STRSERVERBIAS = -60, C_STRFORUMBIAS = -720 WHERE CONFIG_ID = 1
Don't know about the first bit, could you mail me your admin_config_datetime.asp, the other is because Iforgot to remove a reponse.write. Have updated readme
quote:
Secondly, when I got to edit my Profile to set my preferred time zone, the 'Date/Time Adjust' selector menu is empty, and not offering me any options to choose from. Then when I click the submit button anyway, I get this error message:
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression '65(GMT+13:00)'.
/forum/pop_profile.asp, line 956
in inc_profile.asp look for
if rs("M_STRTIMEADJUST") = rs2("Z_ID") then Response.Write " selected>" end if Response.write rs2("Z_NAME") & "</OPTION>"
and replace it with
if rs("M_STRTIMEADJUST") = rs2("Z_ID") then Response.Write " selected>" else response.write ">" end if Response.write rs2("Z_NAME") & "</OPTION>"
quote:
Also, I am a little unclear about something. In your readme you state the following:
Whenever you display a date/time on a forum page, you should use the function chkDate(myDate) and chkTime(myDate) to display the Date/time in the correct Timezone
Does this mean that I need to edit my forum.asp, topic.asp and possibly default.asp to make sure they are using the right functions?
Thanks!
No, it is just a note for MOD developers
|
|
|
rick7165
Senior Member
USA
1094 Posts |
Posted - 04 April 2001 : 20:57:20
|
quote:
quote:
Firstly, when I go to Admin Home to set the Server Date/Time, a lot of the options listed seem to be listed more than once (doubled up). Then, after I submit the new config, it writes this:
UPDATE FORUM_CONFIG SET C_STRSERVERBIAS = -60, C_STRFORUMBIAS = -720 WHERE CONFIG_ID = 1
I get that same error.
quote:
in inc_profile.asp look for
if rs("M_STRTIMEADJUST") = rs2("Z_ID") then Response.Write " selected>" end if Response.write rs2("Z_NAME") & "</OPTION>"
and replace it with
if rs("M_STRTIMEADJUST") = rs2("Z_ID") then Response.Write " selected>" else response.write ">" end if Response.write rs2("Z_NAME") & "</OPTION>"
That fixed it Huwr...
Test Site www.eastpasco.com Running on HuwR's SR4 release. Colors and Graphic scheme done by Richard Kinser. |
|
|
MisterVB
Junior Member
274 Posts |
Posted - 05 April 2001 : 06:59:17
|
Had no problems installing at all and i'm a asp retard. Great mod i needed this one so badly. Now all i need is to wait for the fix for the dates in the events calendar. lol
Edited by - MisterVB on 05 April 2001 07:00:26 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 05 April 2001 : 07:16:02
|
quote:
Had no problems installing at all and i'm a asp retard. Great mod i needed this one so badly. Now all i need is to wait for the fix for the dates in the events calendar. lol
Edited by - MisterVB on 05 April 2001 07:00:26
Glad you liked it, I have started looking at the events.asp, but not thoroughly, the biggest problem is it requires date input from the user which it must then format as american before doing it's internal processing whereas in the forum, dates are not input manually, so conversion is only necesary to store and display.
The problem therefore is how do I know how you want to enter the date, also a point to consider is, whenever you fill out a form anywhere else, it must be in a specific format not just any old format you wish to enter.
The best solution therefore would be to have seperate inputes for day / month / year rather than asking for a complete date.
|
|
|
rick7165
Senior Member
USA
1094 Posts |
Posted - 05 April 2001 : 10:34:06
|
Huw...
How do I get the Time zone to default to say Eastern Time zone within the Profiles?
Rick
Test Site www.eastpasco.com Running on HuwR's SR4 release. Colors and Graphic scheme done by Richard Kinser. |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 05 April 2001 : 10:44:59
|
firstlly check the Z_ID value for the time zone you want to be default then in inc_profile change the following bit of code
do while not rs2.EOF if rs("M_STRTIMEADJUST") = 0 then Response.write "<OPTION value=" & rs2("Z_ID") & " SELECTED >" & rs2("Z_NAME") & "</OPTION>" Else Response.write "<OPTION value=" & rs2("Z_ID") if rs("M_STRTIMEADJUST") = rs2("Z_ID") then Response.Write " selected>" else Response.write ">" end if Response.write rs2("Z_NAME") & "</OPTION>" End If rs2.movenext loop
To this
do while not rs2.EOF if rs("M_STRTIMEADJUST") = 0 then if rs2("Z_ID") = MYDEFAULTID then Response.write "<OPTION value=" & rs2("Z_ID") & " SELECTED >" & rs2("Z_NAME") & "</OPTION>" end if Else Response.write "<OPTION value=" & rs2("Z_ID") if rs("M_STRTIMEADJUST") = rs2("Z_ID") then Response.Write " selected>" else Response.write ">" end if Response.write rs2("Z_NAME") & "</OPTION>" End If rs2.movenext loop
|
|
|
rick7165
Senior Member
USA
1094 Posts |
Posted - 05 April 2001 : 11:29:57
|
That didn't work... I was trying to use ID 26
Test Site www.eastpasco.com Running on HuwR's SR4 release. Colors and Graphic scheme done by Richard Kinser. |
|
|
Topic |
|
|
|