Mod JumpToPost
Date: 29 September 2002
For snitz 3.4xx
Note: Changes are for Access and sqlServer users only. Changes required for mysql users are not posted.
This is more of a feature enhancement rather then a new feature.
1. Jump to LastPost (LastEdit/LastPost)
2. Jump to First NewPost
3. Jump to EndPost
4. Hilites the Posted date on JumptoPost (updated)
Above options will be available after the changes are made as posted below:
Changes are required to be made in following files
1. topic.asp
2. default.asp
3. forum.asp
4. active.asp
5. inc_func_common.asp
topic.asp
Step 1:
Add the following code at the end of topic.asp. Just before the ASP closing tag (%>).
function JumpToPage(jump)
dim intPageNumber
Select Case jump
Case "lastpost"
rsReplies.MoveLast
Case "newpost"
rsReplies.Find = "R_DATE >'" & Session(strCookieURL & "last_here_date") & "'"
Case "thispost"
rsReplies.Find = "REPLY_ID=" & Request.QueryString("REPLY_ID")
Case else
JumpToPage = myPage
exit function
End select
if not (rsReplies.BOF or rsReplies.EOF) then
intPageNumber = rsReplies.absolutepage
intJumpToID = rsReplies("REPLY_ID")
end if
rsReplies.MoveFirst
if intPageNumber <= 0 then intPageNumber = myPage
JumpToPage = intPageNumber
End function
Step 2:
Find the following statements on Line 601
Response.Write " " & getCurrentIcon(strIconPosticon,"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Posted - " & ChkDate(Reply_Date, " : " ,true) & "</font>" & vbNewline
Modify the above statement to look like as below
Response.Write " " & getCurrentIcon(strIconPosticon,"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & strHiliteOTag & "Posted - " & ChkDate(Reply_Date, " : " ,true) & strHiliteCTag & "</font>" & vbNewline
Step 3:
Find the following statement on Line 595
Response.Write "valign=""top""><a name=""" & Reply_ReplyID & """></a>" & vbNewLine & _
Modify the above statement to look like as below
Response.Write "valign=""top"">" & vbNewLine
strHiliteOTag="" : strHiliteCTag = ""
If Reply_ReplyID = intJumpToID Then
Response.Write "<a name=""" & strJumpTo & """></a>"
strHiliteOTag = "<span class=""spnSearchHighlight"">"
strHiliteCTag = "</span>"
end if
Response.Write "<a name=""" & Reply_ReplyID & """></a>" & vbNewLine & _
Step 4:
Find the following statements on Lines 381-382
if not (rsReplies.EOF or rsReplies.BOF) then
rsReplies.pagesize = strPageSize
Add the following statement just below the above statementsif strJumpTo <> "" then myPage = JumpToPage(strJumpTo)
Step 5:
Remove the statements between lines 203-276.
The statement on Line 203 and statements on Lines 274-276 looks like as shown below
if mypage = -1 and Request.QueryString("REPLY_ID") <> "" then ---Line 203
...
...
Response.Redirect("topic.asp?" & strwhichpage & "TOPIC_ID=" & Topic_ID & "#" & LastPostReplyID & "") --- Line 274
Response.End --- Line 275
end if --- Line 276
After Remove the code between Lines 197-206 will look like as shown below:
if strModeration > 0 and Cat_Moderation > 0 and Forum_Moderation > 0 and AdminAllowed = 0 then
Moderation = "Y"
else
Moderation = "N"
end if
' -- Get all the high level(board, category, forum) subscriptions being held by the user
Dim strSubString, strSubArray, strBoardSubs, strCatSubs, strForumSubs, strTopicSubs
Step 6:
Add the following statements on Line Number 202-204
Rem -Declare and initialize the variable
Dim strJumpTo, intJumpToID
strJumpTo = Trim(Request.QueryString("jump"))
After adding these lines code will look like as shown below:
if strModeration > 0 and Cat_Moderation > 0 and Forum_Moderation > 0 and AdminAllowed = 0 then
Moderation = "Y"
else
Moderation = "N"
end if
Rem -Declare and initialize the variable
Dim strJumpTo, intJumpToID
strJumpTo = Trim(Request.QueryString("jump"))
' -- Get all the high level(board, category, forum) subscriptions being held by the user
Dim strSubString, strSubArray, strBoardSubs, strCatSubs, strForumSubs, strTopicSubs
default.asp
Replace the function DoLastPostLink between Lines 1041-1053 with the following function
Function DoLastPostLink(showicon)
if ForumLastPostReplyID <> 0 then
AnchorLink = "&REPLY_ID=" & ForumLastPostReplyID & "&jump=replyid#replyid"
DoLastPostLink = "<a href=""topic.asp?TOPIC_ID=" & ForumLastPostTopicID & AnchorLink & """>"
elseif ForumLastPostTopicID <> 0 then
DoLastPostLink = "<a href=""topic.asp?TOPIC_ID=" & ForumLastPostTopicID & """>"
else
DoLastPostLink = ""
exit function
end if
if (showicon = true) then
DoLastPostLink = DoLastPostLink & getCurrentIcon(strIconLastpost,"Jump to this Post","align=""absmiddle""") & "</a>"
end if
end function
forum.asp
Step 1:
Replace the function DoLastPostLink between Lines 881-891 with the following function
Function DoLastPostLink()
dim AnchorLink, strIcon
strIcon = getCurrentIcon(strIconLastpost,"Jump to this Post","align=""absmiddle""")
if Topic_Replies < 1 or Topic_LastPostReplyID = 0 then
DoLastPostLink = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & """>" & strIcon & "</a>"
elseif Topic_LastPostReplyID <> 0 then
AnchorLink = "&REPLY_ID=" & Topic_LastPostReplyID & "&jump=thispost#thispost"
DoLastPostLink = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & AnchorLink & """>" & strIcon & "</a>"
else
DoLastPostLink = ""
end if
end function
Step 2:
Find the following statements on Lines 533-535
if strShowPaging = "1" then
Call TopicPaging()
end if
Step 3:
Add the following statement just below the above statements
if Topic_Replies > 0 then Response.Write LinkToPost("lastpost")
Step 4:
Find the following statements on Lines 528
Response.Write "</a></td>" & vbNewLine & _
Step 5:
Modify the above statement as shown below
Response.Write "</a>"
if Topic_Replies > 0 and _
Topic_LastPost > Session(strCookieURL & "last_here_date") then
Response.Write LinkToPost("newpost")
end if
Response.Write vbNewLine & _
" </td>" & vbNewLine & _
active.asp
Step 1:
Replace the function DoLastPostLink between Lines 789-799 with the following function
Function DoLastPostLink()
dim AnchorLink, strIcon
strIcon = getCurrentIcon(strIconLastpost,"Jump to this Post","align=""absmiddle""")
if Topic_Replies < 1 or Topic_Last_Post_Reply_ID = 0 then
DoLastPostLink = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & """>" & strIcon & "</a>"
elseif Topic_Last_Post_Reply_ID <> 0 then
AnchorLink = "&REPLY_ID=" & Topic_Last_Post_Reply_ID & "&jump=thispost#thispost"
DoLastPostLink = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & AnchorLink & """>" & strIcon & "</a>"
else
DoLastPostLink = ""
end if
end function
Step 2:
Find the following statements on Lines 573-575
if strShowPaging = "1" then
TopicPaging()
end if
Step 3:
Add the following statement just below the above statements
if Topic_Replies > 0 then Response.Write LinkToPost("lastpost")
Step 4:
Find the following statements on Lines 570
Response.Write " </td>" & vbNewline
Step 5:
Add the following statement in red just before the above statement as shown below
if Topic_Replies > 0 then Response.Write LinkToPost("newpost")
Response.Write " </td>" & vbNewline
inc_func_common.asp
Add the following function at the end of this file
Function LinkToPost(strLinkTo)
dim AnchorLink, strHoverText, strIcon
Select case strLinkTo
Case "newpost"
AnchorLink = "&jump=newpost#newpost"
strHoverText = "Jump to first New Post"
Case "lastpost"
AnchorLink = "&jump=lastpost#lastpost"
strHoverText = "Jump to Last Post"
case else
AnchorLink = "&jump=lastpost#lastpost"
strHoverText = "Jump to Last Post"
end select
if Topic_Replies >= 1 then
strIcon = getCurrentIcon(strIconLastpost,strHoverText,"align=""absmiddle""")
LinkToPost = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & AnchorLink & """>" & strIcon & "</a>"
else
LinkToPost = ""
end if
end function