<% '################################################################################# '## Copyright (C) 2000-01 Michael Anderson and Pierre Gorissen '## '## This program is free software; you can redistribute it and/or '## modify it under the terms of the GNU General Public License '## as published by the Free Software Foundation; either version 2 '## of the License, or any later version. '## '## All copyright notices regarding Snitz Forums 2000 '## must remain intact in the scripts and in the outputted HTML '## The "powered by" text/logo with a link back to '## http://forum.snitz.com in the footer of the pages MUST '## remain visible when the pages are viewed on the internet or intranet. '## '## This program is distributed in the hope that it will be useful, '## but WITHOUT ANY WARRANTY; without even the implied warranty of '## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '## GNU General Public License for more details. '## '## You should have received a copy of the GNU General Public License '## along with this program; if not, write to the Free Software '## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. '## '## Support can be obtained from support forums at: '## http://forum.snitz.com '## '## Correspondence and Marketing Questions can be sent to: '## reinhold@bigfoot.com '## '## or '## '## Snitz Communications '## C/O: Michael Anderson '## PO Box 200 '## Harpswell, ME 04079 '################################################################################# %> <% Dim ArchiveView if request("ARCHIVE") = "true" then strActivePrefix = strArchiveTablePrefix ArchiveView = "true" else strActivePrefix = strTablePrefix ArchiveView = "" end if set rs = Server.CreateObject("ADODB.Recordset") ' DEM --> Added code for topic moderation If mlev = 3 then strSql = "SELECT FORUM_ID FROM " & strTablePrefix & "MODERATOR " & _ " WHERE MEMBER_ID = " & MemberID set rsmod = my_Conn.Execute (strSql) if rsmod.EOF or rsmod.BOF then ' Do Nothing - User is not an active moderator else modcount = 0 ModOfForums = "(" do until rsmod.EOF modcount = modcount + 1 if modcount > 1 then ModOfForums = ModOfForums & ", " end if ModOfForums = ModOfForums & rsmod("FORUM_ID") rsmod.MoveNext loop ModOfForums = ModOfForums & ")" end if end if Response.Write "" & vbNewline & _ " " & vbNewline & _ " " & vbNewline & _ " " & vbNewline & _ "
" & vbNewline & _ " " & _ "" & _ " All Forums
" & vbNewline If Request.QueryString("mode") = "DoIt" then Response.Write " " & vbNewline & _ " " & _ " Search Form
" Response.Write " " & vbNewline & _ " " & _ "" & _ " Search Results for: " & Request.Form("Search") & vbNewline else Response.Write " " & vbNewline & _ " " & _ " Search Form" end if Response.Write "
" & vbNewline & _ "

