The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
After some recent discussions about it, I've been working on modifying the jump to last post feature so it does not need to pass the REPLY_ID through the querystring, effectively allowing you to create permanent links that will always take you to the latest post in a topic. Here's what I have so far:That replaces the if statement beginning on line 202 of a fresh, v3.4.05 topic.asp. Note that I haven't tested this yet mainly because I don't have a clean Snitz that I can test it on but also because I've already encountered a problem in that the code above will always take you to the last actual reply to a topic without taking into account any replies that may have been edited after the last actual reply. I'm about to switch over to me other job for the evening but wanted to post this here first so's ye could see where I'm going with it and maybe offer some insights as to how to get around the problem I mentioned.
<
Code:
if mypage=-1 then
strSql1="SELECT REPLY_ID"
strSql2=" FROM "&strActivePrefix&"REPLY "
strSql3=" WHERE TOPIC_ID="&Topic_ID
if AdminAllowed=0 then
strSql3=strSql3&" AND (R_STATUS<"
if Moderation="Y" then strSql3=strSql3&"2" else strSql3=strSql3&"3"
strSql3=strSql3&" OR R_AUTHOR="&MemberID&")"
end if
strSql4=" ORDER BY R_DATE ASC"
set rsReplies=server.createobject("ADODB.Recordset")
if strDBType="mysql" then
rsReplies.open strSql1&strSql2&strSql3&strSql4,my_Conn,adOpenStatic,adLockReadOnly,adCmdText
if rsReplies.eof then
iReplyCount=-1
strwhichpage=""
else
arrReplyData=rsReplies.getrows(adGetRowsRest)
iReplyCount=ubound(arrReplyData,2)
if len(request.querystring("REPLY_ID"))>0 then LastPostReplyID=clng(request.querystring("REPLY_ID")) else LastPostReplyID=cLng(arrReplyData(0,iReplyCount))
end if
if iReplyCount>-1 then
for iReply=0 to iReplyCount
intReplyID=arrReplyData(0,iReply)
if LastPostReplyID=intReplyID then
intPageNumber=((iReply+1)/strPageSize)
if intPageNumber>clng(intPageNumber) then intPageNumber=clng(intPageNumber)+1
strwhichpage="whichpage="&intPageNumber&"&"
exit for
end if
next
end if
else
rsReplies.cachesize=strPageSize
rsReplies.pagesize=strPageSize
rsReplies.open strSql1&strSql2&strSql3&strSql4,my_Conn,adOpenStatic,,adCmdText
if len(request.querystring("REPLY_ID"))>0 then
LastPostReplyID=clng(request.querystring("REPLY_ID"))
else
rsReplies.movelast
LastPostReplyID=cLng(rsReplies("REPLY_ID"))
rsReplies.movefirst
end if
rsReplies.find="REPLY_ID="&LastPostReplyID&""
if not (rsReplies.eof or rsReplies.bof) then
if rsReplies.absolutepage>1 then strwhichpage="whichpage="&rsReplies.absolutepage&"&"
else
strwhichpage = ""
end if
end if
rsReplies.close
set rsReplies=nothing
my_Conn.close
set my_Conn=nothing
response.redirect("topic.asp?"&strwhichpage&"TOPIC_ID="&Topic_ID&"#"&LastPostReplyID&"")
response.end
end if<
