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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Need help with Simple Paging MOD
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

adonix
Starting Member

46 Posts

Posted - 10 March 2005 :  19:50:33  Show Profile
Ok, I just tried installing this simple MOD which only repuires you to modified one file, forum.asp...but I can't get it to work.

http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=50773

I cut and paste it all the code as instructed, but I don't see any paging. I don't understand what I did wrong. and it is only one file to modfied. Please help.

I'm using snitz 3.4.0.5

Edited by - adonix on 10 March 2005 19:52:38

Jorrit787
Average Member

Netherlands
681 Posts

Posted - 10 March 2005 :  22:27:22  Show Profile  Visit Jorrit787's Homepage  Send Jorrit787 an AOL message  Send Jorrit787 a Yahoo! Message
Does the forum have enough topics to need multiple pages?

eXtremeGossip
Go to Top of Page

adonix
Starting Member

46 Posts

Posted - 10 March 2005 :  23:20:22  Show Profile
quote:
Originally posted by Jorrit787

Does the forum have enough topics to need multiple pages?



Thank you for the reply Jorrit787.
Please correct me if I'm wrong: I was testing the forum today after I installed the mod by replying mutiple times in the testing area forum for one specifc topic. So, after replying lots of time in the same topic, the thread created two pages. Thus, I was expecting to start seeing the numbers as shown in the demo mod, but instead I saw the regular drop-down number list to go to page #. Isn't how this it is supposed to work also that If I have a very hot topic that has more than two pages...shoudln't it show the page number links instead of the drop down list?
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 11 March 2005 :  05:00:23  Show Profile
quote:
Originally posted by adonix
Ok, I just tried installing this simple MOD which only repuires you to modified one file, forum.asp...
You'll need to apply similar changes to topic.asp for this mod to work as you want.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

adonix
Starting Member

46 Posts

Posted - 11 March 2005 :  13:06:12  Show Profile
quote:
Originally posted by Shaggy

quote:
Originally posted by adonix
Ok, I just tried installing this simple MOD which only repuires you to modified one file, forum.asp...
You'll need to apply similar changes to topic.asp for this mod to work as you want.





Hi Shaggy, I have heard about you in this forum for known stuff really well and helping lots of people. Could you tell me exactly what changes I need to make in topic.asp. I'm no so sure what do or where to paste what code. Please let me know if it is not too much of a hassle. Thanks in advance.

Edited by - adonix on 11 March 2005 13:08:23
Go to Top of Page

adonix
Starting Member

46 Posts

Posted - 11 March 2005 :  15:44:57  Show Profile
Or does anybody know where I have to make the changes and with what code for topic.asp that shaggy is talking about?

Has anybody got this Paging Mod running with snitz 3.4.05? If so please, post how.
Go to Top of Page

Jorrit787
Average Member

Netherlands
681 Posts

Posted - 11 March 2005 :  18:00:19  Show Profile  Visit Jorrit787's Homepage  Send Jorrit787 an AOL message  Send Jorrit787 a Yahoo! Message
Look at the changes to forum.asp and look for similar code in topic.asp - There shouldn't be too much of a difference between the paging code of both files.

eXtremeGossip
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 14 March 2005 :  07:01:26  Show Profile
I have a reputation? Cool! Let's see if I can live up to it!

