Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 next & prev page in topic snippet
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

jcfmachado
Starting Member

7 Posts

Posted - 31 October 2001 :  21:14:54  Show Profile
hyall,

this is a small piece of code that you can add to topic.asp to show the next and prev page when topic is more than 1 page long:

in the file topic.asp you will find near the bottom a routine named Paging().

in that sub place this code...

		if cint(pge)<>1 then
response.write " [<a href='" & scriptname & "?whichpage=" & (cint(pge)-1) & "&topic_id=" & topic_id & "&ARCHIVE=" & ArchiveView & "'>«««</a>] "
end if

---just before the line below...---
for counter = 1 to maxpages
.......
next
^^^-and after this line place this---
if cint(pge)<>maxpages then
response.write " [<a href='" & scriptname & "?whichpage=" & (cint(pge)+1) & "&topic_id=" & topic_id & "&ARCHIVE=" & ArchiveView & "'>»»»</a>] "
end if



Cheers & Sagres,
Machado

KC
Junior Member

USA
152 Posts

Posted - 27 November 2001 :  13:17:56  Show Profile  Visit KC's Homepage
The above code didn't work for me on ver 3.3.03

I wanted the previous/next page icons on the Topic line anyway.
Since there were no icons, I made these two <img src="http://vales.com/evo2/PrevPage.gif"> <img src="http://vales.com/evo2/NextPage.gif">, you are free to use them, put them in the same dir as the forum.

I went ahead and changed the static word "Topic" to be the actual topic your in's name while I was at it.

All of the following code goes in the Topic.asp page.

The last Sub at the bottom of the page (assuming no other mods) is
Sub Topic_nav()

Near the bottom of that sub there is only one RESPONSE.WRITE statement.
REPLACE that ONE line with the ENTIRE snippet below:
- - - - - - - -


'<-- KC mod for prev/next Page in Topic Line + Topic Title -->

'<-- get page number -->
if maxpages > 1 then
if Request("whichpage") = "" then
pge = 1
else
pge = Request("whichpage")
end if
end if

'<-- Previous Page -->
if cint(pge)>1 then
prevPage= "<a href='" & scriptname & "?whichpage=" & (cint(pge)-1) & "&topic_id=" & topic_id & "&ARCHIVE=" & ArchiveView & "'><img src=""icon_PrevPage.gif"" border=""0"" alt=""Previous Page""></a> "
else
prevPage=""
end if

'<-- Next Page -->
if maxpages>1 then
if cint(pge)< maxpages then
nextPage= " <a href='" & scriptname & "?whichpage=" & (cint(pge)+1) & "&topic_id=" & topic_id & "&ARCHIVE=" & ArchiveView & "'><img src=""icon_NextPage.gif"" border=""0"" alt=""Next Page""></a>"
else
nextPage=""
end if
else
nextPage=""
end if

TopicName=ChkString(Topic_Subject,"title")

Response.Write ( prevTopic & prevPage & "<b><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """> " & TopicName & " </font></b>" & nextPage & nextTopic )

'<-- End KC mod for prev/next Page in Topic Line + Topic Title -->

- - - - - - - - -

In my example I place the Next and Previous Page icons inside the Next and Previous Topic icons because it seemed to make more sence.
You may want to replace the blank variables for NO next or previous with the icon_blank.gif image for spacing reasons, or if you don't want the icons, simply change the NextPage and PrevPage variables to text.





Edited by - KC on 27 November 2001 13:32:41
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07