" If Request.QueryString("mode") = "DoIt" then if Request.Form("Search") <> "" then keywords = split(Request.Form("Search"), " ") keycnt = ubound(keywords) '## Forum_SQL - Find all records with the search criteria in them strSql = "SELECT " & strTablePrefix & "FORUM.FORUM_ID, " & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "FORUM.CAT_ID, " & strActivePrefix & "TOPICS.TOPIC_ID, " & strActivePrefix & "TOPICS.T_AUTHOR, " & strActivePrefix & "TOPICS.T_SUBJECT, " & strActivePrefix & "TOPICS.T_STATUS, " & strActivePrefix & "TOPICS.T_LAST_POST, " & strActivePrefix & "TOPICS.T_LAST_POST_AUTHOR, " & strActivePrefix & "TOPICS.T_REPLIES, " & strActivePrefix & "TOPICS.T_VIEW_COUNT, " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME " strSql = strSql & " FROM ((" & strTablePrefix & "FORUM LEFT JOIN " & strActivePrefix & "TOPICS " strSql = strSql & " ON " & strTablePrefix & "FORUM.FORUM_ID = " & strActivePrefix & "TOPICS.FORUM_ID) LEFT JOIN " & strActivePrefix & "REPLY " strSql = strSql & " ON " & strActivePrefix & "TOPICS.TOPIC_ID = " & strActivePrefix & "REPLY.TOPIC_ID) LEFT JOIN " & strMemberTablePrefix & "MEMBERS " strSql = strSql & " ON " & strActivePrefix & "TOPICS.T_AUTHOR = " & strMemberTablePrefix & "MEMBERS.MEMBER_ID " strSql = strSql & " WHERE (" '################# New Search Code ################################################# if Request.Form("SearchMessage") = 1 then if Request.Form("andor") = "phrase" then strSql = strSql & " (" & strTablePrefix & "FORUM.F_SUBJECT LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'" strSql = strSql & " OR " & strActivePrefix & "TOPICS.T_SUBJECT LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%') " else For Each word in keywords SearchWord = ChkString(word, "SQLString") strSql = strSql & " (" & strTablePrefix & "FORUM.F_SUBJECT LIKE '%" & SearchWord & "%'" strSql = strSql & " OR " & strActivePrefix & "TOPICS.T_SUBJECT LIKE '%" & SearchWord & "%') " if cnt < keycnt then strSql = strSql & Request.Form("andor") cnt = cnt + 1 next end if else if Request.Form("andor") = "phrase" then strSql = strSql & " (" & strActivePrefix & "REPLY.R_MESSAGE LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'" strSql = strSql & " OR " & strTablePrefix & "FORUM.F_DESCRIPTION LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'" strSql = strSql & " OR " & strActivePrefix & "TOPICS.T_SUBJECT LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'" strSql = strSql & " OR " & strActivePrefix & "TOPICS.T_MESSAGE LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%') " else For Each word in keywords SearchWord = ChkString(word, "SQLString") strSql = strSql & " (" & strActivePrefix & "REPLY.R_MESSAGE LIKE '%" & SearchWord & "%'" strSql = strSql & " OR " & strTablePrefix & "FORUM.F_DESCRIPTION LIKE '%" & SearchWord & "%'" strSql = strSql & " OR " & strActivePrefix & "TOPICS.T_SUBJECT LIKE '%" & SearchWord & "%'" strSql = strSql & " OR " & strActivePrefix & "TOPICS.T_MESSAGE LIKE '%" & SearchWord & "%') " if cnt < keycnt then strSql = strSql & Request.Form("andor") cnt = cnt + 1 next end if '################# New Search Code ################################################# end if strSql = strSql & " ) " ' DEM --> Added code to ignore unmoderated/held posts... if mlev <> 4 then strSql = strSql & " AND ((" & strActivePrefix & "TOPICS.T_AUTHOR <> " & MemberID strSql = strSql & " AND " & strActivePrefix & "TOPICS.T_STATUS < 2)" ' Ignore unapproved/held posts strSql = strSql & " OR " & strActivePrefix & "TOPICS.T_AUTHOR = " & MemberID & ")" end if ' DEM --> End of Code added to ignore unmoderated/held posts.... cnt = 0 if Request.Form("Forum") <> 0 then strSql = strSql & " AND " & strTablePrefix & "FORUM.FORUM_ID = " & Request.Form("Forum") & " " end if if Request.Form("SearchDate") <> 0 then dt = cint(Request.Form("SearchDate")) strSql = strSql & " AND (T_DATE > '" & DateToStr(dateadd("d", -dt, strForumTimeAdjust)) & "')" end if if Request.Form("SearchMember") <> 0 then strSql = strSql & " AND (" & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & Request.Form("SearchMember") & " " strSql = strSql & " OR " & strActivePrefix & "REPLY.R_AUTHOR = " & Request.Form("SearchMember") & ") " end if strSql = strSql & " AND " & strTablePrefix & "FORUM.F_TYPE = " & 0 strSql = strSql & " ORDER BY " & strActivePrefix & "TOPICS.FORUM_ID DESC, " strSql = strSql & " " & strActivePrefix & "TOPICS.T_LAST_POST DESC" mypage = request("whichpage") If mypage = "" then mypage = 1 end if 'response.write strSql 'response.end rs.Open strSql, my_Conn, 3,1 %>
<% if (mlev = 4 or mlev = 3) or (lcase(strNoCookies) = "1") then %> <% end if %> <% if rs.EOF or rs.BOF then '## No topic %> <% if (mlev = 4 or mlev = 3) or (lcase(strNoCookies) = "1") then %> <% end if %> <% else rs.MoveFirst currForum = 0 currTopic = 0 do until rs.EOF if ChkForumAccess(rs("FORUM_ID"),getNewMemberNumber()) then '## Forum_SQL - Find out if the Category is Locked or Un-Locked and if it Exists strSql = "SELECT " & strTablePrefix & "CATEGORY.CAT_STATUS " ' DEM --> Added *_SUBSCRIPTION Lines strSql = strSql & ", " & strTablePrefix & "CATEGORY.CAT_SUBSCRIPTION " strSql = strSql & ", " & strTablePrefix & "FORUM.F_SUBSCRIPTION " strSql = strSql & ", " & strTablePrefix & "FORUM.F_STATUS " strSql = strSql & " FROM " & strTablePrefix & "CATEGORY " strSql = strSql & " , " & strTablePrefix & "FORUM " strSql = strSql & " WHERE " & strTablePrefix & "CATEGORY.CAT_ID = " & strTablePrefix & "FORUM.CAT_ID " strSql = strSql & " AND " & strTablePrefix & "FORUM.FORUM_ID = " & rs("FORUM_ID") set rsCFStatus = my_Conn.Execute (StrSql) if (mLev = 4) or ((chkForumModerator(rs("FORUM_ID"), Session(strCookieURL & "username"))= "1") and mLev = 3) or ((chkForumModerator(rs("FORUM_ID"), Request.Cookies(strUniqueID & "User")("Name")) = "1") and mlev = 3) or (lcase(strNoCookies) = "1") then AdminAllowed = 1 else AdminAllowed = 0 end if if (currForum <> rs("FORUM_ID")) and (currTopic <> rs("TOPIC_ID")) then %> <% if (AdminAllowed = 1) or (lcase(strNoCookies) = "1") then %> <% elseif (mLev = 3) then %> <% end if %> <% currForum = rs("FORUM_ID") end if if currTopic <> rs("TOPIC_ID") then Response.Write " " & vbNewline ' Response.Write " " if rsCFStatus("CAT_STATUS") <> 0 and rsCFstatus("F_STATUS") <> 0 and rs("T_STATUS") <> 0 then ' DEM --> Added if statement to display topic status properly if rs("T_STATUS") = 2 then Response.Write " " & vbNewline elseif rs("T_STATUS") = 3 then Response.Write " " & vbNewline else Response.Write " " & vbNewline end if else Response.Write " " & vbNewline end if %> <% if IsNull(rs("T_LAST_POST_AUTHOR")) then strLastAuthor = "" else strLastAuthor = "
by: " if strUseExtendedProfile then strLastAuthor = strLastAuthor & "" else strLastAuthor = strLastAuthor & "" end if strLastAuthor = strLastAuthor & getMemberName(rs("T_LAST_POST_AUTHOR")) & "" end if %> <% if AdminAllowed = 1 or strNoCookies = "1" then %> <% elseif (mLev = 3) then%> <% end if %> <% currTopic = rs("TOPIC_ID") end if end if rs.MoveNext loop end if %>
  Topic Author Replies Read Last Post 
