Search.Asp
上传用户:qfkgdy
上传日期:2020-06-18
资源大小:1888k
文件大小:5k
- <!--#include file="wml.ini"-->
- <%
- Search=wap.req("Search","")
- page=cint(request("page"))
- call wmlbegin("搜索","wrap")
- %>
- <input title="关键字" size="20" name="Search" value="" maxlength="8" emptyok="true" />
- <anchor><br/><go href="Search.Asp" method="POST">
- <postfield name="Search" value="$(Search)"/>
- </go>搜索</anchor><br/>
- <%
- if Search<>"" then
- Page_Style=2
- sql="SELECT * FROM Album WHERE Show=1 AND Album_Title like '%"&Search&"%' ORDER BY last_update_time DESC"
- Set rs = Server.CreateObject("ADODB.Recordset")
- rs.open sql,conn,1,1
- n=rs.RecordCount
- PageSize=5
- rs.pagesize=PageSize
- m=cint(rs.pagecount)
- if page="" then
- page=1
- elseif page<1 then
- page=1
- end if
- if page>m then
- page=m
- end if
- page=cint(page)
- if not rs.eof then
- rs.absolutepage=page
- end if
-
- if m>page+3 then
- endpage=page+3
- else
- endpage=m
- end if
- if page>4 then
- pagetitle=pagetitle & " " & ""
- end if
-
- for i=page-3 to endpage
- if not i<1 then
- if i = page then
- select case Page_Style
- case 2
- pagetitle=pagetitle & " " & "" & i & ""
- case 3
- pagetitle=pagetitle & " " & "" & wap.corder(i) & ""
- end select
- else
- select case Page_Style
- case 2
- pagetitle=pagetitle & " " & "<a href='Search.Asp?Search=" & Search & "&page=" & i & "'>" & i & "</a>"
- case 3
- pagetitle=pagetitle & " " & "<a href='Search.Asp?Search=" & Search & "&page=" & i & "'>" & wap.corder(i) & "</a>"
- end select
- end if
- end if
- next
- if page+3 < m then
- pagetitle=pagetitle & " " & ""
- end if
- %>
- <%
- i=0
- j=1
-
- Do While Not rs.Eof And i<PageSize
-
- i = i + 1
-
- ci=ci+1
-
- if(ci<Categories_Page_Show_Pic_Amount+1) then
-
- set rs1=conn.execute("select top 1 * from [Picture] WHERE AlbumID=" & rs("id") & " order by newid() ")
- do while not rs1.eof
- v1=wap.rndc()
- Call (new ImageClass).zoom(rs1("File_Url"),"images/temp/"& v1 &"." & wap.ftype(rs1("File_Url")) & "",80,80)
- call wmlimg("/images/temp/" & v1 & "." & wap.ftype(rs1("File_Url")) & "?",wap.filter("wml",rs("Album_Title")),true)
- call wmllink2("View.Asp?id=" & rs("id") & "&p=" & page & "",((page-1)*PageSize+j),"" & wap.filter("wml",rs("Album_Title")) & "",true)
-
- rs1.movenext
- loop
-
- Closers1()
- else
- call wmllink2("View.Asp?id=" & rs("id") & "&p=" & page & "",((page-1)*PageSize+j),"" & wap.filter("wml",rs("Album_Title")) & "",true)
- end if
- %>
-
-
-
- <%
- rs.MoveNext
- j=j+1
- loop
- select case Page_Style
- case 1
- if page>1 then
-
- 'response.write("<a href='Search.Asp?Search=" & Search & "&&Page=1'><<</a>")
- call wmllink("Search.Asp?Search=" & Search & "&&Page=1","<<",false)
- end if
- if page="" and page=0 then page=1
- if page*PageSize<rs.recordcount then
- 'response.write("<a href='Search.Asp?Search=" & Search & "&&Page=" & page+1 & "'>下页</a>")
- call wmllink("Search.Asp?Search=" & Search & "&&Page=" & page+1 & "","下页",false)
- end if
- if Page*PageSize<rs.recordcount or Page>1 then response.write("(" & Page & "/" & (int((rs.recordcount-1)/PageSize)+1) & ")")
- if page>1 then
- response.write("<a href='Search.Asp?Search=" & Search & "&&Page=" & page-1 & "'>上页</a>")
- end if
- if page*PageSize<rs.recordcount then
- response.write("<a href='Search.Asp?Search=" & Search & "&&Page=" & (int((rs.recordcount-1)/PageSize)+1) & "'>>></a>")
- end if
- response.write("<br/>")
- %>
- <% if Page*10<rs.recordcount or Page>1 then %>
- <input name="page" title="页码" type="text" format="*N" emptyok="true" size="3" maxlength="4" value="2"/>
- <anchor>跳页<go href="Search.Asp?Search=<%=Searc%>" accept-charset='utf-8'><postfield name="Page" value="$(page)"/></go></anchor><br/>
- <% end if %>
- <%
- case 2
- response.write("第")
- if page>1 then
-
- call wmllink("Search.Asp?Search=" & Search & "&&Page=1","1",false)
- call wmlwrite("<",false)
- end if
- response.write(pagetitle)
- if page*PageSize<rs.recordcount then
- call wmlwrite(">",false)
- call wmllink("Search.Asp?Search=" & Search & "&&Page=" & (int((rs.recordcount-1)/PageSize)+1) & "","" & (int((rs.recordcount-1)/PageSize)+1) & "",false)
- end if
- response.write("页<br/>")
- case 3
- response.write("第")
- if page>1 then
-
- call wmllink("Search.Asp?Search=" & Search & "&&Page=1",wap.corder("1"),false)
- call wmlwrite("<",false)
- end if
- response.write(pagetitle)
- if page*PageSize<rs.recordcount then
- call wmlwrite(">",false)
- call wmllink("Search.Asp?Search=" & Search & "&&Page=" & (int((rs.recordcount-1)/PageSize)+1) & "","" & wap.corder((int((rs.recordcount-1)/PageSize)+1)) & "",false)
- end if
- response.write("页<br/>")
- end select
- end if
-
- call wap.navs("搜索,|")
- call wmlend
- %>