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)
 Today / Yesterday Mod... Anyone Have?
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

bobby131313
Senior Member

USA
1163 Posts

Posted - 16 February 2008 :  19:09:19  Show Profile  Visit bobby131313's Homepage  Reply with Quote
Does anyone have a copy of this mod anywhere? The links are dead, I installed it eons ago and now want to try and add it to the User Space mod.

Thanks in advance.<

Switch the order of your title tags

Etymon
Advanced Member

United States
2385 Posts

Posted - 17 February 2008 :  11:06:40  Show Profile  Visit Etymon's Homepage  Reply with Quote
Hi,

The .zip file for this MOD contains only a text file, and it is short. Instead of posting a link to the .zip, here are the contents of the readme.txt file.

Cheers,

Etymon


----------------------------------------------------------------------

Title: Today and Yesterday
Author: Kevin Whipp
Developed for use with Snitz Forums 2000 v3.4
Support: http://whipp.us/forum.asp?FORUM_ID=19
Description: Changes the display of today's date to "Today" and yesterday's date to "Yesterday".


INSTALLATION
============

1. Edit your own files according to the code and instructions below



*******************
INC_FUNC_COMMON.ASP
*******************

-------------------
FIND THIS FUNCTION:
-------------------

function chkDate(fDate,separator,fTime)
if fDate = "" or isNull(fDate) then
if fTime then
chkTime(fDate)
end if
exit function
end if
select case strDateType
case "dmy"
chkDate = Mid(fDate,7,2) & "/" & _
Mid(fDate,5,2) & "/" & _
Mid(fDate,1,4)
case "mdy"
chkDate = Mid(fDate,5,2) & "/" & _
Mid(fDate,7,2) & "/" & _
Mid(fDate,1,4)
case "ymd"
chkDate = Mid(fDate,1,4) & "/" & _
Mid(fDate,5,2) & "/" & _
Mid(fDate,7,2)
case "ydm"
chkDate =Mid(fDate,1,4) & "/" & _
Mid(fDate,7,2) & "/" & _
Mid(fDate,5,2)
case "dmmy"
chkDate = Mid(fDate,7,2) & " " & _
Monthname(Mid(fDate,5,2),1) & " " & _
Mid(fDate,1,4)
case "mmdy"
chkDate = Monthname(Mid(fDate,5,2),1) & " " & _
Mid(fDate,7,2) & " " & _
Mid(fDate,1,4)
case "ymmd"
chkDate = Mid(fDate,1,4) & " " & _
Monthname(Mid(fDate,5,2),1) & " " & _
Mid(fDate,7,2)
case "ydmm"
chkDate = Mid(fDate,1,4) & " " & _
Mid(fDate,7,2) & " " & _
Monthname(Mid(fDate,5,2),1)
case "dmmmy"
chkDate = Mid(fDate,7,2) & " " & _
Monthname(Mid(fDate,5,2),0) & " " & _
Mid(fDate,1,4)
case "mmmdy"
chkDate = Monthname(Mid(fDate,5,2),0) & " " & _
Mid(fDate,7,2) & " " & _
Mid(fDate,1,4)
case "ymmmd"
chkDate = Mid(fDate,1,4) & " " & _
Monthname(Mid(fDate,5,2),0) & " " & _
Mid(fDate,7,2)
case "ydmmm"
chkDate = Mid(fDate,1,4) & " " & _
Mid(fDate,7,2) & " " & _
Monthname(Mid(fDate,5,2),0)
case else
chkDate = Mid(fDate,5,2) & "/" & _
Mid(fDate,7,2) & "/" & _
Mid(fDate,1,4)
end select
if fTime then
chkDate = chkDate & separator & chkTime(fDate)
end if
end function

--------------------------------
REPLACE THAT WITH THIS FUNCTION:
--------------------------------

function chkDate(fDate,separator,fTime)
if fDate = "" or isNull(fDate) then
if fTime then
chkTime(fDate)
end if
exit function
end if
select case strDateType
case "dmy"
chkDate = Mid(fDate,7,2) & "/" & _
Mid(fDate,5,2) & "/" & _
Mid(fDate,1,4)
case "mdy"
chkDate = Mid(fDate,5,2) & "/" & _
Mid(fDate,7,2) & "/" & _
Mid(fDate,1,4)
case "ymd"
chkDate = Mid(fDate,1,4) & "/" & _
Mid(fDate,5,2) & "/" & _
Mid(fDate,7,2)
case "ydm"
chkDate =Mid(fDate,1,4) & "/" & _
Mid(fDate,7,2) & "/" & _
Mid(fDate,5,2)
case "dmmy"
chkDate = Mid(fDate,7,2) & " " & _
Monthname(Mid(fDate,5,2),1) & " " & _
Mid(fDate,1,4)
case "mmdy"
chkDate = Monthname(Mid(fDate,5,2),1) & " " & _
Mid(fDate,7,2) & " " & _
Mid(fDate,1,4)
case "ymmd"
chkDate = Mid(fDate,1,4) & " " & _
Monthname(Mid(fDate,5,2),1) & " " & _
Mid(fDate,7,2)
case "ydmm"
chkDate = Mid(fDate,1,4) & " " & _
Mid(fDate,7,2) & " " & _
Monthname(Mid(fDate,5,2),1)
case "dmmmy"
chkDate = Mid(fDate,7,2) & " " & _
Monthname(Mid(fDate,5,2),0) & " " & _
Mid(fDate,1,4)
case "mmmdy"
chkDate = Monthname(Mid(fDate,5,2),0) & " " & _
Mid(fDate,7,2) & " " & _
Mid(fDate,1,4)
case "ymmmd"
chkDate = Mid(fDate,1,4) & " " & _
Monthname(Mid(fDate,5,2),0) & " " & _
Mid(fDate,7,2)
case "ydmmm"
chkDate = Mid(fDate,1,4) & " " & _
Mid(fDate,7,2) & " " & _
Monthname(Mid(fDate,5,2),0)
case else
chkDate = Mid(fDate,5,2) & "/" & _
Mid(fDate,7,2) & "/" & _
Mid(fDate,1,4)
end select
select case Mid(Request.ServerVariables("SCRIPT_NAME"), InstrRev(Request.ServerVariables("SCRIPT_NAME"), "/")+1)
case "admin_accounts_pending.asp", _
"admin_config_datetime.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
end function


******************************************************************************
* Now upload the edited files to your forum directory on your website. *
* *
* I hope you enjoy this MOD. Please let me know if you have any questions, *
* comments or suggestions! *
* *
* - Kevin Whipp *
* - http://whipp.us *
******************************************************************************<
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 17 February 2008 :  11:47:27  Show Profile  Visit bobby131313's Homepage  Reply with Quote

Thanks! <

Switch the order of your title tags
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 18 February 2008 :  05:20:22  Show Profile  Reply with Quote
See here as well.

<

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

cripto9t
Average Member

USA
881 Posts

Posted - 18 February 2008 :  08:54:46  Show Profile  Reply with Quote
I dug this out of my archives. Replace "Today" with a hour time format. "5 hr. 37 min. ago"

Just replace
chkDate = "Today"

With
nDif = DateDiff("n",strToDate(fDate),strForumTimeAdjust) mod 60 & " min. "
                                if DateDiff("n",strToDate(fDate),strForumTimeAdjust) > 60 then
                                        hrDif = DateDiff("h",strToDate(fDate),strForumTimeAdjust) mod 24 & " hr. "
                                else
                                        hrDif = ""
                                end if
                                chkDate = hrDif & nDif & "ago"

And as pointed out in the post that Shaggy linked to, it's important to use strForumTimeAdjust instead of the Date() function in kwipps mod

<

    _-/Cripto9t\-_
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 18 February 2008 :  10:45:40  Show Profile  Visit bobby131313's Homepage  Reply with Quote
OK, made these changes and the hour/minute is only working prior to midnight and < 24 hours ago forum time.

The others after midnight, some say Today and some say 2/18. Hmmm...

http://www.coincommunity.com/forum/


Never mind, had an errant paste problem. <

Switch the order of your title tags

Edited by - bobby131313 on 18 February 2008 10:57:29
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 18 February 2008 :  11:05:17  Show Profile  Visit bobby131313's Homepage  Reply with Quote
Almost, works with everything but the bookmarks now, we're close...

Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "Yesterday 11:46:05 P"]'
/forum/user_space.asp, line 1313