No Matches Found 
 <% =ChkString(rs("F_SUBJECT"),"display") %><% ForumAdminOptions() %> 
 " & _ "" & _ "" & _ "" & ChkIsNew(rs("T_LAST_POST")) & "" & _ ""><% =ChkString(left(rs("T_SUBJECT"), 50),"display") %> <% if strShowPaging = "1" then TopicPaging() end if%> <% =ChkString(rs("M_NAME"),"display") %> <% =rs("T_REPLIES") %> <% =rs("T_VIEW_COUNT") %><% =ChkDate(rs("T_LAST_POST")) %> <% =ChkTime(rs("T_LAST_POST")) %><%=strLastAuthor%> <% if rsCFStatus("CAT_STATUS") = 0 then %> ')">Un-Lock Category <% elseif rsCFStatus("F_STATUS") = 0 then %> &CAT_ID=<% =rs("CAT_ID") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"JSurlpath")%>')">Un-Lock Forum <% elseif rs("T_STATUS") <> 0 then ' DEM --> Added code to allow for moderation if rs("T_STATUS") >= 2 or _ (CheckForUnModeratedPosts("TOPIC", rs("CAT_ID"), rs("FORUM_ID"), rs("TOPIC_ID")) > 0) then ModString = "CAT_ID=" & rs("CAT_ID") & "&FORUM_ID=" & rs("FORUM_ID") & "&TOPIC_ID=" & rs("TOPIC_ID") & "&REPLY_ID=X" Response.Write " = 2 then Response.Write "alt=""Approve/Hold/Reject Topic""" else Response.Write "alt=""Approve/Hold/Reject Replies to Topic""" end if Response.Write " height=15 width=15 border=0>" & vbNewline else ' DEM --> End of Code added for topic moderation %> &FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&Topic_Title=<% =ChkString(rs("T_SUBJECT"),"JSurlpath")%>')">Lock Topic <% End if else %> &FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&Topic_Title=<% =ChkString(rs("T_SUBJECT"),"JSurlpath")%>')">Un-Lock Topic <% end if if (AdminAllowed = 1) or (rsCFStatus("CAT_STATUS") <> 0 and rsCFStatus("F_STATUS") <> 0 and rs("T_STATUS") <> 0) then %> &FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&auth=<% =rs("T_AUTHOR") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>&Topic_Title=<% =ChkString(rs("T_SUBJECT"),"urlpath") %>">Edit Message <% end if %> &FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&Topic_Title=<% =ChkString(rs("T_SUBJECT"),"JSurlpath") %>')">Delete Topic &FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>&Topic_Title=<% =ChkString(left(rs("T_SUBJECT"), 50),"urlpath") %>">Reply to Topic <% ' DEM --> Start of Code added for subscriptions if strSubscription > 0 and _ rsCFStatus("Cat_Subscription") > 0 and _ rsCFStatus("F_Subscription") > 0 then CheckSubscription "TOPICNOTEXT", MemberID, rs("CAT_ID"), rs("FORUM_ID"), rs("TOPIC_ID"), "", "" end if ' DEM --> End of Code added for subscriptions %>  

> Back To Search Page

<% Else %>

You must enter keywords

Back To Search Page

<% end if Else %>
<%'################# New Search Code #################################################%> <%'################# New Search Code #################################################%>
Search For: ">
<% '################# New Search Code ################################################# %> Match exact phrase
<% '################# New Search Code ################################################# %> Search for all Words
Match any of the words
Search Forum:
Search In:   Archived Posts
Search By Date:
Search By Member:
<% end if on error resume next set rs = nothing WriteFooter sub ForumAdminOptions() if (AdminAllowed = 1) or (lcase(strNoCookies) = "1") then if rsCFStatus("CAT_STATUS") = 0 then if mlev = 4 then %> ')">Un-Lock Category <% else %> Category Locked <% end if else if rsCFStatus("F_STATUS") <> 0 then %> &CAT_ID=<% =rs("CAT_ID") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"JSurlpath")%>')">Lock Forum <% else %> &CAT_ID=<% =rs("CAT_ID") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"JSurlpath")%>')">Un-Lock Forum <% end if end if if (rsCFStatus("CAT_STATUS") <> 0 and rsCFStatus("F_STATUS") <> 0) or (AdminAllowed = 1) then %> &CAT_ID=<% =rs("CAT_ID") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>&type=0">Edit Forum Properties <% end if %> &CAT_ID=<% =rs("CAT_ID") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"JSurlpath") %>')">Delete Forum &CAT_ID=<% =rs("CAT_ID")%>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>">New Topic <% ' DEM --> Added code to allow for moderation if AdminAllowed = 1 and (CheckForUnModeratedPosts("FORUM", rs("CAT_ID"), rs("FORUM_ID"), 0)) > 0 then ModString = "CAT_ID=" & rs("CAT_ID") & "&FORUM_ID=" & rs("FORUM_ID") & "&TOPIC_ID=" & rs("TOPIC_ID") & "&REPLY_ID=X" Response.Write " " & vbNewline end if ' DEM --> End of code added to allow for moderation ' DEM --> Start of Code added for subscriptions if (strSubscription > 0 and strSubscription < 4) and _ (rsCFStatus("CAT_SUBSCRIPTION") > 0 and rsCFStatus("CAT_SUBSCRIPTION") < 3) and _ (rsCFStatus("F_SUBSCRIPTION") > 0 and rsCFStatus("F_SUBSCRIPTION") = 1) then CheckSubscription "TOPICNOTEXT", MemberID, rs("CAT_ID"), rs("FORUM_ID"), 0, "", "" end if ' DEM --> End of Code added for subscriptions end if end sub sub TopicPaging() mxpages = (rs("T_REPLIES") / strPageSize) if mxPages <> cint(mxPages) then mxpages = int(mxpages) + 1 end if if mxpages > 1 then Response.Write("") for counter = 1 to mxpages ref = "" Response.Write ref if counter mod strPageNumberSize = 0 then Response.Write("") end if next Response.Write("
" if ((mxpages > 9) and (mxpages > strPageNumberSize)) or ((counter > 9) and (mxpages < strPageNumberSize)) then ref = ref & " " end if ref = ref & widenum(counter) & "" & counter & "
 
") end if end sub %>