Show only first five and last page of topic

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/69089?pagenum=1
05 November 2025, 05:15

Topic


kyodai
Show only first five and last page of topic
20 December 2009, 08:39


Well now that some topics have reached over 50 pages on my forum it made it very irritating to have the numbers 1-50 all lined up under the topic title. After like 5 rows it started looking ridiculous so i decided to change it to look like

1 2 3 4 5 ... 51


it also places the "jump to last post" arrow above the page links.

Here is an example:

[IMG]http://i50.tinypic.com/23vygqt.jpg[/IMG]
Here's the code i changed in Forum.asp

You must replace the whole TopicPaging() with my version.
Find the block that starts with:

sub TopicPaging()
mxpages = (Topic_Replies / strPageSize)
if mxPages <> cLng(mxPages) then

and ends with

end sub


Replace it with this:
-----------------------------------------------------------------




Code:
sub TopicPaging()
mxpages = (Topic_Replies / strPageSize)
if mxPages <> cLng(mxPages) then
mxpages = int(mxpages) + 1
end if
if mxpages > 1 then
Response.Write(" <table border=""0"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine)
Response.Write(" <tr>" & vbNewLine)
Response.Write(" <td valign=""bottom""><font face=""" & strDefaultFontFace & """ size=""" & "2" & """>" & getCurrentIcon(strIconPosticon,"","") & "</font></td>" & vbNewLine)
for counter = 1 to mxpages
if counter < 6 then



ref = " <td align=""right"" valign=""bottom"" bgcolor=""" & strForumCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & "2" & """>"


if ((mxpages > 9) and (mxpages > 9)) or ((counter > 9) and (mxpages < strPageNumberSize)) then
ref = ref & " "
end if
ref = ref & widenum(counter) & "<span class=""spnMessageText""><a href=""topic.asp?"
ref = ref & ArchiveLink
ref = ref & "TOPIC_ID=" & Topic_ID
ref = ref & "&whichpage=" & counter
ref = ref & """>" & counter & "</a></span></font></td>"
Response.Write ref & vbNewLine
if counter mod strPageNumberSize = 0 and counter < mxpages then
Response.Write(" </tr>" & vbNewLine)
Response.Write(" <tr>" & vbNewLine)
Response.Write(" <td> </td>" & vbNewLine)
end if
else
if counter = 6 then

PageLink = "whichpage=-1&"
AnchorLink = "&REPLY_ID="
Response.write("<a href=""topic.asp?" & ArchiveLink & PageLink & "TOPIC_ID=" & Topic_ID & AnchorLink & Topic_LastPostReplyID & """>" & getCurrentIcon(strIconLastpost,"Jump to Last Post","align=""absmiddle""") & "</a>")

end if
if counter = mxpages then
ref = " <td align=""right"" valign=""bottom"" bgcolor=""" & strForumCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & "2" & """>"


if ((mxpages > 9) and (mxpages > 9)) or ((counter > 9) and (mxpages < strPageNumberSize)) then
ref = ref & " "
end if
ref = ref & widenum(counter) & "<span class=""spnMessageText"">... <a href=""topic.asp?"
ref = ref & ArchiveLink
ref = ref & "TOPIC_ID=" & Topic_ID
ref = ref & "&whichpage=" & counter
ref = ref & """>" & counter & "</a></span></font></td>"
Response.Write ref & vbNewLine
if counter mod strPageNumberSize = 0 and counter < mxpages then
Response.Write(" </tr>" & vbNewLine)
Response.Write(" <tr>" & vbNewLine)
Response.Write(" <td> </td>" & vbNewLine)
end if
end if
end if



next

Response.Write(" </tr>" & vbNewLine)
Response.Write(" </table>" & vbNewLine)
end if
end sub

 

Replies ...


Etymon
17 January 2010, 09:16


Thank you kyodai for this MOD! smile
© 2000-2021 Snitz™ Communications