📄 search.asp
字号:
<%
'#############################################################
'# 中国在线--极酷论坛 ver.2001 3.0
'#
'# 版权所有: 中国在线 (ChinaXP.Net)
'#
'# 制作人 : 周周 (SeeYa!)
'#
'#
'# 主页地址: http://www.ChinaXP.net/ 中国在线
'# http://bbs.ChinaXP.Net 中国在线--极酷论坛
'#
'#############################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->
<!--#INCLUDE FILE="inc_functions2.asp" -->
<% '################################## %>
<TD width="70%" align="left" valign="top">
<TABLE border="0" width="85%" align=center>
<TR>
<TD width="33%" align="left" nowrap><font face="<% Response.Write strDefaultFontFace %>" size="<% Response.Write strDefaultFontSize %>"><a href="default.asp"><img src="<% =strImageURL %>icon_folder_open.gif" alt="返回论坛首页" border="0"> <% =strForumTitle %></a>
<% If Request.QueryString("mode") = "DoIt" then %>
<BR><img src="<%=strImageURL %>icon_bar.gif" border="0"><img src="<%=strImageURL %>icon_folder_open.gif" border="0"> <a href="search.asp?Search=<%=Request.Form("Search")%>">论坛搜索</a>
<BR><img src="<%=strImageURL %>icon_blank.gif" border="0"><img src="<%=strImageURL %>icon_bar.gif" border="0"><img src="<% =strImageURL %>icon_folder_open_topic.gif" border="0"> 搜索结果:<%=Request.Form("Search")%>
<% else %>
<BR><img src="<%=strImageURL %>icon_bar.gif" border="0"><img src="<%=strImageURL %>icon_folder_open_topic.gif" border="0"> 论坛超级搜索
<% end if %>
</FONT></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<% '################################## %>
<%
' ### 产生随机数
Dim strFolderImg
Randomize
strFolderImg = CStr(Int(Rnd * 5))
%>
<%
set rs = Server.CreateObject("ADODB.Recordset")
If Request.QueryString("mode") = "DoIt" then
if Request.Form("Search") <> "" or Request.Form("SearchMember") <> 0 then 'Huwr
keywords = split(Request.Form("Search"), " ")
keycnt = ubound(keywords)
'## Forum_SQL - Find all records with the search criteria in them
strSql = "SELECT " & strTablePrefix & "FORUM.FORUM_ID, " & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "FORUM.CAT_ID, " & strTablePrefix & "TOPICS.TOPIC_ID, " & strTablePrefix & "TOPICS.T_SUBJECT, " & strTablePrefix & "TOPICS.T_MAIL, " & strTablePrefix & "TOPICS.T_STATUS, " & strTablePrefix & "TOPICS.T_LAST_POST, " & strTablePrefix & "TOPICS.T_REPLIES, " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & " FROM ((" & strTablePrefix & "FORUM LEFT JOIN " & strTablePrefix & "TOPICS "
strSql = strSql & " ON " & strTablePrefix & "FORUM.FORUM_ID = " & strTablePrefix & "TOPICS.FORUM_ID) LEFT JOIN " & strTablePrefix & "REPLY "
strSql = strSql & " ON " & strTablePrefix & "TOPICS.TOPIC_ID = " & strTablePrefix & "REPLY.TOPIC_ID) LEFT JOIN " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " ON " & strTablePrefix & "TOPICS.T_AUTHOR = " & strMemberTablePrefix & "MEMBERS.MEMBER_ID "
strSql = strSql & " WHERE ("
if Request.Form("Search") <> "" then 'Huwr
'################# New Search Code #################################################
if Request.Form("SearchMessage") = 1 then
if Request.Form("andor") = "phrase" then
strSql = strSql & " (" & strTablePrefix & "FORUM.F_SUBJECT LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'"
strSql = strSql & " OR " & strTablePrefix & "TOPICS.T_SUBJECT LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%') "
else
For Each word in keywords
SearchWord = ChkString(word, "SQLString")
strSql = strSql & " (" & strTablePrefix & "FORUM.F_SUBJECT LIKE '%" & SearchWord & "%'"
strSql = strSql & " OR " & strTablePrefix & "TOPICS.T_SUBJECT LIKE '%" & SearchWord & "%') "
if cnt < keycnt then strSql = strSql & Request.Form("andor")
cnt = cnt + 1
next
end if
else
if Request.Form("andor") = "phrase" then
strSql = strSql & " (" & strTablePrefix & "REPLY.R_MESSAGE LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'"
strSql = strSql & " OR " & strTablePrefix & "FORUM.F_DESCRIPTION LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'"
strSql = strSql & " OR " & strTablePrefix & "TOPICS.T_SUBJECT LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'"
strSql = strSql & " OR " & strTablePrefix & "TOPICS.T_MESSAGE LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%') "
else
For Each word in keywords
SearchWord = ChkString(word, "SQLString")
strSql = strSql & " (" & strTablePrefix & "REPLY.R_MESSAGE LIKE '%" & SearchWord & "%'"
strSql = strSql & " OR " & strTablePrefix & "FORUM.F_DESCRIPTION LIKE '%" & SearchWord & "%'"
strSql = strSql & " OR " & strTablePrefix & "TOPICS.T_SUBJECT LIKE '%" & SearchWord & "%'"
strSql = strSql & " OR " & strTablePrefix & "TOPICS.T_MESSAGE LIKE '%" & SearchWord & "%') "
if cnt < keycnt then strSql = strSql & Request.Form("andor")
cnt = cnt + 1
next
end if
end if
strSql = strSql & " ) "
cnt = 0
'################# New Search Code #################################################
if Request.Form("Forum") <> 0 then
strSql = strSql & " AND " & strTablePrefix & "FORUM.FORUM_ID = " & Request.Form("Forum") & " "
end if
if Request.Form("SearchDate") <> 0 then
dt = cint(Request.Form("SearchDate"))
strSql = strSql & " AND (T_DATE > '" & DateToStr(dateadd("d", -dt, strForumTimeAdjust)) & "')"
end if
end if ' Huwr
if Request.Form("Search") = "" and Request.Form("SearchMember") <> 0 then 'Huwr
strSql = strSql & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & Request.Form("SearchMember") & " "
strSql = strSql & " OR " & strTablePrefix & "REPLY.R_AUTHOR = " & Request.Form("SearchMember") & ") "
else
if Request.Form("SearchMember") <> 0 then
strSql = strSql & " AND (" & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & Request.Form("SearchMember") & " "
strSql = strSql & " OR " & strTablePrefix & "REPLY.R_AUTHOR = " & Request.Form("SearchMember") & ") "
end if
end if
strSql = strSql & " AND " & strTablePrefix & "FORUM.F_TYPE = " & 0
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.FORUM_ID DESC, "
strSql = strSql & " " & strTablePrefix & "TOPICS.T_LAST_POST DESC"
mypage = request("whichpage")
If mypage = "" then
mypage = 1
end if
rs.Open strSql, my_Conn, 3,1
%>
<BR>
<table border="0"width="<% Response.Write strTableWidth %>" align="center" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="<% =strTableBorderColor %>">
<table border="0" width="100%" cellspacing="1" cellpadding="4">
<tr>
<td align="center" bgcolor="<% =strHeadCellColor %>"><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">状态</font></b></td>
<td align="center" bgcolor="<% =strHeadCellColor %>"><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">主题</font></b></td>
<td align="center" bgcolor="<% =strHeadCellColor %>"><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">作者</font></b></td>
<td align="center" bgcolor="<% =strHeadCellColor %>"><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">回复数</font></b></td>
<td align="center" bgcolor="<% =strHeadCellColor %>"><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">最新文章</font></b></td>
</tr>
<% if rs.EOF or rs.BOF then '## No new topic posts found in DB %>
<tr>
<td bgcolor="<% =strForumCellColor %>" colspan="5"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b>没有找到相关资料</b></font></td>
</tr>
<%
else
rs.MoveFirst
currForum = 0
currTopic = 0
do until rs.EOF
if ChkForumAccess(rs("FORUM_ID")) then
'## Forum_SQL - Find out if the Category is Locked or Un-Locked and if it Exists
strSql = "SELECT " & strTablePrefix & "CATEGORY.CAT_STATUS "
strSql = strSql & ", " & strTablePrefix & "FORUM.F_STATUS "
strSql = strSql & " FROM " & strTablePrefix & "CATEGORY "
strSql = strSql & " , " & strTablePrefix & "FORUM "
strSql = strSql & " WHERE " & strTablePrefix & "CATEGORY.CAT_ID = " & strTablePrefix & "FORUM.CAT_ID "
strSql = strSql & " AND " & strTablePrefix & "FORUM.FORUM_ID = " & rs("FORUM_ID")
set rsCFStatus = my_Conn.Execute (StrSql)
if (currForum <> rs("FORUM_ID")) and (currTopic <> rs("TOPIC_ID")) then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -