%
'#################################################################################
'## 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
'#################################################################################
%>
<%
if request("ARCHIVE") = "true" then
strActivePrefix = strTablePrefix & "A_"
ArchiveView = "true"
else
strActivePrefix = strTablePrefix
ArchiveView = ""
end if
'Topic Move Check
Dim blnTopicMoved
Dim fSubscription
fsubscription = 1
blnTopicMoved = false
if strAuthType = "db" then
strDBNTUserName = Request.Form("UserName")
end if
MethodType = Request.Form("Method_Type")
Cat_ID = Chkstring(Request("CAT_ID"), "SQLString")
Forum_ID = ChkString(Request("FORUM_ID"), "SQLString")
Topic_ID = ChkString(Request("TOPIC_ID"), "SQLString")
Reply_ID = ChkString(Request("REPLY_ID"), "SQLString")
fSubscription = Request("Subscription")
if Request("Subscription") = "" then
fSubscription = 0
end if
set rs = Server.CreateObject("ADODB.RecordSet")
err_Msg = ""
ok = ""
if ArchiveView <> "" then
if MethodType = "Reply" or _
MethodType = "ReplyQuote" or _
MethodType = "TopicQuote" then
Go_Result "This is not allowed in the Archives.", 0
end if
end if
if MethodType = "Edit" then
'## Forum_SQL - Get the author of the reply
strSql = "SELECT " & strTablePrefix & "REPLY.R_AUTHOR "
strSql = strSql & " FROM " & strTablePrefix & "REPLY "
strSql = strSql & " WHERE " & strTablePrefix & "REPLY.REPLY_ID = " & REPLY_ID
set rsStatus = my_Conn.Execute(strSql)
if rsStatus.EOF or rsStatus.BOF then
Go_Result "Please don't attempt to edit the URL
to gain access to locked Forums/Categories.", 0
else
strReplyAuthor = rsStatus("R_AUTHOR")
rsStatus.close
set rsStatus = nothing
end if
end if
if MethodType = "Edit" or _
MethodType = "EditTopic" or _
MethodType = "Reply" or _
MethodType = "ReplyQuote" or _
MethodType = "Topic" or _
MethodType = "TopicQuote" then
if MethodType <> "Topic" then
'## Forum_SQL - Find out if the Category, Forum or Topic is Locked or Un-Locked and if it Exists
strSql = "SELECT " & strTablePrefix & "CATEGORY.CAT_STATUS, " &_
strTablePrefix & "FORUM.F_STATUS, " &_
strActivePrefix & "TOPICS.T_STATUS, " &_
strActivePrefix & "TOPICS.T_AUTHOR " &_
" FROM " & strTablePrefix & "CATEGORY, " &_
strTablePrefix & "FORUM, " &_
strActivePrefix & "TOPICS " &_
" WHERE " & strTablePrefix & "CATEGORY.CAT_ID = " & strActivePrefix & "TOPICS.CAT_ID " &_
" AND " & strTablePrefix & "FORUM.FORUM_ID = " & strActivePrefix & "TOPICS.FORUM_ID " &_
" AND " & strActivePrefix & "TOPICS.TOPIC_ID = " & Topic_ID & ""
else
'## Forum_SQL - Find out if the Category or Forum is Locked or Un-Locked and if it Exists
strSql = "SELECT " & strTablePrefix & "CATEGORY.CAT_STATUS, " &_
strTablePrefix & "FORUM.F_STATUS " &_
" FROM " & strTablePrefix & "CATEGORY, " &_
strTablePrefix & "FORUM " &_
" WHERE " & strTablePrefix & "CATEGORY.CAT_ID = " & strTablePrefix & "FORUM.CAT_ID " &_
" AND " & strTablePrefix & "FORUM.FORUM_ID = " & Forum_ID & ""
end if
set rsStatus = my_Conn.Execute(strSql)
if rsStatus.EOF or rsStatus.BOF then
Go_Result "Please don't attempt to edit the URL
to gain access to locked Forums/Categories."
else
blnCStatus = rsStatus("CAT_STATUS")
blnFStatus = rsStatus("F_STATUS")
if MethodType <> "Topic" then
blnTStatus = rsStatus("T_STATUS")
strTopicAuthor = rsStatus("T_AUTHOR")
else
blnTStatus = 1
end if
rsStatus.close
set rsStatus = nothing
end if
if (mLev = 4) or (chkForumModerator(Forum_ID, ChkString(strDBNTUserName, "decode"))= "1") or (lcase(strNoCookies) = "1") then
AdminAllowed = 1
else
AdminAllowed = 0
end if
select case MethodType
case "Topic"
if (blnCStatus = 0) and (AdminAllowed = 0) then
Go_Result "You have attempted to post a New Topic to a Locked Category", 0
end if
if (blnFStatus = 0) and (AdminAllowed = 0) then
Go_Result "You have attempted to post a New Topic to a Locked Forum", 0
end if
case "EditTopic"
if ((blnCStatus = 0) or (blnFStatus = 0) or (blnTStatus = 0)) and (AdminAllowed = 0) then
Go_Result "You have attempted to edit a Locked Topic", 0
end if
case "Reply", "ReplyQuote", "TopicQuote"
if ((blnCStatus = 0) or (blnFStatus = 0) or (blnTStatus = 0)) and (AdminAllowed = 0) then
Go_Result "You have attempted to Reply to a Locked Topic", 0
end if
case "Edit"
if ((blnCStatus = 0) or (blnFStatus = 0) or (blnTStatus = 0)) and (AdminAllowed = 0) then
Go_Result "You have attempted to Edit a Reply to a Locked Topic", 0
end if
end select
end if
' If Creating a new topic or reply, the subscription and moderation capabilities will need to be checked.
Moderation = "No"
if MethodType = "Topic" or _
MethodType = "Reply" or _
MethodType = "ReplyQuote" or _
MethodType = "TopicQuote" or _
MethodType = "Forum" or _
MethodType = "EditForum" then
if strModeration > 0 or strSubscription > 0 then
'## Forum_SQL - Get the Cat_Subscription, Cat_Moderation, Forum_Subscription, Forum_Moderation
strSql = "Select C.CAT_MODERATION, " & "C.CAT_SUBSCRIPTION, " & "C.CAT_NAME "
if MethodType <> "Forum" then
strSql = strSql & ", F.F_MODERATION, F.F_SUBSCRIPTION "
end if
strsql = strsql & " FROM " & strTablePrefix & "CATEGORY C"
if MethodType <> "Forum" then
strSql = strSql & ", " & strTablePrefix & "FORUM F"
end if
strSql = strSql & " WHERE C.CAT_ID = " & Cat_ID
if MethodType <> "Forum" then
strSql = strSql & " AND F.FORUM_ID = " & Forum_ID
end if
set rsCheck = my_Conn.Execute (strSql)
CatName = rsCheck("CAT_NAME")
CatSubscription = rsCheck("CAT_SUBSCRIPTION")
CatModeration = rsCheck("CAT_MODERATION")
if MethodType <> "Forum" then
ForumSubscription = rsCheck("F_SUBSCRIPTION")
ForumModeration = rsCheck("F_MODERATION")
end if
rsCheck.Close
set rsCheck = nothing
if MethodType <> "Forum" then
'## Moderators and Admins are not subject to Moderation
if strModeration = 0 or mlev = 4 or chkForumModerator(Forum_ID, STRdbntUserName) = "1" then
Moderation = "No"
'## Is Moderation allowed on the category?
elseif CatModeration = 1 then
'## if this is a topic, is forum moderation set to all posts or topic?
if (ForumModeration = 1 or ForumModeration = 2) and (MethodType = "Topic") then
Moderation = "Yes"
'## if this is a reply, is forum moderation set to all posts or reply?
elseif (ForumModeration = 1 or ForumModeration = 3) and (MethodType <> "Topic") then
Moderation = "Yes"
end if
end if
end if
end if
end if
if MethodType = "Edit" then
member = cint(ChkUser2(strDBNTUserName, Request.Form("Password"), strReplyAuthor))
Select Case Member
case 0 '## Invalid Pword
Go_Result "Invalid Password or UserName", 0
Response.End
case 1 '## Author of Post so OK
'## Do Nothing
case 2 '## Normal User - Not Authorised
Go_Result "Only Admins, Moderators and the Author can change this post", 0
Response.End
case 3 '## Moderator so OK - check the Moderator of this forum
if chkForumModerator(Forum_ID, STRdbntUserName) = "0" then
Go_Result "Only Admins, Moderators and the Author can change this post", 0
end if
case 4 '## Admin so OK
'## Do Nothing
case else
Go_Result cstr(Member), 0
Response.End
end select
txtMessage = ChkString(Request.Form("Message"),"message")
Err_Msg = ""
if txtMessage = " " then
Err_Msg = Err_Msg & "
You Must Enter a Message for your Reply"
end if
if Err_Msg = "" then
if strEditedByDate = "1" and mlev < 4 then
txtMessage = txtMessage & vbNewline & vbNewline & "Edited by - "
txtMessage = txtMessage & ChkString(STRdbntUserName, "display") & " on " & ChkDate(DateToStr(strForumTimeAdjust)) & " " & ChkTime(DateToStr(strForumTimeAdjust))
end if
'## Forum_SQL - Do DB Update
strSql = "UPDATE " & strActivePrefix & "REPLY "
strSql = strSql & " SET R_MESSAGE = '" & txtMessage & "'"
strSql = strSql & " WHERE REPLY_ID=" & Reply_ID
my_Conn.Execute (strSql)
if mLev <> 4 and Moderation = "No" then
'## Forum_SQL - Update Last Post
strSql = " UPDATE " & strTablePrefix & "FORUM"
strSql = strSql & " SET F_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", F_LAST_POST_AUTHOR = " & getMemberID(STRdbntUserName)
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
my_Conn.Execute (strSql)
'## Forum_SQL - Update Last Post
strSql = " UPDATE " & strActivePrefix & "TOPICS"
strSql = strSql & " SET T_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", T_LAST_POST_AUTHOR = " & getMemberID(STRdbntUserName)
strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID
my_Conn.Execute (strSql)
end if
err_Msg = ""
if Err.description <> "" then
Go_Result "There was an error = " & Err.description, 0
Response.End
else
Go_Result "Updated OK", 1
end if
'## Forum_SQL
strSql = "UPDATE " & strActivePrefix & "TOPICS "
strSql = strSql & " SET T_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", T_LAST_POST_AUTHOR = " & getMemberID(STRdbntUserName)
strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID
my_Conn.Execute (strSql)
err_Msg = ""
if Err.description <> "" then
Go_Result "There was an error = " & Err.description, 0
Response.End
else
Go_Result "Updated OK", 1
Response.End
end if
else
%>
There Was A Problem With Your Details
>Go Back To Enter Data
<%
end if
end if
if MethodType = "EditTopic" then
member = cint(ChkUser2(STRdbntUserName, Request.Form("Password"), strTopicAuthor))
select case Member
case 0 '## Invalid Pword
Go_Result "Invalid Password or UserName", 0
Response.End
case 1 '## Author of Post so OK
'## Do Nothing
case 2 '## Normal User - Not Authorised
Go_Result "Only Admins, Moderators and the Author can change this post", 0
Response.End
case 3 '## Moderator so
if chkForumModerator(Forum_ID, STRdbntUserName) = "0" then
Go_Result "Only Admins, Moderators and the Author can change this post", 0
end if
case 4 '## Admin so OK
'## Do Nothing
case else
Go_Result cstr(Member), 0
Response.End
end select
txtMessage = chkString(Request.Form("Message"),"message")
txtSubject = chkString(Request.Form("Subject"),"SQLString")
Err_Msg = ""
if txtSubject = " " then
Err_Msg = Err_Msg & "You Must Enter a Subject for the Topic"
end if
if txtMessage = " " then
Err_Msg = Err_Msg & "You Must Enter a Message for the Topic"
end if
if Err_Msg = "" then
if strEditedByDate = "1" and mlev < 4 then
txtMessage = txtMessage & vbNewline & vbNewline & "Edited by - "
txtMessage = txtMessage & chkstring(strDBNTUserName, "display") & " on " & chkDate(DateToStr(strForumTimeAdjust)) & " " & chkTime(DateToStr(strForumTimeAdjust))
end if
'## Set array to pull out CAT_ID and FORUM_ID from dropdown values in post.asp
aryForum = split(Request.Form("Forum"), "|")
'## if the forum we are moving to doesn't have MODERATION, and this topic did have that
'## we are going to have to auto-approve the topic !
AutoApprove = "No"
Moderation = "No"
if Forum_ID <> aryForum(1) then
blnTopicMoved = true
strSql = "Select " & strTablePrefix & "FORUM.F_MODERATION "
strSql = strsql & " FROM " & strTablePrefix & "FORUM "
strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & Forum_ID
set rsForumCheck = my_Conn.Execute (strSql)
ForumModeration = rsForumCheck("F_MODERATION")
rsForumCheck.Close
set rsForumCheck = nothing
'## Is Moderation allowed on the topic in the old forum ?
if (ForumModeration = 1 or ForumModeration = 2) then
Moderation = "Yes"
end if
if Moderation = "Yes" then
strSql = "Select " & strTablePrefix & "FORUM.F_MODERATION "
strSql = Strsql & " FROM " & strTablePrefix & "FORUM "
strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & aryForum(1)
set rsNewForumCheck = my_Conn.Execute (strSql)
NewForumModeration = rsNewForumCheck("F_MODERATION")
rsNewForumCheck.Close
set rsNewForumCheck = nothing
'## Is Moderation allowed on the topic in the new forum ?
if not(NewForumModeration = 1 or NewForumModeration = 2) then
AutoApprove = "Yes"
end if
end if
end if
'## Forum_SQL
strSql = "UPDATE " & strActivePrefix & "TOPICS "
strSql = strSql & " SET T_MESSAGE = '" & txtMessage & "'"
strSql = strSql & ", T_SUBJECT = '" & txtSubject & "'"
if blnTopicMoved then
strSql = strSql & ", CAT_ID = " & aryForum(0)
strSql = strSql & ", FORUM_ID = " & aryForum(1)
if AutoApprove = "Yes" then
strSql = strSql & ", T_STATUS = 1 "
end if
end if
strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID
my_Conn.Execute(strSql)
if blnTopicMoved then
if strEmail = "1" and strMoveNotify = "1" then DoAutoMoveEmail(Topic_ID)
strSQL = "SELECT F_SUBSCRIPTION FROM " & strTablePrefix & "FORUM WHERE FORUM_ID=" & aryForum(1)
set rs = my_conn.execute (strSQL)
if rs("F_SUBSCRIPTION") < 3 then
strSQL = "DELETE FROM " & strTablePrefix & "SUBSCRIPTIONS WHERE TOPIC_ID=" & Topic_ID
my_conn.execute(strSQL)
end if
rs.close
end if
if Forum_ID <> aryForum(1) then
'## Forum_SQL
strSql = "UPDATE " & strActivePrefix & "REPLY "
strSql = strSql & " SET CAT_ID = " & aryForum(0)
strSql = strSql & ", FORUM_ID = " & aryForum(1)
strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID
my_Conn.Execute(strSql)
set rs = Server.CreateObject("ADODB.Recordset")
'## if the topic hasn't been approved yet, it isn't counted either
'## so then the topic count doesn't need to be updated
if Moderation = "No" or AutoApprove = "Yes" then
'## Forum_SQL - count total number of replies in Topics table
strSql = "SELECT T_REPLIES, T_LAST_POST, T_LAST_POST_AUTHOR "
strSql = strSql & " FROM " & strActivePrefix & "TOPICS "
strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID
set rs = my_Conn.Execute (strSql)
intResetCount = rs("T_REPLIES") + 1
strT_Last_Post = rs("T_LAST_POST")
strT_Last_Post_Author = rs("T_LAST_POST_AUTHOR")
rs.Close
set rs = nothing
'## Forum_SQL - Get last_post and last_post_author for MoveFrom-Forum
strSql = "SELECT T_LAST_POST, T_LAST_POST_AUTHOR "
strSql = strSql & " FROM " & strActivePrefix & "TOPICS "
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID & " "
strSql = strSql & " ORDER BY T_LAST_POST DESC;"
set rs = my_Conn.Execute (strSql)
if not rs.eof then
strLast_Post = rs("T_LAST_POST")
strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
else
strLast_Post = ""
strLast_Post_Author = ""
end if
rs.Close
set rs = nothing
if Moderation = "No" then
'## Forum_SQL - Update count of replies to a topic in Forum table
strSql = "UPDATE " & strTablePrefix & "FORUM SET "
strSql = strSql & " F_COUNT = F_COUNT - " & intResetCount
if strLast_Post <> "" then
strSql = strSql & ", F_LAST_POST = '" & strLast_Post & "'"
if strLast_Post_Author <> "" then
strSql = strSql & ", F_LAST_POST_AUTHOR = " & strLast_Post_Author
end if
end if
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
my_Conn.Execute(strSql)
'## Forum_SQL
strSql = "UPDATE " & strTablePrefix & "FORUM SET "
strSql = strSql & " F_TOPICS = F_TOPICS - 1 "
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
my_Conn.Execute(strSql)
end if
'## Forum_SQL - Get last_post and last_post_author for Forum
strSql = "SELECT T_LAST_POST, T_LAST_POST_AUTHOR, T_AUTHOR "
strSql = strSql & " FROM " & strActivePrefix & "TOPICS "
strSql = strSql & " WHERE FORUM_ID = " & aryForum(1) & " "
strSql = strSql & " ORDER BY T_LAST_POST DESC;"
set rs = my_Conn.Execute (strSql)
if not rs.eof then
strAuthor = getMemberName(strT_Last_Post_Author)
strLast_Post = rs("T_LAST_POST")
strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
else
strAuthor = ""
strLast_Post = ""
strLast_Post_Author = ""
end if
rs.Close
set rs = nothing
'Huw -- Update member count
if (AutoApprove = "Yes") and blnTStatus = 2 and blnTopicMoved then
doUCount(strAuthor)
doULastPost(strAuthor)
end if
'## Forum_SQL - Update count of replies to a topic in Forum table
strSql = "UPDATE " & strTablePrefix & "FORUM SET "
strSql = strSql & " F_COUNT = (F_COUNT + " & intResetCount & ")"
if strLast_Post <> "" then
strSql = strSql & ", F_LAST_POST = '" & strLast_Post & "'"
if strLast_Post_Author <> "" then
strSql = strSql & ", F_LAST_POST_AUTHOR = " & strLast_Post_Author
end if
end if
strSql = strSql & " WHERE FORUM_ID = " & aryForum(1)
my_Conn.Execute(strSql)
'## Forum_SQL
strSql = "UPDATE " & strTablePrefix & "FORUM SET "
strSql = strSql & " F_TOPICS = F_TOPICS + 1 "
strSql = strSql & " WHERE FORUM_ID = " & aryForum(1)
my_Conn.Execute(strSql)
end if
end if
err_Msg = ""
aryForum = ""
if Err.description <> "" then
Go_Result "There was an error = " & Err.description, 0
Response.End
else
Go_Result "Updated OK", 1
end if
else
%>
There Was A Problem With Your Details
>Go Back To Enter Data
<%
end if
end if
if MethodType = "Topic" then
'## Forum_SQL
strSql = "SELECT MEMBER_ID, M_LEVEL, M_EMAIL, "&Strdbntsqlname
if strAuthType = "db" then
strSql = strSql & ", M_PASSWORD "
end if
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE "&Strdbntsqlname&" = '" & ChkString(STRdbntUserName, "SQLString") & "'"
strSql = strSql & " AND " & strMemberTablePrefix & "MEMBERS.M_STATUS = " & 1
if strAuthType = "db" then
strSql = strSql & " AND M_PASSWORD = '" & ChkString(Request.Form("Password"), "SQLString") &"'"
QuoteOk = (ChkQuoteOk(STRdbntUserName) and ChkQuoteOk(Request.Form("Password")))
else
QuoteOk = ChkQuoteOk(Session(strCookieURL & "userid"))
end if
set rs = my_Conn.Execute (strSql)
if rs.BOF or rs.EOF or not(QuoteOk) or not (ChkQuoteOk(Password))then '## Invalid Password
Go_Result "Invalid UserName or Password", 0
Response.End
else
if not(chkForumAccess(Forum_ID, getNewMemberNumber())) then
Go_Result "You are not allowed to post in this forum !", 0
end if
txtMessage = ChkString(Request.Form("Message"),"message")
txtSubject = ChkString(Request.Form("Subject"),"SQLString")
if txtMessage = " " then
Go_Result "You must post a message!", 0
Response.End
end if
if txtSubject = " " then
Go_Result "You must post a subject!", 0
Response.End
end if
if Request.Form("sig") = "yes" and GetSig(STRdbntUserName) <> "" then
txtMessage = txtMessage & vbNewline & vbNewline & ChkString(GetSig(STRdbntUserName), "signature" )
end if
'## Forum_SQL - Add new post to Topics Table
strSql = "INSERT INTO " & strTablePrefix & "TOPICS (FORUM_ID"
strSql = strSql & ", CAT_ID"
strSql = strSql & ", T_SUBJECT"
strSql = strSql & ", T_MESSAGE"
strSql = strSql & ", T_AUTHOR"
strSql = strSql & ", T_LAST_POST"
strSql = strSql & ", T_LAST_POST_AUTHOR"
strSql = strSql & ", T_DATE"
strSql = strSql & ", T_STATUS"
if strIPLogging <> "0" then
strSql = strSql & ", T_IP"
end if
strSql = strSql & ", T_ARCHIVE_FLAG"
'## strSql = strSql & ", C_STRMOVENOTIFY"
strSql = strSql & ") VALUES ("
strSql = strSql & Forum_ID
strSql = strSql & ", " & Cat_ID
strSql = strSql & ", '" & txtSubject & "'"
strSql = strSql & ", '" & txtMessage & "'"
strSql = strSql & ", " & rs("MEMBER_ID")
strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", " & rs("MEMBER_ID")
strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
if Request.Form("lock") = 1 then
strSql = strSql & ", 0 "
else
if Moderation = "Yes" then
strSql = strSql & ", 2 "
else
strSql = strSql & ", 1 "
end if
end if
if strIPLogging <> "0" then
strSql = strSql & ", '" & Request.ServerVariables("REMOTE_ADDR") & "'"
end if
strSql = strSql & ", 1 "
'## strSql = strSql & ", 1 "
strSql = strSql & ")"
my_Conn.Execute (strSql)
if Err.description <> "" then
err_Msg = "There was an error = " & Err.description
else
err_Msg = "Updated OK"
end if
' DEM --> Do not update forum count if topic is moderated.... Added if and end if
if Moderation = "No" then
'## Forum_SQL - Increase count of topics and replies in Forum table by 1
strSql = "UPDATE " & strTablePrefix & "FORUM "
strSql = strSql & " SET F_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", F_TOPICS = F_TOPICS + 1"
strSql = strSql & ", F_COUNT = F_COUNT + 1"
strSql = strSql & ", F_LAST_POST_AUTHOR = " & rs("MEMBER_ID") & ""
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
my_Conn.Execute (strSql)
strSql = "SELECT Max(TOPIC_ID) as NewTopicID "
strSql = strSql & " FROM " & strActivePrefix & "TOPICS "
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
strSql = strSql & " and T_AUTHOR = " & rs("MEMBER_ID")
set rs9 = my_Conn.Execute (strSql)
NewTopicID = rs9("NewTopicId")
rs9.close
set rs9 = nothing
ProcessSubscriptions rs("Member_ID"), Cat_ID, Forum_ID, NewTopicID
end if
Go_Result err_Msg, 1
Response.End
end if
end if
if MethodType = "Reply" or MethodType = "ReplyQuote" or MethodType = "TopicQuote" then
'## Forum_SQL
strSql = "SELECT MEMBER_ID, M_LEVEL, M_EMAIL, "&Strdbntsqlname
if strAuthType = "db" then
strSql = strSql & ", M_PASSWORD "
end if
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE "&Strdbntsqlname&" = '" & ChkString(STRdbntUserName, "SQLString") & "'"
strSql = strSql & " AND " & strMemberTablePrefix & "MEMBERS.M_STATUS = " & 1
if strAuthType = "db" then
strSql = strSql & " AND M_PASSWORD = '" & ChkString(Request.Form("Password"), "SQLString") &"'"
QuoteOk = (ChkQuoteOk(STRdbntUserName) and ChkQuoteOk(Request.Form("Password")))
else
QuoteOk = ChkQuoteOk(STRdbntUserName)
end if
set rs = my_Conn.Execute (strSql)
if rs.BOF or rs.EOF or not(QuoteOk) or not(ChkQuoteOk(Password)) then '## Invalid Password
err_Msg = "Invalid Password or User Name"
Go_Result(err_Msg), 0
Response.End
else
if not(chkForumAccess(Forum_ID,getNewMemberNumber())) then
Go_Result "You are not allowed to post in this forum !", 0
end if
txtMessage = ChkString(Request.Form("Message"),"message")
if txtMessage = " " then
Go_Result "You must post a message!", 0
Response.End
end if
if Request.Form("sig") = "yes" and GetSig(STRdbntUserName) <> "" then
txtMessage = txtMessage & vbNewline & vbNewline & ChkString(GetSig(STRdbntUserName), "signature" )
end if
'## Forum_SQL
strSql = "INSERT INTO " & strTablePrefix & "REPLY "
strSql = strSql & "(TOPIC_ID"
strSql = strSql & ", FORUM_ID"
strSql = strSql & ", CAT_ID"
strSql = strSql & ", R_AUTHOR"
strSql = strSql & ", R_DATE "
if strIPLogging <> "0" then
strSql = strSql & ", R_IP"
end if
strSql = strSql & ", R_STATUS"
strSql = strSql & ", R_MESSAGE"
strSql = strSql & ") VALUES ("
strSql = strSql & Topic_ID
strSql = strSql & ", " & Forum_ID
strSql = strSql & ", " & Cat_ID
strSql = strSql & ", " & rs("MEMBER_ID")
strSql = strSql & ", " & "'" & DateToStr(strForumTimeAdjust) & "'"
if strIPLogging <> "0" then
strSql = strSql & ", " & "'" & Request.ServerVariables("REMOTE_ADDR") & "'"
end if
' DEM --> Added R_STATUS to allow for moderation of posts
' Used R_STATUS = 1 to match the topic status code.
if Moderation = "Yes" then
strSql = strSql & ", 2"
else
strSql = strSql & ", 1"
end if
' DEM --> End of Code added
strSql = strSql & ", " & "'" & txtMessage & "'"
strSql = strSql & ")"
my_Conn.Execute (strSql)
' DEM --> Do not update totals on topics and forums database if post is moderated...Added if and end if
if Moderation = "No" then
'## Forum_SQL - Update Last Post and count
strSql = "UPDATE " & strActivePrefix & "TOPICS "
strSql = strSql & " SET T_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", T_REPLIES = T_REPLIES + 1 "
strSql = strSql & ", T_LAST_POST_AUTHOR = " & rs("MEMBER_ID")
if Request.Form("lock") = 1 then
strSql = strSql & ", T_STATUS = 0 "
end if
strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID
my_Conn.Execute (strSql)
'## Forum_SQL
strSql = "UPDATE " & strTablePrefix & "FORUM "
strSql = strSql & " SET F_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", F_LAST_POST_AUTHOR = " & rs("MEMBER_ID")
strSql = strSql & ", F_COUNT = F_COUNT + 1 "
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
my_Conn.Execute (strSql)
end if
if Err.description <> "" then
Go_Result "There was an error = " & Err.description, 0
Response.End
else
if Moderation = "No" then
ProcessSubscriptions rs("Member_ID"), Cat_ID, Forum_ID, Topic_ID
end if
Go_Result "Updated OK", 1
Response.End
end if
end if
end if
if MethodType = "Forum" then
member = cint(ChkUser(strDBNTUserName, Request.Form("Password")))
select case Member
case 0
'## Invalid Pword
Go_Result "Invalid Password or UserName", 0
Response.End
case 1 '## Author of Post
'## Do Nothing
case 2 '## Normal User - Not Authorised
Go_Result "Only the Moderator can create a Forum", 0
Response.End
case 3 '## Moderator
if chkForumModerator(Forum_ID, STRdbntUserName) = "0" then
Go_Result "Only the Moderator can create a Forum", 0
end if
case 4 '## Admin
'## Do Nothing
case else
Go_Result cstr(Member), 0
Response.End
end select
txtMessage = ChkString(Request.Form("Message"),"message")
txtSubject = ChkString(Request.Form("Subject"),"SQLString")
Err_Msg = ""
if txtSubject = " " then
Err_Msg = Err_Msg & "You Must Enter a Subject for the New Forum"
end if
if Err_Msg = "" then
'## Forum_SQL - Do DB Update
strSql = "INSERT INTO " & strTablePrefix & "FORUM "
strSql = strSql & "(CAT_ID"
if strPrivateForums = "1" then
strSql = strSql & ", F_PRIVATEFORUMS"
if Request.Form("AuthPassword") <> " " then
strSql = strSql & ", F_PASSWORD_NEW"
end if
end if
strSql = strSql & ", F_LAST_POST"
strSql = strSql & ", F_SUBJECT"
strSql = strSql & ", F_DESCRIPTION"
strSql = strSql & ", F_TYPE"
strSql = strSql & ", F_L_ARCHIVE "
strSql = strSql & ", F_ARCHIVE_SCHED "
strSql = strSql & ", F_L_DELETE "
strSql = strSql & ", F_DELETE_SCHED "
strSql = strSql & ", F_SUBSCRIPTION"
strSql = strSql & ", F_MODERATION"
strSql = strSql & ", F_ORDER "
strSql = strSql & ") VALUES ("
strSql = strSql & Cat_ID
if strPrivateForums = "1" then
strSql = strSql & ", " & Request.Form("AuthType") & ""
if Request.Form("AuthPassword") <> " " then
strSql = strSql & ", '" & ChkString(Request.Form("AuthPassword"),"SQLString") & "'"
end if
end if
strSql = strSql & ", " & "'" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", '" & txtSubject & "'"
strSql = strSql & ", '" & txtMessage & "'"
strSql = strSql & ", " & ChkString(Request.Form("Type"), "SQLString")
strSql = strSql & ", '' "
strSql = strSql & ", 30 "
strSql = strSql & ", '' "
strSql = strSql & ", 365 "
' DEM --> Start of Code added for moderation and subscription
if strSubscription = 1 and CatSubscription > 0 then
strSql = strSql & ", " & fSubscription
else
strSql = strSql & ", 0"
end if
if strModeration = 1 and CatModeration = 1 then
strSql = strSql & ", " & ChkString(Request.Form("Moderation"), "SQLString")
else
strSql = strSql & ", 0"
end if
' DEM --> End of Code added for moderation and subscription
strSql = strSql & ", 1 "
strSql = strSql & ")"
my_Conn.Execute (strSql)
err_Msg = ""
if Err.description <> "" then
Go_Result "There was an error = " & Err.description, 0
Response.End
Else
set rsCount = my_Conn.execute("SELECT MAX(FORUM_ID) AS maxForumID FROM " & strTablePrefix & "FORUM ")
newForumMembers rsCount("maxForumId")
Go_Result "Updated OK", 1
end if
else
%>
There Was A Problem With Your Details
>Go Back To Enter Data
<%
end if
end if
if MethodType = "URL" then
member = cint(ChkUser(strDBNTUserName, Request.Form("Password")))
select case Member
case 0'## Invalid Pword
Go_Result "Invalid Password or UserName", 0
Response.End
case 1 '## Author of Post
'## Do Nothing
case 2 '## Normal User - Not Authorised
Go_Result "Only the Moderator can create a web link", 0
Response.End
case 3 '## Moderator
if chkForumModerator(Forum_ID, STRdbntUserName) = "0" then
Go_Result "Only the Moderator can create a web link", 0
end if
case 4 '## Admin
'## Do Nothing
case else
Go_Result cstr(Member), 0
Response.End
end select
txtMessage = ChkString(Request.Form("Message"),"message")
txtAddress = ChkString(Request.Form("Address"),"url")
txtSubject = ChkString(Request.Form("Subject"),"SQLString")
Err_Msg = ""
if txtSubject = " " then
Err_Msg = Err_Msg & "You Must Enter a Subject for the New URL"
end if
if txtAddress = " " or lcase(txtAddress) = "http://" or lcase(txtAddress) = "https://" or lcase(txtAddress) = "file:///" then
Err_Msg = Err_Msg & "You Must Enter an Address for the New URL"
end if
if (left(lcase(txtAddress), 7) <> "http://" and left(lcase(txtAddress), 8) <> "https://" and left(lcase(txtAddress), 8) <> "file:///") and txtAddress <> "" then
Err_Msg = Err_Msg & "You Must prefix the Address with http://, https:// or file:///"
end if
if Err_Msg = "" then
'## Forum_SQL - Do DB Update
strSql = "INSERT INTO " & strTablePrefix & "FORUM "
strSql = strSql & "(CAT_ID"
if strPrivateForums = "1" then
strSql = strSql & ", F_PRIVATEFORUMS"
end if
strSql = strSql & ", F_LAST_POST"
strSql = strSql & ", F_LAST_POST_AUTHOR"
strSql = strSql & ", F_SUBJECT"
strSql = strSql & ", F_URL"
strSql = strSql & ", F_DESCRIPTION"
strSql = strSql & ", F_TYPE"
strSql = strSql & ", F_L_ARCHIVE "
strSql = strSql & ", F_ARCHIVE_SCHED "
strSql = strSql & ", F_L_DELETE "
' strSql = strSql & ", F_L_DELETE_SCHED "
strSql = strSql & ", F_DELETE_SCHED "
strSql = strSql & ", F_SUBSCRIPTION, F_MODERATION"
strSql = strSql & ", F_ORDER "
strSql = strSql & ") VALUES ("
strSql = strSql & Cat_ID
if strPrivateForums = "1" then
strSql = strSql & ", " & ChkString(Request.Form("AuthType"), "SQLString") & ""
end if
strSql = strSql & ", " & "'" & DateToStr(strForumTimeAdjust) & "'"
' strSql = strSql & ", " & getMemberID(strDBNTFUserName) & " "
strSql = strSql & ", " & getMemberID(strDBNTUserName) & " "
strSql = strSql & ", " & "'" & txtSubject & "'"
strSql = strSql & ", " & "'" & txtAddress & "'"
strSql = strSql & ", " & "'" & txtMessage & "'"
strSql = strSql & ", " & Request.Form("Type")
strSql = strSql & ", ''"
strSql = strSql & ", 30"
strSql = strSql & ", ''"
strSql = strSql & ", 365"
' DEM --> Added 0's for the subscription and moderation fields since they are ignored for URLS
strSql = strSql & ", 0, 0"
strSql = strSql & ", 1"
' strSql = strSql & ", 0"
strSql = strSql & ") "
my_Conn.Execute (strSql)
err_Msg = ""
if Err.description <> "" then
Go_Result "There was an error = " & Err.description, 0
Response.End
else
set rsCount = my_Conn.execute("SELECT MAX(FORUM_ID) AS maxForumID FROM " & strTablePrefix & "FORUM ")
newForumMembers rsCount("maxForumId")
Go_Result "Updated OK", 1
end if
else
%>
There Was A Problem With Your Details
>Go Back To Enter Data
<%
end if
end if
if MethodType = "EditForum" then
member = cint(ChkUser(STRdbntUserName, Request.Form("Password")))
select case Member
case 0
'## Invalid Pword
Go_Result "Invalid Password or UserName", 0
Response.End
case 1 '## Author of Post
'## Do Nothing
case 2 '## Normal User - Not Authorised
Go_Result "Only Admins and Moderators can change this Forum", 0
Response.End
case 3 '## Moderator
if chkForumModerator(Forum_ID, STRdbntUserName) = "0" then
Go_Result "Only Admins and Moderators change this Forum", 0
end if
case 4 '## Admin
'## Do Nothing
case else
Go_Result cstr(Member), 0
Response.End
end select
txtMessage = ChkString(Request.Form("Message"),"message")
txtSubject = ChkString(Request.Form("Subject"),"SQLString")
Err_Msg = ""
if txtSubject = " " then
Err_Msg = Err_Msg & "You Must Enter a Subject for the Forum"
end if
if Err_Msg = "" then
'## Forum_SQL - Check if CAT_ID changed
strSql = "SELECT " & strTablePrefix & "FORUM.CAT_ID "
strSql = strSql & " FROM " & strTablePrefix & "FORUM "
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
set rsCatIDCheck = my_Conn.execute(strSql)
bolCatIDChanged = (cSTr(rsCatIDCheck("CAT_ID")) <> ChkString(Request.Form("Category"), "SQLString"))
rsCatIDCheck.Close
set rsCatIDCheck = Nothing
'## Forum_SQL - Do DB Update
strSql = "UPDATE " & strTablePrefix & "FORUM "
strSql = strSql & " SET CAT_ID = " & ChkString(Request.Form("Category"), "SQLString")
if strPrivateForums = "1" then
strSql = strSql & ", F_PRIVATEFORUMS = " & Request.Form("AuthType") & ""
if Request.Form("AuthPassword") <> " " then
strSql = strSql & ", F_PASSWORD_NEW = '" & ChkString(Request.Form("AuthPassword"),"SQLString") & "'"
end if
end if
strSql = strSql & ", F_SUBJECT = '" & txtSubject & "'"
strSql = strSql & ", F_DESCRIPTION = '" & txtMessage & "'"
if Request.Form("Moderation") <> "" then
strSql = strSql & ", F_MODERATION = " & ChkString(Request.Form("Moderation"), "SQLString")
end if
if fSubscription <> "" then
strSql = strSql & ", F_SUBSCRIPTION = " & fSubscription
end if
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
my_Conn.Execute (strSql)
if bolCatIDChanged then
'## Update category CAT_SUBSCRIPTION/CAT_MODERATION if required
strSQL = "SELECT " & strTablePrefix & "CATEGORY.CAT_SUBSCRIPTION, " & strTablePrefix & "CATEGORY.CAT_MODERATION FROM " & strTablePrefix & "CATEGORY "
strSQL = strSQL & " WHERE CAT_ID=" & ChkString(Request.Form("Category"), "SQLString")
set rs = my_conn.execute(strSQL)
intCatSubs = rs("CAT_SUBSCRIPTION")
intCatMod = rs("CAT_MODERATION")
rs.close
if intCatSubs < fSubscription then
strSQL = "UPDATE " & strTablePrefix & "CATEGORY SET " & strTablePrefix & "CATEGORY.CAT_SUBSCRIPTION = " & fSubscription
my_Conn.Execute (strSql)
end if
if intCatMod = 0 and Request.Form("Moderation") > 0 then
strSQL = "UPDATE " & strTablePrefix & "CATEGORY SET " & strTablePrefix & "CATEGORY.CAT_MODERATION = " & 1
my_Conn.Execute (strSql)
end if
'## Forum_SQL - Do DB Update
strSql = "UPDATE " & strActivePrefix & "TOPICS "
strSql = strSql & " SET CAT_ID = " & ChkString(Request.Form("Category"), "SQLString")
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
my_Conn.Execute (strSql)
'## Forum_SQL - Do DB Update
strSql = "UPDATE " & strActivePrefix & "REPLY "
strSql = strSql & " SET CAT_ID = " & Request.Form("Category")
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
my_Conn.Execute (strSql)
' DEM --> Added _SUBSCRIPTIONS table
'## Forum_SQL - Do DB Update
strSql = "UPDATE " & strTablePrefix & "SUBSCRIPTIONS "
strSql = strSql & " SET CAT_ID = " & ChkString(Request.Form("Category"), "SQLString")
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
my_Conn.Execute (strSql)
end if
err_Msg= ""
if Err.description <> "" then
Go_Result "There was an error = " & Err.description, 0
Response.End
else
set rsCount = my_Conn.execute("SELECT MAX(FORUM_ID) AS maxForumID FROM " & strTablePrefix & "FORUM ")
updateForumMembers Forum_ID
Go_Result "Updated OK", 1
end if
else
%>
There Was A Problem With Your Details
>Go Back To Enter Data
<%
end if
end if
if MethodType = "EditURL" then
member = cint(ChkUser(strDBNTUserName, Request.Form("Password")))
select case Member
case 0
'## Invalid Pword
Go_Result "Invalid Password or UserName", 0
Response.End
case 1 '## Author of Post
'## Do Nothing
case 2 '## Normal User - Not Authorised
Go_Result "Only Admins and Moderators can change this Forum", 0
Response.End
case 3 '## Moderator
if chkForumModerator(Forum_ID, STRdbntUserName) = "0" then
Go_Result "Only Admins and Moderators change this Forum", 0
end if
case 4 '## Admin
'## Do Nothing
case else
Go_Result cstr(Member), 0
Response.End
end select
txtMessage = ChkString(Request.Form("Message"),"message")
txtAddress = ChkString(Request.Form("Address"),"url")
txtSubject = ChkString(Request.Form("Subject"),"SQLString")
Err_Msg = ""
if txtSubject = " " then
Err_Msg = Err_Msg & "You Must Enter a Subject for the New URL"
end if
if txtAddress = " " or lcase(txtAddress) = "http://" or lcase(txtAddress) = "https://" or lcase(txtAddress) = "file:///" then
Err_Msg = Err_Msg & "You Must Enter an Address for the New URL"
end if
if (left(lcase(txtAddress), 7) <> "http://" and left(lcase(txtAddress), 8) <> "https://" and left(lcase(txtAddress), 8) <> "file:///") and (txtAddress <> "") then
Err_Msg = Err_Msg & "You Must prefix the Address with http://, https:// or file:///"
end if
if Err_Msg = "" then
'## Forum_SQL - Do DB Update
strSql = "UPDATE " & strTablePrefix & "FORUM "
strSql = strSql & " SET CAT_ID = " & ChkString(Request.Form("Category"), "SQLString")
if strPrivateForums = "1" then
strSql = strSql & ", F_PRIVATEFORUMS = " & ChkString(Request.Form("AuthType"), "SQLString") & ""
end if
strSql = strSql & ", F_SUBJECT = '" & txtSubject & "'"
strSql = strSql & ", F_URL = '" & txtAddress & "'"
strSql = strSql & ", F_DESCRIPTION = '" & txtMessage & "'"
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
my_Conn.Execute (strSql)
err_Msg= ""
if Err.description <> "" then
Go_Result "There was an error = " & Err.description, 0
Response.End
else
set rsCount = my_Conn.execute("SELECT MAX(FORUM_ID) AS maxForumID FROM " & strTablePrefix & "FORUM ")
updateForumMembers Forum_ID
Go_Result "Updated OK", 1
end if
else
%>
There Was A Problem With Your Details
>Go Back To Enter Data
<%
end if
end if
if MethodType = "Category" then
member = cint(ChkUser(STRdbntUserName, Request.Form("Password")))
select case Member
case 0
'## Invalid Pword
Go_Result "Invalid Password or UserName", 0
Response.End
case 1 '## Author of Post
'## Do Nothing
case 2 '## Normal User - Not Authorised
Go_Result "Only an administrator can create a category", 0
Response.End
case 3 '## Moderator
if chkForumModerator(Forum_ID, STRdbntUserName) = "0" then
Go_Result "Only an administrator can create a category", 0
end if
case 4 '## Admin
'## Do Nothing
case else
Go_Result cstr(Member), 0
Response.End
end select
Err_Msg = ""
if Request.Form("Subject") = "" then
Err_Msg = Err_Msg & "You Must Enter a Subject for the New Category"
end if
if Err_Msg = "" then
'## Forum_SQL - Do DB Update
' DEM --> Insert replaced to add subscription and moderation capabilities
strSql = "INSERT INTO " & strTablePrefix & "CATEGORY (CAT_NAME, CAT_SUBSCRIPTION, CAT_MODERATION, CAT_ORDER) "
strSql = strSql & " VALUES ('" & ChkString(Request.Form("Subject"),"SQLString") & "'"
if strSubscription <> 0 then
strSql = strSql & ", " & fSubscription
else
strSql = strSql & ", 0"
end if
if strModeration <> 0 then
strSql = strSql & ", " & ChkString(Request.Form("Moderation"), "SQLString")
else
strSql = strSql & ", 0"
end if
strSql = strSql & ", 1"
strSql = strSql & ")"
my_Conn.Execute (strSql)
err_Msg= ""
if Err.description <> "" then
Go_Result "There was an error = " & Err.description, 0
Response.End
else
Go_Result "Updated OK", 1
end if
else
%>
There Was A Problem With Your Details
>Go Back To Enter Data
<%
end if
end if
if MethodType = "EditCategory" then
member = cint(ChkUser(STRdbntUserName, Request.Form("Password")))
select case Member
case 0
'## Invalid Pword
Go_Result "Invalid Password or UserName", 0
Response.End
case 1 '## Author of Post
'## Do Nothing
case 2 '## Normal User - Not Authorised
Go_Result "Only an administrator can change a category", 0
Response.End
case 3 '## Moderator
'## Do Nothing
if chkForumModerator(Forum_ID, STRdbntUserName) = "0" then
Go_Result "Only an administrator can change a category", 0
end if
case 4 '## Admin
'## Do Nothing
case else
Go_Result cstr(Member), 0
Response.End
end select
Err_Msg = ""
if Request.Form("Subject") = "" then
Err_Msg = Err_Msg & "You Must Enter a Subject for the Category"
end if
if Err_Msg = "" then
'## Forum_SQL - Do DB Update
strSql = "UPDATE " & strTablePrefix & "CATEGORY "
strSql = strSql & " SET CAT_NAME = '" & ChkString(Request.Form("Subject"),"SQLString") & "'"
' DEM --> Start of Code added for moderation and subscription functionality
if strModeration <> 0 then
strSql = strSql & ", CAT_MODERATION = " & ChkString(Request.Form("Moderation"), "SQLString")
end if
if strSubscription <> 0 then
strSql = strSql & ", CAT_SUBSCRIPTION = " & ChkString(Request.Form("Subscription"), "SQLString")
end if
' DEM --> End of code added for moderation and subscription functionality
strSql = strSql & " WHERE CAT_ID = " & Cat_ID
my_Conn.Execute (strSql)
err_Msg= ""
if Err.description <> "" then
Go_Result "There was an error = " & Err.description, 0
Response.End
else
Go_Result "Updated OK", 1
end if
else
%>
There Was A Problem With Your Details
>Go Back To Enter Data
<%
end if
end if
set rs = nothing
Go_Result "", 1
response.end
sub Go_Result(str_err_Msg, boolOk)
Response.write ""
if boolOk = 1 then
Response.write ""
select case MethodType
case "Edit"
Response.Write("Your Reply Was Changed Successfully!")
case "EditCategory"
' DEM --> Added if statement to handle if subscriptions or moderation is allowed
if strSubscription > 0 or strModeration > 0 then
Response.Write("Category Information Changed Successfully")
else
Response.Write("Category Name Changed Successfully!")
end if
case "EditForum"
Response.Write("FORUM Information Updated Successfully!")
case "EditTopic"
Response.Write("Topic Changed Successfully!")
case "EditURL"
Response.Write("URL Information Updated Successfully!")
case "Reply", "ReplyQuote", "TopicQuote"
' DEM --> If moderated post, the counts should not be updated until after approval
' Combined the Reply, ReplyQuote and TopicQuote because the basic code was the same.
if Moderation = "Yes" then
Response.Write("New Reply Posted! It will appear once approved by a moderator")
else
Response.Write("New Reply Posted!")
DoPCount
DoUCount Request.Form("UserName")
DoULastPost Request.Form("UserName")
end if
case "Topic"
' DEM --> If moderated post, the counts should not be updated until after approval
if Moderation = "Yes" then
Response.Write("New Topic Posted! It will appear once approved by a moderator")
else
Response.Write("New Topic Posted!")
DoTCount
DoPCount
DoUCount Request.Form("UserName")
DoULastPost Request.Form("UserName")
end if
case "Forum"
Response.Write("New Forum Created!")
case "URL"
Response.Write("New URL Created!")
case "Category"
Response.Write("New Category Created!")
case else
Response.Write("Complete!")
DoPCount
DoUCount Request.Form("UserName")
DoULastPost Request.Form("UserName")
end select
Response.write "
" &_
"" &_
""
select case MethodType
case "Category"
Response.Write("Remember to create at least one new forum in this category.")
case "Forum"
Response.Write("The new forum is ready for users to begin posting!")
case "EditForum", "EditCategory"
Response.Write("Thank you for your contribution!")
case "URL"
Response.Write("The new URL is in place!")
case "EditURL"
Response.Write("Cheers! Have a nice day!")
case "Topic", "TopicQuote", "EditTopic", "Reply", "ReplyQuote", "Edit"
Response.Write("Thank you for your contribution!")
case else
Response.Write("Have a nice day!")
end select
Response.write "
" &_
"Back To Forum
"
else
Response.write "There has been a problem!
" &_
"" & str_err_Msg & "
" &_
"Go back to correct the problem.
"
end if
WriteFooter
Response.End
end sub
sub newForumMembers(fForumID)
on error resume next
if Request.Form("AuthUsers") = "" then
exit Sub
end if
Users = split(Request.Form("AuthUsers"),",")
for count = Lbound(Users) to Ubound(Users)
strSql = "INSERT INTO " & strTablePrefix & "ALLOWED_MEMBERS ("
strSql = strSql & " MEMBER_ID, FORUM_ID) VALUES ( "& Users(count) & ", " & fForumID & ")"
my_conn.execute (strSql)
if err.number <> 0 then
Go_REsult err.description, 0
end if
next
end sub
sub updateForumMembers(fForumID)
my_Conn.execute ("DELETE FROM " & strTablePrefix & "ALLOWED_MEMBERS WHERE FORUM_ID = " & fForumId)
newForumMembers(fForumID)
end sub
sub DoAutoMoveEmail(TopicNum)
'## Emails Topic Author if Topic Moved.
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID," & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.M_EMAIL, " & strActivePrefix & "TOPICS.FORUM_ID, " & strActivePrefix & "TOPICS.T_SUBJECT "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strActivePrefix & "TOPICS "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strActivePrefix & "TOPICS.T_AUTHOR "
strSql = strSql & " AND " & strActivePrefix & "TOPICS.TOPIC_ID = " & TopicNum
set rs2 = my_Conn.Execute (strSql)
email = rs2("M_EMAIL")
user_name = rs2("M_NAME")
Topic_Title = rs2("T_SUBJECT")
ForumId = rs2("FORUM_ID")
Usernum = rs2("MEMBER_ID")
rs2.close
if lcase(strEmail) = "1" then
strRecipientsName = user_name
strRecipients = email
strSubject = strForumTitle & " - Topic Moved"
strMessage = "Hello " & user_name & vbCrLf & vbCrLf
strMessage = strMessage & "Your posting on " & strForumTitle & "." & vbCrLf
strMessage = strMessage & "Regarding the subject - " & Topic_Title & "." & vbCrLf & vbCrLf
if not(chkForumAccess(ForumID,Usernum)) then
strMessage = strMessage & "Has been removed from public display, If you have any questions regarding this, please contact the Administrator of the forum" & vbCrLf
else
strMessage = strMessage & "Has been moved to a new forum, You can view it at " & vbCrLf & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "topic.asp?TOPIC_ID=" & TopicNum & vbCrLf
end if
%>
<%
end if
end sub
%>