Author |
Topic |
adonix
Starting Member
46 Posts |
Posted - 10 March 2005 : 19:50:33
|
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
|
Does the forum have enough topics to need multiple pages? |
eXtremeGossip |
|
|
adonix
Starting Member
46 Posts |
Posted - 10 March 2005 : 23:20:22
|
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? |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 11 March 2005 : 05:00:23
|
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.” |
|
|
adonix
Starting Member
46 Posts |
Posted - 11 March 2005 : 13:06:12
|
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 |
|
|
adonix
Starting Member
46 Posts |
Posted - 11 March 2005 : 15:44:57
|
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. |
|
|
Jorrit787
Average Member
Netherlands
681 Posts |
Posted - 11 March 2005 : 18:00:19
|
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 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 14 March 2005 : 07:01:26
|
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.” |
|
|
adonix
Starting Member
46 Posts |
Posted - 14 March 2005 : 13:48:14
|
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>" ---------------------------------------------------------------------------------------------------------^ |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 15 March 2005 : 06:39:30
|
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.” |
|
|
adonix
Starting Member
46 Posts |
Posted - 15 March 2005 : 15:05:16
|
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. |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 16 March 2005 : 09:35:58
|
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.” |
|
|
adonix
Starting Member
46 Posts |
Posted - 16 March 2005 : 19:55:36
|
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>" ^
|
|
|
adonix
Starting Member
46 Posts |
Posted - 16 March 2005 : 20:07:59
|
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 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 18 March 2005 : 05:58:52
|
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.” |
|
|
adonix
Starting Member
46 Posts |
Posted - 18 March 2005 : 13:53:10
|
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:
|
|
|
Topic |
|