📄 so.asp
字号:
<!--#include file = admin_conn.asp -->
<!--#include file = admin/titleb.asp --><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="Css.css">
<style>
<!--
#yabock {
float:none; margin: 0px auto; width: 940px; height: 1%; border: 1px #6FB5DB solid; padding-bottom: 7px; margin-top: 15px; *margin-top: 15px;_margin-top: 15px; overflow:hidden
}
#yabock .mulur {
float:left; width: 937px; height: 25px; background-color:#E7F7FF; border-bottom: 1px #6FB5DB solid; padding: 8px 0px 0px 15px; color:#003278
}
#yabock .fenli {
float: left; width: 98%; height: 100%; padding: 12px 0px 0px 0px
}
#yabock .fenli .yoleft {
float:left; width: 12%; height: 100%; text-align: right; margin-right: 7px
}
#yabock .fenli .yorift {
float:left; width: 70%; height: 100%; text-align: left; padding-bottom: 7px
}
-->
</style>
</head>
<%
root_path=finddir(request.servervariables("URL"))
top=replace(config("top"),"$$网站目录$$",root_path)
down=replace(config("down"),"$$网站目录$$",root_path)
Response.Write top
%>
<table width=940 border="0" align=center cellpadding="0" cellspacing="0">
<tr><td >
<div id='yabock'>
<div class='mulur'>搜索选项
</div>
<div class='fenli'>
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<form method="post" action="so.asp">
<tr>
<td valign="top">
关键字:
<input type="text" name="word" size="25" value="<%=trim(request("word"))%>" style=" border: 1px #7F9DB9 solid; height: 18px">
所属类别:
<select size="1" name="lm" style="font-size: 9pt">
<option value=" ">请选择栏目</option>
<option value=" ">所有栏目</option>
<%
sql = "select * from lm where lm<>'' order by id asc"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
while not rs.eof
%>
<option value='<%=rs("id")%>' <% if int(lmid)=rs("id") then response.write " selected" %>><%=rs("lm")%></option>
<%
sql2 = "select * from lm where lmid='"&rs("id")&"' order by id asc"
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
while not rs2.eof
%>
<option value='<%=rs2("id")%>' <% if int(lmid)=rs2("id") then response.write " selected" %>> ├<%=rs2("lm2")%></option>
<%
Set rs33 = Server.CreateObject("ADODB.RecordSet")
rs33.Open "select * from [lm] where lmid='"&rs2("id")&"' and LM3<>'' order by id desc",conn,1,1
while not rs33.eof
%>
<option value='<%=rs33("id")%>' <% if int(lmid)=rs33("id") then response.write " selected" %>> ├<%=rs33("lm3")%></option>
<%
rs33.movenext
wend
rs2.movenext
wend
rs.movenext
wend
rs.close:set rs=nothing
rs2.close:set rs2=nothing
rs33.close:set rs33=nothing
%>
</select>
<br />
<br />
时 间:
<select size="1" name="year">
<option value="">年份</option>
<option value="">不限</option>
<%for i=2005 to 2010%>
<option value="<%=i%>"><%=i%></option><%next%>
</select>
<select size="1" name="month">
<option value="">月份</option>
<option value="">不限</option>
<%for i=1 to 12%>
<option value="<%=i%>"><%=i%></option><%next%>
</select>
范 围:
<select size="1" name="wh">
<option value="title">标题</option>
<option value="content">内容</option>
<option value="zz">作者</option>
</select>
<input type="submit" name="seabtn" value="立即搜索">
<br /></td>
</tr>
</form>
</table>
</div>
</div>
</td>
</tr>
<tr><td >
<div id='yabock'>
<div class='mulur'>搜索结果列表</div>
<div class='fenli'>
<%
ON ERROR RESUME NEXT
word=trim(chkhtm(Request("word")))
lm=trim(chkhtm(trim(request("lm"))))
wh=trim(chkhtm(trim(request("wh"))))
yy=trim(chkhtm(trim(request("year"))))
mm=trim(chkhtm(trim(request("month"))))
if wh="" then wh="title"
nnn="<font color='#FF0000'><span >"&word&"</span></font>"
sql = "select * from news where title<>'' and sh=1 "
if word<>"" then
sql=sql&" and "&wh&" like '%"&word&"%' "
if yy<>"" then sql=sql&" and year(time)="&yy&" "
if mm<>"" then sql=sql&" and month(time)="&mm&" "
if lm<>"" then sql=sql&" and (lm='"&lm&"' or lm2='"&lm&"' or lm3='"&lm&"') "
sql=sql&" order by id desc"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
if rs.recordcount<>0 then
page=int(request.QueryString ("page"))
rs.PageSize=10
pagecount=rs.pagesize
if page<=0 then page=1
if request.QueryString("page")="" then page=1
rs.AbsolutePage=page
%>
<%
for i=1 to pagecount
lmid=rs("lm3")
if lmid="0" then lmid=rs("lm2")
if lmid="0" then lmid=rs("lm")
sql2 = "select * from lm where id="&lmid
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
lm=rs2("lm")&rs2("lm2")&rs2("lm3")
title=replace(rs("title"),word,nnn)
nr=glhtml(rs("content"))
nr=replace(nr,"<","<")
nr=replace(nr,">",">")
nr=replace(nr,word,nnn)
content=" "&nr
%>
<li><a href="<%=fun_html_url(rs("id"))%>" target=_top><strong><font style='font-size:12pt; text-decoration:underline'><%=title%></font></strong></a></li><BR>
<%
if len(content)<350 then
Response.Write "<font color=#333333 style='font-size:10pt;'>"&content&"</font>"
Else
Response.Write "<font color=#333333 style='font-size:10pt;'>"&titleb(content,350)&"</font>"
end if
%><br /><br />
<font color="#666666">发布时间:<%=rs("time")%> 所属栏目:<%=lm%> 访问量:<%=rs("hit")%></font><br /><hr />
<%
rs.movenext
if rs.eof then exit for
next
else
response.write "<b> 您查找的<font color=red>“"&word&"”</font>的信息暂时没有找到</b><BR><BR><BR><BR>"
end if
%>
<center>
<%
if rs.recordcount<>0 then
lm=trim(request("lm"))
if page>1 then%>
<a href='<%=request.servervariables("URL")%>?page=1&word=<%=word%>&id=<%=trim(request("id"))%>&lmname=<%=trim(request("lmname"))%>&open=<%=trim(request("open"))%>&n=<%=trim(request("n"))%>&wh=<%=wh%>&yy=<%=yy%>&mm=<%=mm%>&lm=<%=lm%>'>首页</a>
<a href='<%=request.servervariables("URL")%>?page=<%=page-1%>&word=<%=word%>&id=<%=trim(request("id"))%>&lmname=<%=trim(request("lmname"))%>&open=<%=trim(request("open"))%>&n=<%=trim(request("n"))%>&wh=<%=wh%>&yy=<%=yy%>&mm=<%=mm%>&lm=<%=lm%>'>上一页</a>
<%end if%>
<%if page<rs.pagecount then%>
<a href='<%=request.servervariables("URL")%>?page=<%=page+1%>&word=<%=word%>&id=<%=trim(request("id"))%>&lmname=<%=trim(request("lmname"))%>&open=<%=trim(request("open"))%>&n=<%=trim(request("n"))%>&wh=<%=wh%>&yy=<%=yy%>&mm=<%=mm%>&lm=<%=lm%>'>下一页</a>
<a href='<%=request.servervariables("URL")%>?page=<%=rs.pagecount%>&word=<%=word%>&id=<%=trim(request("id"))%>&lmname=<%=trim(request("lmname"))%>&open=<%=trim(request("open"))%>&n=<%=trim(request("n"))%>&wh=<%=wh%>&yy=<%=yy%>&mm=<%=mm%>&lm=<%=lm%>'>尾页</a>
<%end if%>
共<%=rs.recordcount%>条 每页显示<%=pagecount%>条 第<%=page%>页 共<%=rs.pagecount%>页
<script language="JavaScript">
<!--
function FP_jumpMenu(el,frm,sel) {//v1.0
var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
}
// -->
</script>
<select size="1" onchange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt; border-style: solid; border-width: 1px">
<%for i=1 to rs.pagecount%>
<option value="<%=request.servervariables("URL")%>?page=<%=i%>&word=<%=word%>&id=<%=trim(request("id"))%>&lmname=<%=trim(request("lmname"))%>&open=<%=trim(request("open"))%>&n=<%=trim(request("n"))%>&wh=<%=wh%>&yy=<%=yy%>&mm=<%=mm%>&lm=<%=lm%>" <%if page=i then response.write "selected"%>>第<%=i%>页</option>
<%next%>
</select>
</center>
</div>
</div>
<%
end if
end if%>
</TD>
</tr></table>
<%
Response.Write down
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -