📄 search.asp
字号:
<!--#include file="const.asp"-->
<!--#include file="BtBBS_Fun.asp"-->
<!--#include file="../conn.asp"--><%
dim login,username,key,mode,page,i,idimage,titlename,titlenamew
dim rs,sql,AccessNum,StarTime,EndTime
login=Request.Cookies("login")
username=Request.Cookies("username")
StarTime = Timer():AccessNum=0
Call JCC_Board_Top
key=Request("key")
key=replace(replace(replace(replace(key,"'","‘"),"<","<"),">",">")," "," ")
mode=Request("mode")
if mode="" or IsNumeric(mode)=false then mode=1 end if
page=Request.QueryString("page")
if IsNumeric(page)=false then page=1 else page=clng(page) end if
if page="" or page<1 then page=1 end if
call Login_EN
Response.Write "<table width=743 align=center><tr><td height=30 class=light> <img src=../images/nav.gif> <a href=index.asp><font class=NavColor>论坛首页</a> >> 论坛搜索</font></td></tr></table>"
Response.Write "<table border=2 width=743 cellspacing=0 cellpadding=0 class=table1>"
Response.Write "<tr><td height=27 class=TBHead> <B>论坛搜索</B></td></tr>"
Response.Write "<tr><td height=27 class=light></form><form name=sform action=Search.asp method=post> <font class=NavColor>搜索词:</font><input class=fminpt name=key> <select name=mode><option value=1>帖子名称</option><option value=3>帖子作者</option></select> <input type=image src=../images/sch.gif border=0 WIDTH=17 height=14 align=absmiddle><img src=../images/null.gif width=5 height=2></form></td></tr>"
Response.Write "<tr><td height=27 class=light> 请把关键字输入到上面的搜索词中,然后选择搜索的位置</td></tr>"
Response.Write "</table>"
if key<>"" then
AccessNum=AccessNum+1
Set rs = Server.CreateObject("ADODB.Recordset")
select case mode
case 1
sql="select id,BoardID,Subject,PostUser,FileName,LastPostTime,IsBest,IsTop,PollID from BT_Topic where Subject LIKE '%"&key&"%' order by LastPostTime desc "
case 2
sql="select id,BoardID,Subject,PostUser,FileName,LastPostTime,IsBest,IsTop,PollID from BT_Topic where 内容 LIKE '%"&key&"%' order by LastPostTime desc "
case 3
sql="select id,BoardID,Subject,PostUser,FileName,LastPostTime,IsBest,IsTop,PollID from BT_Topic where PostUser LIKE '%"&key&"%' order by LastPostTime desc "
end select
rs.open sql,conn,1,1
if rs.BOF and rs.EOF then
Response.Write "<br><br><br>没有找到任何相关的帖子<br><br><br><br>"
else
rs.PageSize=ListNum
if page>rs.PageCount then page=rs.PageCount end if
rs.absolutepage=page
Response.Write "<table border=0 width=743 cellspacing=0 cellpadding=0 class=table1><tr align=center><td width=27 height=27 class=TBHead><font class=HeadFont><b>ID</b></font></td><td width=350 class=TBHead><font class=HeadFont><b>主题</b></font></td><td class=TBHead><font class=HeadFont><b>作者</b></font></td><td class=TBHead><font class=HeadFont><b>最后更新时间</b></font></td></tr>"
i=0
while not rs.eof and i<ListNum
i=i+1
idimage="<img src=../images/tz1.gif alt='普通帖子'>" '处理加精,固顶,总固顶图标
if rs("IsBest")="Y" then idimage="<img src=../images/tz2.gif alt='精华帖子'>" end if
if rs("IsTop")="1" then idimage="<img src=../images/tz3.gif alt='固顶帖子'>" end if
if rs("IsTop")="2" then idimage="<img src=../images/tz4.gif alt='总固顶帖子'>" end if
if rs("PollID")<>"file" and rs("PollID")<>"" then idimage="<img src=../images/poll.gif alt='投票帖子'>" end if
titlename=rs("Subject")
titlenamew=titlename
if len(titlename)>54 then
titlename=left(titlename,50)
titlename=titlename+"..."
end if
Response.Write "<tr><td width=27 height=27 align=center class=light>"&idimage&"</td><td width=450 class=light> <a href=bbs"+cstr(rs("BoardID"))+"/"+rs("FileName")+" title="&titlenamew&">"&titlename&"</a></td><td align=center class=light><a href=LookUserInfo.asp?username="&rs("PostUser")&" title='查看作者资料'>"&rs("PostUser")&"</a></td><td align=center class=light>"+cstr(rs("LastPostTime"))+"</td></tr>"
rs.MoveNext
wend
Response.Write "</table>"
if rs.PageCount=1 then '''
Response.Write "<table border=0 width=743 cellspacing=0 cellpadding=0 class=table1><tr><td>第 "&page&" 页 <font color=#666666>上一页</font> <font color=#666666>下一页</font> 共"&rs.pagecount&"页</td></tr></table>"
else
if page=rs.PageCount then
Response.Write "<table border=0 width=743 cellspacing=0 cellpadding=0 class=table1><tr><td>第 "&page&" 页 <a href=Search.asp?page="&page-1&"&mode="&mode&"&key="&key&">上一页</a> <font color=#666666>下一页</font> 共"&rs.pagecount&"页</td></tr></table>"
else
if page=1 then Response.Write "<table border=0 width=743 cellspacing=0 cellpadding=0 class=table1><tr><td>第 "&page&" 页 <font color=#666666>上一页</font> <a href=Search.asp?page="&page+1&"&mode="&mode&"&key="&key&">下一页</a> 共"&rs.pagecount&"页</td></tr></table>" else Response.Write "<table border=0 width=743 cellspacing=0 cellpadding=0 class=table1><tr><td>第 "&page&" 页 <a href=Search.asp?page="&page-1&"&mode="&mode&"&key="&key&">上一页</a> <a href=Search.asp?page="&page+1&"&mode="&mode&"&key="&key&">下一页</a> 共"&rs.pagecount&"页</td></tr></table>" end if
end if
end if
end if
end if
EndTime = Timer()%>
<!--#include file="../inc/tom1.inc"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -