⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search.asp

📁 代码名称: Snitz Forums 2000 代码语言: 英文 代码类型: 国外代码 运行环境: ASP 授权方式: 免费代码 代码大小: 530kb 代码等级: 3 整
💻 ASP
📖 第 1 页 / 共 3 页
字号:
				strSql3 = strSql3 & " OR R.R_AUTHOR = " & cLng(intSearchMember) & ") "
			end if
		else
			if cLng(Request.Form("SearchMember")) <> 0 then
				strSql3 = strSql3 & " AND (M.MEMBER_ID = " & cLng(Request.Form("SearchMember")) & " "
				strSql3 = strSql3 & " OR R.R_AUTHOR = " & cLng(Request.Form("SearchMember")) & ") "
			end if
		end if
		if cLng(Request.QueryString("MEMBER_ID")) <> 0 then
			strSql3 = strSql3 & " AND (M.MEMBER_ID = " & cLng(Request.QueryString("MEMBER_ID")) & " "
			strSql3 = strSql3 & " OR R.R_AUTHOR = " & cLng(Request.QueryString("MEMBER_ID")) & ") "
		end if
		if strPrivateForums = "1" and mLev < 4 then
			strSql3 = strSql3 & " AND F.FORUM_ID IN (" & allAllowedForums & ")"
		end if
		strSql3 = strSql3 & " AND F.F_TYPE = 0"

		strSql4 = " ORDER BY C.CAT_ORDER, C.CAT_NAME, F.F_ORDER, F.F_SUBJECT, T.T_LAST_POST DESC"

		mypage = request("whichpage")
		if ((Trim(mypage) = "") or (IsNumeric(mypage) = False)) then mypage = 1
		mypage = cLng(mypage)

		if strDBType = "mysql" then 'MySql specific code
			if mypage > 1 then 
				intOffset = cLng((mypage-1) * strPageSize)
				strSql5 = strSql5 & " LIMIT " & intOffset & ", " & strPageSize & " "
			end if

			'## Forum_SQL - Get the total pagecount 
			strSql1 = "SELECT COUNT(DISTINCT T.TOPIC_ID) AS PAGECOUNT "

			set rsCount = my_Conn.Execute(strSql1 & strSql2 & strSql3)
			iPageTotal = rsCount(0).value
			rsCount.close
			set rsCount = nothing

			if iPageTotal > 0 then
				inttotaltopics = iPageTotal
				maxpages = (iPageTotal \ strPageSize )
				if iPageTotal mod strPageSize <> 0 then
					maxpages = maxpages + 1
				end if
				if iPageTotal < (strPageSize + 1) then
					intGetRows = iPageTotal
				elseif (mypage * strPageSize) > iPageTotal then
					intGetRows = strPageSize - ((mypage * strPageSize) - iPageTotal)
				else
					intGetRows = strPageSize
				end if
			else
				iPageTotal = 0
				inttotaltopics = iPageTotal
				maxpages = 0
			end if 

			if iPageTotal > 0 then
				set rs = Server.CreateObject("ADODB.Recordset")
				rs.open strSql & strSql2 & strSql3 & strSql4 & strSql5, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
					arrTopicData = rs.GetRows(intGetRows)
					iTopicCount = UBound(arrTopicData, 2)
				rs.close
				set rs = nothing
			else
				iTopicCount = ""
			end if
 
		else 'end MySql specific code

			set rs = Server.CreateObject("ADODB.Recordset")
			rs.cachesize = strPageSize

			rs.open strSql & strSql2 & strSql3 & strSql4, my_Conn, adOpenStatic
				if not rs.EOF then
					rs.movefirst
					rs.pagesize = strPageSize
					inttotaltopics = cLng(rs.recordcount)
					rs.absolutepage = mypage '**
					maxpages = cLng(rs.pagecount)
					arrTopicData = rs.GetRows(strPageSize)
					iTopicCount = UBound(arrTopicData, 2)
				else
					iTopicCount = ""
					inttotaltopics = 0
				end if
			rs.Close
			set rs = nothing
		end if

		if strModeration = "1" and mLev > 2 then
			UnModeratedPosts = CheckForUnmoderatedPosts("BOARD", 0, 0, 0)
			UnModeratedFPosts = 0
		end if

		Response.Write	"      <table border=""0"" width=""100%"" align=""center"">" & vbNewline & _
				"        <tr>" & vbNewline & _
				"          <td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
				"          " & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & "&nbsp;<a href=""default.asp"">All Forums</a><br />" & vbNewline
		Response.Write	"          " & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & "&nbsp;<a href=""search.asp"">Search Form</a><br />" & vbNewLine
		if Request.Form("Search") <> "" then
			Response.Write	"          " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpenTopic,"","align=""absmiddle""") & "&nbsp;Search Results for: " & chkString(Request.Form("Search"),"display")
		elseif Request.QueryString("MEMBER_ID") <> "" then
			Response.Write	"          " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpenTopic,"","align=""absmiddle""") & "&nbsp;Search Results for: All non-archived Topics that contain posts by " & getMemberName(cLng(Request.QueryString("MEMBER_ID")))
		end if
		Response.Write	"</font></td>" & vbNewline & _
				"        </tr>" & vbNewline
		if maxpages > 1 then
			Response.Write	"        <tr align=""right"">" & vbNewLine
			Call DropDownPaging(1)
			Response.Write	"        </tr>" & vbNewLine
		end if
		Response.Write	"      </table>" & vbNewLine

		Response.Write	"      <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
				"        <tr>" & vbNewLine & _
				"          <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
				"            <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
				"              <tr>" & vbNewLine & _
				"                <td align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>&nbsp;</font></b></td>" & vbNewLine & _
				"                <td align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Topic</font></b></td>" & vbNewLine & _
				"                <td align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Author</font></b></td>" & vbNewLine & _
				"                <td align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Replies</font></b></td>" & vbNewLine & _
				"                <td align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Read</font></b></td>" & vbNewLine & _
				"                <td align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Last Post</font></b></td>" & vbNewLine & _
				"              </tr>" & vbNewLine
		if iTopicCount = "" then '## No Search Results
			Response.Write	"              <tr>" & vbNewLine & _
					"                <td bgcolor=""" & strForumCellColor & """ colspan=""6""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>No Matches Found</b></font></td>" & vbNewLine & _
					"              </tr>" & vbNewLine
		else 
			cCAT_STATUS = 0
			cCAT_SUBSCRIPTION = 1
			cCAT_NAME = 2
			fFORUM_ID = 5
			fF_SUBJECT = 6
			fCAT_ID = 7
			fF_SUBSCRIPTION = 8
			fF_STATUS = 9
			tTOPIC_ID = 10
			tT_AUTHOR = 11
			tT_SUBJECT = 12
			tT_STATUS = 13
			tT_LAST_POST = 14
			tT_LAST_POST_AUTHOR = 15
			tT_LAST_POST_REPLY_ID = 16
			tT_REPLIES = 17
			tT_UREPLIES = 18
			tT_VIEW_COUNT = 19
			mMEMBER_ID = 20
			mM_NAME = 21
			tLAST_POST_AUTHOR_NAME = 22
			fF_PRIVATEFORUMS = 23
			fF_PASSWORD_NEW = 24

			currForum = 0 
			currTopic = 0
			dim Cat_Status
			dim Cat_Subscription
			dim Forum_Status
			dim Forum_Subscription
			dim mdisplayed
			mdisplayed = 0
			rec = 1

			for iTopic = 0 to iTopicCount
				if (rec = strPageSize + 1) then exit for

				Cat_Status = arrTopicData(cCAT_STATUS, iTopic)
				Cat_Subscription = arrTopicData(cCAT_SUBSCRIPTION, iTopic)
				Cat_Name = arrTopicData(cCAT_NAME, iTopic)
				Forum_ID = arrTopicData(fFORUM_ID, iTopic)
				Forum_Subject = arrTopicData(fF_SUBJECT, iTopic)
				Forum_Cat_ID = arrTopicData(fCAT_ID, iTopic)
				Forum_Subscription = arrTopicData(fF_SUBSCRIPTION, iTopic)
				Forum_Status = arrTopicData(fF_STATUS, iTopic)
				Topic_ID = arrTopicData(tTOPIC_ID, iTopic)
				Topic_Author = arrTopicData(tT_AUTHOR, iTopic)
				Topic_Subject = arrTopicData(tT_SUBJECT, iTopic)
				Topic_Status = arrTopicData(tT_STATUS, iTopic)
				Topic_LastPost = arrTopicData(tT_LAST_POST, iTopic)
				Topic_LastPostAuthor = arrTopicData(tT_LAST_POST_AUTHOR, iTopic)
				Topic_LastPostReplyID = arrTopicData(tT_LAST_POST_REPLY_ID, iTopic)
				Topic_Replies = arrTopicData(tT_REPLIES, iTopic)
				Topic_UReplies = arrTopicData(tT_UREPLIES, iTopic)
				Topic_ViewCount = arrTopicData(tT_VIEW_COUNT, iTopic)
				Topic_MemberID = arrTopicData(mMEMBER_ID, iTopic)
				Topic_MemberName = arrTopicData(mM_NAME, iTopic)
				Topic_LastPostAuthorName = arrTopicData(tLAST_POST_AUTHOR_NAME, iTopic)
				Forum_PrivateForums = arrTopicData(fF_PRIVATEFORUMS, iTopic)
				Forum_FPasswordNew = arrTopicData(fF_PASSWORD_NEW, iTopic)

				if mLev = 4 then
					AdminAllowed = 1
				else
				    	AdminAllowed = 0
				end if
				if mLev = 4 then
					ModerateAllowed = "Y"
				elseif mLev = 3 and ModOfForums <> "" then
					if (strAuthType = "nt") then
						if (chkForumModerator(Forum_ID, Session(strCookieURL & "username")) = "1") then ModerateAllowed = "Y" else ModerateAllowed = "N"
					else 
						if (instr("," & ModOfForums & "," ,"," & Forum_ID & ",") > 0) then ModerateAllowed = "Y" else ModerateAllowed = "N"
					end if
				else
					ModerateAllowed = "N"
				end if

				if ModerateAllowed = "Y" and Topic_UReplies > 0 then
					Topic_Replies = Topic_Replies + Topic_UReplies
				end if
				if (currForum <> Forum_ID) and (currTopic <> Topic_ID) then 
					Response.Write	"              <tr>" & vbNewLine & _
							"                <td height=""20"" colspan=""6"" bgcolor=""" & strCategoryCellColor & """ valign=""middle""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><a href=""default.asp?CAT_ID=" & Forum_Cat_ID & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>" & ChkString(Cat_Name,"display") & "</b></font></a>&nbsp;/&nbsp;<a href=""forum.asp?FORUM_ID=" & Forum_ID & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>" & ChkString(Forum_Subject,"display") & "</b></font></a></font></td>" & vbNewline & _
							"              </tr>" & vbNewLine
					currForum = Forum_ID
				end if 
				if currTopic <> Topic_ID then
					Response.Write	"              <tr>" & vbNewline
					if Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0 then 
						' DEM --> Added if statement to display topic status properly
						if Topic_Status = 2 then
							UnApprovedFound = "Y"
							Response.Write	"                <td bgcolor=""" & strForumCellColor & """ align=""center""><a href=""topic.asp?TOPIC_ID=" & Topic_ID & SearchLink & """>" & getCurrentIcon(strIconFolderUnmoderated,"Topic UnModerated","hspace=""0""") & "</a></td>" & vbNewline
						elseif Topic_Status = 3 then
							HeldFound = "Y"
							Response.Write	"                <td bgcolor=""" & strForumCellColor & """ align=""center""><a href=""topic.asp?TOPIC_ID=" & Topic_ID & SearchLink & """>" & getCurrentIcon(strIconFolderHold,"Topic Held","hspace=""0""") & "</a></td>" & vbNewline
						else
							Response.Write	"                <td bgcolor=""" & strForumCellColor & """ align=""center""><a href=""topic.asp?TOPIC_ID=" & Topic_ID & SearchLink & """>" & ChkIsNew(Topic_LastPost) & "</a></td>" & vbNewline
						end if
					else 
						if Cat_Status = 0 then 
							strAltText = "Category Locked"
						elseif Forum_Status = 0 then 
							strAltText = "Forum Locked"
						else
							strAltText = "Topic Locked"
						end if 
						Response.Write	"                <td bgcolor=""" & strForumCellColor & """ align=""center""><a href=""topic.asp?TOPIC_ID=" & Topic_ID & SearchLink & """>" & getCurrentIcon(strIconFolderLocked,strAltText,"hspace=""0""") & "</a></td>" & vbNewline
					end if
					Response.Write	"                <td bgcolor=""" & strForumCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>"
					Response.Write	"<span class=""spnMessageText""><a href=""topic.asp?TOPIC_ID=" & Topic_ID & SearchLink & """>" & ChkString(left(Topic_Subject, 50),"display") & "</a></span>&nbsp;</font>" & vbNewLine
					if strShowPaging = "1" then
						TopicPaging()
					end if
					Response.Write	"                </td>" & vbNewLine & _
							"                <td bgcolor=""" & strForumCellColor & """ valign=""middle"" align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><span class=""spnMessageText"">" & profileLink(chkString(Topic_MemberName,"display"),Topic_MemberID) & "</span></font></td>" & vbNewLine & _
							"                <td bgcolor=""" & strForumCellColor & """ valign=""middle"" align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & Topic_Replies & "</font></td>" & vbNewLine & _
							"                <td bgcolor=""" & strForumCellColor & """ valign=""middle"" align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & Topic_ViewCount & "</font></td>" & vbNewLine
					if IsNull(Topic_LastPostAuthor) then
						strLastAuthor = ""
					else
						strLastAuthor = "<br />by: <span class=""spnMessageText"">" & profileLink(Topic_LastPostAuthorName,Topic_LastPostAuthor) & "</span>"
						if (strJumpLastPost = "1" and ArchiveView = "") then strLastAuthor = strLastAuthor & "&nbsp;" & DoLastPostLink
					end if
					Response.Write	"                <td bgcolor=""" & strForumCellColor & """ valign=""middle"" align=""center"" nowrap><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strFooterFontSize & """><b>" & ChkDate(Topic_LastPost, "</b>&nbsp" ,true) & strLastAuthor & "</font></td>" & vbNewLine
					Response.Write	"              </tr>" & vbNewLine
					currTopic = Topic_ID
					rec = rec + 1 
				end if 
				mdisplayed = mdisplayed + 1
			next
			if mdisplayed = 0 then
				Response.Write	"              <tr>" & vbNewLine & _
						"                <td bgcolor=""" & strForumCellColor & """ colspan=""6""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>No Matches Found</b></font></td>" & vbNewLine
				if (mlev > 0) or (lcase(strNoCookies) = "1") then
					Response.Write	"                <td align=""center"" bgcolor=""" & strForumCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>&nbsp;</font></b></td>" & vbNewLine
				end if
				Response.Write	"              </tr>" & vbNewLine
			end if
		end if 
		Response.Write	"            </table>" & vbNewLine & _
				"          </td>" & vbNewLine & _
				"        </tr>" & vbNewLine
		Response.Write	"      </table>" & vbNewLine

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -