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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Last Post - Today Yesterday
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 19 February 2007 :  19:02:51  Show Profile
Having a view at other users of snitz forum, I came across a variation in the way the Last Post date was displayed. Is there a mod/snippet available that will convert the LastPost date to Today or Yesterday as www.snowmobilefanatics.com/forum/ is. There was an old thread in this forum which touches the subject but all the links are broken. See http://forum.snitz.com/forum/topic.asp?TOPIC_ID=59907
Looking forward to response..

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 February 2007 :  19:12:16  Show Profile  Visit HuwR's Homepage
the MOD is available here http://dev1.whipp.us/asp/snitz_today_yesterday.htm
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 19 February 2007 :  19:25:15  Show Profile
Thank you HuwR
from rainy Lyneham across the county border (Wilts)
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 February 2007 :  19:31:16  Show Profile  Visit HuwR's Homepage
quote:
Originally posted by Andy Humm

Thank you HuwR
from rainy Lyneham across the county border (Wilts)


you're welcome, raining here as well at the moment
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 20 February 2007 :  02:28:33  Show Profile
Works okay, but obviously times feed from the server time. In rainy old Lyneham UK we are at GMT and my american server time is GMT-7.

I have noticed that posts from late last night are displayed with 'today'. Example a post at 22.30 last night reads today 22.30, when the time here is actually 06.30am. I waited until the actual UK time (GMT) went past 7am (server difference -7 GMT hours) and refreshed the page, then the posted time showed yesterday. Obviously driving from server time.
My time adjustment is set correctly in the Admin Options > Server Date/Time Configuration section?
As a thought, when a visitor posts a thread between midnight and 7am (UK GMT) will the date show as today or yesterday?

Looking at the code for the mod
select case Mid(Request.ServerVariables("SCRIPT_NAME"), InstrRev(Request.ServerVariables("SCRIPT_NAME"), "/")+1)
case "admin_accounts_pending.asp", _
"admin_config_datetime.asp", _
"pop_printer_friendly.asp"
'
' For any page that needs the actual date, add the file name to the above case statement.
'
case else
select case left(fDate,8)
case left(DateToStr(date),8)
chkDate = "Today"
case left(DateToStr(date-1),8)
chkDate = "Yesterday"
end select
end select

if fTime then
chkDate = chkDate & separator & chkTime(fDate)
end if


Could the date element be altered/triggered:
1. To ensure that any posted times prior to midnight GMT, are display as yesterday even if we are at actually at UK GMT times between midnight to 7am.
2. Also posted times between midnight and 7am (server difference) show as today.
Greatly appreciate any help

Edited by - Andy Humm on 20 February 2007 04:10:02
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 20 February 2007 :  05:37:15  Show Profile
Have you changed the LCID in your config.asp file as I advised in a previous post? That should take care of it for you.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 February 2007 :  05:39:19  Show Profile  Visit HuwR's Homepage
if the times are relative to the server rather than your forum, then the whole MOD needs rewriting since it is not Snitz compatible.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 February 2007 :  05:46:05  Show Profile  Visit HuwR's Homepage
the problem is this DateToStr(date) strictly speaking it should be using DateToStr(strForumTimeAdjust)
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 February 2007 :  05:46:44  Show Profile  Visit HuwR's Homepage
quote:
Originally posted by Shaggy

Have you changed the LCID in your config.asp file as I advised in a previous post? That should take care of it for you.




you shouldn't need to change LCID for the forum to work correctly
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 20 February 2007 :  05:59:43  Show Profile
Yep I did think about mentioning to alter the LCID to 2057 (UK) That I did thanks ..
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 20 February 2007 :  06:05:59  Show Profile
quote:
Originally posted by HuwR
the problem is this DateToStr(date) strictly speaking it should be using DateToStr(strForumTimeAdjust)
That'll be it - surprised I didn't spot it; was working on an American box for the first time in years last week, trying to figure out why the dates were all over the place and it was down to some spanner having "tweaked" the script to use now() in places instead of strforumtimeadjust and swearing blind that he hadn't touched the files since I last edited them for him!


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 20 February 2007 :  06:06:34  Show Profile
quote:
Originally posted by HuwR

the problem is this DateToStr(date) strictly speaking it should be using DateToStr(strForumTimeAdjust)


HuwR or Shaggy
Could you suggest a fix using the DateToStr(strForumTimeAdjust) if it is possible
edited as Shaggy was in dialog too. apols

Edited by - Andy Humm on 20 February 2007 06:08:18
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 20 February 2007 :  06:17:05  Show Profile
Where KWhipp has:

case left(DateToStr(date),8)

Use:

case left(DateToStr(strForumTimeAdjust),8)

And where he has:

case left(DateToStr(date-1),8)

Use:

case left(DateToStr(dateadd("d",-1,strForumTimeAdjust)),8)


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 20 February 2007 :  06:33:42  Show Profile
Shaggy, your a pal,
I had added the changes, obviously, I'll have to check the times between midnight GMT and 7am (server difference) to see the effect. Another late night, still its worth it
Thanks again
Andy
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 20 February 2007 :  19:16:44  Show Profile
Shaggy
Its a few minutes past midnight and the fix above works brilliantly. I can only commend you for your support and it is appreciated. These development issues certainly are helping me to start to understand the some of the coding.
As a little bit of smartening up,or bull, could the today/yesterday font colour be changed to a different colour

case left(DateToStr(strForumTimeAdjust),8)
chkDate = "Today" (change to green)
case left(DateToStr(dateadd("d",-1,strForumTimeAdjust)),8)
chkDate = "Yesterday" (change to dark green)

I am not at my editing computer so would this work:
chkDate = <font='color:#green'> "Today" </font>
thnx
andy

Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 21 February 2007 :  04:17:08  Show Profile
quote:
Originally posted by Andy Humm
I can only commend you for your support and it is appreciated.
You're welcome but all thanks to Huw on this one; he spotted it, I just provided the fix.

As to your next question, it'd go something like this:

chkDate="<font color=""colour"">Today/Yesterday</font>"

Just replace the code in green with the hex reference of the colour you want. However, I would recommend that you use colours that are already in use on your forum rather than hardcoding in the values. This way, in a year or two's time, when you're redesigning your forum or simply changing the colours, you won't be bouncing your head of your keyboard trying to remember how to change the colour of those 2 words. If you pick a couple of colours you're using in your admin options and post where they're being used, I'll provide you with the necessary code.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page
Page: of 2 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.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07