www.gusucode.com > 山寨版广告信息招贴网源码程序 > 山寨版广告信息招贴网源码程序/ewuyi/dir_发布/search.asp

    <!-- #include file="conn.asp"-->
<%
If request("i")="" Then
ii=1
else
ii=request("i")
End If
set rs=Server.CreateObject("ADODB.RecordSet")
If Request("o")="" then
sql="select * from ewuyi_info where title like '%"&request("q")&"%' or text like '%"&request("q")&"%' and type>=1 order by adid desc"
ElseIf Request("o")=1 then
sql="select * from ewuyi_info where title like '%"&request("q")&"%' or text like '%"&request("q")&"%' and type>=1 order by hits desc"
ElseIf Request("o")=2 then
sql="select * from ewuyi_info where title like '%"&request("q")&"%' or text like '%"&request("q")&"%' and type>=1 order by view desc"
ElseIf Request("o")=3 then
sql="select * from ewuyi_info where title like '%"&request("q")&"%' or text like '%"&request("q")&"%' and type>=1 order by stop asc"
end if
rs.open sql,conn,1,1
rs.PageSize=10
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><%=request("q")%><%=sitetitle%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="<%=sitekey%>" />
<meta name="description" content="<%=sitemeta%>" />
<meta http-equiv="Content-Language" content="zh-cn" />
<link href="<%=siteurl%>/css/dir.css" type="text/css" rel="stylesheet" />
<script language="javascript" type="text/javascript" src="<%=siteurl%>/user/js/click_stat.js"></script>
<script language="javascript" type="text/javascript">
function i_function(s){
document.location="?i="+s+"&o=<%=request("o")%>&d=<%=request("d")%>&q=<%=request("q")%>&p=1"
}
</script>
</head>
<body bgcolor="#FFFFFF">
<DIV id=Head>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
 <tr>
 <td width="220" align="center" style="padding:1px 0px 0px 0px;"><a href="<%=siteurl%>" onFocus="this.blur();"><img src="<%=sitelogo%>" width=206 vspace=7 border=0 alt="XX县广告招贴网"></a></td>
 <td valign="middle" style="padding:1px 0px 0px 0px;"> 
 <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:8px;">
 <tr>
 <td align="right" valign="top" nowrap="nowrap" style="padding:6px 16px 0px 0px;"><a href="<%=siteurl%>/index.asp">招贴网首页</a> 
 </td>
 </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<form action="search.asp" name=dirform method="get">
 <tr>
 <td width="266" valign="top" nowrap="nowrap" style="padding:0px 0px 4px 0px;">
<input maxlength=80 name=q size=25 value="<%=request("q")%>">
 <input type=submit value="搜索信息" class="searchB"></td>
 <td nowrap="nowrap"> <a href="<%=siteurl%>/help/" title="XX县广告招贴网帮助">帮助</a> - <a href="<%=siteurl%>/user/adfabu.asp">发布信息</a></td>
 </tr>
</form>
</table>
</td>
 </tr>
</table>
<table width="100%" border="0" cellpadding="2" cellspacing="1" class="navborder">
 <tr>
 <td class="navbg">
 <table width="100%" border="0" cellpadding="0" cellspacing="0">
 <tr>
 <td>&nbsp;信息搜索:<a href="index.asp" class="linknov">首页</a> > 所有信息 </td>
 <td align="right">约有 <b><%=rs.recordcount%></b> 项符合 <b><%=request("q")%></b> 的查询结果&nbsp;&nbsp;</td>
 </tr>
 </table></td>
 </tr>
 </table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
 <tr>
 <td class="left" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="160" valign="bottom" style="padding:3px;">
<br>
<span onClick="i_function(0)"><input id="i_0" name="i" type="radio" value="0" <%if ii=0 then%>checked<%end if%>><label for="i_0">显示图片</label></span>
<span onClick="i_function(1)"><input id="i_1" name="i" type="radio" value="1" <%if ii=1 or request("i")="" then%>checked<%end if%>><label for="i_1">隐藏图片</label></span>
</td>
 <td align="right" valign="bottom" style="padding:3px;">
