?? search.asp
字號:
<%
'########## Snitz Forums 2000 Version 3.1 SR4 ####################
'# #
'# 漢化修改: 資源搜羅站 #
'# 電子郵件: cgier@21cn.com #
'# 主頁地址: http://www.sdsea.com #
'# http://www.99ss.net #
'# http://www.cdown.net #
'# http://www.wzdown.com #
'# http://www.13888.net #
'# 論壇地址:http://ubb.yesky.net #
'# 最后修改日期: 2001/03/12 中文版本:Version 3.1 SR4 #
'#################################################################
'# 原始來源 #
'# Snitz Forums 2000 Version 3.1 SR4 #
'# Copyright 2000 http://forum.snitz.com - All Rights Reserved #
'#################################################################
'#【版權聲明】 #
'# #
'# 本軟體為共享軟體(shareware)提供個人網站免費使用,請勿非法修改,#
'# 轉載,散播,或用于其他圖利行為,并請勿刪除版權聲明。 #
'# 如果您的網站正式起用了這個腳本,請您通知我們,以便我們能夠知曉#
'# 如果可能,請在您的網站做上我們的鏈接,希望能給予合作。謝謝! #
'#################################################################
'# 請您尊重我們的勞動和版權,不要刪除以上的版權聲明部分,謝謝合作#
'# 如有任何問題請到我們的論壇告訴我們 #
'#################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->
<% set rs = Server.CreateObject("ADODB.Recordset") %>
<table width="100%" border="0">
<tr>
<td align="left" valign="top">
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<img src="<%=strImageURL %>icon_folder_open.gif" border="0"> <a href="default.asp">返回論壇首頁</a>
<% If Request.QueryString("mode") = "DoIt" then %>
<img src="<%=strImageURL %>icon_folder_open.gif" border="0"> <a href="search.asp?Search=<%=Request.Form("Search")%>">論壇搜索</a> <img src="<%=strImageURL %>icon_folder_open_topic.gif" border="0"> 搜索結果:<%=Request.Form("Search")%>
<% else %>
<img src="<%=strImageURL %>icon_folder_open_topic.gif" border="0"> 論壇搜索
<% end if %>
</font>
</td>
</tr>
</table>
<%
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
%>
<table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">
<tr>
<td bgcolor="<% =strTableBorderColor %>">
<table border="0" width="100%" cellspacing="1" cellpadding="4">
<tr>
<td align="center" bgcolor="<% =strHeadCellColor %>"> </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 + -