?? search.asp
字號:
<!--#include file="up.asp"-->
<script>ctree('→ <a href=search.asp>論壇搜索</a>')</script>
<%if isnull(lguserid) or lguserid="" then
tl=""
mes="對不起,該功能只對會員開放。"
call sendinfo(tl,mes)
call down
response.end
end if
dim action,key,sql,thetime,searchtime,bbs,pagesetup,totalpage,Count,pagecount,topicinfo,retopic,reinfo,ii,iii
%>
<style type=text/css>
.c1{background-color: <%=c1%>}
.c2{background-color: <%=c2%>}
.c3{background-color: #ffffff}
.hf{background-image: url(<%=tbw%>);color:#ffffff; font-weight: bold;height=25}
</style>
<tr><form method="GET" action="?">
<td class=c2 height=40>
<b>關鍵字:</b>
<input type="text" name="key" size="40">
<select size="1" name="searchtime" style="font-size: 9pt">
<option selected value="0">所有日期</option>
<option value="1">1天以來</option>
<option value="2">2天以來</option>
<option value="7">7天以來</option>
<option value="15">15天以來</option>
<option value="30">30天以來</option>
</select>
<select size="1" name="bbs" style="font-size: 9pt">
<option value="0">所有論壇</option>
<%set rs=conn.execute("select id,bdinfo from bdinfo where followid<>0 order by orders desc,id")
do while not rs.eof
response.write"<option value="&rs("id")&">"&split(rs("bdinfo"),"|")(0)&"</option>"
rs.movenext
loop
rs.close
set rs=nothing
%></select>
<input type="submit" value=" 搜 索 " name="B1"><input type="hidden" name="action" size="20" value="search">
</td><%=tbottom%></form></center>
</tr>
<%
key=Replace(request.querystring("key"),"'","")
key=Replace(key,"[","[[]")
key=Replace(key,"|","│")
if key="" then response.write"<tr><td class=c2><center>請輸入要搜索的關鍵字。關鍵字必須大于2個字符,支持與關系搜索,如“娛樂 網站”。</td></tr></center></table>":call down:response.end
Dim N,TempKey,FullTextKey
If key<>"" then
if instr("face",key) or instr(" ",key) or len(key)<2 then
tl=""
mes="<b>搜索關鍵字太短,或者關鍵字含有非法字符。</b><br><a href='javascript:history.go(-1)'><img border=0 src=pic/re.gif align=absmiddle> 返回重新填寫</a>"
call sendinfo(tl,mes)
call down
response.end
else
response.write"<center><tr><td class=c2>您搜索的是: <font color=red>"&key&"</font> ,以下是搜索結果:</td></tr></table></center>"
end if
TempKey = split(Key," ")
FullTextKey = ""
for N = 0 to ubound(TempKey)
If TempKey(N)<>"" Then FullTextKey = FullTextKey&"topicinfo like '%"&TempKey(N)&"%' and "
Next
If Right(FullTextKey,5) = " and " Then FullTextKey = Left(FullTextKey,Len(FullTextKey) - 5)
searchtime=checknum(request.querystring("searchtime"))
bbs=checknum(request.querystring("bbs"))
sql="select*from topic where "&FullTextKey&" and type<>3"
if bbs>0 then sql=sql&"and bd="&bbs&" "
if searchtime>0 then sql=sql&"and edittime>now()+"×et&"/24-"&searchtime&""
sql=sql&" order by edittime desc"
response.write"<script language='javascript'>function Check(){var Name=document.form.topage.value;document.location='?action=search&bbs="&bbs&"&key="&key&"&searchtime="&searchtime&"&topage='+Name+'';}</script>"
set rs = server.createobject("adodb.recordset")
pagesetup=checknum(application(prefix&"topiclistpage"))
rs.Open sql,conn,1
TotalPage=0
Count=rs.recordcount
if rs.eof then response.write"<br><br><center>抱歉!沒有找到您需要的結果!</center><br><br>":call down:response.end
if not rs.eof then
response.write"<br><table align=center class=c1 border=0 cellpadding=0 cellspacing=0 style='border-collapse: collapse' width="&tbw&" bgcolor="&c1&" background="&tbg&" height=38><tr align=center class=hf><td width=5% >表情</td><td width=45% >主題 (點擊表情在新窗口打開)</td><td width=10% >作者</td><td width=5% >回復</td><td width=5% >人氣</td><td width=20% >最后更新時間</td><td width=10% >最后回復</td></tr>"
If Count/pagesetup > (Count\pagesetup) then
TotalPage=(Count\pagesetup)+1
else
TotalPage=(Count\pagesetup)
End If
pagecount= 0
rs.moveFirst
if Request.QueryString("ToPage")<>"" and isnumeric(Request.QueryString("ToPage")) then PageCount = cint(Request.QueryString("ToPage"))
if PageCount <=0 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
rs.move (PageCount-1) * pagesetup
i=1
do while not rs.eof
topicinfo=rs("topicinfo")
topicinfo=split(topicinfo,"|")
retopic=rs("retopic")
if isnull(retopic) or retopic="" then
reinfo="——"
retopic="未有人回復。|——|0"
retopic=split(retopic,"|")
else
retopic=split(retopic,"|")
reinfo="<a href=userinfo.asp?userid="&retopic(2)&">"&kbbs(retopic(1))&"</a>"
end if
response.write"<tr height=28><td align=center class=c2><a target=_blank href='show.asp?bd="&rs("bd")&"&id="&rs("id")&"&totable="&rs("totable")&"' title='最后回復:"&kbbs(retopic(0))&"'><img border=0 src=images/face/"&topicinfo(0)&".gif></a></td><td class=c3 onMouseOver=this.style.backgroundColor='#F8F8F8' onMouseOut=this.style.backgroundColor=''> <a href='show.asp?bd="&rs("bd")&"&id="&rs("id")&"&totable="&rs("totable")&"' title='最后回復:"&kbbs(retopic(0))&"'>"&topicinfo(3)&" <font color="&replacecolor(kbbs(topicinfo(1)))&">"&lefttrue(kbbs(topicinfo(1)),40)&"</font></a></td><td align=center class=c2><a href=userinfo.asp?userid="&rs("userid")&">"&kbbs(topicinfo(2))&"</a></td><td align=center class=c3>"&rs("renum")&"</td><td class=c2 align=center>"&rs("hits")&"</td><td align=center class=c3>"&rs("edittime")&"</td><td align=center class=c2>"&reinfo&"</td></tr>"
i=i+1
if i>pagesetup then exit do
rs.movenext
loop
end if
rs.Close
set rs=nothing
response.write"</table><TABLE align='center' cellSpacing=0 cellPadding=0 width="&tbw&" bgcolor="&c1&" border=0 class=tab1><TR height=25 class=c2><TD> <img border='0' src='pic/fl.gif'> 本版面共 <b>"&count&"</b> 帖,每頁 <b>"&pagesetup&"</b> 帖,分 <b>"&TotalPage&"</b> 頁: "
if PageCount=1 then
Response.Write " <font face=Webdings title=首頁 color=888888>9</font> <font face=Webdings title=上頁 color=888888>7</font> "
else
Response.Write " <a href=?topage=1&action=search&bbs="&bbs&"&key="&key&"&searchtime="&searchtime&"><font face=Webdings title=首頁>9</font></a> <a href=?topage="&PageCount-1&"&action=search&bbs="&bbs&"&key="&key&"&searchtime="&searchtime&"><font face=Webdings title=上頁>7</font></a> "
end if
ii=PageCount-5
iii=PageCount+5
if ii < 1 then
ii=1
end if
if iii > TotalPage then
iii=TotalPage
end if
if PageCount > 6 then
Response.Write "<a href=?topage=1&action=search&bbs="&bbs&"&key="&key&"&searchtime="&searchtime&">1</a> ... "
end if
for i=ii to iii
If i<>PageCount then
Response.Write "<a href=?topage="& i &"&action=search&bbs="&bbs&"&key="&key&"&searchtime="&searchtime&">" & i & "</a> "
else
Response.Write " <font color=red><b>"&i&"</b></font> "
end if
next
if TotalPage > PageCount+5 then
Response.Write " ... <a href=?topage="&TotalPage&"&action=search&bbs="&bbs&"&key="&key&"&searchtime="&searchtime&">"&TotalPage&"</a>"
end if
if PageCount=TotalPage then
Response.Write " <font face=Webdings title=下頁 color=888888>8</font> <font face=Webdings title=尾頁 color=888888>:</font> "
else
Response.Write " <a href=?topage="&PageCount+1&"&action=search&bbs="&bbs&"&key="&key&"&searchtime="&searchtime&"><font face=Webdings title=下頁>8</font></a> <a href=?topage="&TotalPage&"&action=search&bbs="&bbs&"&key="&key&"&searchtime="&searchtime&"><font face=Webdings title=尾頁>:</font></a> "
end if
response.write" </TD><form name=form method='POST' action=javascript:Check()><TD height=2 align='right'>頁碼:<input style=FONT-SIZE:9pt maxLength='6' size='6' name='topage' value='"&PageCount&"'><input style=FONT-SIZE:9pt value='GO!' type='submit'></TD></form></TR></TABLE><script>tbottom()</script>"
%>
<%End If
call down%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -