Author |
Topic |
Andy Humm
Average Member
United Kingdom
908 Posts |
Posted - 19 February 2007 : 19:02:51
|
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 |
|
Andy Humm
Average Member
United Kingdom
908 Posts |
Posted - 19 February 2007 : 19:25:15
|
Thank you HuwR from rainy Lyneham across the county border (Wilts) |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 19 February 2007 : 19:31:16
|
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 |
|
|
Andy Humm
Average Member
United Kingdom
908 Posts |
Posted - 20 February 2007 : 02:28:33
|
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 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 20 February 2007 : 05:37:15
|
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.” |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 20 February 2007 : 05:39:19
|
if the times are relative to the server rather than your forum, then the whole MOD needs rewriting since it is not Snitz compatible. |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 20 February 2007 : 05:46:05
|
the problem is this DateToStr(date) strictly speaking it should be using DateToStr(strForumTimeAdjust) |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 20 February 2007 : 05:46:44
|
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 |
|
|
Andy Humm
Average Member
United Kingdom
908 Posts |
Posted - 20 February 2007 : 05:59:43
|
Yep I did think about mentioning to alter the LCID to 2057 (UK) That I did thanks .. |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 20 February 2007 : 06:05:59
|
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.” |
|
|
Andy Humm
Average Member
United Kingdom
908 Posts |
Posted - 20 February 2007 : 06:06:34
|
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 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 20 February 2007 : 06:17:05
|
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.” |
|
|
Andy Humm
Average Member
United Kingdom
908 Posts |
Posted - 20 February 2007 : 06:33:42
|
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 |
|
|
Andy Humm
Average Member
United Kingdom
908 Posts |
Posted - 20 February 2007 : 19:16:44
|
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
|
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 21 February 2007 : 04:17:08
|
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.” |
|
|
Topic |
|