% '################################################################################# '## Snitz Forums 2000 v3.4.05 '################################################################################# '## Copyright (C) 2000-05 Michael Anderson, Pierre Gorissen, '## Huw Reddick and Richard Kinser '## '## 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 (at your option) 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 our support forums at: '## http://forum.snitz.com '## '## Correspondence and Marketing Questions can be sent to: '## manderson@snitz.com '## '################################################################################# %> <% if (Request.QueryString("TOPIC_ID") = "" or IsNumeric(Request.QueryString("TOPIC_ID")) = False) and Request.Form("Method_Type") <> "login" and Request.Form("Method_Type") <> "logout" then Response.Redirect "default.asp" Response.End else Topic_ID = cLng(Request.QueryString("TOPIC_ID")) end if Dim ArchiveView, ArchiveLink, CColor if request("ARCHIVE") = "true" then strActivePrefix = strTablePrefix & "A_" ArchiveView = "true" ArchiveLink = "ARCHIVE=true&" elseif request("ARCHIVE") <> "" then Response.Redirect "default.asp" Response.End else strActivePrefix = strTablePrefix ArchiveView = "" ArchiveLink = "" end if %> <% Response.Write " " & vbNewLine mypage = request("whichpage") if ((Trim(mypage) = "") or (IsNumeric(mypage) = False)) then mypage = 1 mypage = cLng(mypage) if Request("SearchTerms") <> "" then SearchLink = "&SearchTerms=" & Request("SearchTerms") else SearchLink = "" end if if strSignatures = "1" and strDSignatures = "1" then if ViewSig(MemberID) <> "0" then CanShowSignature = 1 end if end if '## Forum_SQL - Get original topic and check for the Category, Forum or Topic Status and existence strSql = "SELECT M.M_NAME, M.M_RECEIVE_EMAIL, M.M_AIM, M.M_ICQ, M.M_MSN, M.M_YAHOO" & _ ", M.M_TITLE, M.M_HOMEPAGE, M.MEMBER_ID, M.M_LEVEL, M.M_POSTS, M.M_COUNTRY, M.M_FIRSTNAME, M.M_LASTNAME" & _ ", T.T_DATE, T.T_SUBJECT, T.T_AUTHOR, T.TOPIC_ID, T.T_STATUS, T.T_LAST_EDIT" & _ ", T.T_LAST_EDITBY, T.T_LAST_POST, T.T_SIG, T.T_REPLIES" & _ ", C.CAT_STATUS, C.CAT_ID, C.CAT_NAME, C.CAT_SUBSCRIPTION, C.CAT_MODERATION" & _ ", F.F_STATUS, F.FORUM_ID, F.F_SUBSCRIPTION, F.F_SUBJECT, F.F_MODERATION, T.T_MESSAGE" if CanShowSignature = 1 then strSql = strSql & ", M.M_SIG" end if strSql = strSql & " FROM " & strActivePrefix & "TOPICS T, " & strTablePrefix & "FORUM F, " & _ strTablePrefix & "CATEGORY C, " & strMemberTablePrefix & "MEMBERS M " & _ " WHERE T.TOPIC_ID = " & Topic_ID & _ " AND F.FORUM_ID = T.FORUM_ID " & _ " AND C.CAT_ID = T.CAT_ID " & _ " AND M.MEMBER_ID = T.T_AUTHOR " set rsTopic = Server.CreateObject("ADODB.Recordset") rsTopic.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText if rsTopic.EOF then recTopicCount = "" else recTopicCount = 1 Member_Name = rsTopic("M_NAME") Member_ReceiveMail = rsTopic("M_RECEIVE_EMAIL") Member_AIM = rsTopic("M_AIM") Member_ICQ = rsTopic("M_ICQ") Member_MSN = rsTopic("M_MSN") Member_YAHOO = rsTopic("M_YAHOO") Member_Title = rsTopic("M_TITLE") Member_Homepage = rsTopic("M_HOMEPAGE") TMember_ID = rsTopic("MEMBER_ID") Member_Level = rsTopic("M_LEVEL") Member_Posts = rsTopic("M_POSTS") Member_Country = rsTopic("M_COUNTRY") Member_FirstName = rsTopic("M_FIRSTNAME") Member_LastName = rsTopic("M_LASTNAME") Topic_Date = rsTopic("T_DATE") Topic_Subject = rsTopic("T_SUBJECT") Topic_Author = rsTopic("T_AUTHOR") TopicID = rsTopic("TOPIC_ID") Topic_Status = rsTopic("T_STATUS") Topic_LastEdit = rsTopic("T_LAST_EDIT") Topic_LastEditby = rsTopic("T_LAST_EDITBY") Topic_LastPost = rsTopic("T_LAST_POST") Topic_Sig = rsTopic("T_SIG") Topic_Replies = rsTopic("T_REPLIES") Cat_Status = rsTopic("CAT_STATUS") Cat_ID = rsTopic("CAT_ID") Cat_Name = rsTopic("CAT_NAME") Cat_Subscription = rsTopic("CAT_SUBSCRIPTION") Cat_Moderation = rsTopic("CAT_MODERATION") Forum_Status = rsTopic("F_STATUS") Forum_ID = rsTopic("FORUM_ID") Forum_Subject = rsTopic("F_SUBJECT") Forum_Subscription = rsTopic("F_SUBSCRIPTION") Forum_Moderation = rsTopic("F_MODERATION") Topic_Message = rsTopic("T_MESSAGE") if CanShowSignature = 1 then Topic_MemberSig = trim(rsTopic("M_SIG")) end if end if rsTopic.close set rsTopic = nothing if recTopicCount = "" then if ArchiveView <> "true" then Response.Redirect("topic.asp?ARCHIVE=true&" & ChkString(Request.QueryString,"sqlstring")) else Response.Redirect("default.asp") end if end if if mLev = 4 then AdminAllowed = 1 ForumChkSkipAllowed = 1 elseif mLev = 3 then if chkForumModerator(Forum_ID, chkString(strDBNTUserName,"decode")) = "1" then AdminAllowed = 1 ForumChkSkipAllowed = 1 else if lcase(strNoCookies) = "1" then AdminAllowed = 1 ForumChkSkipAllowed = 0 else AdminAllowed = 0 ForumChkSkipAllowed = 0 end if end if elseif lcase(strNoCookies) = "1" then AdminAllowed = 1 ForumChkSkipAllowed = 0 else AdminAllowed = 0 ForumChkSkipAllowed = 0 end if if strPrivateForums = "1" and (Request.Form("Method_Type") <> "login") and (Request.Form("Method_Type") <> "logout") and ForumChkSkipAllowed = 0 then result = ChkForumAccess(Forum_ID, MemberID, true) end if if strModeration > 0 and Cat_Moderation > 0 and Forum_Moderation > 0 and AdminAllowed = 0 then Moderation = "Y" else Moderation = "N" end if if mypage = -1 and Request.QueryString("REPLY_ID") <> "" then strSql1 = "SELECT REPLY_ID " strSql2 = "FROM " & strActivePrefix & "REPLY " strSql3 = "WHERE TOPIC_ID = " & Topic_ID & " " ' DEM --> if not a Moderator, all unapproved posts should not be viewed. if AdminAllowed = 0 then strSql3 = strSql3 & "AND (R_STATUS < " if Moderation = "Y" then ' Ignore unapproved/rejected posts strSql3 = strSql3 & "2 " else ' Ignore any previously rejected topic strSql3 = strSql3 & "3 " end if strSql3 = strSql3 & "OR R_AUTHOR = " & MemberID & ") " end if strSql4 = "ORDER BY R_DATE ASC " if strDBType = "mysql" then set rsReplies = Server.CreateObject("ADODB.Recordset") rsReplies.open strSql1 & strSql2 & strSql3 & strSql4, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText if rsReplies.EOF then iReplyCount = "" else arrReplyData = rsReplies.GetRows(adGetRowsRest) iReplyCount = UBound(arrReplyData, 2) rREPLY_ID = 0 end if LastPostReplyID = cLng(Request.QueryString("REPLY_ID")) if iReplyCount <> "" then for iReply = 0 to iReplyCount intReplyID = arrReplyData(rREPLY_ID,iReply) if LastPostReplyID = intReplyID then intPageNumber = ((iReply+1)/strPageSize) if intPageNumber > cLng(intPageNumber) then intPageNumber = cLng(intPageNumber) + 1 end if strwhichpage = "whichpage=" & intPageNumber & "&" exit for end if next else strwhichpage = "" end if rsReplies.Close set rsReplies = nothing else set rsReplies = Server.CreateObject("ADODB.Recordset") rsReplies.cachesize = strPageSize rsReplies.pagesize = strPageSize rsReplies.open strSql1 & strSql2 & strSql3 & strSql4, my_Conn, adOpenStatic, adLockReadOnly, adCmdText LastPostReplyID = cLng(Request.QueryString("REPLY_ID")) rsReplies.Find = "REPLY_ID=" & LastPostReplyID & "" if not (rsReplies.EOF or rsReplies.BOF) then if rsReplies.absolutepage > 1 then strwhichpage = "whichpage=" & rsReplies.absolutepage & "&" else strwhichpage = "" end if rsReplies.Close set rsReplies = nothing end if Response.Redirect("topic.asp?" & strwhichpage & "TOPIC_ID=" & Topic_ID & "" & LastPostReplyID & "") Response.End end if ' -- 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 if (Moderation = "Y" and Topic_Status > 1 and Topic_Author <> MemberID) then Response.write "
Viewing of this Topic is not permitted until it has been moderated.
Please try again later
" & vbNewLine & _
" " & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " All Forums " & vbNewLine & _ " " & getCurrentIcon(strIconBar,"","align=""absmiddle""") if Cat_Status <> 0 then Response.Write getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") else Response.Write getCurrentIcon(strIconFolderClosed,"","align=""absmiddle""") end if Response.Write " " & ChkString(Cat_Name,"display") & " " & vbNewLine & _ " " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") if ArchiveView = "true" then Response.Write getCurrentIcon(strIconFolderArchived,"","align=""absmiddle""") else if Forum_Status <> 0 and Cat_Status <> 0 then Response.Write getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") else Response.Write getCurrentIcon(strIconFolderClosed,"","align=""absmiddle""") end if end if Response.Write " " & ChkString(Forum_Subject,"display") & " " & vbNewLine if ArchiveView = "true" then Response.Write " " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderArchived,"","align=""absmiddle""") & " " elseif Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0 then Response.Write " " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpenTopic,"","align=""absmiddle""") & " " else Response.Write " " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderClosedTopic,"","align=""absmiddle""") & " " end if if Request.QueryString("SearchTerms") <> "" then Response.Write SearchHiLite(ChkString(Topic_Subject,"title")) else Response.Write ChkString(Topic_Subject,"title") end if Response.Write " | " & vbNewLine & _
" " & vbNewLine call PostingOptions() Response.Write " | " & vbNewLine & _ "
" if mypage > 1 then Response.Write("Previous Page") 'if mypage > 1 then Response.Write("Previous Page") if mypage > 1 and mypage < maxpages then Response.Write(" | ") if mypage < maxpages then Response.Write("Next Page") 'if mypage < maxpages then Response.Write("Next Page") Response.Write " | " & vbNewLine & _ "
" & vbNewLine & _
"
| " & vbNewLine & _
"
" if mypage > 1 then Response.Write("Previous Page") 'if mypage > 1 then Response.Write("Previous Page") if mypage > 1 and mypage < maxpages then Response.Write(" | ") if mypage < maxpages then Response.Write("Next Page") 'if mypage < maxpages then Response.Write("Next Page") Response.Write " | " & vbNewLine & _ "
" & vbNewLine & _
"
| |||||
" & vbNewLine & _
" " & profileLink(ChkString(Member_FirstName & " " & Member_LastName,"display"),TMember_ID) & " " & profileLink(ChkString(Member_FirstName & " " & Member_LastName,"display"),TMember_ID) & " " & profileLink(ChkString(Member_Name,"display"),TMember_ID) & " " & vbNewLine
if strCountry = "1" and trim(Member_Country) <> "" then
Response.Write " " & Member_Country & " | " & vbNewLine & _
" 1) then
Response.Write (" colspan=""3"" ")
else
Response.Write (" colspan=""2"" ")
end if
Response.Write "valign=""top"">" & vbNewLine & _
"
| " & vbNewLine & _
"
" & vbNewLine & _
" | " & vbNewLine & _
"