MiniMOD - Update Last Here Date - نوشته شده در (1157 Views)
Senior Member
muzishun
مطلب: 1079
1079
Currently, the forum does not update your last here date when you post while logged out. This can cause the last here date and last post dates to be out of sync. This miniMOD fixes that issue (which technically isn't a bug, but to me it's a bit odd).
In post_info.asp, find this code around lines 1847-1853:
Code:

			case else
Response.Write("Have a nice day!")
end select
Response.write "</font></p>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""" & strReturnURL & """>" & strReturnTxt & "</a></font></p>" & vbNewLine
else
Response.write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There has been a problem!</font></p>" & vbNewLine & _
Make that look like this by adding the code in red:
Code:

			case else
Response.Write("Have a nice day!")
end select
Response.write "</font></p>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""" & strReturnURL & """>" & strReturnTxt & "</a></font></p>" & vbNewLine
If blnUpdateLastVisited Then
UpdateLastHereDate DateToStr(strForumTimeAdjust),strDBNTUserName
End If
else
Response.write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There has been a problem!</font></p>" & vbNewLine & _
Then find this code around lines 60-67:
Code:

if strAuthType = "db" and strDBNTUserName = "" and len(Request.Form("Password")) <> 64 then
strPassword = sha256("" & Request.Form("Password"))
else
strPassword = ChkString(Request.Form("Password"),"SQLString")
end if

if strAuthType = "db" and strDBNTUserName = "" then
strDBNTUserName = Request.Form("UserName")
Make that look like this by adding the code in red:
Code:

blnUpdateLastVisited = False
if strAuthType = "db" and strDBNTUserName = "" and len(Request.Form("Password")) <> 64 then
strPassword = sha256("" & Request.Form("Password"))
blnUpdateLastVisited = True else
strPassword = ChkString(Request.Form("Password"),"SQLString")
end if

if strAuthType = "db" and strDBNTUserName = "" then
strDBNTUserName = Request.Form("UserName")
Basically what this does is adds a boolean value at the beginning that checks if we're hashing a password (this only happens if the user enters their password, meaning they aren't logged in when they post). Then, at the end of the whole process, the forum checks that boolean value, and if it's true, updates the last here date.<
Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Forum Admin
HuwR
مطلب: 20611
20611
it was designed that way for a reason , and if you look at the way the forum deals with "active topics since your last visit" you will understand why smile

it is kind of like coming to your house and posting a note through your mailbox, does that mean I visited you ? no, it doesn't.<
نوشته شده در
Senior Member
muzishun
مطلب: 1079
1079
That's a good point, and I know the forum was designed that way on purpose. However, occasionally people will browse/post without logging in, and then the next time they log in, they're shown topics that they have already seen. This gives people the option to remove some of that confusion (albeit adding a little of it's own).
Thinking about your mailbox analogy, I may not even implement this in my own forum, but at least the code is here if someone else down the road decides they want it.<
Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
نوشته شده در
Forum Admin
HuwR
مطلب: 20611
20611
agreed smile there will always be people who want it to behave a different way.<
نوشته شده در
Support Moderator
Shaggy
مطلب: 6780
6780
What I've done on a couple of sites that have more to them than forums is add an extra field to the members table that holds the date they were last seen on the site with the forum's lastheredate only being updated if they hit the forums while logged in. Although all those sites require registration so they can't get to post.asp without being logged in, I've still added some code to post_info.asp that will update the date they were last seen on the site if they post when not logged in, just in case the admins ever turn off the registration requirement.
<
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.”
نوشته شده در
Access 2000 Support Moderator
davemaxwell
مطلب: 3020
3020
Originally posted by muzishun
That's a good point, and I know the forum was designed that way on purpose. However, occasionally people will browse/post without logging in, and then the next time they log in, they're shown topics that they have already seen. This gives people the option to remove some of that confusion (albeit adding a little of it's own).

Makes sense, but then to keep the active topics functionality from breaking for those that are logged in, I'd only apply it to the forum for those users that are not logged in. If the user is logged in, I wouldn't apply this functionality.<
Dave Maxwell
Barbershop Harmony Freak
نوشته شده در
Senior Member
muzishun
مطلب: 1079
1079
Originally posted by muzishun
That's a good point, and I know the forum was designed that way on purpose. However, occasionally people will browse/post without logging in, and then the next time they log in, they're shown topics that they have already seen. This gives people the option to remove some of that confusion (albeit adding a little of it's own).

Makes sense, but then to keep the active topics functionality from breaking for those that are logged in, I'd only apply it to the forum for those users that are not logged in. If the user is logged in, I wouldn't apply this functionality. That's what the MOD does. It only updates the lastheredate when the user posts while not logged in.<
Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
 
شما باید یک متن وارد کنید