Find the following function on line 985 of topic.asp:
sub DropDownPaging(fnum)
	if maxpages > 1 then
		if mypage = "" then
			pge = 1
		else
			pge = mypage
		end if
		scriptname = request.servervariables("script_name")
		Response.Write("                <form name=""PageNum" & fnum & """ action=""topic.asp"">" & vbNewLine)
		Response.Write("                <td bgcolor=""" & strHeadCellColor & """ nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>" & vbNewLine)
		if Archiveview = "true" then Response.Write("                <input type=""hidden"" name=""ARCHIVE"" value=""" & ArchiveView & """>" & vbNewLine)
		Response.Write("                <input type=""hidden"" name=""TOPIC_ID"" value=""" & Request("TOPIC_ID") & """>" & vbNewLine)
		Response.Write("                <b>Page: </b><select name=""whichpage"" size=""1"" onchange=""ChangePage(" & fnum & ");"">" & vbNewLine)
		for counter = 1 to maxpages
			if counter <> cLng(pge) then   
				Response.Write "                	<option value=""" & counter &  """>" & counter & "</option>" & vbNewLine
			else
				Response.Write "                	<option selected value=""" & counter &  """>" & counter & "</option>" & vbNewLine
			end if
		next
		Response.Write("                </select><b> of " & maxpages & "</b>" & vbNewLine)
		if Request.QueryString("SearchTerms") <> "" then Response.Write("                <input type=""hidden"" name=""SearchTerms"" value=""" & Request.QueryString("SearchTerms") & """>" & vbNewLine)
		Response.Write("                </font></td>" & vbNewLine)
		Response.Write("                </form>" & vbNewLine)
	end if
	top = "0"
end sub
And replace the entire thing with the following:
sub DropDownPaging(fnum)
	page_limit = 10
	first_pages = 3
	last_pages = 0
	if maxpages > 1 then
		if mypage = "" then
			pge = 1
		else
			pge = mypage
		end if
		scriptname = request.servervariables("script_name")
		Response.Write("                <td bgcolor=""" & strHeadCellColor & """ nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>" & vbNewLine)
		Response.Write("                <b>Page:</b>" & vbNewLine)
		if mxPages > page_limit then
			if first_pages>0 then
				for counter = 1 to first_pages
					if counter <> cLng(pge) then   
						Response.Write	" <a href="""&scriptname&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage="&counter&SearchLink">" & counter & "</a>"
					else
						Response.Write	" "&counter
					end if
				next
			else
				Response.Write	" <a href="""&scriptname&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage=1"&SearchLink">#171; First</a>"
			end if
			Response.Write	" ..."
			if last_pages>0 then
				for counter = mxpages-last_pages+1 to mxpages
					if counter <> cLng(pge) then   
						Response.Write	" <a href="""&scriptname&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage="&counter&SearchLink">" & counter & "</a>"
					else
						Response.Write	" "&counter
					end if
				next
			else
				Response.Write	" <a href="""&scriptname&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage="mxpages&SearchLink">Last #187;</a>"
			end if
		else
			for counter = 1 to maxpages
				if counter <> cLng(pge) then   
					Response.Write	" <a href="""&scriptname&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage="&counter&SearchLink">" & counter & "</a>"
				else
					Response.Write	" "&counter
				end if
			next
		end if
		Response.Write(" <b>of " & maxpages & "</b>" & vbNewLine)
		Response.Write("                </font></td>" & vbNewLine)
	end if
	top = "0"
end sub
Haven't tested this meself on a fresh copy of topic.asp, so be sure to back up your copy beforehand, just in case.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

adonix
Starting Member

46 Posts

Posted - 14 March 2005 :  13:48:14  Show Profile
Shaggy, I get the following error when I use that code:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/forum2/topic.asp, line 1031

Response.Write " <a href="""&scriptname&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage="&counter&SearchLink">" & counter & "</a>"
---------------------------------------------------------------------------------------------------------^
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 15 March 2005 :  06:39:30  Show Profile
Actually, scrap that altogether; don't know where I pulled it from but it will prevent you from accessing pages in the middle of a topic; try the following instead:
sub DropDownPaging(fnum)
	dim PagesToShow
	PagesToShow=3
	response.write	"<strong>Page:</strong>"
	if mxpages>1 then
		if mypage-PagesToShow<1 then MinPageToShow=1 else MinPageToShow=mypage-PagesToShow
		if mypage+PagesToShow>maxpages then MaxPageToShow=maxpages else MaxPageToShow=mypage+PagesToShow
		if MinPageToShow>1 then response.write " <a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage=1"&SearchLink&""">#171;</a>"
		for counter=MinPageToShow to MaxPageToShow
			if counter<>mypage then response.write " <a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage=&counter&SearchLink&""">"&counter&"</a>" else response.write " <strong>"&counter&"</strong>"
		next
		if MaxPageToShow<maxpages then response.write " <a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage="&maxpages&SearchLink&""">#187;</a>"
		response.write	" (of "&maxpages&")"
	else
		response.write	" <strong>1</strong> (of 1)"
	end if
	top="0"
end sub
Change the value of PagesToShow to however many pages you want to list before and after the current page.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

adonix
Starting Member

46 Posts

Posted - 15 March 2005 :  15:05:16  Show Profile
Thansk Shaggy for the replied. I appreciated, but now I'm getting the a syntax error:

Microsoft VBScript compilation error '800a03ea'

Syntax error

/forum2/topic.asp, line 1023

if counter<>mypage then response.write " <a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage=&counter&SearchLink&""">"&counter&"</a>" else response.write " <strong>"&counter&"</strong>"
------------------------------------------------------------------------------------------------------------------------------------------------^

Any ideas. Thanks.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 16 March 2005 :  09:35:58  Show Profile
Sorry about that, a " must have gone missing between whichpage= and &counter when transcribing that here; change that link so it looks like this:

<a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage="&counter&SearchLink&""">


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

adonix
Starting Member

46 Posts

Posted - 16 March 2005 :  19:55:36  Show Profile
Hey Shaggy, thanks again for trying to help. I really appreaciated that at least your trying.

this is how the code is looking like right now, but I'm still getting an error:


sub DropDownPaging(fnum)
dim PagesToShow
PagesToShow=3
response.write "<strong>Page:</strong>"
if mxpages>1 then
if mypage-PagesToShow<1 then MinPageToShow=1 else MinPageToShow=mypage-PagesToShow
if mypage+PagesToShow>maxpages then MaxPageToShow=maxpages else MaxPageToShow=mypage+PagesToShow
if MinPageToShow>1 then response.write " <a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage=1"&SearchLink&""">#171;</a>"
for counter=MinPageToShow to MaxPageToShow
if counter<>mypage then response.write " <a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage=&counter&SearchLink&""">"&counter&""</a>"
else response.write " <strong>"&counter&"</strong>"
next
if MaxPageToShow<maxpages then response.write " <a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage="&maxpages&SearchLink&""">#187;</a>"
response.write " (of "&maxpages&")"
else
response.write " <strong>1</strong> (of 1)"
end if
top="0"
end sub

-------------------------------------------------------------
Here's the syntax error:

Microsoft VBScript compilation error '800a03fc'

Expected 'Next'

/forum2/topic.asp, line 1024

else response.write " <strong>"&counter&"</strong>"
^

Go to Top of Page

adonix
Starting Member

46 Posts

Posted - 16 March 2005 :  20:07:59  Show Profile
Shaggy, actually I was able to fix that syntax error, but now when I click on a topic to see the thread, the page is looking funky and it is still not showing the page numbers as it supposed to. I can see there's a link that says "nextpage", but the text in the post in looking rather funky. The section or square that tell the name of the person who has posted has become rather large and the row for the text to the posts small.

Here's how the code is looking right now:

sub DropDownPaging(fnum)
dim PagesToShow
PagesToShow=25
response.write "<strong>Page:</strong>"
if mxpages>1 then
if mypage-PagesToShow<1 then MinPageToShow=1 else MinPageToShow=mypage-PagesToShow
if mypage+PagesToShow>maxpages then MaxPageToShow=maxpages else MaxPageToShow=mypage+PagesToShow
if MinPageToShow>1 then response.write " <a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage=1"&SearchLink&""">#171;</a>"
for counter=MinPageToShow to MaxPageToShow
if counter<>mypage then response.write " <a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage=&counter&SearchLink&""">"&counter&""</a>" else response.write " <strong>"&counter&"</strong>"
next
if MaxPageToShow<maxpages then response.write " <a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage="&maxpages&SearchLink&""">#187;</a>"
response.write " (of "&maxpages&")"
else
response.write " <strong>1</strong> (of 1)"
end if
top="0"
end sub

I think there might be some quotes ( " ) missing in the reponse.write (strong)....Any ideas?

Edited by - adonix on 16 March 2005 20:10:52
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 18 March 2005 :  05:58:52  Show Profile
Delete the carriage return before that else; the if/else statement should be on one continuous line as in my original post.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

adonix
Starting Member

46 Posts

Posted - 18 March 2005 :  13:53:10  Show Profile
Hey Shaggy...I have pasted the code just exactly as you said without the carriage return, but the post is still looking funky. I don't know what I'm wrong. Here's the code:

sub DropDownPaging(fnum)
	dim PagesToShow
	PagesToShow=3
	response.write	"<strong>Page:</strong>"
	if mxpages>1 then
		if mypage-PagesToShow<1 then MinPageToShow=1 else MinPageToShow=mypage-PagesToShow
		if mypage+PagesToShow>maxpages then MaxPageToShow=maxpages else MaxPageToShow=mypage+PagesToShow
		if MinPageToShow>1 then response.write " <a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage=1"&SearchLink&""">#171;</a>"
		for counter=MinPageToShow to MaxPageToShow
			if counter<>mypage then response.write " <a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage="&counter&SearchLink&"""></a>" else response.write " <strong>"&counter&"</strong>"
		next
		if MaxPageToShow<maxpages then response.write " <a href=""topic.asp?"&ArchiveLink&"TOPIC_ID="&Topic_ID&"&whichpage="&maxpages&SearchLink&""">#187;</a>"
		response.write	" (of "&maxpages&")"
	else
		response.write	" <strong>1</strong> (of 1)"
	end if
	top="0"
end sub


Here's a pic of how the post looks like:

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 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.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07