📄 search.asp
字号:
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/set.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="inc/inc.asp"-->
<%
'//版权所有:野草设计
'//程序作者:野草
'//当前版本:V2.0
'//联系QQ:94440079
'//官方网站:http://www.yecaoweb.com
%>
<%
title="站内搜索"
execute(loadskin(skinmode))
keyword=trim(replace(JPE(request("keyword")),"'",""))
jinzheclass=trim(replace(request("jinzheclass"),"'",""))
mode=trim(replace(request("mode"),"'",""))
call head()
%>
<table border="0" cellspacing="0" cellpadding="0" id="content">
<tr><td valign="top" align="center" id="left" nowrap>
<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
<td class="1" nowrap></td><td class="2" align="center" nowrap>
<%call myday()%>
<td class="3" nowrap></td></td></tr></table>
<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
<td class="4" nowrap></td>
<td class="5" valign="top" nowrap>
<p class="left_title"><script type="text/javascript">yecaotitle("left","用户登陆","0");</script></p>
<div class="left_content"><%call YC_userlogin()%></div>
<p class="left_title"><script type="text/javascript">yecaotitle("left","站内搜索","0");</script></p>
<div class="left_content"><%call YC_search("0","0")%></div>
</td><td class="6" nowrap></td></tr></table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="7" nowrap></td>
<td class="8" nowrap></td>
<td class="9" nowrap></td>
</tr></table>
</td>
<td id="center" nowrap></td>
<td valign="top" align="center" id="right" nowrap>
<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
<td class="11" nowrap></td>
<td class="22" nowrap>
当前位置:<a href="index.asp">本站首页</a>→<a href="search.asp">站内搜索</a>
<td class="33" nowrap></td>
</td></tr></table>
<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
<td class="44" nowrap></td>
<td class="55" valign="top" nowrap>
<%
select case jinzheclass
case "搜索新闻"
if mode="按标题" then
mode="title"
elseif mode="按内容" then
mode="content"
else
mode="title"
end if
sql="select * from [YC_news] where "&mode&" like '%"&keyword&"%' and pass=1 order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
YC("<table border=""1"" width=""100%"" bordercolor="""&color(0)&""" align=""center"" frame=""void"">")
if not rs.bof and not rs.eof then
rs.pagesize=20
i=1
mypage=request("page")
if mypage="" then
mypage=1
else
mypage=cint(mypage)
end if
pages=rs.pagecount
rs.absolutepage=mypage
YC("<tr height=""24"" bgcolor='"&color(2)&"'>")
YC("<td width=""70%"" align=""center"">标 题")
YC("</td>")
YC("<td width=""10%"" align=""center"" nowrap>点 击")
YC("</td>")
YC("<td width=""20%"" align=""center"" nowrap>发表时间")
YC("</td>")
YC("</tr>")
do while not rs.eof
YC("<tr height=""24"" bgcolor='"&color(1)&"' onmouseover=""this.bgColor='"&color(2)&"';"" onmouseout=""this.bgColor='"&color(1)&"';"" >")
YC("<td>")
YC("<ul class=""list""><li>[")
call myclass("YC_newsclass","news",rs("class"))
YC("] <a href=""shownews.asp?id="&rs("id")&""" target=""news"" title=""新闻标题:"&rs("title")&"<br />发表时间:"&rs("date")&"<br />点击次数:"&rs("click")&"次"">"&replace(rs("title"),keyword,"<font color='red'>"&keyword&"</font>")&"</a> ["&rs("date")&"]")
if rs("best")=1 then
YC("『<font color=red>推荐</font>』")
end if
YC("</li></ul></td>")
YC("<td align=""center"" bgcolor='"&color(2)&"' nowrap>"&rs("click")&"")
YC("</td>")
YC("<td nowrap> "&replacetime(rs("date"),"1")&"")
YC("</td>")
YC("</tr>")
if i=rs.pagesize then exit do end if
i=i+1
rs.movenext
loop
YC("</ul>")
end if
if rs.eof and rs.bof then
YC("<tr height=""60"" bgcolor='"&color(1)&"'><td colspan=""4"" align=""center"">")
YC("<br/ ><center>没有搜索到包含[<b><font color=""red"">"&keyword&"</font></b>]的数据……</center><br />")
YC("</td</tr>")
else
YC("<tr height=""24"" bgcolor='"&color(2)&"'><td colspan=""4"" align=""center"">")
YC("<script language=""javascript"">")
YC("showPageLink(""?page="","&mypage&","&pages&");")
YC("</script>")
YC(" 共有"&a&""&rs.recordcount&"条数据,分"&mypage&"/"&rs.pagecount&"页,每页"&rs.pagesize&"条。")
YC("</td</tr>")
end if
YC("</table>")
rs.close
set rs=nothing
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
case "搜索文章"
if mode="按标题" then
mode="title"
elseif mode="按内容" then
mode="content"
else
mode="title"
end if
sql="select * from [YC_art] where "&mode&" like '%"&keyword&"%' and pass=1 order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
YC("<table border=""1"" width=""100%"" bordercolor="""&color(0)&""" align=""center"" frame=""void"">")
if not rs.bof and not rs.eof then
rs.pagesize=20
i=1
mypage=request("page")
if mypage="" then
mypage=1
else
mypage=cint(mypage)
end if
pages=rs.pagecount
rs.absolutepage=mypage
YC("<tr height=""24"" bgcolor='"&color(2)&"'>")
YC("<td width=""70%"" align=""center"">标 题")
YC("</td>")
YC("<td width=""10%"" align=""center"" nowrap>点 击")
YC("</td>")
YC("<td width=""20%"" align=""center"" nowrap>发表时间")
YC("</td>")
YC("</tr>")
do while not rs.eof
YC("<tr height=""24"" bgcolor='"&color(1)&"' onmouseover=""this.bgColor='"&color(2)&"';"" onmouseout=""this.bgColor='"&color(1)&"';"" >")
YC("<td>")
YC("<ul class=""list""><li>[")
call myclass("YC_artclass","art",rs("class"))
YC("] <a title=""发表用户:"&rs("user")&"<br />发表时间:"&rs("date")&"<br />点击次数:"&rs("click")&"次"" href=""showart.asp?id="&rs("id")&""" target=""art"">"&replace(rs("title"),keyword,"<font color=""red"">"&keyword&"</font>")&"</a>")
if rs("best")=1 then
YC("『<font color=red>推荐</font>』")
end if
YC("</li></ul></td>")
YC("<td align=""center"" bgcolor='"&color(2)&"' nowrap>"&rs("click")&"")
YC("</td>")
YC("<td nowrap> "&replacetime(rs("date"),"1")&"")
YC("</td>")
YC("</tr>")
if i=rs.pagesize then exit do end if
i=i+1
rs.movenext
loop
YC("</ul>")
end if
if rs.eof and rs.bof then
YC("<tr height=""60"" bgcolor='"&color(1)&"'><td colspan=""4"" align=""center"">")
YC("<br/ ><center>没有搜索到包含[<b><font color=""red"">"&keyword&"</font></b>]的数据……</center><br />")
YC("</td</tr>")
else
YC("<tr height=""24"" bgcolor='"&color(2)&"'><td colspan=""4"" align=""center"">")
YC("<script language=""javascript"">")
YC("showPageLink(""?page="","&mypage&","&pages&");")
YC("</script>")
YC(" 共有"&a&""&rs.recordcount&"条数据,分"&mypage&"/"&rs.pagecount&"页,每页"&rs.pagesize&"条。")
YC("</td</tr>")
end if
YC("</table>")
rs.close
set rs=nothing
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
case "搜索下载"
if mode="按标题" then
mode="title"
elseif mode="按内容" then
mode="content"
else
mode="title"
end if
sql="select * from [YC_down] where "&mode&" like '%"&keyword&"%' and pass=1 order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
YC("<table border=""1"" width=""100%"" bordercolor="""&color(0)&""" align=""center"" frame=""void"">")
if not rs.bof and not rs.eof then
rs.pagesize=20
i=1
mypage=request("page")
if mypage="" then
mypage=1
else
mypage=cint(mypage)
end if
pages=rs.pagecount
rs.absolutepage=mypage
YC("<tr height=""24"" bgcolor='"&color(2)&"'>")
YC("<td width=""70%"" align=""center"">标 题")
YC("</td>")
YC("<td width=""10%"" align=""center"" nowrap>点 击")
YC("</td>")
YC("<td width=""20%"" align=""center"" nowrap>发表时间")
YC("</td>")
YC("</tr>")
do while not rs.eof
YC("<tr height=""24"" bgcolor='"&color(1)&"' onmouseover=""this.bgColor='"&color(2)&"';"" onmouseout=""this.bgColor='"&color(1)&"';"" >")
YC("<td>")
YC("<ul class=""list""><li>[")
call myclass("YC_downclass","down",rs("class"))
YC("] <a title=""发表用户:"&rs("user")&"<br />发表时间:"&rs("date")&"<br />点击次数:"&rs("click")&"次"" href=""showdown.asp?id="&rs("id")&""" target=""down"">"&replace(rs("title"),keyword,"<font color=""red"">"&keyword&"</font>")&"</a>")
if rs("best")=1 then
YC("『<font color=red>推荐</font>』")
end if
YC("</li></ul></td>")
YC("<td align=""center"" bgcolor='"&color(2)&"' nowrap>"&rs("click")&"")
YC("</td>")
YC("<td nowrap> "&replacetime(rs("date"),"1")&"")
YC("</td>")
YC("</tr>")
if i=rs.pagesize then exit do end if
i=i+1
rs.movenext
loop
YC("</ul>")
end if
if rs.eof and rs.bof then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -