Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 New Category Level Searching function
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

polpot
Starting Member

11 Posts

Posted - 04 April 2003 :  16:38:11  Show Profile
Hi folks,

I wonder if we could develop a new fast search function together, using all the mods available. How about that?

I have upgraded my category search level scripts in search.asp and also added a line in inc_header.asp to facilitate reading the users position in the forum when he tries to search for something. Adds more user friendliness.

I supply both files so that you can copy paste them into your own forums.

/PolPot

Edited by - polpot on 04 April 2003 16:42:02

polpot
Starting Member

11 Posts

Posted - 04 April 2003 :  16:39:22  Show Profile
New version of search.asp


<%
'#################################################################################
'## search.asp
'## Snitz Forum 3.4.0.3
'##
'## 2003-03-29 Enhanced to support Category Searching
'## 2003-04-04 Adding feature that reads the users position in the forum. Optimization.
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<%
Dim HasHigherSub
Dim HeldFound, UnApprovedFound, UnModeratedPosts, UnModeratedFPosts
Dim canView
HasHigherSub = false
Dim strUseMemberDropDownBox
strUseMemberDropDownBox = 1
%>
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_func_chknew.asp" -->
<!--#INCLUDE FILE="inc_moderation.asp" -->
<!--#INCLUDE FILE="inc_subscription.asp" -->
<% 
Dim ArchiveView
Dim AdminAllowed, ModerateAllowed
Dim SearchLink : SearchLink = ""
if request("ARCHIVE") = "true" then
	strActivePrefix = strArchiveTablePrefix
	ArchiveView = "true"
	ArchiveLink = "ARCHIVE=true&"
else
	strActivePrefix = strTablePrefix
	ArchiveView = ""
	ArchiveLink = ""
end if

select case cLng(Request.Form("andor"))
	case 1 : strAndOr = " and "
	case 2 : strAndOr = " or "
	case 3 : strAndOr = "phrase"
	case else : strAndOr = " and "
end select

Response.Write	"    <script language=""JavaScript"" type=""text/javascript"">" & vbNewLine & _
		"    function ChangePage(fnum){" & vbNewLine & _
		"    	if (fnum == 1) {" & vbNewLine & _
		"    		document.PageNum1.submit();" & vbNewLine & _
		"    		}" & vbNewLine & _
		"    	else {" & vbNewLine & _
		"    		document.PageNum2.submit();" & vbNewLine & _
		"    	}" & vbNewLine & _
		"    }" & vbNewLine & _
		"    </script>" & vbNewLine

' -- Get all the high level(board, category, forum) subscriptions being held by the user
Dim strSubString, strSubArray, strBoardSubs, strCatSubs, strForumSubs, strTopicSubs
if MySubCount > 0 then
	strSubString = PullSubscriptions(0,0,0)
	strSubArray  = Split(strSubString,";")
	if uBound(strSubArray) < 0 then
		strBoardSubs = ""
		strCatSubs = ""
		strForumSubs = ""
		strTopicSubs = ""
	else
		strBoardSubs = strSubArray(0)
		strCatSubs = strSubArray(1)
		strForumSubs = strSubArray(2)
		strTopicSubs = strSubArray(3)
	end if
end if

' DEM --> Added code for topic moderation
if mlev = 3 then
	strSql = "SELECT FORUM_ID FROM " & strTablePrefix & "MODERATOR " & _
		 " WHERE MEMBER_ID = " & MemberID

	Set rsMod = Server.CreateObject("ADODB.Recordset")
	rsMod.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

	if rsMod.EOF then
		recModCount = ""
	else
		allModData = rsMod.GetRows(adGetRowsRest)
		recModCount = UBound(allModData,2)
	end if

	RsMod.close
	set RsMod = nothing

	if recModCount <> "" then
		for x = 0 to recModCount
			if x = 0 then
				ModOfForums = allModData(0,x)
			else
				ModOfForums = ModOfForums & "," & allModData(0,x)
			end if
		next
	else
		ModOfForums = ""
	end if
else
	ModOfForums = ""
end if

if strPrivateForums = "1" and mLev < 4 then
	'######## Administrators don't see this ##########
	allAllowedForums = ""

	allowSql = "SELECT FORUM_ID, F_PRIVATEFORUMS, F_PASSWORD_NEW"
	allowSql = allowSql & " FROM " & strTablePrefix & "FORUM "
	allowSql = allowSql & " WHERE F_TYPE = 0"
	if cLng(Request.Form("Category")) <> 0 then 
		allowSql = allowSql & "AND CAT_ID = " & cLng(Request.Form("Category"))
	end if
	allowSql = allowSql & " ORDER BY FORUM_ID"

	set rsAllowed = Server.CreateObject("ADODB.Recordset")
	rsAllowed.open allowSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

	if rsAllowed.EOF then
		recAllowedCount = ""
	else
		allAllowedData = rsAllowed.GetRows(adGetRowsRest)
		recAllowedCount = UBound(allAllowedData,2)
	end if

	rsAllowed.close
	set rsAllowed = nothing

	if recAllowedCount <> "" then
		fFORUM_ID = 0
		fF_PRIVATEFORUMS = 1
		fF_PASSWORD_NEW = 2

		for RowCount = 0 to recAllowedCount

			Forum_ID = allAllowedData(fFORUM_ID,RowCount)
			Forum_PrivateForums = allAllowedData(fF_PRIVATEFORUMS,RowCount)
			Forum_FPasswordNew = allAllowedData(fF_PASSWORD_NEW,RowCount)

			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 ChkDisplayForum(Forum_PrivateForums,Forum_FPasswordNew,Forum_ID,MemberID) = true then
				canView = true
				select case Forum_PrivateForums
					case 2 '## password
						select case Request.Cookies(strUniqueID & "Forum")("PRIVATE_" & Forum_Subject)
							case Forum_FPasswordNew
								canView = true
							case else
								canView = false
						end select
					case 3,7 '## Either Password or Allowed Member(already covered)/Member
						if MemberID > 0 then
							canView = true
						else
							select case Request.Cookies(strUniqueID & "Forum")("PRIVATE_" & Forum_Subject)
								case Forum_FPasswordNew
									canView = true
								case else
									canView = false
							end select
						end if
					case else
						canView = true
				end select
				if canView then
					if allAllowedForums = "" then
						allAllowedForums = Forum_ID
					else
						'############## Introduce spaces in the string so that rows can be wrapped ##############
						allAllowedForums = allAllowedForums & ", " & Forum_ID
					end if
				end if
			end if
		next
	end if
	if allAllowedForums = "" then allAllowedForums = 0
	'################ Change to a smaller font ####################
	Response.Write	"<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & allAllowedForums
	Response.Write	"</font>" & vbNewLine
end if

'if Request.QueryString("mode") = "DoIt" then
'	if Request.Form("Category") <> "" then
'		Response.Write "<p> This sucks! </p>" & vbNewLine
'		end if
'end if