排序:<a href="search.asp?o=1&d=<%=request("d")%>&q=<%=request("q")%>&i=<%=ii%>" class="linkNo" title="点击">点击排行</a> | <a href="search.asp?o=2&d=<%=request("d")%>&q=<%=request("q")%>&i=<%=ii%>" class="linkNo" title="最新查看">最新查看</a> | <a href="search.asp?o=3&d=<%=request("d")%>&q=<%=request("q")%>&i=<%=ii%>" class="linkNo" title="快要过期">快要过期</a></td>
 </tr>
 <tr>
 <td class="h1" colspan="2"></td>
 </tr>
 </table> 
<br>
<%
if Len(Trim(Request("page")))=0 Then '返回目标页码的判断
page=1 
Else 
page=CInt(Trim(Request("page"))) 
End if
if rs.bof and rs.eof then
response.write "<p class=""f60b14"" align=""center"">没有符合条件的信息!<a href=""user/adfabu.asp"" title=""免费发布信息"">免费发布广告信息</a></p>"
end If
if not (rs.bof and rs.eof) then
 rs.AbsolutePage=page
 for k=1 to rs.PageSize 
%>
 <table width="100%" border="0" cellspacing="1" cellpadding="2" style="margin-top:12px;border-bottom:0px dotted #A5BAC6;">
 <tr>
<%
iiii=iiii+1
if ii=0 and request("i")<>"" then
If rs("img")<>"" Then
SiteImg=rs("img")
Else
SiteImg="img/no.jpg"
End If%>
 <td width="110"><a href="<%=siteurl%>/info/info.asp?id=<%=rs("adid")%>" target="_blank" onClick="chk_stat(<%=rs("adid")%>);" title="访问此信息"><img hspace="4" border="0" align="left" width="105" height="75" src="<%=siteurl%>/img.asp?i=<%=SiteImg%>" class="DirImg"></a></td><%end if%> <td valign="top"><span class=""gray""><%=iiii%>.</span>&nbsp;<a href="<%=siteurl%>/info/info.asp?id=<%=rs("adid")%>" target="_blank" onClick="chk_stat(<%=rs("adid")%>);" class="link14b" title="访问此信息"><%=replace(rs("title"),request("q"),"<font color=red>"&request("q")&"</font>")%></a><span class="small"> - <span class="greendomain"><%=rs("time")%></span><br>
<%=Left(replace(rs("text"),request("q"),"<font color=red>"&request("q")&"</font>"),52)%></td></tr>
 </table>
<%
 rs.movenext
 if rs.EOF Then Exit For
 next
end if
%> 
 <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top:10px;">
 <tr>
 <td class="h1"></td>
 </tr>
<%
if not( rs.bof and rs.eof )then
%>
 <tr>
 <td align="center" style="padding:5px;">结果页码:
<%
 if page <>1 then
 Response.Write "<a href=?page=1>首页</a> "
 end if
 tmppage = page - 1 
 if tmppage <= 0 then 
 tmppage = 1 
 else
 Response.Write"<a href=?page="&tmppage&"&d="&request("d")&">上一页</a>"
 end if
 tmppage = page + 1 
 if tmppage >rs.PageCount then 
 tmppage = page
 else
 Response.Write " <a href=?page="&tmppage&"&d="&request("d")&">下一页</a> "
 end if 
 if Cstr(page) <> Cstr(rs.PageCount) and Cstr(rs.PageCount) <> 0 then
 Response.Write "<a href=?page="&rs.PageCount&"&d="&request("d")&">尾页</a>"
 end if
 Response.Write " "&rs.RecordCount&" 条记录 "
 if Cstr(rs.PageCount) <> 0 then
 Response.Write "" & page & " / "&rs.PageCount&"页"
 end if
rs.close
set rs=nothing
%>
</td>
 </tr>
<%End If%>
 </table>
 </td>
 <td class="w1"></td>
 <td class="right" valign="top">
<!-- #include file="left.asp"-->
 <%
conn.close
set conn=nothing
%>
 </td>
 </tr>
</table>
</td>
</tr>
</table>
<%call footer%>
</div>
</body>
</html>