quote: Originally posted by OneWayMule
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=46442
That only works correctly for Forum.asp
Rrok007 - This was based off of Rgunds forum.asp Navaigation, that I used for my Topic.ASP. It will diplay navigation like this:
Page: FirstPage << | 7 8 9 [10] 11 12 13 | >> LastPage
Instructions
In TOPIC.ASP Place this at the very bottom Just before the "%>" tag
'##############################################
'## Function for topic.asp page listings
'## Originaly by rgrund, modified by AWD_ENVY
'###############################################
sub ListPaging(fnum)
if maxpages > 1 then
if mypage = "" then
pge = 1
else
pge = mypage
end if
if fnum = 1 then
Response.Write("<b>Page:</b> ")
else
Response.Write("<b>Total Pages (" & maxpages &"):</b>")
end if
for counter = 1 to maxpages
if counter <> cLng(pge) then
IF counter = 1 OR counter = cLng(pge)-3 OR counter = cLng(pge)-2 OR counter = cLng(pge)-1 OR counter = cLng(pge)+1 OR counter = cLng(pge)+2 OR counter = cLng(pge)+3 OR (counter = maxpages) THEN
Response.Write " <a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&whichpage=" & counter & SearchLink & """ title=""Goto to page "& counter &" in this Topic""" & dWStatus("Goto to page "& counter &" in this Topic")
If ArchiveView = "true" then
Response.Write "&ARCHIVE=" & ArchiveView
End If
Response.Write """>"
IF counter = maxpages AND cLng(pge) <= maxpages-5 THEN
Response.Write("LastPage")
ELSEIF counter = 1 AND cLng(pge) >= 6 THEN
Response.Write("FirstPage")
ELSE
Response.Write(counter)
END IF
Response.Write("</a>")
ELSE
IF counter = cLng(pge)-4 THEN
IF (counter-5) <= 0 THEN
tmpnum = (cLng(pge)-5)
Do Until tmpnum >= 1
tmpnum = tmpnum + 1
Loop
NextGapJump = tmpnum
ELSE
NextGapJump = cLng(pge)-5
END IF
Response.Write(" <a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&whichpage=" & NextGapJump & SearchLink & """ title=""Jump back to page "& NextGapJump &" in this Topic""" & dWStatus("Jump back to Page "&NextGapJump) &"""><<</a> |")
ELSEIF counter = cLng(pge)+4 THEN
IF counter+5 > maxpages THEN
tmpnum = (cLng(pge)+5)
Do Until tmpnum <= maxpages
tmpnum = tmpnum - 1
Loop
NextGapJump = tmpnum
ELSE
NextGapJump = cLng(pge)+5
END IF
Response.Write(" | <a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&whichpage=" & NextGapJump & SearchLink & """ title=""Jump ahead to page "& NextGapJump &" in this Topic""" & dWStatus("Jump ahead to Page "&NextGapJump) &""">>></a>")
END IF
END IF
else
Response.Write " <b> [" & counter & "]</b>"
end if
next
end if
end sub
'#################################################
In TOPIC.ASP around line 446: Replace:
if mypage > 1 then Response.Write("<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&whichpage=" & mypage-1 & SearchLink & """ title=""Goto the Previous page in this Topic""" & dWStatus("Goto the Previous page in this Topic") & ">Previous Page</a>")
'if mypage > 1 then Response.Write("<a href=""javascript: onclick=document.PageNum1.whichpage.value=" & mypage-1 & ";document.PageNum1.submit();"" title=""Goto the Previous page in this Topic""" & dWStatus("Goto the Previous page in this Topic") & ">Previous Page</a>")
if mypage > 1 and mypage < maxpages then Response.Write(" | ")
if mypage < maxpages then Response.Write("<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&whichpage=" & mypage+1 & SearchLink & """ title=""Goto the Next page in this Topic""" & dWStatus("Goto the Next page in this Topic") & ">Next Page</a>")
'if mypage < maxpages then Response.Write("<a href=""javascript: onclick=document.PageNum1.whichpage.value=" & mypage+1 & ";document.PageNum1.submit();"" title=""Goto the Next page in this Topic""" & dWStatus("Goto the Next page in this Topic") & ">Next Page</a>")
With : Call ListPaging(1)
In TOPIC.ASP around line 742: Replace:
if mypage > 1 then Response.Write("<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&whichpage=" & mypage-1 & SearchLink & """ title=""Goto the Previous page in this Topic""" & dWStatus("Goto the Previous page in this Topic") & ">Previous Page</a>")
'if mypage > 1 then Response.Write("<a href=""javascript: onclick=document.PageNum1.whichpage.value=" & mypage-1 & ";document.PageNum1.submit();"" title=""Goto the Previous page in this Topic""" & dWStatus("Goto the Previous page in this Topic") & ">Previous Page</a>")
if mypage > 1 and mypage < maxpages then Response.Write(" | ")
if mypage < maxpages then Response.Write("<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&whichpage=" & mypage+1 & SearchLink & """ title=""Goto the Next page in this Topic""" & dWStatus("Goto the Next page in this Topic") & ">Next Page</a>")
'if mypage < maxpages then Response.Write("<a href=""javascript: onclick=document.PageNum1.whichpage.value=" & mypage+1 & ";document.PageNum1.submit();"" title=""Goto the Next page in this Topic""" & dWStatus("Goto the Next page in this Topic") & ">Next Page</a>")
With : Call ListPaging(2) |