if Request.QueryString("mode") = "DoIt" then
	if Request.Form("Search") <> "" or Request.QueryString("MEMBER_ID") <> "" then
		if Request.Form("Search") <> "" then
			keywords = split(Request.Form("Search"), " ")
			keycnt = ubound(keywords)
			for i = 0 to keycnt
				if i = 0 then
					strKeywords = keywords(i)
				else
					strKeywords = strKeywords & "," & keywords(i)
				end if
			next
			if strAndOr = "phrase" then strKeyWords = replace(strKeyWords,",","+")
			SearchLink = "&SearchTerms=" & chkString(strKeyWords,"search")
		end if

		'## Forum_SQL - Find all records with the search criteria in them
		strSql = "SELECT DISTINCT C.CAT_STATUS, C.CAT_SUBSCRIPTION, C.CAT_NAME, C.CAT_ORDER"
		strSql = strSql & ", F.F_ORDER, F.FORUM_ID, F.F_SUBJECT, F.CAT_ID"
		strSql = strSql & ", F.F_SUBSCRIPTION, F.F_STATUS"
		strSql = strSql & ", T.TOPIC_ID, T.T_AUTHOR, T.T_SUBJECT, T.T_STATUS, T.T_LAST_POST"
		strSql = strSql & ", T.T_LAST_POST_AUTHOR, T.T_LAST_POST_REPLY_ID, T.T_REPLIES, T.T_UREPLIES, T.T_VIEW_COUNT"
		strSql = strSql & ", M.MEMBER_ID, M.M_NAME, MEMBERS_1.M_NAME AS LAST_POST_AUTHOR_NAME"
		strSql = strSql & ", F.F_PRIVATEFORUMS, F.F_PASSWORD_NEW"

		strSql2 = " FROM ((((" & strTablePrefix & "FORUM F LEFT JOIN " & strActivePrefix & "TOPICS T"
		strSql2 = strSql2 & " ON F.FORUM_ID = T.FORUM_ID) LEFT JOIN " & strActivePrefix & "REPLY R"
		strSql2 = strSql2 & " ON T.TOPIC_ID = R.TOPIC_ID) LEFT JOIN " & strMemberTablePrefix & "MEMBERS M"
		strSql2 = strSql2 & " ON T.T_AUTHOR = M.MEMBER_ID) LEFT JOIN " & strTablePrefix & "CATEGORY C"
		strSql2 = strSql2 & " ON T.CAT_ID = C.CAT_ID) LEFT JOIN " & strMemberTablePrefix & "MEMBERS MEMBERS_1"
		strSql2 = strSql2 & " ON T.T_LAST_POST_AUTHOR = MEMBERS_1.MEMBER_ID"
		if Request.Form("Search") <> "" then
			strSql3 = " WHERE ("
			if Request.Form("SearchMessage") = 1 then
				if strAndOr = "phrase" then
					strSql3 = strSql3 & " (T.T_SUBJECT LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%') "
				else
					For Each word in keywords
						SearchWord = ChkString(word, "SQLString")
						strSql3 = strSql3 & " (T.T_SUBJECT LIKE '%" & SearchWord & "%') "
						if cnt < keycnt then strSql3 = strSql3 & strAndOr
						cnt = cnt + 1
					next
				end if
			else
				if strAndOr = "phrase" then
					strSql3 = strSql3 & " (R.R_MESSAGE LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'"
					strSql3 = strSql3 & " OR T.T_SUBJECT LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'"
					strSql3 = strSql3 & " OR T.T_MESSAGE LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%') "
				else
					For Each word in keywords
						SearchWord = ChkString(word, "SQLString")
						strSql3 = strSql3 & " (R.R_MESSAGE LIKE '%" & SearchWord & "%'"
						strSql3 = strSql3 & " OR T.T_SUBJECT LIKE '%" & SearchWord & "%'"
						strSql3 = strSql3 & " OR T.T_MESSAGE LIKE '%" & SearchWord & "%') "
						if cnt < keycnt then strSql3 = strSql3 & strAndOr
						cnt = cnt + 1
					next
				end if
			end if
			strSql3 = strSql3 & " ) "
		else
			strSql3 = " WHERE (0 = 0)"
		end if
		' DEM --> Added code to ignore unmoderated/held posts...
		if mlev <> 4 then 
			strSql3 = strSql3 & " AND ((T.T_AUTHOR <> " & MemberID
			strSql3 = strSql3 & " AND T.T_STATUS < 2)"  ' Ignore unapproved/held posts
			strSql3 = strSql3 & " OR T.T_AUTHOR = " & MemberID & ")"
		end if
		' DEM --> End of Code added to ignore unmoderated/held posts....
		cnt = 0
		'######## If category is selected, filter the result ############
		if cLng(Request.Form("Category")) <> 0 then			
			strSql3 = strSql3 & " AND C.CAT_ID = " & cLng(Request.Form("Category")) & " "
		end if

		if cLng(Request.Form("Forum")) <> 0 then
			strSql3 = strSql3 & " AND F.FORUM_ID = " & cLng(Request.Form("Forum")) & " "
		end if
		if cLng(Request.Form("SearchDate")) <> 0 then
			dt = cLng(Request.Form("SearchDate"))
			strSql3 = strSql3 & " AND (T.T_DATE > '" & DateToStr(dateadd("d", -dt, strForumTimeAdjust)) & "')"
		end if
		if strUseMemberDropDownBox = 0 then
			intSearchMember = getMemberID(chkString(Request.Form("SearchMember"),"SQLString"))
			if intSearchMember <> 0 then
				strSql3 = strSql3 & " AND (M.MEMBER_ID = " & cLng(intSearchMember) & " "
				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""") & " <a href=""default.asp"">All Forums</a><br />" & vbNewline
		Response.Write	"          " & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <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""") & " 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""") & " 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 & """> </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>Ooops! 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 & """> </font></b></td>" & vbNewLine
			end if
			Response.Write	"              </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> / <a href=""forum.asp?FORUM_ID=" & Forum_ID & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>" & ChkString(Forum_Subject,"display") & "</b></font></a></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> </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 & " " & 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> " ,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 & """> </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

		if maxpages > 1 then
			Response.Write	"      <table border=""0"" width=""100%"" align=""center"">" & vbNewline & _
					"        <tr>" & vbNewLine
			Call DropDownPaging(2)
			Response.Write	"        </tr>" & vbNewLine & _
					"      </table>" & vbNewLine
		end if

		Response.Write	"      <table width=""100%"" align=""center"" border=""0"">" & vbNewLine & _
				"        <tr>" & vbNewLine & _
				"          <td align=""left"" valign=""top"">" & vbNewLine & _
				"            <table>" & vbNewLine & _
				"              <tr>" & vbNewLine & _
				"                <td nowrap>" & vbNewLine & _
				"                <p><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & vbNewLine & _
				"                " & getCurrentIcon(strIconFolderNew,"New Posts","align=""absmiddle""") & " New posts since last logon.<br />" & vbNewLine & _
				"                " & getCurrentIcon(strIconFolder,"Old Posts","align=""absmiddle""") & " Old Posts."
		if lcase(strHotTopic) = "1" then Response.Write	(" (" & getCurrentIcon(strIconFolderHot,"Hot Topic","align=""absmiddle""") & " " & intHotTopicNum & " replies or more.)<br />" & vbNewLine)
		Response.Write	"                " & getCurrentIcon(strIconFolderLocked,"Locked Topic","align=""absmiddle""") & " Locked topic.<br />" & vbNewLine
		' DEM --> Start of Code added for moderation
		if HeldFound = "Y" then
			Response.Write "                " & getCurrentIcon(strIconFolderHold,"Held Topic","align=""absmiddle""") & " Held Topic.<br />" & vbNewline
		end if
		if UnApprovedFound = "Y" then
			Response.Write "                " & getCurrentIcon(strIconFolderUnmoderated,"UnModerated Topic","align=""absmiddle""") & " UnModerated Topic.<br />" & vbNewline
		end if
		' DEM --> End of Code added for moderation
		Response.Write	"                </font></p></td>" & vbNewLine & _
				"              </tr>" & vbNewLine & _
				"            </table>" & vbNewLine & _
				"          </td>" & vbNewLine & _
				"        </tr>" & vbNewLine & _
				"      </table>" & vbNewLine

	'######## Check if Category has been changed ###########
	else
		'if cLng(Request.Form("Category")) <> 0 then
		call RefreshCategory(strRqCategoryID, strRqForumID)
		DrawTable()
	'else
	'	Response.Write	"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>You must enter keywords</p>" & vbNewLine & _
	'			"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Back To Search Page</a></p>" & vbNewLine & _
	'			"      <meta http-equiv=""Refresh"" content=""2; URL=JavaScript:history.go(-1)"">" & vbNewLine
	end if
else '################# If it is a blank search, show the whole search table with all fields, typically new search ################	
	call RequestedCategory(strRqCategoryID, strRqForumID)
	Response.Write	"      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _ 
			"		To narrow the search choose <font color=red>Category</font> first. Then choose the <font color=blue>Forum</font>" & vbNewLine & _
			"		and finally enter the <font color=green>Keyword(s)</font>.<br>Entering a <font color=green>Keyword</font> and choosing " & vbNewLine & _
			"		<font color=red>Category</font> searches the whole <font color=red>Category</font>. </p>" & vbNewLine
	DrawTable()
end if 
WriteFooter
Response.End
 
sub TopicPaging()
	mxpages = (Topic_Replies / strPageSize)
	if mxPages <> cLng(mxPages) then
		mxpages = int(mxpages) + 1
	end if
	if mxpages > 1 then
		Response.Write("                  <table border=""0"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine)
		Response.Write("                    <tr>" & vbNewLine)
		Response.Write("                      <td valign=""bottom""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & getCurrentIcon(strIconPosticon,"","") & "</font></td>" & vbNewLine)
		for counter = 1 to mxpages
			ref = "                      <td align=""right"" valign=""bottom"" bgcolor=""" & strForumCellColor  & """><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>"
			if ((mxpages > 9) and (mxpages > strPageNumberSize)) or ((counter > 9) and (mxpages < strPageNumberSize)) then
				ref = ref & " "
			end if		
			ref = ref & widenum(counter) & "<span class=""spnMessageText""><a href=""topic.asp?"
			ref = ref & ArchiveLink
            		ref = ref & "TOPIC_ID=" & Topic_ID
			ref = ref & "&whichpage=" & counter
			ref = ref & SearchLink
			ref = ref & """>" & counter & "</a></span></font></td>"
			Response.Write ref & vbNewLine
			if counter mod strPageNumberSize = 0 then
				Response.Write("                    </tr>" & vbNewLine)
				Response.Write("                    <tr>" & vbNewLine)
				Response.Write("                      <td> </td>" & vbNewLine)
			end if
		next				
	        Response.Write("                    </tr>" & vbNewLine)
	        Response.Write("                  </table>" & vbNewLine)
	end if
end sub

sub RadioButtons()
	Response.Write	"              <tr>" & vbNewLine & _
			"                <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""top""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Search For:</font></b></td>" & vbNewLine & _
			"                <td bgColor=""" & strPopUpTableColor & """ align=""left"" valign=""middle""><input type=""text"" name=""Search"" size=""40"" value=""" & Request.QueryString("Search") & """><br />" & vbNewLine & _
			"                <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
	Response.Write	"                <input type=""radio"" class=""radio"" name=""andor"" value=""3"">Match exact phrase<br />" & vbNewLine
	Response.Write	"                <input type=""radio"" class=""radio"" name=""andor"" value=""1"" checked>Search for all Words<br />" & vbNewLine & _
			"                <input type=""radio"" class=""radio"" name=""andor"" value=""2"">Match any of the words</font></td>" & vbNewLine & _
			"              </tr>" & vbNewLine
end sub


sub DropDownPaging(fnum)
	if maxpages > 1 then
		if mypage = "" then
			pge = 1
		else
			pge = mypage
		end if
		scriptname = request.servervariables("script_name")
		Response.Write	"          <form name=""PageNum" & fnum & """ action=""search.asp?" & chkString(Request.QueryString,"SQLString") & """ method=""post"">" & vbNewLine
		Response.Write	"          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
		Response.Write	"          <input name=""Search"" type=""hidden"" value=""" & trim(chkString(Request.Form("Search"),"search")) & """>" & vbNewLine
		Response.Write	"          <input name=""andor"" type=""hidden"" value=""" & cLng(Request.Form("andor")) & """>" & vbNewLine
		Response.Write	"          <input name=""Category"" type=""hidden"" value=""" & cLng(Request.Form("Category")) & """>" & vbNewLine
		Response.Write	"          <input name=""Forum"" type=""hidden"" value=""" & cLng(Request.Form("Forum")) & """>" & vbNewLine
		Response.Write	"          <input name=""SearchMessage"" type=""hidden"" value=""" & cLng(Request.Form("SearchMessage")) & """>" & vbNewLine
		if strArchiveState = "1" and ArchiveView = "true" then Response.Write("          <input name=""ARCHIVE"" type=""hidden"" value=""" & ArchiveView & """>" & vbNewLine)
		Response.Write	"          <input name=""SearchDate"" type=""hidden"" value=""" & cLng(Request.Form("SearchDate")) & """>" & vbNewLine
                if strUseMemberDropDownBox = 0 then
			Response.Write	"          <input name=""SearchMember"" type=""hidden"" value=""" & chkString(Request.Form("SearchMember"),"display") & """>" & vbNewLine
		else
			Response.Write	"          <input name=""SearchMember"" type=""hidden"" value=""" & cLng(Request.Form("SearchMember")) & """>" & vbNewLine
		end if
		if fnum = 1 then
			Response.Write("          <b>Page: </b><select name=""whichpage"" size=""1"" onchange=""ChangePage(" & fnum & ");"">" & vbNewLine)
		else
			Response.Write("          <b>There are " & maxpages & " Pages of Search Results: </b><select name=""whichpage"" size=""1"" onchange=""ChangePage(" & fnum & ");"">" & vbNewLine)
		end if
		for counter = 1 to maxpages
			if counter <> cLng(pge) then   
				Response.Write "          	<option value=""" & counter &  """>" & counter & "</option>" & vbNewLine
			else
				Response.Write "          	<option selected value=""" & counter &  """>" & counter & "</option>" & vbNewLine
			end if
		next
		if fnum = 1 then
			Response.Write("          </select><b> of " & maxPages & "</b>" & vbNewLine)
		else
			Response.Write("          </select>" & vbNewLine)
		end if
		Response.Write("          </font></td>" & vbNewLine)
		Response.Write("          </form>" & vbNewLine)
	end if
end sub

sub RefreshCategory(strRqCategoryID, strRqForumID)
	'################### Refresh content based on the new category chosen #####################
	strRqCategoryID = cLng(Request.Form("Category"))
	strRqForumID = cLng(Request.Form("Forum"))
end sub


sub RequestedCategory(strRqCategoryID, strRqForumID)
	'################### Check if user was in a category prior to do a search #####################
	if cLng(Request.QueryString("CAT_ID")) <> "" and IsNumeric(Request.QueryString("CAT_ID")) = True then
		strRqCategoryID = cLng(Request.QueryString("CAT_ID"))
	end if
	'################### Check if user was in a forum prior to do a search #####################
	if cLng(Request.QueryString("FORUM_ID")) <> "" and IsNumeric(Request.QueryString("FORUM_ID")) = True then
		strRqForumID = cLng(Request.QueryString("FORUM_ID"))
		strSql = "SELECT F.CAT_ID FROM " & strTablePrefix & "FORUM F WHERE F.FORUM_ID = " & strRqForumID
		
		set rs = Server.CreateObject("ADODB.Recordset")
		rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

		if rs.EOF then
			recCategoryCount = ""
		else
			allCategoryData = rs.GetRows(adGetRowsRest)
			recCategoryCount = UBound(allCategoryData,1)
			cCAT_ID = 0
		end if
		
		if recCategoryCount <> "" then
			strRqCategoryID = allCategoryData(cCAT_ID , iCategory)
		end if
	end if
end sub

sub CategoryDropDownList()
	'call RequestedCategory(strRqCategoryID, strRqForumID)

	'################### Create the Category drop down menu #################
	Response.Write	"              <tr>" & vbNewLine & _
				"                <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Search Category:</font></b></td>" & vbNewLine & _
				"                <td bgColor=""" & strPopUpTableColor & """ align=""left"" valign=""middle"">" & vbNewLine & _
				"                <select name=""Category"" size=""1"" onchange=submit()>" & vbNewLine
	Response.Write	"                <option value=""0"">All Categories</option>" & vbNewLine 
	'########### Category_SQL ############
	'if cLng(Request.Form("Category")) <> 0 then
	'	strSql = "SELECT C.CAT_ID,C.CAT_NAME FROM " & strTablePrefix & "CATEGORY C WHERE C.CAT_ID = " & cLng(Request.Form("Category"))
	'else
	'	strSql = "SELECT C.CAT_ID, C.CAT_NAME FROM " & strTablePrefix & "CATEGORY C"
	'	strSql = strSql & " ORDER BY C.CAT_ORDER, C.CAT_NAME"
	'end if
	
	strSql = "SELECT C.CAT_ID, C.CAT_NAME FROM " & strTablePrefix & "CATEGORY C"
	strSql = strSql & " ORDER BY C.CAT_ORDER, C.CAT_NAME"
	
	set rs = Server.CreateObject("ADODB.Recordset")
	rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

	if rs.EOF then
		recCategoryCount = ""
	else
		allCategoryData = rs.GetRows(adGetRowsRest)
		recCategoryCount = UBound(allCategoryData,2)
		cCAT_ID = 0
		cCAT_NAME = 1
	end if

	rs.close
	set rs = nothing

	if recCategoryCount <> "" then
		for iCategory = 0 to recCategoryCount
			ForumCategoryID = allCategoryData(cCAT_ID , iCategory)
			CategoryName = allCategoryData(cCAT_NAME , iCategory)
			Response.Write	"                	<option value=""" & ForumCategoryID & """"
			if strRqCategoryID = ForumCategoryID then
				Response.Write(" selected")
			end if
			Response.Write	">" & ChkString(left(CategoryName, 50),"display") & "</option>" & vbNewline
		next
	end if
	Response.Write	"                </select>" & vbNewLine
	'if cLng(Request.Form("Category")) <> 0 then
	'	Response.Write	"      <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Change Category</a>" & vbNewLine
	'end if
	Response.Write	"                </td>" & vbNewLine & _			
			"              </tr>" & vbNewLine
end sub

sub ForumDropDownList()
	'call RequestedCategory(strRqCategoryID, strRqForumID)
	'if strPrivateForums <> "" then
	'	Response.Write "<tr>" & strRqCategoryID & ":" & cLng(Request.Form("Category")) & ":" & Request.Form("Category") & "</tr>" & vbNewLine
	'end if

	Response.Write	"              <tr>" & vbNewLine & _
			"                <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Search Forum:</font></b></td>" & vbNewLine & _
			"                <td bgColor=""" & strPopUpTableColor & """ align=""left"" valign=""middle"">" & vbNewLine & _
			"                <select name=""Forum"" size=""1"">" & vbNewLine & _
			"                	<option value=""0"">All Forums</option>" & vbNewLine	
	'## Forum_SQL
	'###### Clean Search: All Forums #############
	if strRqCategoryID = "0" then
		strSql = "SELECT F.FORUM_ID, F.F_SUBJECT FROM " & strTablePrefix & "FORUM F, " & strTablePrefix & "CATEGORY C"
		strSql = strSql & " WHERE F_TYPE = " & 0
		if strPrivateForums = "1" and allAllowedForums <> "" and mLev < 4 then
			strSql = strSql & " AND F.FORUM_ID IN (" & allAllowedForums & ")"
		end if
		strSql = strSql & " AND C.CAT_ID = F.CAT_ID"
	'###### Filter Forums depending on Category selected ########
	else     '######## if strRqCategoryID <> "0" then
		strSql = "SELECT F.FORUM_ID, F.F_SUBJECT FROM " & strTablePrefix & "FORUM F, " & strTablePrefix & "CATEGORY C"
		strSql = strSql & " WHERE F_TYPE = " & 0
		if strPrivateForums = "1" and allAllowedForums <> "" and mLev < 4 then
			strSql = strSql & " AND F.FORUM_ID IN (" & allAllowedForums & ")"
		end if
		strSql = strSql & " AND C.CAT_ID = F.CAT_ID"
		strSql = strSql & " AND F.CAT_ID = " & strRqCategoryID & " "
	'###### Filter Forums depending on Forum selected ########
	'elseif strRqForumID <> "0" then
	'	strSql = "SELECT F.FORUM_ID, F.F_SUBJECT FROM " & strTablePrefix & "FORUM F, " & strTablePrefix & "CATEGORY C"
	'	strSql = strSql & " WHERE F_TYPE = " & 0
	'	if strPrivateForums = "1" and allAllowedForums <> "" and mLev < 4 then
	'		strSql = strSql & " AND F.FORUM_ID IN (" & allAllowedForums & ")"
	'	end if
	'	strSql = strSql & " AND C.CAT_ID = F.CAT_ID"
	'	strSql = strSql & " AND C.CAT_ID = " & strRqCategoryID & " "
	'else
	end if
	
	'strSql = "SELECT F.FORUM_ID, F.F_SUBJECT FROM " & strTablePrefix & "FORUM F, " & strTablePrefix & "CATEGORY C"
	'strSql = strSql & " WHERE F_TYPE = " & 0
	'if strPrivateForums = "1" and allAllowedForums <> "" and mLev < 4 then
	'	strSql = strSql & " AND F.FORUM_ID IN (" & allAllowedForums & ")"
	'end if
	'strSql = strSql & " AND C.CAT_ID = F.CAT_ID"

	'################# Check if Category affects the Forum options ################
	'if cLng(Request.Form("Category")) <> "" then			
	'	strSql = strSql & " AND C.CAT_ID = " & cLng(Request.Form("Category")) & " "
	
	'################# Check if user was in a category when he pressed search #############
	'elseif strRqCategoryID <> "" then
	'	strSql = strSql & " AND F.CAT_ID = " & strRqCategoryID & " "
	'end if

	strSql = strSql & " ORDER BY C.CAT_ORDER, C.CAT_NAME, F.F_ORDER, F.F_SUBJECT"

	set rs = Server.CreateObject("ADODB.Recordset")
	rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

	if rs.EOF then
		recForumCount = ""
	else
		allForumData = rs.GetRows(adGetRowsRest)
		recForumCount = UBound(allForumData,2)
		fFORUM_ID = 0
		fF_SUBJECT = 1
	end if

	rs.close
	set rs = nothing

	if recForumCount <> "" then
		for iForum = 0 to recForumCount
			ForumForumID = allForumData(fFORUM_ID, iForum)
			ForumSubject = allForumData(fF_SUBJECT, iForum)
			Response.Write	"                	<option value=""" & ForumForumID & """"
			if strRqForumID = ForumForumID then Response.Write(" selected")
			Response.Write	">" & ChkString(left(ForumSubject, 50),"display") & "</option>" & vbNewline
		next
	end if
	Response.Write	"                </select>" & vbNewLine & _
			"                </td>" & vbNewLine & _
			"              </tr>" & vbNewLine
end sub


sub SearchMessage()
	Response.Write	"              <tr>" & vbNewLine & _
			"                <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Search In:</font></b></td>" & vbNewLine & _
			"                <td bgColor=""" & strPopUpTableColor & """ align=""left"" valign=""middle"">" & vbNewLine & _
			"                <select name=""SearchMessage"">" & vbNewLine & _
			"                	<option value=""0"">Entire Message</option>" & vbNewLine & _
			"                	<option value=""1"">Subject Only</option>" & vbNewLine & _
			"                </select>" & vbNewLine
	if strArchiveState = "1" then Response.Write("                  <input type=""checkbox"" name=""ARCHIVE"" value=""true""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Archived Posts</font>" & vbNewLine)
	Response.Write	"                </td>" & vbNewLine & _
			"              </tr>" & vbNewLine
end sub

sub SearchDate()
	Response.Write	"              <tr>" & vbNewLine & _
			"                <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Search By Date:</font></b></td>" & vbNewLine & _
			"                <td bgColor=""" & strPopUpTableColor & """ align=""left"" valign=""middle"">" & vbNewLine & _
			"                <select name=""SearchDate"">" & vbNewLine & _
			"                	<option value=""0"">Any Date</option>" & vbNewLine & _
			"                	<option value=""1"">Since Yesterday</option>" & vbNewLine & _
			"                	<option value=""2"">Since 2 Days Ago</option>" & vbNewLine & _
			"                	<option value=""5"">Since 5 Days Ago</option>" & vbNewLine & _
			"                	<option value=""7"">Since 7 Days Ago</option>" & vbNewLine & _
			"                	<option value=""14"">Since 14 Days Ago</option>" & vbNewLine & _
			"                	<option value=""30"">Since 30 Days Ago</option>" & vbNewLine & _
			"                	<option value=""60"">Since 60 Days Ago</option>" & vbNewLine & _
			"                	<option value=""120"">Since 120 Days Ago</option>" & vbNewLine & _
			"                	<option value=""365"">In the Last Year</option>" & vbNewLine & _
			"                </select>" & vbNewLine & _
			"                </td>" & vbNewLine & _
			"              </tr>" & vbNewLine
end sub

sub SearchMember()
	Response.Write	"              <tr>" & vbNewLine & _
			"                <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Search By Member:</font></b></td>" & vbNewLine
	if strUseMemberDropDownBox = 0 then
		Response.Write	"                <td bgColor=""" & strPopUpTableColor & """ align=""left"" valign=""middle""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""SearchMember"" value="""" size=""25""></font></td>" & vbNewLine
	else
		Response.Write	"                <td bgColor=""" & strPopUpTableColor & """ align=""left"" valign=""middle"">" & vbNewLine & _
				"                <select name=""SearchMember"">" & vbNewLine & _
				"                	<option value=""0"">All Members</option>" & vbNewLine
		'## Forum_SQL
		strSql = "SELECT MEMBER_ID, M_NAME "
		strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"
		strSql = strSql & " WHERE M_STATUS = " & 1
		strSql = strSql & " ORDER BY M_NAME ASC;"
	
		set rs = Server.CreateObject("ADODB.Recordset")
		rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

		if rs.EOF then
			recMemberCount = ""
		else
			allMemberData = rs.GetRows(adGetRowsRest)
			recMemberCount = UBound(allMemberData,2)
			meMEMBER_ID = 0
			meM_NAME = 1
		end if

		rs.close
		set rs = nothing

		if recMemberCount <> "" then
			for iMember = 0 to recMemberCount
				MembersMemberID = allMemberData(meMEMBER_ID, iMember)
				MembersMemberName = allMemberData(meM_NAME, iMember)
				Response.Write	"                	<option value=""" & MembersMemberID & """>" & ChkString(MembersMemberName,"display") & "</option>" & vbNewline
			next
		end if
		Response.Write	"                </select>" & vbNewLine & _
				"                </td>" & vbNewLine
	end if
	Response.Write	"              </tr>" & vbNewLine
end sub

sub DrawTable()
	'strRqForumID = cLng(Request.QueryString("FORUM_ID"))
	'strRqCategoryID = cLng(Request.QueryString("CAT_ID"))
	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""") & " <a href=""default.asp"">All Forums</a><br />" & vbNewline & _
			"          " & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " Search Form</font></td>" & vbNewline & _
			"        </tr>" & vbNewline & _
			"      </table><br />" & vbNewLine

	Response.Write	"      <form action=""search.asp?mode=DoIt"" name=""SearchForm"" id=""SearchForm"" method=""post"">" & vbNewLine & _
			"      <table border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
			"        <tr>" & vbNewLine & _
			"          <td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
			"            <table border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine
	CategoryDropDownList()
	ForumDropDownList()
	RadioButtons()
	SearchMessage()
	SearchDate()
	SearchMember()
	Response.Write	"              <tr>" & vbNewLine & _
			"                <td bgColor=""" & strPopUpTableColor & """ align=""center"" valign=""middle"" colspan=""2""><input type=""submit"" value=""Yabba Dabba Doo!""></td>" & vbNewLine & _
			"              </tr>" & vbNewLine & _
			"            </table>" & vbNewLine & _
			"          </td>" & vbNewLine & _
			"        </tr>" & vbNewLine & _
			"      </table>" & vbNewLine & _
			"    </form>" & vbNewLine
end sub

Function DoLastPostLink()
	if Topic_Replies < 1 or Topic_LastPostReplyID = 0 then
		DoLastPostLink = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & """>" & getCurrentIcon(strIconLastpost,"Jump to Last Post","align=""absmiddle""") & "</a>"
	elseif Topic_LastPostReplyID <> 0 then
		PageLink = "whichpage=-1&"
		AnchorLink = "&REPLY_ID="
		DoLastPostLink = "<a href=""topic.asp?" & ArchiveLink & PageLink & "TOPIC_ID=" & Topic_ID & AnchorLink & Topic_LastPostReplyID & """>" & getCurrentIcon(strIconLastpost,"Jump to Last Post","align=""absmiddle""") & "</a>"
	else
		DoLastPostLink = ""
	end if
end function
%>[/red]
Go to Top of Page

polpot
Starting Member

11 Posts

Posted - 04 April 2003 :  16:41:00  Show Profile
Modified inc_header.asp. Changes are in red.




<%
'#################################################################################
'##
'## inc_header.asp
'##
'## 2003-04-04 Search Category support added
'##
'##
'#################################################################################
%>
<!--#INCLUDE FILE="inc_func_common.asp" -->
<%

if strShowTimer = "1" then
	'### start of timer code
	Dim StopWatch(19) 

	sub StartTimer(x)
		StopWatch(x) = timer
	end sub

	function StopTimer(x)
		EndTime = Timer

		'Watch for the midnight wraparound...
		if EndTime < StopWatch(x) then
			EndTime = EndTime + (86400)
		end if

		StopTimer = EndTime - StopWatch(x)
	end function

	StartTimer 1

	'### end of timer code
end if

strArchiveTablePrefix = strTablePrefix & "A_"
strScriptName = request.servervariables("script_name")

if Application(strCookieURL & "down") then 
	if not Instr(strScriptName,"admin_") > 0 then
		Response.redirect("down.asp")
	end if
end if

if strPageBGImageURL = "" then
	strTmpPageBGImageURL = ""
elseif Instr(strPageBGImageURL,"/") > 0 or Instr(strPageBGImageURL,"\") > 0 then
	strTmpPageBGImageURL = " background=""" & strPageBGImageURL & """"
else
	strTmpPageBGImageURL = " background=""" & strImageUrl & strPageBGImageURL & """"
end if

If strDBType = "" then 
	Response.Write	"<html>" & vbNewLine & _
			"<head>" & vbNewline & _
			"<title>" & strForumTitle & "</title>" & vbNewline


'## START - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT
Response.Write	"<meta name=""copyright"" content=""This Forum code is Copyright (C) 2000-02 Michael Anderson, Pierre Gorissen, Huw Reddick and Richard Kinser, Non-Forum Related code is Copyright (C) " & strCopyright & """>" & vbNewline 
'## END   - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT

	Response.Write	"</head>" & vbNewLine & _
			"<body" & strTmpPageBGImageURL & " bgColor=""" & strPageBGColor & """ text=""" & strDefaultFontColor & """ link=""" & strLinkColor & """ aLink=""" & strActiveLinkColor & """ vLink=""" & strVisitedLinkColor & """>" & vbNewLine & _
			"<table border=""0"" cellspacing=""0"" cellpadding=""5"" width=""50%"" height=""40%"" align=""center"">" & vbNewLine & _
			"  <tr>" & vbNewLine & _
			"    <td bgColor=""navyblue"" align=""center""><p><font face=""Verdana, Arial, Helvetica"" size=""2"">" & _
			"<b>There has been a problem...</b><br /><br />" & _
			"Your <b>strDBType</b> is not set, please edit your <b>config.asp</b><br />to reflect your database type." & _
			"</font></p></td>" & vbNewLine & _
			"  </tr>" & vbNewLine & _
			"  <tr>" & vbNewLine & _
			"    <td align=""center""><font face=""Verdana, Arial, Helvetica"" size=""2"">" & _
			"<a href=""default.asp"" target=""_top"">Click here to retry.</a></font></td>" & vbNewLine & _
			"  </tr>" & vbNewLine & _
			"</table>" & vbNewLine & _
			"</body>" & vbNewLine & _
			"</html>" & vbNewLine
	Response.End
end if

set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString

if (strAuthType = "nt") then
	call NTauthenticate()
	if (ChkAccountReg() = "1") then
		call NTUser()
	end if
end if

if strGroupCategories = "1" then
	if Request.QueryString("Group") = "" then
		if Request.Cookies(strCookieURL & "GROUP") = "" Then
			Group = 2
		else 
			Group = Request.Cookies(strCookieURL & "GROUP")
		end if
	else
		Group = cLng(Request.QueryString("Group"))
	end if
	'set default
	Session(strCookieURL & "GROUP_ICON") = "icon_group_categories.gif"
	Session(strCookieURL & "GROUP_IMAGE") = strTitleImage
	'Forum_SQL - Group exists ?
	strSql = "SELECT GROUP_ID, GROUP_NAME, GROUP_ICON, GROUP_IMAGE " 
	strSql = strSql & " FROM " & strTablePrefix & "GROUP_NAMES "
	strSql = strSql & " WHERE GROUP_ID = " & Group
	set rs2 = my_Conn.Execute (strSql)
	if rs2.EOF or rs2.BOF then
		Group = 2
		strSql = "SELECT GROUP_ID, GROUP_NAME, GROUP_ICON, GROUP_IMAGE " 
		strSql = strSql & " FROM " & strTablePrefix & "GROUP_NAMES "
		strSql = strSql & " WHERE GROUP_ID = " & Group
		set rs2 = my_Conn.Execute (strSql)
	end if	
	Session(strCookieURL & "GROUP_NAME") = rs2("GROUP_NAME")
	if instr(rs2("GROUP_ICON"), ".") then
		Session(strCookieURL & "GROUP_ICON") = rs2("GROUP_ICON")
	end if
	if instr(rs2("GROUP_IMAGE"), ".") then
		Session(strCookieURL & "GROUP_IMAGE") = rs2("GROUP_IMAGE")
	end if
	rs2.Close  
	set rs2 = nothing  
	Response.Cookies(strCookieURL & "GROUP") = Group
	Response.Cookies(strCookieURL & "GROUP").Expires =  dateAdd("d", intCookieDuration, strForumTimeAdjust)
	if Session(strCookieURL & "GROUP_IMAGE") <> "" then
		strTitleImage = Session(strCookieURL & "GROUP_IMAGE") 
	end if 
end if

strDBNTUserName = Request.Cookies(strUniqueID & "User")("Name")
strDBNTFUserName = trim(chkString(Request.Form("Name"),"SQLString"))
if strDBNTFUserName = "" then strDBNTFUserName = trim(chkString(Request.Form("User"),"SQLString"))
if strAuthType = "nt" then
	strDBNTUserName = Session(strCookieURL & "userID")
	strDBNTFUserName = Session(strCookieURL & "userID")
end if

if strRequireReg = "1" and strDBNTUserName = "" then
	if not Instr(strScriptName,"policy.asp") > 0 and _
	not Instr(strScriptName,"register.asp") > 0 and _
	not Instr(strScriptName,"password.asp") > 0 and _
	not Instr(strScriptName,"faq.asp") > 0 and _
	not Instr(strScriptName,"login.asp") > 0 then
		scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
		if Request.QueryString <> "" then
			Response.Redirect("login.asp?target=" & lcase(scriptname(ubound(scriptname))) & "?" & Request.QueryString)
		else
			Response.Redirect("login.asp?target=" & lcase(scriptname(ubound(scriptname))))
		end if
	end if
end if

select case Request.Form("Method_Type")
	case "login"
		strEncodedPassword = sha256("" & Request.Form("Password"))
		select case chkUser(strDBNTFUserName, strEncodedPassword,-1)
			case 1, 2, 3, 4
				Call DoCookies(Request.Form("SavePassword"))
				strLoginStatus = 1
			case else
				strLoginStatus = 0
			end select
	case "logout"
		Call ClearCookies()
end select

if trim(strDBNTUserName) <> "" and trim(Request.Cookies(strUniqueID & "User")("Pword")) <> "" then
	chkCookie = 1
	mLev = cLng(chkUser(strDBNTUserName, Request.Cookies(strUniqueID & "User")("Pword"),-1))
	chkCookie = 0
else
	MemberID = -1
	mLev = 0
end if

if mLev = 4 and strEmailVal = "1" and strRestrictReg = "1" and strEmail = "1" then
	'## Forum_SQL - Get membercount from DB 
	strSql = "SELECT COUNT(MEMBER_ID) AS U_COUNT FROM " & strMemberTablePrefix & "MEMBERS_PENDING WHERE M_APPROVE = " & 0

	set rs = Server.CreateObject("ADODB.Recordset")
	rs.open strSql, my_Conn

	if not rs.EOF then
		User_Count = cLng(rs("U_COUNT"))
	else
		User_Count = 0
	end if

	rs.close
	set rs = nothing
end if

Response.Write	"<html>" & vbNewline & vbNewline & _
		"<head>" & vbNewline & _
		"<title>" & GetNewTitle(strScriptName) & "</title>" & vbNewline


'## START - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT
Response.Write	"<meta name=""copyright"" content=""This Forum code is Copyright (C) 2000-02 Michael Anderson, Pierre Gorissen, Huw Reddick and Richard Kinser, Non-Forum Related code is Copyright (C) " & strCopyright & """>" & vbNewline 
'## END   - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT



Response.Write	"<script language=""JavaScript"" type=""text/javascript"">" & vbNewLine & _
		"<!-- hide from JavaScript-challenged browsers" & vbNewLine & _
		"function openWindow(url) {" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=400,height=400')" & vbNewLine & _
		"}" & vbNewLine & _
		"function openWindow2(url) {" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=400,height=450')" & vbNewLine & _
		"}" & vbNewLine & _
		"function openWindow3(url) {" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=400,height=450,scrollbars=yes')" & vbNewLine & _
		"}" & vbNewLine & _
		"function openWindow4(url) {" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=400,height=525')" & vbNewLine & _
		"}" & vbNewLine & _
		"function openWindow5(url) {" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=450,height=525,scrollbars=yes,toolbars=yes,menubar=yes,resizable=yes')" & vbNewLine & _
		"}" & vbNewLine & _
		"function openWindow6(url) {" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=500,height=450,scrollbars=yes')" & vbNewLine & _
		"}" & vbNewLine & _
		"function openWindowHelp(url) {" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=470,height=200,scrollbars=yes')" & vbNewLine & _
		"}" & vbNewLine & _
		"// done hiding -->" & vbNewLine & _
		"</script>" & vbNewLine & _
		"<style type=""text/css"">" & vbNewLine & _
		"<!--" & vbNewLine & _
		"a:link    {color:" & strLinkColor & ";text-decoration:" & strLinkTextDecoration & "}" & vbNewLine & _
		"a:visited {color:" & strVisitedLinkColor & ";text-decoration:" & strVisitedTextDecoration & "}" & vbNewLine & _
		"a:hover   {color:" & strHoverFontColor & ";text-decoration:" & strHoverTextDecoration & "}" & vbNewLine & _
		"a:active  {color:" & strActiveLinkColor & ";text-decoration:" & strActiveTextDecoration & "}" & vbNewLine & _
		".spnMessageText a:link    {color:" & strForumLinkColor & ";text-decoration:" & strForumLinkTextDecoration & "}" & vbNewLine & _
		".spnMessageText a:visited {color:" & strForumVisitedLinkColor & ";text-decoration:" & strForumVisitedTextDecoration & "}" & vbNewLine & _
		".spnMessageText a:hover   {color:" & strForumHoverFontColor & ";text-decoration:" & strForumHoverTextDecoration & "}" & vbNewLine & _
		".spnMessageText a:active  {color:" & strForumActiveLinkColor & ";text-decoration:" & strForumActiveTextDecoration & "}" & vbNewLine & _
		".spnSearchHighlight {background-color:" & strSearchHiLiteColor & "}" & vbNewLine & _
		"input.radio {background:" & strPopUpTableColor & ";color:#000000}" & vbNewLine & _
		"-->" & vbNewLine & _
		"</style>" & vbNewLine & _
		"</head>" & vbNewLine & _
		vbNewLine & _
		"<body" & strTmpPageBGImageURL & " bgColor=""" & strPageBGColor & """ text=""" & strDefaultFontColor & """ link=""" & strLinkColor & """ aLink=""" & strActiveLinkColor & """ vLink=""" & strVisitedLinkColor & """>" & vbNewLine & _
		"<a name=""top""></a><font face=""" & strDefaultFontFace & """>" & vbNewLine & _
		vbNewLine & _
		"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""100%"">" & vbNewLine & _
		"  <tr>" & vbNewLine & _
		"    <td valign=""top"" width=""50%""><a href=""default.asp"" tabindex=""-1"">" & getCurrentIcon(strTitleImage & "||",strForumTitle,"") & "</a></td>" & vbNewLine & _
		"    <td align=""center"" valign=""top"" width=""50%"">" & vbNewLine & _
		"      <table border=""0"" cellPadding=""2"" cellSpacing=""0"">" & vbNewLine & _
		"        <tr>" & vbNewLine & _
		"          <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & strForumTitle & "</b></font></td>" & vbNewLine & _
		"        </tr>" & vbNewLine & _
		"        <tr>" & vbNewLine & _
		"          <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & vbNewLine
call sForumNavigation()
Response.Write	"</font></td>" & vbNewLine & _
		"        </tr>" & vbNewLine

select case Request.Form("Method_Type")

	case "login"
		Response.Write	"      </table>" & vbNewLine & _
				"    </td>" & vbNewLine & _
				"  </tr>" & vbNewLine & _
				"</table>" & vbNewLine
		if strLoginStatus = 0 then
			Response.Write	"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Your username and/or password were incorrect.</font></p>" & vbNewLine & _
					"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Please either try again or register for an account.</font></p>" & vbNewLine
		else
			Response.Write	"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>You logged on successfully!</font></p>" & vbNewLine & _
					"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Thank you for your participation.</font></p>" & vbNewLine
		end if
		Response.Write	"<meta http-equiv=""Refresh"" content=""2; URL=" & Request.ServerVariables("HTTP_REFERER") & """>" & vbNewLine & _
				"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""" & Request.ServerVariables("HTTP_REFERER") & """>Back To Forum</font></a></p>" & vbNewLine & _
				"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""95%"">" & vbNewLine & _
				"  <tr>" & vbNewLine & _
				"    <td>" & vbNewLine
		WriteFooter
		Response.End
	case "logout" 
		Response.Write	"      </table>" & vbNewLine & _
				"    </td>" & vbNewLine & _
				"  </tr>" & vbNewLine & _
				"</table>" & vbNewLine & _
				"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>You logged out successfully!</font></p>" & vbNewLine & _
				"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Thank you for your participation.</font></p>" & vbNewLine & _
				"<meta http-equiv=""Refresh"" content=""2; URL=default.asp"">" & vbNewLine & _
				"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""default.asp"">Back To Forum</font></a></p>" & vbNewLine & _
				"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""95%"">" & vbNewLine & _
				"  <tr>" & vbNewLine & _
				"    <td>" & vbNewLine
		WriteFooter
		Response.End
end select

if (mlev = 0) then
	if not(Instr(Request.ServerVariables("Path_Info"), "register.asp") > 0) and _
	not(Instr(Request.ServerVariables("Path_Info"), "policy.asp") > 0) and _
	not(Instr(Request.ServerVariables("Path_Info"), "pop_profile.asp") > 0) and _
	not(Instr(Request.ServerVariables("Path_Info"), "search.asp") > 0) and _
	not(Instr(Request.ServerVariables("Path_Info"), "login.asp") > 0) and _
	not(Instr(Request.ServerVariables("Path_Info"), "password.asp") > 0) and _
	not(Instr(Request.ServerVariables("Path_Info"), "faq.asp") > 0) then
		Response.Write	"        <form action=""" & Request.ServerVariables("URL") & """ method=""post"" id=""form1"" name=""form1"">" & vbNewLine & _
				"        <input type=""hidden"" name=""Method_Type"" value=""login"">" & vbNewLine & _
				"        <tr>" & vbNewLine & _
				"          <td align=""center"">" & vbNewLine & _
				"            <table>" & vbNewLine & _
				"              <tr>" & vbNewLine
		if (strAuthType = "db") then
			Response.Write	"                <td><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><b>Username:</b></font><br />" & vbNewLine & _
					"                <input type=""text"" name=""Name"" size=""10"" maxLength=""25"" value=""""></td>" & vbNewLine & _
					"                <td><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><b>Password:</b></font><br />" & vbNewLine & _
					"                <input type=""password"" name=""Password"" size=""10"" maxLength=""25"" value=""""></td>" & vbNewLine & _
					"                <td valign=""bottom"">" & vbNewLine
			if strGfxButtons = "1" then
				Response.Write	"                <input src=""" & strImageUrl & "button_login.gif"" type=""image"" border=""0"" value=""Login"" id=""submit1"" name=""Login"">" & vbNewLine
			else
				Response.Write	"                <input type=""submit"" value=""Login"" id=""submit1"" name=""submit1"">" & vbNewLine
			end if 
			Response.Write	"                </td>" & vbNewLine & _
					"              </tr>" & vbNewLine & _
					"              <tr>" & vbNewLine & _
					"                <td colspan=""3"" align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & vbNewLine & _
					"                <input type=""checkbox"" name=""SavePassWord"" value=""true"" tabindex=""-1"" CHECKED><b> Save Password</b></font></td>" & vbNewLine
		else
			if (strAuthType = "nt") then 
				Response.Write	"                <td><font face=""" & strDefaultFontFace & """ size=""1""  color=""" & strHiLiteFontColor & """>Please <a href=""policy.asp"" tabindex=""-1"">register</a> to post in these Forums</font></td>" & vbNewLine
			end if
		end if 
		Response.Write	"              </tr>" & vbNewLine
		if (lcase(strEmail) = "1") then
			Response.Write	"              <tr>" & vbNewLine & _
					"                <td colspan=""3"" align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" & vbNewLine & _
					"                <a href=""password.asp""" & dWStatus("Choose a new password if you have forgotten your current one...") & " tabindex=""-1"">Forgot your "
			if strAuthType = "nt" then Response.Write("Admin ")
			Response.Write	"Password?</a>" & vbNewLine
			if (lcase(strNoCookies) = "1") then
				Response.Write	"                |" & vbNewLine & _
						"                <a href=""admin_home.asp""" & dWStatus("Access the Forum Admin Functions...") & " tabindex=""-1"">Admin Options</a>" & vbNewLine
			end if
			Response.Write	"                <br /><br /></font></td>" & vbNewLine & _
					"              </tr>" & vbNewLine
		end if
		Response.Write	"            </table>" & vbNewLine & _
				"          </td>" & vbNewLine & _
				"        </tr>" & vbNewLine & _
				"        </form>" & vbNewLine
	end if
else
	Response.Write	"        <form action=""" & Request.ServerVariables("URL") & """ method=""post"" id=""form2"" name=""form2"">" & vbNewLine & _
			"        <input type=""hidden"" name=""Method_Type"" value=""logout"">" & vbNewLine & _
			"        <tr>" & vbNewLine & _
			"          <td align=""center"">" & vbNewLine & _
			"            <table>" & vbNewLine & _
			"              <tr>" & vbNewLine & _
			"                <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>You are logged on as<br />"
	if strAuthType="nt" then
		Response.Write	"<b>" & Session(strCookieURL & "username") & " (" & Session(strCookieURL & "userid") & ")</b></font></td>" & vbNewLine & _
				"                <td> "
	else 
		if strAuthType = "db" then 
			Response.Write	"<b>" & ChkString(strDBNTUserName, "display") & "</b></font></td>" & vbNewLine & _
					"                <td>"
			if strGfxButtons = "1" then
				Response.Write	"<input src=""" & strImageUrl & "button_logout.gif"" type=""image"" border=""0"" value=""Logout"" id=""submit1"" name=""Logout"" tabindex=""-1"">"
			else
				Response.Write	"<input type=""submit"" value=""Logout"" id=""submit1"" name=""submit1"" tabindex=""-1"">"
			end if 
		end if 
	end if 
	Response.Write	"</td>" & vbNewLine & _
			"              </tr>" & vbNewLine & _
			"            </table>" & vbNewLine & _
			"          </td>" & vbNewLine & _
			"        </tr>" & vbNewLine
	if (mlev = 4) or (lcase(strNoCookies) = "1") then
		Response.Write	"        <tr>" & vbNewLine & _
				"          <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><a href=""admin_home.asp""" & dWStatus("Access the Forum Admin Functions...") & " tabindex=""-1"">Admin Options</a>"
		if mLev = 4 and (strEmailVal = "1" and strRestrictReg = "1" and strEmail = "1" and User_Count > 0) then Response.Write(" | <a href=""admin_accounts_pending.asp""" & dWStatus("(" & User_Count & ") Member(s) awaiting approval") & " tabindex=""-1"">(" & User_Count & ") Member(s) awaiting approval</a>")
		Response.Write	"<br /><br /></font></td>" & vbNewLine & _
				"        </tr>" & vbNewLine
	end if
	Response.Write	"        </form>" & vbNewLine
