<% dim search_sql,search_nclss,search_keywords,search_id,filego search_nclass=request("nclass") search_keywords=request("keywords") search_id=request("search_id") filego="news.asp?nclass="&search_nclass&"&keywords="&search_keywords&"&search_id="&search_id search_sql="select * from [news] where 1=1" if search_ntype<>"" and search_ntype<>"不限" then search_sql=search_sql & " and ntype="&search_ntype end if if search_keywords<>"" then search_sql=search_sql & " and (loupan like '%"&search_keywords&"%' or title like '%"&search_keywords&"%')" end if if search_id<>"" then search_sql=search_sql & " and id="&search_id end if search_sql=search_sql & " order by pubdate desc" 'response.write search_sql 'response.end set rs=Server.CreateObject("ADODB.RecordSet") rs.open search_sql,conn,1,1 if not rs.eof then rs.pagesize=20 page=request("page") If Not Isnumeric(page) or page="" Then page=1 else page=cint(page) End if if page<1 then page=1 if page>rs.pagecount then page=rs.pagecount rs.AbsolutePage = page for i=1 to rs.pagesize %> <% rs.movenext if rs.eof then Exit For End if next %> <% else%> <% end if %>
"> " target="_blank"><%=left(rs("title"),20)%> "><% if rs("top")=1 then response.write "推荐" else response.write "未推荐" end if%> <% sql2="select * from news_class where id="&rs("nclass") Set rs2 = Server.CreateObject("ADODB.Recordset") rs2.open sql2,conn,1,1 news_class_name=rs2("news_class_name") rs2.close() set rs2=nothing %> <%=news_class_name%>

">  ">

<% if filego<>"news.asp" then filego2=filego&"&" else filego2="news.asp?" end if if page>10 then s1=page else s1=1 if page=10 then response.write "上一页" for j=s1 to s2 if j=page then response.write ""&j&" " else response.write ""&j&" " end if next if s2下一页" response.write "         共"&rs.RecordCount&"条记录,每页显示"&rs.pagesize&"条,共"&rs.pagecount&"页,当前第"&page&"页" rs.close set rs=nothing %>