Line 1313

if DateDiff("d",chkDate(eDate,"",true),strForumTimeAdjust) <= intIsNew then blnDate = true
<

Switch the order of your title tags

Edited by - bobby131313 on 18 February 2008 11:05:44
Go to Top of Page

blackinwhite
Average Member

Turkey
657 Posts

Posted - 18 February 2008 :  11:14:16  Show Profile  Reply with Quote
is it possible to get it forward like;

if it's today, just say "2 hours ago" ?<
Go to Top of Page

blackinwhite
Average Member

Turkey
657 Posts

Posted - 18 February 2008 :  11:42:28  Show Profile  Reply with Quote
what I mean is more like this one

http://www.tanguay.info/web/codeExample.php?id=543<
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 18 February 2008 :  17:00:27  Show Profile  Visit bobby131313's Homepage  Reply with Quote
quote:
Almost, works with everything but the bookmarks now, we're close...

Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "Yesterday 11:46:05 P"]'
/forum/user_space.asp, line 1313

Line 1313

if DateDiff("d",chkDate(eDate,"",true),strForumTimeAdjust) <= intIsNew then blnDate = true

Function that includes line 1313...
Function ChkIsRecent(eDate)
        dim blnDate
        blnDate = false
        if DateDiff("d",chkDate(eDate,"",true),strForumTimeAdjust) <= intIsNew then blnDate = true

        ChkIsRecent = blnDate
End Function

Examining the file it looks like this function is only used to determine the icon used (new or old) so it appears that if on this line I could also check the chkDate value for "ago" and "Yesterday" and set it to true if they exist then I'd be in business. If I had an idea how to do this I'd just try it. Does any of this make sense?<

Switch the order of your title tags

Edited by - bobby131313 on 18 February 2008 17:05:55
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 18 February 2008 :  17:05:20  Show Profile  Reply with Quote
quote:
Originally posted by bobby131313


if DateDiff("d",chkDate(eDate,"",true),strForumTimeAdjust) <= intIsNew then blnDate = true



Bobby I posted this in the user space topic, you might have missed it. Use this instead
if DateDiff("d",StrToDate(eDate),strForumTimeAdjust) <= intIsNew then blnDate = true
<

    _-/Cripto9t\-_
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 18 February 2008 :  17:13:44  Show Profile  Visit bobby131313's Homepage  Reply with Quote
No I didn't see that. However that fixes the bookmarks but breaks the drafts.
quote:
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'strEditDate'

/forum/user_space.asp, line 658

middle line...
if strUSDraftAutoDeleteSwitch = 1 and strUSDraftAutoDelete <> "" then
                                                if DateDiff("d",strEditDate,strForumTimeAdjust) >= (strUSDraftAutoDelete - intDraftWarn) then
                                                        strTrimWarning = "<font color=""" & strHiLiteFontColor & """><acronym title=""This Draft will be deleted soon"">*</acronym></font>"
<

Switch the order of your title tags

Edited by - bobby131313 on 18 February 2008 17:14:13
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 18 February 2008 :  17:18:11  Show Profile  Visit bobby131313's Homepage  Reply with Quote
Ha! Changed that line too and all seems swell so far!

Thanks!<

Switch the order of your title tags
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 18 February 2008 :  17:27:36  Show Profile  Reply with Quote
quote:
Originally posted by blackinwhite

is it possible to get it forward like;

if it's today, just say "2 hours ago" ?

The code I posted above does this. If you want something that goes farther back, I have some code that looks like it might do that. Its old and I've forgot if it works or not.<

    _-/Cripto9t\-_
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 18 February 2008 :  17:32:28  Show Profile  Reply with Quote
I need to go through the code and change everything that compares dates, to use StrToDate()<

    _-/Cripto9t\-_
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 19 February 2008 :  04:24:40  Show Profile  Reply with Quote
quote:
Originally posted by blackinwhite
what I mean is more like this one

http://www.tanguay.info/web/codeExample.php?id=543
Might take a crack at a mod that does that soon, if I've the time.

<

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  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.19 seconds. Powered By: Snitz Forums 2000 Version 3.4.07