end if
Response.Write	"      </table>" & vbNewLine & _
		"    </td>" & vbNewLine & _
		"  </tr>" & vbNewLine & _
		"</table>" & vbNewLine & _
		"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""95%"">" & vbNewLine
'########### GROUP Categories ########### %>
<!--#INCLUDE FILE="inc_groupjump_to.asp" -->
<% '######## GROUP Categories ##############
Response.Write	"  <tr>" & vbNewLine & _
		"    <td>" & vbNewLine

sub sForumNavigation()
	' DEM --> Added code to show the subscription line
	if strSubscription > 0 and strEmail = "1" then
		if mlev > 0 then
			strSql = "SELECT COUNT(*) AS MySubCount FROM " & strTablePrefix & "SUBSCRIPTIONS"
			strSql = strSql & " WHERE MEMBER_ID = " & MemberID
			set rsCount = my_Conn.Execute (strSql)
			if rsCount.BOF or rsCount.EOF then
				' No Subscriptions found, do nothing
				MySubCount = 0
				rsCount.Close
				set rsCount = nothing
			else
				MySubCount = rsCount("MySubCount")
				rsCount.Close
				set rsCount = nothing
			end if
			if mLev = 4 then
				strSql = "SELECT COUNT(*) AS SubCount FROM " & strTablePrefix & "SUBSCRIPTIONS"
				set rsCount = my_Conn.Execute (strSql)
				if rsCount.BOF or rsCount.EOF then
					' No Subscriptions found, do nothing
					SubCount = 0
					rsCount.Close
					set rsCount = nothing
				else
					SubCount = rsCount("SubCount")
					rsCount.Close
					set rsCount = nothing
				end if
			end if
		else
			SubCount = 0
			MySubCount = 0
		end if
	else
		SubCount = 0
		MySubCount = 0
	end if
	Response.Write	"          <a href=""" & strHomeURL & """" & dWStatus("Homepage") & " tabindex=""-1""><acronym title=""Homepage"">Home</acronym></a>" & vbNewline & _
			"          |" & vbNewline
	if strUseExtendedProfile then 
		Response.Write	"          <a href=""pop_profile.asp?mode=Edit""" & dWStatus("Edit your personal profile...") & " tabindex=""-1""><acronym title=""Edit your personal profile..."">Profile</acronym></a>" & vbNewline
	else
		Response.Write	"          <a href=""javascript:openWindow3('pop_profile.asp?mode=Edit')""" & dWStatus("Edit your personal profile...") & " tabindex=""-1""><acronym title=""Edit your personal profile..."">Profile</acronym></a>" & vbNewline
	end if 
	if strAutoLogon <> "1" then
		if strProhibitNewMembers <> "1" then
			Response.Write	"          |" & vbNewline & _
					"          <a href=""policy.asp""" & dWStatus("Register to post to our forum...") & " tabindex=""-1""><acronym title=""Register to post to our forum..."">Register</acronym></a>" & vbNewline
		end if
	end if
	Response.Write	"          |" & vbNewline & _
			"          <a href=""active.asp""" & dWStatus("See what topics have been active since your last visit...") & " tabindex=""-1""><acronym title=""See what topics have been active since your last visit..."">Active Topics</acronym></a>" & vbNewline 
	' DEM --> Start of code added to show subscriptions if they exist
	if (strSubscription > 0) then
		if mlev = 4 and SubCount > 0 then
			Response.Write	"          |" & vbNewline & _
					"          <a href=""subscription_list.asp?MODE=all""" & dWStatus("See all current subscriptions") & " tabindex=""-1""><acronym title=""See all current subscriptions"">All Subscriptions</acronym></a>" & vbNewline
		end if
		if MySubCount > 0 then
			Response.Write	"          |" & vbNewline & _
					"          <a href=""subscription_list.asp""" & dWStatus("See all of your subscriptions") & " tabindex=""-1""><acronym title=""See all of your subscriptions"">My Subscriptions</acronym></a>" & vbNewline
		end if
	end if
	' DEM --> End of Code added to show subscriptions if they exist
	Response.Write	"          |" & vbNewline & _
			"          <a href=""members.asp""" & dWStatus("Current members of these forums...") & " tabindex=""-1""><acronym title=""Current members of these forums..."">Members</acronym></a>" & vbNewline & _
			"          |" & vbNewline & _
			"          <a href=""search.asp"
	if Request.QueryString("FORUM_ID") <> "" then Response.Write("?FORUM_ID=" & cLng(Request.QueryString("FORUM_ID")))
	if Request.QueryString("CAT_ID") <> "" then Response.Write("?CAT_ID=" & cLng(Request.QueryString("CAT_ID")))	Response.Write	"""" & dWStatus("Perform a search by keyword, date, and/or name...") & " tabindex=""-1""><acronym title=""Perform a search by keyword, date, and/or name..."">Search</acronym></a>" & vbNewline & _
			"          |" & vbNewline & _
			"          <a href=""faq.asp""" & dWStatus("Answers to Frequently Asked Questions...") & " tabindex=""-1""><acronym title=""Answers to Frequently Asked Questions..."">FAQ</acronym></a>"
