I have worked this on the topic.asp an forum.asp page.
but i want this now on the result page if your seach(search.asp) on the forum.
thanks erwin<
Carefree
30 June 2008, 19:01
Don't think anyone wrote this for search.asp (even though someone else requested it).
The code will be something like this, but the links aren't correct yet.
Code:
sub DropDownPaging(fnum) dim PagesToShow PagesToShow=3 response.write "<td bgcolor="""&strHeadCellColor&""" nowrap><strong>Page:</strong>" if maxpages>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=""search.asp?&whichpage=1"&SearchLink&""">#171;</a>" for counter=MinPageToShow to MaxPageToShow if counter<>mypage then response.write " <a href=""search.asp?whichpage="&counter&""&SearchLink&""">"& Counter &"</a>" else response.write " <strong>"&counter&"</strong>" next if MaxPageToShow<maxpages then response.write " <a href=""search.asp?whichpage="&maxpages&""&SearchLink&""">#187;</a>" response.write " (of "&maxpages&")" else response.write " <strong>1</strong> (of 1)" end if response.write "</td>" top="0" end sub
Instead of taking you to the pages, it's going back to search.asp with no data. If someone will point out the error, this is done.<
leatherlips
30 June 2008, 20:18
I'd like to know how to add this to my topic.asp and search.asp as well. Can you post how you did it for topic.asp?<
Carefree
30 June 2008, 20:26
In topic.asp, search for dropdownpaging
Replace the entire sub-routine with the following:
Code:
sub DropDownPaging(fnum) dim PagesToShow PagesToShow=3 Response.Write(" <form name=""PageNum" & fnum & """ action=""topic.asp"">" & vbNewLine) Response.Write(" <td class=header nowrap><font size=""" & strDefaultFontSize & """>" & vbNewLine) if maxpages>1 then response.write "Page " 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 response.write "</td>" top="0" end sub
Where the code is in red, remove the spaces between the symbols. Spaces were left in so the code wouldn't parse.<
leatherlips
30 June 2008, 21:01
Thanks Carefree. I'll work on that to make it more like on my forum.asp page. This gives me a great start!<
Carefree
30 June 2008, 21:08
To get the single, small < and > (for use with next and previous), use & #139; and & #155;<
Shaggy
01 July 2008, 05:02
Or just < and >
<
Carefree
01 July 2008, 08:32
Actually & lt; and & gt; are the full-size symbols and will not match the 171 & 187 symbols.<
ernieek
01 July 2008, 09:00
but how to implementate this to the search page.
when i do this, the searche wil wil now go back to the first search screen because there is no seach data anymore.
is there anyone that can help?<
leatherlips
01 July 2008, 09:05
Can you post the code you are trying to use for the search page?<
Carefree
01 July 2008, 11:39
Instead of taking you to the pages, it's going back to search.asp with no data. If someone will point out the error, this is done.
<
ernieek
01 July 2008, 16:54
I will post my code next evening, i can't take the files on this moment.
i try it to copy the code soon as possible<
ernieek
04 July 2008, 17:22
this is the code
I have only changed the function DropDownPaging. the function DropDownPagingOld is the original function of the search page.
================================================================
I have changed the code to this: The only thing that not work is the wichpage.
============================================= sub DropDownPaging(fnum) dim PagesToShow PagesToShow=3
if fnum = 1 then Response.Write(" <b>"&fLang("L_Search054")&"</b> [") else Response.Write(" <b>"& fLangN("L_Search055",maxPages) &"</b>[") end if
if maxpages>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=""#"" onClick=""changeValue("&fnum &",1)""><<</a>" for counter=MinPageToShow to MaxPageToShow if counter<>mypage then response.write " <a href=""#"" onClick=""changeValue("&fnum &","&counter&")"">"&counter&"</a> " else response.write " <strong>"&counter&"</strong> "
next if MaxPageToShow<maxpages then response.write " <a href=""#"" onClick=""changeValue("&fnum &","&maxpages&")"">>></a> " response.write " ]" else response.write " <strong>1</strong> (of 1)" end if response.write "</font></td>"
Response.Write(" </form>" & vbNewLine)
top="0" end sub ===============================================================<
Carefree
05 July 2008, 12:24
You're missing an "end if" before the "end sub". It should look like this:
Code:
sub DropDownPaging(fnum) dim PagesToShow PagesToShow=3 Response.Write " <form name=""PageNum" & fnum & """ action=""search.asp?" & chkString(Request.QueryString,"SQLString") & """ method=""post"">" & vbNewLine & _ " <input name=""Search"" type=""hidden"" value=""" & trim(chkString(Request.Form("Search"),"search")) & """>" & vbNewLine & _ " <input name=""andor"" type=""hidden"" value=""" & cLng(Request.Form("andor")) & """>" & vbNewLine & _ " <input name=""Forum"" type=""hidden"" value=""" & cLng(Request.Form("Forum")) & """>" & vbNewLine & _ " <input name=""SearchMessage"" type=""hidden"" value=""" & cLng(Request.Form("SearchMessage")) & """>" & vbNewLine & _ " <input name=""whichpage"" type=""hidden"" value="""">" & vbNewLine if strArchiveState = "1" and ArchiveView = "true" then Response.Write(" <input name=""ARCHIVE"" type=""hidden"" value=""" & ArchiveView & """>" & vbNewLine) & _ " <input name=""SearchDate"" type=""hidden"" value=""" & cLng(Request.Form("SearchDate")) & """>" & vbNewLine if strUseMemberDropDownBox = 0 then " <input name=""SearchMember"" type=""hidden"" value=""" & chkString(Request.Form("SearchMember"),"display") & """>" & vbNewLine else Response.Write " <input name=""SearchMember"" type=""hidden"" value=""" & cLng(Request.Form("SearchMember")) & """>" & vbNewLine end if Response.Write "<td nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine if fnum = 1 then Response.Write(" <b>"&fLang("L_Search054")&"</b> [") else Response.Write(" <b>"& fLangN("L_Search055",maxPages) &"</b>[") end if if maxpages>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=""#"" onClick=""changeValue("&fnum &",1)""><<</a>" for counter=MinPageToShow to MaxPageToShow if counter<>mypage then response.write " <a href=""#"" onClick=""changeValue("&fnum &","&counter&")"">"&counter&"</a> " else response.write " <strong>"&counter&"</strong> " next if MaxPageToShow<maxpages then response.write " <a href=""#"" onClick=""changeValue("&fnum &","&maxpages&")"">>></a> " response.write " ]" else response.write " <strong>1</strong> (of 1)" end if response.write "</font></td>" Response.Write(" </form>" & vbNewLine) top="0" end if end sub
<
ernieek
05 July 2008, 14:31
but then we get the error:
Microsoft VBScript compilation error '800a03f8'
Expected 'Sub'
/search.asp, line 794
end if ----^ <
ernieek
05 July 2008, 15:12
@ Carefree
i missed more then 1 end if states.
this code must be okay ===============================================================
if fnum = 1 then Response.Write(" <b>"& fLang("L_Search054") &"</b> [") else Response.Write(" <b>"& fLangN("L_Search055",maxPages) &"</b>[") end if
if maxpages>1 then if mypage-PagesToShow<1 then MinPageToShow=1 else MinPageToShow=mypage-PagesToShow end if if mypage+PagesToShow>maxpages then MaxPageToShow=maxpages else MaxPageToShow=mypage+PagesToShow end if
if MinPageToShow>1 then response.write " <a href=""#"" onClick=""changeValue("&fnum &",1)""><<</a>" end if
for counter=MinPageToShow to MaxPageToShow if counter<>mypage then response.write " <a href=""#"" onClick=""changeValue("&fnum &","&counter&")"">"&counter&"</a> " else response.write " <strong>"&counter&"</strong> " end if next if MaxPageToShow<maxpages then response.write " <a href=""#"" onClick=""changeValue("&fnum &","&maxpages&")"">>></a> ]" else response.write " ]" end if
top="0" response.write "</font></td>" Response.Write(" </form>" & vbNewLine) end if end sub<