Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 MOD: Correct Timezone display
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 5

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 04 April 2001 :  15:02:38  Show Profile  Visit HuwR's Homepage
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  Show Profile  Visit rick7165's Homepage
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
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 04 April 2001 :  17:59:00  Show Profile  Visit HuwR's Homepage
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

Go to Top of Page

rick7165
Senior Member

USA
1094 Posts

Posted - 04 April 2001 :  18:07:50  Show Profile  Visit rick7165's Homepage
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
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 04 April 2001 :  18:29:50  Show Profile  Visit HuwR's Homepage
can you mail me your inc_profile

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 04 April 2001 :  18:35:14  Show Profile  Visit HuwR's Homepage
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.

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 04 April 2001 :  18:54:42  Show Profile  Visit HuwR's Homepage
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))



Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 04 April 2001 :  20:17:52  Show Profile  Visit HuwR's Homepage
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

Go to Top of Page

Martha2Mary
Junior Member

New Zealand
250 Posts

Posted - 04 April 2001 :  20:22:59  Show Profile  Visit Martha2Mary's Homepage  Send Martha2Mary an AOL message  Send Martha2Mary an ICQ Message  Send Martha2Mary a Yahoo! Message
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 *
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 04 April 2001 :  20:44:41  Show Profile  Visit HuwR's Homepage
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

Go to Top of Page

rick7165
Senior Member

USA
1094 Posts

Posted - 04 April 2001 :  20:57:20  Show Profile  Visit rick7165's Homepage
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.
Go to Top of Page

MisterVB
Junior Member

274 Posts

Posted - 05 April 2001 :  06:59:17  Show Profile  Visit MisterVB's Homepage
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
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 05 April 2001 :  07:16:02  Show Profile  Visit HuwR's Homepage
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.

Go to Top of Page

rick7165
Senior Member

USA
1094 Posts

Posted - 05 April 2001 :  10:34:06  Show Profile  Visit rick7165's Homepage
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.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 05 April 2001 :  10:44:59  Show Profile  Visit HuwR's Homepage
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


Go to Top of Page

rick7165
Senior Member

USA
1094 Posts

Posted - 05 April 2001 :  11:29:57  Show Profile  Visit rick7165's Homepage
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.
Go to Top of Page
Page: of 5 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07