end sub

if strGroupCategories = "1" then
	if Session(strCookieURL & "GROUP_NAME") = "" then
		GROUPNAME = " Default Groups "
	else
		GROUPNAME = Session(strCookieURL & "GROUP_NAME")
	end if
	'Forum_SQL - Get Groups
	strSql = "SELECT GROUP_ID, GROUP_CATID " 
	strSql = strSql & " FROM " & strTablePrefix & "GROUPS "
	strSql = strSql & " WHERE GROUP_ID = " & Group
	set rsgroups = Server.CreateObject("ADODB.Recordset")
	rsgroups.Open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
	if rsgroups.EOF then
		recGroupCatCount = ""
	else
		allGroupCatData = rsgroups.GetRows(adGetRowsRest)
		recGroupCatCount = UBound(allGroupCatData, 2)
	end if
	rsgroups.Close
	set rsgroups = nothing
end if
%>


Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 04 April 2003 :  17:58:44  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
I recommend you either put the files in a zip and post a download link or post links to text versions of those files instead of pasting the whole code here.

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

polpot
Starting Member

11 Posts

Posted - 08 April 2003 :  13:21:17  Show Profile
You are right, however I don't have any such site to upload it to. If you want to help, please upload the fiels (zip) somewhere and post the link and I delete the two posts above.
Go to Top of Page

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 08 April 2003 :  13:29:02  Show Profile
Why don't you uplaod it to www.snitzbitz.com
Go to Top of Page

Lweast
Starting Member

29 Posts

Posted - 29 April 2003 :  13:56:52  Show Profile
Every time I change the catagory it automatically starts the search even though I have not entered data in the serch terms field yet.. Looks good though..
Is the Yabba Dabba Doo there because it's still in beta??
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.47 seconds. Powered By: Snitz Forums 2000 Version 3.4.07