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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Poll Mod Addon Error in post_info.asp
 New Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

MaGraham
Senior Member

USA
1297 Posts

Posted - 10 December 2013 :  20:40:17  Show Profile  Reply with Quote
When trying to create a poll, after doing Carefree's "Poll Mod Addon," I am receiving the following error.


Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 5.1 Driver][mysqld-5.5.28]Unknown column 'P_ENDDATE' in 'field list'

/fp/post_info.asp, line 1098



Here's my post_info.asp if someone could help, please.




<%
'#################################################################################
'## Snitz Forums 2000 v3.4.07
'#################################################################################
'## Copyright (C) 2000-06 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
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<!--#INCLUDE FILE="inc_moderation.asp" -->
<!--#INCLUDE FILE="inc_subscription.asp" -->
<!--#INCLUDE FILE="inc_func_count.asp" -->
<!--#INCLUDE FILE="cal_post_info1.asp" -->
<%
if request("ARCHIVE") = "true" then
   strActivePrefix = strTablePrefix & "A_"
   ArchiveView = "true"
else
   strActivePrefix = strTablePrefix
   ArchiveView = ""
end if

'Topic Move Check
Dim blnTopicMoved
Dim fSubscription
'####### Poll Mod #########
Dim txtAns()
'##########################

fsubscription = 1
blnTopicMoved = false

if strAuthType = "db" and strDBNTUserName = "" and len(Request.Form("Password")) <> 64 then
   strPassword = sha256("" & Request.Form("Password"))
else
   strPassword = ChkString(Request.Form("Password"),"SQLString")
end if

if strAuthType = "db" and strDBNTUserName = "" then
   strDBNTUserName = Request.Form("UserName")
   if mLev = 0 then mLev = cLng(chkUser(strDBNTUserName, strPassword,-1))
end if

MethodType = chkString(Request.Form("Method_Type"),"SQLString")

if Request.Form("CAT_ID") <> "" then
   if IsNumeric(Request.Form("CAT_ID")) = True then
      Cat_ID = cLng(Request.Form("CAT_ID"))
   else
      Response.Redirect("default.asp")
   end if
end if
if Request.Form("FORUM_ID") <> "" then
   if IsNumeric(Request.Form("FORUM_ID")) = True then
      Forum_ID = cLng(Request.Form("FORUM_ID"))
   else
      Response.Redirect("default.asp")
   end if
end if
if Request.Form("TOPIC_ID") <> "" then
   if IsNumeric(Request.Form("TOPIC_ID")) = True then
      Topic_ID = cLng(Request.Form("TOPIC_ID"))
   else
      Response.Redirect("default.asp")
   end if
end if
if Request.Form("REPLY_ID") <> "" then
   if IsNumeric(Request.Form("REPLY_ID")) = True then
      Reply_ID = cLng(Request.Form("REPLY_ID"))
   else
      Response.Redirect("default.asp")
   end if
end if
if Request.Form("Subscription") <> "" then
   fSubscription = cLng(Request.Form("Subscription"))
else
   fSubscription = 0
end if

if Request.Form("cookies") = "yes" then
   strSelectSize = Request.Form("SelectSize")
end if

if strSelectSize = "" or IsNull(strSelectSize) then
   strSelectSize = Request.Cookies(strUniqueID & "strSelectSize")
end if
if not(IsNull(strSelectSize)) and strSelectSize <> "" then
   if strSetCookieToForum = 1 then
         Response.Cookies(strUniqueID & "strSelectSize").Path = strCookieURL
   else
      Response.Cookies(strUniqueID & "strSelectSize").Path = "/"
   end if
   Response.Cookies(strUniqueID & "strSelectSize") = strSelectSize
   Response.Cookies(strUniqueID & "strSelectSize").expires = dateAdd("yyyy", 1, strForumTimeAdjust)
end if

if MethodType = "Edit" or _
MethodType = "EditTopic" or _
MethodType = "Reply" or _
MethodType = "ReplyQuote" or _
MethodType = "TopicQuote" then
   '## check if topic exists in TOPICS table
   set rsTCheck = my_Conn.Execute ("SELECT TOPIC_ID FROM " & strActivePrefix & "TOPICS WHERE TOPIC_ID = " & Topic_ID)
   if rsTCheck.EOF or rsTCheck.BOF then
      set rsTCheck = nothing
      Go_Result "Sorry, that Topic no longer exists in the Database", 0
   end if
   set rsTCheck = nothing
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 R_AUTHOR "
   strSql = strSql & " FROM " & strActivePrefix & "REPLY "
   strSql = strSql & " WHERE REPLY_ID = " & REPLY_ID

   set rsStatus = my_Conn.Execute(strSql)
   if rsStatus.EOF or rsStatus.BOF then
      rsStatus.close
      set rsStatus = nothing
      Go_Result "Please don't attempt to edit the URL<br />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 C.CAT_STATUS, C.CAT_NAME, " &_
      "F.FORUM_ID, F.F_STATUS, F.F_TYPE, F.F_SUBJECT, " &_
      "T.T_STATUS, T.T_AUTHOR, T.T_SUBJECT " &_
      " FROM " & strTablePrefix & "CATEGORY C, " &_
      strTablePrefix & "FORUM F, " &_
      strActivePrefix & "TOPICS T" &_
      " WHERE C.CAT_ID = T.CAT_ID " &_
      " AND F.FORUM_ID = T.FORUM_ID " &_
      " AND T.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 C.CAT_STATUS, C.CAT_NAME, " &_
      "F.FORUM_ID, F.F_STATUS, F.F_TYPE, F.F_SUBJECT " &_
      " FROM " & strTablePrefix & "CATEGORY C, " &_
      strTablePrefix & "FORUM F" &_
      " WHERE C.CAT_ID = F.CAT_ID " &_
      " AND F.FORUM_ID = " & Forum_ID & ""
        end if

   set rsStatus = my_Conn.Execute(strSql)
   if rsStatus.EOF or rsStatus.BOF then
      rsStatus.close
      set rsStatus = nothing
      Go_Result "Please don't attempt to edit the URL<br />to gain access to locked Forums/Categories.", 0
   else
      blnCStatus = rsStatus("CAT_STATUS")
      strCatTitle = rsStatus("CAT_NAME")
      blnFStatus = rsStatus("F_STATUS")
      Forum_ID = rsStatus("FORUM_ID")
      Forum_Type = rsStatus("F_TYPE")
      strForum_Title = rsStatus("F_SUBJECT")
      if MethodType <> "Topic" then
         blnTStatus = rsStatus("T_STATUS")
         strTopicAuthor = rsStatus("T_AUTHOR")
         strTopicTitle = rsStatus("T_SUBJECT")
      else
         blnTStatus = 1
      end if
      rsStatus.close
      set rsStatus = nothing
   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

   select case MethodType
      case "Topic"
         if (Forum_Type = 1) then
            Go_Result "You have attempted to post a New Topic to a Forum designated as a Web Link",0
         end if
         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
'#######    Begin UserGroup MOD     #######
    if isDeniedMember(Forum_ID,MemberID) = 1 then
        Go_Result "You have been denied access to this forum"
    end if
    if isReadOnly(Forum_ID,MemberID) = 1 then
        Go_Result "Your access to this forum is read-only"
    end if
'#######     End UserGroup MOD      #######
   if strPrivateForums = "1" and ForumChkSkipAllowed = 0 then
      if not(chkForumAccess(Forum_ID,MemberID,false)) then
            Go_Result "You do not have access to post to this forum", 0
      end if
   end if
end if
'##DRAFTS ## User Space Mod ## ADD line below ######################

 %><!--#INCLUDE FILE="inc_draft_info.asp" --><%

'## End ## Thats all for this file #############################

' If Creating a new topic or reply, the subscription and moderation capabilities will need to be checked.

Moderation = "No"
'############# Merge Topic Mod ################
'Added "or _ MethodType = "MergeTopic"" in following if...then statement
if MethodType = "Topic" or _
   MethodType = "Edit" or _
   MethodType = "Reply" or _
   MethodType = "ReplyQuote" or _
   MethodType = "TopicQuote" or _
   MethodType = "Forum" or _
   MethodType = "EditForum" or _
   MethodType = "MergeTopic" or _
   MethodType = "SplitTopic"  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?
            '####################### Merge Topic Mod #############################
            ' Added "or MethodType = "MergeTopic"" in following line
            elseif (ForumModeration = 1 or ForumModeration = 3) and (MethodType <> "Topic" or MethodType = "MergeTopic") then
            '#####################################################################
               Moderation = "Yes"
            end if
            end if
            end if
   end if
end if

if MethodType = "Edit" then
   member = cLng(ChkUser(strDBNTUserName, strPassword, 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 an Admin, a Moderator or 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 an Admin, a Moderator or the Author can change this post", 0
         end if
         if strReplyAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
            Go_Result "Only the website owner can change this post", 0
         end if
      case 4 '## Admin so OK
         if strReplyAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
            Go_Result "Only the website owner can change this post", 0
         end if
      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 & "<li>You Must Enter a Message for your Reply</li>"
   end if
   if Err_Msg = "" then
      '## Forum_SQL - Do DB Update
      strSql = "UPDATE " & strActivePrefix & "REPLY "
      strSql = strSql & " SET R_MESSAGE = '" & txtMessage & "'"
      strSql = strSql & ", R_MSGICON = " & cLng(Request.Form("strMessageIcon"))
      if Request.Form("sig") = "yes" and strDSignatures = "1" then
         strSql = strSql & ", R_SIG = 1"
      else
         strSql = strSql & ", R_SIG = 0"
      end if
      if mLev < 4 and strEditedByDate = "1" then
         strSql = strSql & ", R_LAST_EDIT = '"  & DateToStr(strForumTimeAdjust) & "'"
         strSql = strSql & ", R_LAST_EDITBY = "  & MemberID
      end if
      strSql = strSql & " WHERE REPLY_ID=" & Reply_ID

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      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 = " & MemberID
         strSql = strSql & ",    F_LAST_POST_TOPIC_ID = " & Topic_ID
         strSql = strSql & ",    F_LAST_POST_REPLY_ID = " & Reply_ID
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

         '## Forum_SQL - Update Last Post
         strSql = " UPDATE " & strActivePrefix & "TOPICS"
         strSql = strSql & " SET T_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
         strSql = strSql & ",    T_LAST_POST_AUTHOR = " & MemberID
         strSql = strSql & ",    T_LAST_POST_REPLY_ID = " & Reply_ID
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

      if Moderation = "No" then
         '## Subscribe checkbox start ##
         if request.form("TNotify") <> "" then
            if request.form("TNotify") = "1" then
               AddSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
            else
               DeleteSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
            end if
         end if
         '## Subscribe checkbox end ##
      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
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "EditTopic" then
   member = cLng(ChkUser(strDBNTUserName, strPassword, 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 an Admin, a Moderator or the Author can change this post", 0
         Response.End
      case 3 '## Moderator so
         if chkForumModerator(Forum_ID, strDBNTUserName) = "0" then
            Go_Result "Only an Admin, a Moderator or the Author can change this post", 0
         end if
         if strTopicAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
            Go_Result "Only the website owner can change this post", 0
         end if
      case 4 '## Admin so OK
         if strTopicAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
            Go_Result "Only the website owner can change this post", 0
         end if
         '## 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")
' ######################### Poll Mod ########################
   if Request.Form("poll") = "1" then
      count = Request.Form("count")
      ReDim txtAns(CInt(count))

      For i = 1 To CInt(count)
         if trim(Request.Form("answer" & CStr(i))) <> "" then
            txtAns(i) = Request.Form("answer" & CStr(i))
         else
            txtAns(i) = ""
         end if
      Next
   end if
' ###########################################################
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the Topic</li>"
   end if
   if Len(Request.Form("Subject")) > 50 then
      Err_Msg = Err_Msg & "<li>The Subject can not be greater than 50 characters</li>"
   end if
   if txtMessage = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Message for the Topic</li>"
   end if
' ######################### Poll Mod ########################
   if Request.Form("poll") = "1" then
      count = Request.Form("count")
      For i = 1 to CInt(count)
         if trim(Request.Form("answer" & CStr(i))) <> "" then
            intCount = intCount + 1
         end if
      Next
      if intCount < 2 then
         Err_Msg = Err_Msg & "<li>You Must Enter at least two Answers for the Poll</li>"
      end if
   end if
' ###########################################################
   if Err_Msg = "" then
      '##Get Status of this Topic
      strSql = "SELECT T_STATUS, T_UREPLIES"
      strSql = Strsql & " FROM " & strTablePrefix & "TOPICS "
      strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

      set rsTopicStatusCheck = my_Conn.Execute (strSql)

      Topic_Status = rsTopicStatusCheck("T_STATUS")
      Topic_UReplies = rsTopicStatusCheck("T_UREPLIES")

      rsTopicStatusCheck.Close
      set rsTopicStatusCheck = nothing

      '## 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 <> cLng(aryForum(1)) then
      '############################ Poll Mod ############################
         strSql = "SELECT " & strTablePrefix & "FORUM.F_POLLS "
         strSql = strsql & " FROM " & strTablePrefix & "FORUM "
         strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & aryForum(1)

         set rsPollCheck = my_Conn.Execute(strSql)

         ForumPolls = rsPollCheck("F_POLLS")

         rsPollCheck.close
         set rsPollCheck = nothing
      '##################################################################
         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" and Topic_Status > 0 then

            strSql = "SELECT " & strTablePrefix & "FORUM.F_MODERATION "
            strSql = Strsql & " FROM " & strTablePrefix & "FORUM "
            strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & cLng(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

      if Moderation = "Yes" and AutoApprove = "Yes" and Topic_UReplies > 0 then
         Go_Result "There was an error = The Topic you are attempting to move to an UnModerated Forum has UnModerated Replies<br />Please either approve or delete them and then try again.", 0
         Response.End
      end if

      '## Forum_SQL
      strSql = "UPDATE " & strActivePrefix & "TOPICS "
      strSql = strSql & " SET T_MESSAGE = '" & txtMessage & "'"
      strSql = strSql & ", T_SUBJECT = '" & txtSubject & "'"
      strSql = strSql & ", T_MSGICON = " & cLng(Request.Form("strMessageIcon"))
      if blnTopicMoved then
         strSql = strSql & ", CAT_ID = " & cLng(aryForum(0))
         strSql = strSql & ", FORUM_ID = " & cLng(aryForum(1))
         if AutoApprove = "Yes" then
            strSql = strSql & ", T_STATUS = 1 "
         end if
      end if
   '################# Poll Mod ###################
      if Request.Form("lockpoll") = "1" or ForumPolls = "0" then
         strSql = strSql & ", T_POLLSTATUS = 0"
      else
         strSql = strSql & ", T_POLLSTATUS = 1"
      end if
   '##############################################
      if Request.Form("sig") = "yes" and strDSignatures = "1" then
         strSql = strSql & ", T_SIG = 1"
      else
         strSql = strSql & ", T_SIG = 0"
      end if
   '########## Topic Rating ##########
      if Request.Form("AllowRating") = 1 then
         strSql = strSql & ", ALLOW_RATING = 1 "
      else
         strSql = strSql & ", ALLOW_RATING = 0 "
      end if
   '########## End Topic Rating ##########
      if mLev < 4 and strEditedByDate = "1" then
         strSql = strSql & ", T_LAST_EDIT = '"  & DateToStr(strForumTimeAdjust) & "'"
         strSql = strSql & ", T_LAST_EDITBY = "  & MemberID
      end if
      if ForumChkSkipAllowed = 1 then
         if Request.Form("sticky") = 1 then
            strSql = strSql & ", T_STICKY = " & 1
            strSql = strSql & ", T_ARCHIVE_FLAG = " & 0
         else
            strSql = strSql & ", T_STICKY = " & 0
            strSql = strSql & ", T_ARCHIVE_FLAG = " & 1
         end if
      end if
      strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

      my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
      %><!--#INCLUDE FILE="cal_post_info2.asp"--><%
   '############################ Poll Mod ###################################
      if Request.Form("poll") = "1" then
         '### Update poll answers and counts
         strSql = "UPDATE " & strTablePrefix & "POLLS "
         strSql = strSql & " SET P_WHOVOTES = '" & chkString(Request.Form("WhoVotes"),"SQLString") & "', "
         strSql = strSql & "     CAT_ID = " & cLng(aryForum(0)) & ", "
         strSql = strSql & "     FORUM_ID = " & cLng(aryForum(1)) & ", "
         for i = 1 to CInt(Request.Form("count"))
            strSql = strSql & "ANSWER" & CStr(i) & " = '" & chkString(txtAns(i),"") & "'"
            if txtAns(i) = "" or chkString(Request.Form("resetpoll"),"SQLString") = "1" then
               strSql = strSql & ", COUNT" & CStr(i) & " = " & 0
            end if
            if ubound(txtAns) <> i then
               strSql = strSql & ", "
            end if
         next
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID
         my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

         if Request.Form("resetpoll") = "1" then
            '### Delete poll votes from POLL_VOTES table for this topic
            strSql = "DELETE FROM " & strTablePrefix & "POLL_VOTES "
            strSql = strSql & "WHERE " & strTablePrefix & "POLL_VOTES.TOPIC_ID = " & Topic_ID
            my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
         end if
      end if
   '#########################################################################

      '# Subscribe checkbox start ##
      if request.form("TNotify") <> "" then
         if request.form("TNotify") = "1" then
            AddSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
         elseif request.form("TNotify") = "0" then
            DeleteSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
         end if
      end if
      '## Subscribe checkbox end ##

      if blnTopicMoved then
         if strEmail = "1" and strMoveNotify = "1" then DoAutoMoveEmail(Topic_ID)
         strSQL = "SELECT F_SUBSCRIPTION FROM " & strTablePrefix & "FORUM WHERE FORUM_ID=" & cLng(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),,adCmdText + adExecuteNoRecords
         end if
         rs.close
         set rs = nothing
      end if
      if Forum_ID <> cLng(aryForum(1)) then
         '## Forum_SQL
         strSql = "UPDATE " & strActivePrefix & "REPLY "
         strSql = strSql & " SET CAT_ID = " & cLng(aryForum(0))
         strSql = strSql & ", FORUM_ID = " & cLng(aryForum(1))
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

         my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

         '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" or Topic_Status < 2 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 TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID "
            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_Topic_ID = rs("TOPIC_ID")
               strLast_Post = rs("T_LAST_POST")
               strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
               strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
            else
               strLast_Post_Topic_ID = 0
               strLast_Post = ""
               strLast_Post_Author = 0
               strLast_Post_Reply_ID = 0
            end if

            rs.Close
            set rs = nothing

               if Moderation = "No" or Topic_Status < 2 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
               strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
               my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

               '## 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),,adCmdText + adExecuteNoRecords

            end if

            strSql = "UPDATE " & strTablePrefix & "FORUM SET "
            '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 & ", F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID
            strSql = strSql & ", F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
            strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
            my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

            '## Forum_SQL - Get last_post and last_post_author for Forum
            strSql = "SELECT TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_AUTHOR, T_LAST_POST_REPLY_ID "
            strSql = strSql & " FROM " & strActivePrefix & "TOPICS "
            strSql = strSql & " WHERE FORUM_ID = " & cLng(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_Topic_ID = rs("TOPIC_ID")
               strLast_Post = rs("T_LAST_POST")
               strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
               strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
            else
               strAuthor = ""
               strLast_Post_Topic_ID = 0
               strLast_Post = ""
               strLast_Post_Author = ""
               strLast_Post_Reply_ID = 0
            end if

            rs.Close
            set rs = nothing
            'Huw -- Update member count
            if (AutoApprove = "Yes") and blnTStatus = 2 and blnTopicMoved then
               set rsFCountMP = my_Conn.Execute("SELECT F_COUNT_M_POSTS FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & cLng(aryForum(1)))
               ForumCountMPosts = rsFCountMP("F_COUNT_M_POSTS")
               rsFCountMP.close
               set rsFCountMP = nothing
               if ForumCountMPosts <> 0 then
                  '  ## Points Below
                  Call doUCount(strT_Last_Post_Author, "T", False)
                  '  ## Points Above
               end if
               doULastPost(strT_Last_Post_Author)
            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 & ")"
            strSql = strSql & ", F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID
            strSql = strSql & ", F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
            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 = " & cLng(aryForum(1))
            my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

            '## Forum_SQL
            strSql =  "UPDATE " & strTablePrefix & "FORUM SET "
            strSql = strSql & " F_TOPICS = F_TOPICS + 1 "
            strSql = strSql & " WHERE FORUM_ID = " & cLng(aryForum(1))
            my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
         end if
      else
         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 = " & MemberID
            strSql = strSql & ",    F_LAST_POST_TOPIC_ID = " & Topic_ID
            strSql = strSql & ",    F_LAST_POST_REPLY_ID = " & 0
            strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

            my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

            '## Forum_SQL - Update Last Post
            strSql = " UPDATE " & strActivePrefix & "TOPICS"
            strSql = strSql & " SET T_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
            strSql = strSql & ",    T_LAST_POST_AUTHOR = " & MemberID
            strSql = strSql & ",    T_LAST_POST_REPLY_ID = " & 0
            strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

            my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
         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
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "Topic" then
   '## Forum_SQL
   strSql = "SELECT MEMBER_ID, M_LEVEL, M_EMAIL, M_LASTPOSTDATE, " & 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(strPassword, "SQLString") &"'"
      QuoteOk = (ChkQuoteOk(strDBNTUserName) and ChkQuoteOk(strPassword))
   else
      QuoteOk = ChkQuoteOk(strDBNTUserName)
   end if

   set rs = my_Conn.Execute (strSql)

   if rs.BOF or rs.EOF or not(QuoteOk) or not (ChkQuoteOk(strPassword))then '##  Invalid Password
      rs.close
      set rs = nothing
      Go_Result "Invalid UserName or Password!", 0
      Response.End
   else
      if strPrivateForums = "1" and ForumChkSkipAllowed = 0 then
         if not(chkForumAccess(Forum_ID, MemberID,false)) then
            Go_Result "You are not allowed to post in this forum !", 0
         end if
      end if
      if strFloodCheck = 1 then
         if rs("M_LASTPOSTDATE") > DateToStr(DateAdd("s",strFloodCheckTime,strForumTimeAdjust)) and mLev < 3 then
            strTimeLimit = replace(strFloodCheckTime, "-", "")
            Go_Result "Sorry! We have flood control activated.<br />You cannot post within " & strTimeLimit & " seconds of your last post.<br />Please try again after this period of time elapses.", 0
         end if
      end if

      txtMessage = ChkString(Request.Form("Message"),"message")
      txtSubject = ChkString(Request.Form("Subject"),"SQLString")
      UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
      if UserIPAddress = "" then
         UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
      end if
   ' ##################### Poll Mod ######################
      if Request.Form("poll") = "1" then
         ReDim txtAns(strMaxVotes)
         for i = 1 to strMaxVotes
            if trim(Request.Form("answer" & CStr(i))) <> "" then
               txtAns(i) = Request.Form("answer" & CStr(i))
            else
               txtAns(i) = ""
            end if
         next
      end if
   ' #####################################################
      if strBadWordFilter = "1" then
         txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
      end if

      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 Len(Request.Form("Subject")) > 50 then
         Go_Result "The Subject can not be greater than 50 characters", 0
         Response.End
      end if
   ' ####################### Poll Mod ##########################
      if Request.Form("poll") = "1" then
         For i = 1 to strMaxVotes
            if trim(Request.Form("answer" & CStr(i))) <> "" then
               intCount = intCount + 1
            end if
         Next
         if intCount < 2 then
            Go_Result "You Must Enter at least two Answers for the Poll", 0
         end if
      end if
   ' ##########################################################
      if strSignatures = "1" and strDSignatures <> "1" then
         if Request.Form("sig") = "yes" and GetSig(strDBNTUserName) <> " " then
            txtMessage = txtMessage & vbNewline & vbNewline & ChkString(GetSig(strDBNTUserName), "signature" )
         end if
      end if

'Gatekeeper Mod
      if strLinkSpamGatekeeper = "1" then
         select case len(Request.Form("GateKeeperAnswer"))
         case "0"
            Go_Result "You have not entered an answer for the Antispam question. Please use your back button and try again.", 0
         case else
            if (lcase(Request.Form("GateKeeperAnswer")) <> lcase(strGatekeeperAnswer1)) and (lcase(Request.Form("GateKeeperAnswer")) <> lcase(strGatekeeperAnswer2)) then
               Go_Result "You have entered a wrong answer for the Antispam question. Please use your back button and try again.", 0
            end if
         end select
      end if
'Gatekeeper Mod

      '## 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"
   ' ############# Poll Mod #############
      strSql = strSql & ", T_ISPOLL"
      strSql = strSql & ", T_POLLSTATUS"
   ' ###################################
      strSql = strSql & ", T_AUTHOR"
      strSql = strSql & ", T_LAST_POST"
      strSql = strSql & ", T_LAST_POST_AUTHOR"
      strSql = strSql & ", T_LAST_POST_REPLY_ID"
      strSql = strSql & ", T_DATE"
      strSql = strSql & ", T_STATUS"
      if strIPLogging <> "0" then
         strSql = strSql & ", T_IP"
      end if
      strSql = strSql & ", T_STICKY"
      strSql = strSql & ", T_SIG"
      strSql = strSql & ", T_ARCHIVE_FLAG"
      strSql = strSql & ", T_REPLIES"
      strSql = strSql & ", T_UREPLIES"
   '########## Topic Rating ##########
      strSql = strSql & ", ALLOW_RATING"
  '########## End Topic Rating ##########
      strSql = strSql & ", T_MSGICON"
      strSql = strSql & ") VALUES ("
      strSql = strSql & Forum_ID
      strSql = strSql & ", " & Cat_ID
      strSql = strSql & ", '" & txtSubject & "'"
      strSql = strSql & ", '" & txtMessage & "'"
   ' ################ Poll Mod ###############
      if Request.Form("poll") = "1" then
         strSql = strSql & ", " & 1
      else
         strSql = strSql & ", " & 0
      end if
      if Request.Form("lockpoll") = "1" then
         strSql = strSql & ", " & 0
      else
         strSql = strSql & ", " & 1
      end if
   ' ##########################################
      strSql = strSql & ", " & rs("MEMBER_ID")
      strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
      strSql = strSql & ", " & rs("MEMBER_ID")
      strSql = strSql & ", 0 "
      strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
      if Request.Form("lock") = 1 and ForumChkSkipAllowed = 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 & ", '" & UserIPAddress & "'"
      end if
      if ForumChkSkipAllowed = 1 then
         if Request.Form("sticky") = 1 then
            strSql = strSql & ", 1 "
         else
            strSql = strSql & ", 0 "
         end if
      else
         strSql = strSql & ", 0 "
      end if
      if Request.Form("sig") = "yes" and strDSignatures = "1" then
         strSql = strSql & ", 1 "
      else
         strSql = strSql & ", 0 "
      end if
      if ForumChkSkipAllowed = 1 then
         if Request.Form("sticky") = 1 then
            strSql = strSql & ", 0 "
         else
            strSql = strSql & ", 1 "
         end if
      else
         strSql = strSql & ", 1 "
      end if
      strSql = strSql & ", 0 "
      strSql = strSql & ", 0 "
   '########## Topic Rating ##########
      if Request.Form("AllowRating") = 1 then
         strSql = strSql & ", 1 "
      else
         strSql = strSql & ", 0 "
      end if
  '########## End Topic Rating ##########
  strSql = strSql & ", " & cLng(Request.Form("strMessageIcon"))
         strSql = strSql & ")"

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      %><!--#INCLUDE FILE="cal_post_info2.asp"--><%
   '############################ Poll Mod ##############################
      if Request.Form("poll") = "1" then
         strSql = "SELECT " & strTablePrefix & "TOPICS.TOPIC_ID "
         strSql = strSql & "FROM " & strTablePrefix & "TOPICS "
         strSql = strSql & "WHERE " & strTablePrefix & "TOPICS.T_ISPOLL = " & 1 & " "
         strSql = strSql & "ORDER BY " & strTablePrefix & "TOPICS.T_DATE DESC"
         set rsPollID = my_Conn.Execute (strSql)

         PollID = rsPollID("TOPIC_ID")

         rsPollID.close
         set rsPollID = nothing

         '## Forum_SQL - Add new poll to Polls Table
         strSql = "INSERT INTO " & strTablePrefix & "POLLS (CAT_ID"
         strSql = strSql & ", FORUM_ID"
         strSql = strSql & ", TOPIC_ID"
         strSql = strSql & ", P_WHOVOTES"
         for i = 1 to ubound(txtAns)
            strSql = strSql & ", ANSWER" & CStr(i)
            strSql = strSql & ", COUNT" & CStr(i)
         next
         strSql = strSql & ") VALUES ("
         strSql = strSql & Cat_ID
         strSql = strSql & ", " & Forum_ID
         strSql = strSql & ", " & PollID
         strSql = strSql & ", '" & chkString(Request.Form("WhoVotes"),"SQLString") & "'"
         for i = 1 to ubound(txtAns)
            strSql = strSql & ", '" & chkString(txtAns(i),"") & "'"
            strSql = strSql & ", " & 0
         next
         strSql = strSql & ")"

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if
   '####################################################################
      if Err.description <> "" then
         err_Msg = "There was an error = " & Err.description
      else
         err_Msg = "Updated OK"
      end if

      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

      ' 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 & ",    F_LAST_POST_TOPIC_ID = " & NewTopicID
         strSql = strSql & ",    F_LAST_POST_REPLY_ID = " & 0
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

      ProcessSubscriptions rs("MEMBER_ID"), Cat_ID, Forum_ID, NewTopicID, Moderation

      if Moderation = "No" then
         '## Subscribe checkbox ##
         if request.form("TNotify") <> "" then
            if request.form("TNotify") = "1" then
               AddSubscription "TOPIC", rs("MEMBER_ID"), Cat_ID, Forum_ID, NewTopicID
            elseif request.form("TNotify") = "0" then
               DeleteSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, NewTopicID
            end if
         end if
         '## Subscribe checkbox end ##
      end if

      Go_Result err_Msg, 1
      Response.End
   end if
end if


'#################### Merge Topic Mod ###################
if MethodType = "MergeTopic" then
   lngMember = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   select case lngMember
      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 Authorized
         Go_Result "Only an Admin or Moderator can Merge Topics", 0
         Response.End
      case 3 '## Moderator - Authorized
         '## Do Nothing
      case 4 '## Admin
         '## Do Nothing
      case else
         Go_Result cstr(lngMember), 0
         Response.End
   end select

   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("subject")),"SQLString")
   else
      txtSubject = chkString(Request.Form("subject"),"SQLString")
   end if
   if txtSubject = " " then
      Go_Result "You must post a subject!", 0
      Response.End
   end if
   if Len(Request.Form("subject")) > 50 then
      Go_Result "The subject can not be greater than 50 characters", 0
      Response.End
   end if
   if IsNumeric(Request.Form("MERGE_TOPIC_ID")) = True then
      MergeWithTopicID = cLng(Request.Form("MERGE_TOPIC_ID"))
   else
      Go_Result "You entered an incorrect URL of a topic. Please go back and correct it.", 0
   end if

   'Notes
   '- Check/Move subscriptions for the topics.
   '- Topic starter needs to be notified via email that topic was merged with another
   '- that it?

   '## Get info from database on both topics
   strSql = "SELECT TOPIC_ID, FORUM_ID, CAT_ID, T_IP, T_LAST_EDIT, T_LAST_POST, T_LAST_EDITBY, T_AUTHOR, T_DATE, T_REPLIES, T_SIG, T_VIEW_COUNT, T_MESSAGE "
   strSql = strSql & "FROM " & strTablePrefix & "TOPICS "
   strSql = strSql & "WHERE TOPIC_ID = " & MergeWithTopicID & " "
   strSql = strSql & "OR TOPIC_ID = " & Topic_ID
   'SELECT T_IP, T_LAST_EDIT, T_LAST_EDITBY, T_AUTHOR, T_DATE, T_REPLIES, T_SIG, T_VIEW_COUNT, T_MESSAGE FROM FORUM_TOPICS WHERE TOPIC_ID = 36 AND TOPIC_ID = 35
   'Response.Write strSql & "<br>"
   Set rs = Server.CreateObject("ADODB.Recordset")
   rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

   if rs.EOF then
      recCount = "-1"
   else
      allRec = rs.GetRows(adGetRowsRest)
      recCount = UBound(allRec,2)
   end if

   rs.close
   set rs = nothing
   'Response.Write strSql
   'Response.End

   '## Loop through data
   if recCount <> "-1" then
      Dim RowCount : RowCount = 0
      Dim blnInSameForum : blnInSameForum = true
      Dim intOlderTopic, intOtherTopic

      'Assign numerical locator for the array to variables
      TopicID = 0
      ForumID = 1
      CatID = 2
      Topic_IP = 3
      Topic_LastEdit = 4
      Topic_LastPost = 5
      Topic_LastEditBy = 6
      Topic_Author = 7
      Topic_Date = 8
      Topic_Replies = 9
      Topic_Sig = 10
      Topic_ViewCount = 11
      Topic_Message = 12

      'Check the posted date of both topics. The older topic remains as a topic.
      'I am assigning the row count for each topic in the allRec() array.
      if allRec(Topic_Date,0) < allRec(Topic_Date,1) then
         intOlderTopic = 0
         intOtherTopic = 1
      else
         intOlderTopic = 1
         intOtherTopic = 0
      end if

      'This is needed to get the forum and cat id for the
      'target topic when merging between 2 forums.
      if CLng(allRec(TopicID, 0)) = Topic_ID then
         intTargetTopic = 0
         intNotTargetTopic = 1
      else
         intTargetTopic = 1
         intNotTargetTopic = 0
      end if

      'Check if both topics are in the same forum
      if allRec(ForumID, intOlderTopic) <> allRec(ForumID, intOtherTopic) then
         blnInSameForum = false
      end if

      'if merging between 2 forums, change the forum id and cat id, to the
      'target topic, effectively moving the target topic to the correct forum
      if blnInSameForum = false then
         strSql = "UPDATE " & strTablePrefix & "TOPICS "
         strSql = strSql & " SET FORUM_ID = " & allRec(ForumID, intTargetTopic)
         strSql = strSql & ", CAT_ID = " & allRec(CatID, intTargetTopic)
         strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intNotTargetTopic)
         'Response.Write strSql & "<br>"
         'Response.End
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

      'Following query moves the topic to the reply table
      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"
      strSql = strSql & ", R_IP"
      strSql = strSql & ", R_STATUS"
      strSql = strSql & ", R_SIG"
      strSql = strSql & ", R_MESSAGE"
      strSql = strSql & ", R_MSGICON"
      strSql = strSql & ") VALUES ("
      strSql = strSql & allRec(TopicID, intOlderTopic)
      strSql = strSql & ", " & allRec(ForumID, intOlderTopic)
      strSql = strSql & ", " & allRec(CatID, intOlderTopic)
      strSql = strSql & ", " & allRec(Topic_Author, intOtherTopic)
      strSql = strSql & ", '" & allRec(Topic_Date, intOtherTopic) & "'"
      strSql = strSql & ", '" & allRec(Topic_IP, intOtherTopic) & "'"
      strSql = strSql & ", 1"
      strSql = strSql & ", " & allRec(Topic_Sig, intOtherTopic)
      strSql = strSql & ", '" & chkString(allRec(Topic_Message, intOtherTopic),"message") & "'"
      strSql = strSql & ", " & cLng(Request.Form("strMessageIcon")) & ")"
      'Response.Write strSql & "<br>"
      'Response.End
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'Change the replies topic id from the topic we merging to,
      'to the current topic, effectively moving them from one topic
      'to the other.
      strSql = "UPDATE " & strTablePrefix & "REPLY"
      strSql = strSql & " SET TOPIC_ID = " & allRec(TopicID, intOlderTopic)
      if blnInSameForum = false then
         strSql = strSql & ", FORUM_ID = " & allRec(ForumID, intOlderTopic)
         strSql = strSql & ", CAT_ID = " & allRec(CatID, intOlderTopic)
      end if
      strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intOtherTopic)
      'Response.Write strSql & "<br>"
      'Response.End
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'Update any subscriptions for the topic we are merging with and transfer them
      'to the existing topic.
      strSql = "UPDATE " & strTablePrefix & "SUBSCRIPTIONS"
      strSql = strSql & " SET TOPIC_ID = " & allRec(TopicID, intOlderTopic)
      strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intOtherTopic)
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'Update total # of TOPICS by - 1
      strSql = "UPDATE " & strTablePrefix & "TOTALS "
      strSql = strSql & " SET T_COUNT = T_COUNT - 1"
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'count how many replies are now in the topic
      'get the last reply from the reply table
      strSql = "SELECT Count(REPLY_ID) as TotalReplies "
      strSql = strSql & " FROM " & strTablePrefix & "REPLY "
      strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intOlderTopic)
      'Response.Write strSql & "<br>"
      'Response.End
      set rsTotal = my_Conn.Execute (strSql)

      TotalReplies = rsTotal("TotalReplies") 'holds the number of replies in the current topic

      rsTotal.close
      set rsTotal = nothing

      'Get info about the last reply in the REPLY table
      strSql = "SELECT REPLY_ID, R_AUTHOR, R_DATE, R_LAST_EDIT, R_LAST_EDITBY "
      strSql = strSql & "FROM " & strTablePrefix & "REPLY "
      strSql = strSql & "WHERE TOPIC_ID = " & allRec(TopicID, intOlderTopic) & " "
      strSql = strSql & "AND R_STATUS <= 1 "
      strSql = strSql & "ORDER BY R_DATE DESC"
      'Response.Write strSql & "<br>"
      'Response.End
      set rsLastReply = my_Conn.Execute (strSql)

      LatestReplyID = rsLastReply("REPLY_ID") 'holds the id of the last reply in the current topic
      LastReplyAuthor = rsLastReply("R_AUTHOR")
      LastReplyDate = rsLastReply("R_DATE")
      LastReplyEdit = rsLastReply("R_LAST_EDIT")
      LastReplyEditBy = rsLastReply("R_LAST_EDITBY")

      rsLastReply.close
      set rsLastReply = nothing

      'Update topic with the info about the last post date, and author.
      strSql = "UPDATE " & strTablePrefix & "TOPICS "
      strSql = strSql & "SET T_SUBJECT = '" & txtSubject & "'"
      strSql = strSql & ", T_VIEW_COUNT = T_VIEW_COUNT + " & cLng(allRec(Topic_ViewCount, intOtherTopic))
      strSql = strSql & ", T_LAST_POST_AUTHOR = " & LastReplyAuthor
      strSql = strSql & ", T_LAST_POST = '" & LastReplyDate & "'"
      strSql = strSql & ", T_LAST_POST_REPLY_ID = " & LatestReplyID
      if LastReplyEdit <> "" then
         strSql = strSql & ", T_LAST_EDIT = '" & LastReplyEdit & "'"
         if LastReplyEditBy <> "" then
            strSql = strSql & ", T_LAST_EDITBY = " & LastReplyEditBy
         end if
      end if
      strSql = strSql & ", T_REPLIES = " & TotalReplies
      strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intOlderTopic)
      'Response.Write strSql & "<br>"
      'Response.End
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'delete old topic from topic table
      strSql = "DELETE FROM " & strTablePrefix & "TOPICS "
      strSql = strSql & "WHERE TOPIC_ID = " & allRec(TopicID, intOtherTopic)
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'Get last_post and last_post_author for Forum
      strSql = "SELECT TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID"
      strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
      strSql = strSql & " WHERE FORUM_ID = " & allRec(ForumID, intTargetTopic) & " "
      strSql = strSql & " ORDER BY T_LAST_POST DESC"
      'Response.Write strSql & "<br>"
      set rs = my_Conn.Execute (strSql)

      if not rs.eof then
         rs.movefirst
         strLast_Post = rs("T_LAST_POST")
         strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
         strLast_Post_Topic_ID = rs("TOPIC_ID")
         strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
      else
         strLast_Post = ""
         strLast_Post_Author = "NULL"
         strLast_Post_Topic_ID = 0
         strLast_Post_Reply_ID = 0
      end if

      rs.Close
      set rs = nothing

      'Update the # of posts count for the forum and # of topics for the forum
      strSql = "UPDATE " & strTablePrefix & "FORUM SET"
      if blnInSameForum then
         strSql = strSql & " F_TOPICS = F_TOPICS - 1,"
      else
         strSql = strSql & " F_COUNT = F_COUNT + " & cLng(allRec(Topic_Replies, intOtherTopic) + 1) & ","
      end if
      strSql = strSql & " F_LAST_POST = '" & strLast_Post & "',"
      strSql = strSql & " F_LAST_POST_AUTHOR = " & strLast_Post_Author & ","
      strSql = strSql & " F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID & ","
      strSql = strSql & " F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
      strSql = strSql & " WHERE FORUM_ID = " & allRec(ForumID, intTargetTopic)
      'Response.Write strSql & "<br>"
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'If the topic we merging with is in a different forum, update forum counts for that forum.
      if blnInSameForum = false then
         'Get last_post and last_post_author for Forum
         strSql = "SELECT TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID"
         strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
         strSql = strSql & " WHERE FORUM_ID = " & allRec(ForumID, intNotTargetTopic) & " "
         strSql = strSql & " ORDER BY T_LAST_POST DESC"
         'Response.Write strSql & "<br>"
         'Response.End
         set rs = my_Conn.Execute (strSql)

         if not rs.eof then
            rs.movefirst
            strLast_Post = rs("T_LAST_POST")
            strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
            strLast_Post_Topic_ID = rs("TOPIC_ID")
            strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
         else
            strLast_Post = ""
            strLast_Post_Author = "NULL"
            strLast_Post_Topic_ID = 0
            strLast_Post_Reply_ID = 0
         end if

         rs.Close
         set rs = nothing

         'Update the # of posts count for the forum and # of topics for the forum
         strSql = "UPDATE " & strTablePrefix & "FORUM"
         strSql = strSql & " SET F_TOPICS = F_TOPICS - 1,"
         strSql = strSql & " F_COUNT = F_COUNT - " & cLng(allRec(Topic_Replies, intOtherTopic) + 1) & ","
         strSql = strSql & " F_LAST_POST = '" & strLast_Post & "',"
         strSql = strSql & " F_LAST_POST_AUTHOR = " & strLast_Post_Author & ","
         strSql = strSql & " F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID & ","
         strSql = strSql & " F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
         strSql = strSql & " WHERE FORUM_ID = " & allRec(ForumID, intNotTargetTopic)
         'Response.Write strSql & "<br>"
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

      if lcase(strEmail) = "100" then 'not implemented yet
         'Send mail to author letting him know his topic was merged with another.
         'DoAutoMoveEmail(allRec(Topic_ID, intOlderTopic))
         strSql  = "SELECT M.MEMBER_ID, M.M_NAME, M.M_EMAIL, T.FORUM_ID, T.T_SUBJECT "
         strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS M, " & strActivePrefix & "TOPICS T "
         strSql = strSql & " WHERE M.MEMBER_ID = T.T_AUTHOR "
         strSql = strSql & " AND T.TOPIC_ID = " & TopicNum
         'Response.Write strSql
         'Response.End
         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

         strRecipientsName = user_name
         strRecipients = email
         strSubject = strForumTitle & " - Topic Moved"
         strMessage = "Hello " & user_name & vbNewLine & vbNewLine
         strMessage = strMessage & "Your posting on " & strForumTitle & "." & vbNewLine
         strMessage = strMessage & "Regarding the subject - " & Topic_Title & "." & vbNewLine & vbNewLine

         if not(chkForumAccess(ForumID,Usernum,false)) then
            strMessage = strMessage & "Has been removed from public display. If you have any questions regarding this, please contact the Administrator of the forum" & vbNewLine
         else
            strMessage = strMessage & "Has been moved to a new forum, You can view it at " & vbNewLine & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "topic.asp?TOPIC_ID=" & TopicNum & vbNewLine
         end if
   %>
   <!--#INCLUDE FILE="inc_mail.asp" -->
   <%
      end if

      'ProcessSubscriptions Reply_Author, Cat_ID, Forum_ID, NewTopicID, Moderation
   else
      Go_Result "That topic does not exist in the database. Make sure the url you entered has the correct ID of the topic.", 0
   end if
   'Response.End
   Go_Result err_Msg, 1
   Response.End
end if
'########################################################


if MethodType = "Reply" or MethodType = "ReplyQuote" or MethodType = "TopicQuote" then
   '## Forum_SQL
   strSql = "SELECT MEMBER_ID, M_LEVEL, M_EMAIL, M_LASTPOSTDATE, " & 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(strPassword, "SQLString") &"'"
      QuoteOk = (ChkQuoteOk(strDBNTUserName) and ChkQuoteOk(strPassword))
   else
      QuoteOk = ChkQuoteOk(strDBNTUserName)
   end if

   set rs = my_Conn.Execute (strSql)

   if rs.BOF or rs.EOF or not(QuoteOk) or not(ChkQuoteOk(strPassword)) then '##  Invalid Password
      rs.close
      set rs = nothing
      err_Msg = "Invalid Password or User Name"
      Go_Result(err_Msg), 0
      Response.End
   else

      if strPrivateForums = "1" and ForumChkSkipAllowed = 0 then
         if not(chkForumAccess(Forum_ID,MemberID,false)) then
            Go_Result "You are not allowed to post in this forum !", 0
         end if
      end if

      if strFloodCheck = 1 then
         if rs("M_LASTPOSTDATE") > DateToStr(DateAdd("s",strFloodCheckTime,strForumTimeAdjust)) and mLev < 3 then
            strTimeLimit = replace(strFloodCheckTime, "-", "")
            Go_Result "Sorry! We have flood control activated.<br />You cannot post within " & strTimeLimit & " seconds of your last post.<br />Please try again after this period of time elapses.", 0
         end if
      end if

      txtMessage = ChkString(Request.Form("Message"),"message")
      UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
      if UserIPAddress = "" then
         UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
      end if
      if txtMessage = " " then
         Go_Result "You must post a message!", 0
         Response.End
      end if

      if strSignatures = "1" and strDSignatures <> "1" then
         if Request.Form("sig") = "yes" and GetSig(strDBNTUserName) <> " " then
            txtMessage = txtMessage & vbNewline & vbNewline & ChkString(GetSig(strDBNTUserName), "signature" )
         end if
      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_SIG"
      strSql = strSql & ", R_MESSAGE"
     strSql = strSql & ", R_MSGICON"
      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 & ", " & "'" & UserIPAddress & "'"
      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
      if Request.Form("sig") = "yes" and strDSignatures = "1" then
         strSql = strSql & ", 1 "
      else
         strSql = strSql & ", 0 "
      end if
      strSql = strSql & ", " & "'" & txtMessage & "'"
      strSql = strSql & ", " & cLng(Request.Form("strMessageIcon"))
      strSql = strSql & ")"

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      ' DEM --> Do not update totals on topics and forums database if post is moderated...Added if and end if
      if Moderation = "No" then
         strSql = "SELECT Max(REPLY_ID) as NewReplyID "
         strSql = strSql & " FROM " & strActivePrefix & "REPLY "
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
         strSql = strSql & "   and R_AUTHOR = " & rs("MEMBER_ID")
         set rs9 = my_Conn.Execute (strSql)
         NewReplyID = rs9("NewReplyID")
         rs9.close
         set rs9 = nothing

         '## 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")
         strSql = strSql & ",    T_LAST_POST_REPLY_ID = " & NewReplyID
         if Request.Form("lock") = 1 and ForumChkSkipAllowed = 1 then
            strSql = strSql & ",        T_STATUS = 0 "
         end if
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

         '## Subscribe checkbox start ##
         if request.form("TNotify") <> "" then
            if request.form("TNotify") = "1" then
               AddSubscription "TOPIC", rs("MEMBER_ID"), Cat_ID, Forum_ID, Topic_ID
            elseif request.form("TNotify") = "0" then
               DeleteSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
            end if
         end if
         '## Subscribe checkbox end ##

         '## 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_LAST_POST_TOPIC_ID = " & Topic_ID
         strSql = strSql & ",    F_LAST_POST_REPLY_ID = " & NewReplyID
         strSql = strSql & ",    F_COUNT = F_COUNT + 1 "
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      else
         '## Forum_SQL - Update Unmoderated post count
         strSql = "UPDATE " & strActivePrefix & "TOPICS "
         strSql = strSql & " SET T_UREPLIES = T_UREPLIES + 1 "
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_IDstrSql = strSql & Cat_ID



         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      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, Moderation
         'end if
         Go_Result  "Updated OK", 1
         Response.End
      end if
 end if
  end if

'Parent Location Stuff MOD
strParent = replace(request.form("Parent"), "'", "''")
if strParent <> "" then
  strParentType = left(strParent, 1)
  strParentValue = right(strParent, len(strParent) - 1)
end if
if strParentType = "F" then
  '## Forum_SQL - Find the CAT_ID if forum is now a subforum
  strSQL = "SELECT CAT_ID FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & strParentValue & ";"
  set rsFindCat = my_Conn.Execute(strSQL)
  if not rsFindCat.eof then
    intCategoryValue = rsFindCat("CAT_ID")
  end if
  set rsFindCat = Nothing
  intSetParent = strParentValue
  intSetCategory = intCategoryValue
else
  intSetParent = NULL
  intSetCategory = strParentValue
end if
'End parent location stuff mod - Change variables below for adding a forum

if MethodType = "Forum" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Authorized
         Go_Result "Only an Admin can create a Forum", 0
         Response.End
      case 3 '## Moderator - Not Authorized
         Go_Result "Only an Admin can create a Forum", 0
         Response.End
      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")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the New Forum</li>"
   end if
   if Err_Msg = "" then
      '## Forum_SQL - Do DB Update
      strSql = "INSERT INTO " & strTablePrefix & "FORUM "
      strSql = strSql & "(CAT_ID"
      if isnull(intSetParent) = FALSE then
  strSql = strSql & ", F_PARENT"
end if
      strSql = strSql & ", F_STATUS"
      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 "
   '############ Poll Mod #################
      strSql = strSql & ", F_POLLS "
   '#######################################
      strSql = strSql & ", F_DEFAULTDAYS "
      strSql = strSql & ", F_COUNT_M_POSTS "
      strSql = strSql & ", F_ALLOWEVENTS "
  '############### Topic Rating Mod ###########################
      strSql = strSql & ", F_RATING_AUTH"
  '############### End Topic Rating Mod ###########################

      strSql = strSql & ") VALUES ("
      strSql = strSql & intSetCategory
if isnull(intSetParent) = FALSE then
  strSql = strSql & ", " & intSetParent
end if
      strSql = strSql & ", 1 "
      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 & ", 0"
      strSql = strSql & ", '' "
      strSql = strSql & ", 30 "
      strSql = strSql & ", '' "
      strSql = strSql & ", 365 "
           ' DEM --> Start of Code added for moderation and subscription
           if strSubscription > 0 and CatSubscription > 0 and strEmail = "1" 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 "
   '################ Poll Mod ##################
      if Request.Form("PollAuth") <> "" then
         strSql = strSql & ", " & chkString(Request.Form("PollAuth"),"SQLString")
      else
         strSql = strSql & ", 0 "
      end if
   '############################################
      strSql = strSql & ", " & ChkString(Request.Form("DefaultDays"), "SQLString")
      strSql = strSql & ", " & ChkString(Request.Form("ForumCntMPosts"), "SQLString")
      If CLng(Request.Form("allowevents")) = 1 then StrSql = strSql & ", 1" Else strSql = strSql & ", 0"
    '############### Topic Rating Mod ###########################
      if Request.Form("RatingAuth") = 1 then
         strSql = strSql & ", 1 "
      else
         strSql = strSql & ", 0 "
      end if
    '############### End Topic Rating Mod ###########################

           strSql = strSql & ")"

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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")
newUGPerms rsCount("maxForumId")        '#######    UserGroup MOD     #######
         newForumModerators rsCount("maxForumId")
         set rsCount = nothing
         Go_Result  "Updated OK", 1
      end if
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "URL" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin can create a web link", 0
         Response.End
      case 3 '## Moderator
         Go_Result "Only an Admin can create a web link", 0
         Response.End
      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"),"SQLString")
   txtSubject = ChkString(Request.Form("Subject"),"SQLString")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the New URL</li>"
   end if
   if txtAddress = " " or lcase(txtAddress) = "http://" or lcase(txtAddress) = "https://" or lcase(txtAddress) = "file:///" then
      Err_Msg = Err_Msg & "<li>You Must Enter an Address for the New URL</li>"
   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 & "<li>You Must prefix the Address with <b>http://</b>, <b>https://</b> or <b>file:///</b></li>"
   end if
   if Err_Msg = "" then
      '## Forum_SQL - Do DB Update
      strSql = "INSERT INTO " & strTablePrefix & "FORUM "
      strSql = strSql & "(CAT_ID"
      if isnull(intSetParent) = FALSE then
  strSql = strSql & ", F_PARENT"
end if
      strSql = strSql & ", F_STATUS"
      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_DELETE_SCHED "
           strSql = strSql & ", F_SUBSCRIPTION, F_MODERATION"
      strSql = strSql & ", F_ORDER "
      strSql = strSql & ", F_DEFAULTDAYS "
      strSql = strSql & ")  VALUES ("
      strSql = strSql & intSetCategory
if isnull(intSetParent) = FALSE then
  strSql = strSql & ", " & intSetParent
end if
           strSql = strSql & ", 1"
      if strPrivateForums = "1" then
         strSql = strSql & ", " & ChkString(Request.Form("AuthType"), "SQLString") & ""
      end if
      strSql = strSql & ", " & "'" & DateToStr(strForumTimeAdjust) & "'"
      strSql = strSql & ", " & MemberID & " "
      strSql = strSql & ", " & "'" & txtSubject & "'"
      strSql = strSql & ", " & "'" & txtAddress & "'"
      strSql = strSql & ", " & "'" & txtMessage & "'"
      strSql = strSql & ", 1"
           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 & ", 30"
      strSql = strSql & ") "

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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")
newUGPerms rsCount("maxForumId")        '#######    UserGroup MOD     #######
         newForumModerators rsCount("maxForumId")
         set rsCount = nothing
         Go_Result  "Updated OK", 1
      end if
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "EditForum" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin or a Moderator can change this Forum", 0
         Response.End
      case 3 '## Moderator
         if chkForumModerator(Forum_ID, strDBNTUserName) = "0" then
            Go_Result "Only an Admin or a Moderator can 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")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the Forum</li>"
   end if

        if strModeration <> 0 and Request.Form("Moderation") = 0 then
            if CheckForUnModeratedPosts("FORUM", Cat_ID, Forum_ID, 0) > 0 then
         Err_Msg = Err_Msg & "<li>Please Approve or Delete all UnModerated/Held posts in this Forum before turning Moderation off</li>"
      end if
   end if

   if Err_Msg = "" then'Parent Location Stuff MOD
'## Forum_SQL - Update forum parent and cat_id in db
'We changed lines from request.form("Category") to intSetCategory
'Update parent id
if isnull(intSetParent) = FALSE then
  strSQL = "UPDATE " & strTablePrefix & "FORUM SET F_PARENT = " & intSetParent & " WHERE FORUM_ID = " & Forum_ID
else
  strSQL = "UPDATE " & strTablePrefix & "FORUM SET F_PARENT = NULL WHERE FORUM_ID = " & Forum_ID
end if
my_Conn.Execute(strSQL)
'End parent mod code -- JUST MAKE SURE YOU CHANGE THAT request.form variable!

      '## 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(intSetCategory, "SQLString"))
      rsCatIDCheck.Close
      set rsCatIDCheck = Nothing

      '## Forum_SQL - Do DB Update
      strSql = "UPDATE " & strTablePrefix & "FORUM "
      strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
   '############################ Poll Mod ###########################
      if Request.Form("PollAuth") <> "" then
         strSql = strSql & ", F_POLLS = " & chkString(Request.Form("PollAuth"),"SQLString") & ""
      end if
   '#################################################################
      if strPrivateForums = "1" then
         strSql = strSql & ", F_PRIVATEFORUMS = " & cLng("0" & Request.Form("AuthType"))
         if Request.Form("AuthPassword") <> " " then
            strSql = strSql & ", F_PASSWORD_NEW = '" & ChkString(Request.Form("AuthPassword"),"SQLString") & "'"
         end if
      end if
   '############### Topic Rating Mod ##################################
      if Request.Form("RatingAuth") = 1 then
         strSql = strSql & ", F_RATING_AUTH = 1 "
      else
         strSql = strSql & ", F_RATING_AUTH = 0 "
      end if
  '############### End Topic Rating Mod ##################################
      strSql = strSql & ", F_SUBJECT = '" & txtSubject & "'"
      strSql = strSql & ", F_DESCRIPTION = '" & txtMessage & "'"
      if Request.Form("Moderation") <> "" then
              strSql = strSql & ",    F_MODERATION = " & cLng("0" & Request.Form("Moderation"))
      end if
      if fSubscription <> "" then
              strSql = strSql & ",    F_SUBSCRIPTION = " & cLng("0" & fSubscription)
      end if
      strSql = strSql & ",   F_DEFAULTDAYS = " & cLng(Request.Form("DefaultDays"))
      strSql = strSql & ",   F_COUNT_M_POSTS = " & cLng("0" & Request.Form("ForumCntMPosts"))
      If CLng(Request.Form("allowevents")) = 1 then strSql = strSql & ", F_ALLOWEVENTS = 1" Else strSql = strSql & ", F_ALLOWEVENTS = 0"
      strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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=" & cLng("0" & intSetCategory)
         set rs = my_conn.execute(strSQL)
         intCatSubs = rs("CAT_SUBSCRIPTION")
         intCatMod = rs("CAT_MODERATION")
         rs.close
         set rs = nothing
         if intCatSubs < fSubscription then
            strSQL = "UPDATE " & strTablePrefix & "CATEGORY SET " & strTablePrefix & "CATEGORY.CAT_SUBSCRIPTION = " & fSubscription

            my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
         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),,adCmdText + adExecuteNoRecords
         end if
         '## Forum_SQL - Do DB Update
         strSql = "UPDATE " & strActivePrefix & "TOPICS "
         strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

         '## Forum_SQL - Do DB Update
         strSql = "UPDATE " & strActivePrefix & "REPLY "
         strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

         ' DEM --> Added _SUBSCRIPTIONS table
         '## Forum_SQL - Do DB Update
         strSql = "UPDATE " & strTablePrefix & "SUBSCRIPTIONS "
         strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

       err_Msg= ""
      if Err.description <> "" then
         Go_Result "There was an error = " & Err.description, 0
         Response.End
      else
         updateForumMembers Forum_ID
updateUGPerms Forum_ID        '#######    UserGroup MOD     #######
         if mLev = 4 then
            updateForumModerators Forum_ID
         end if
         Go_Result  "Updated OK", 1
      end if
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "EditURL" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin or a Moderator can change this web link", 0
         Response.End
      case 3 '## Moderator
         if chkForumModerator(Forum_ID, strDBNTUserName) = "0" then
            Go_Result "Only an Admin or a Moderator can change this 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"),"SQLString")
   txtSubject = ChkString(Request.Form("Subject"),"SQLString")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the New URL</li>"
   end if
   if txtAddress = " " or lcase(txtAddress) = "http://" or lcase(txtAddress) = "https://" or lcase(txtAddress) = "file:///" then
      Err_Msg = Err_Msg & "<li>You Must Enter an Address for the New URL</li>"
   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 & "<li>You Must prefix the Address with <b>http://</b>, <b>https://</b> or <b>file:///</b></li>"
   end if
   if Err_Msg = "" then
   'Update parent id
if isnull(intSetParent) = FALSE then
  strSQL = "UPDATE " & strTablePrefix & "FORUM SET F_PARENT = " & intSetParent & " WHERE FORUM_ID = " & Forum_ID
else
  strSQL = "UPDATE " & strTablePrefix & "FORUM SET F_PARENT = NULL WHERE FORUM_ID = " & Forum_ID
end if
my_Conn.Execute(strSQL)
'End parent mod code -- JUST MAKE SURE YOU CHANGE THAT request.form variable!

      '## Forum_SQL - Do DB Update
      strSql = "UPDATE " & strTablePrefix & "FORUM "
      strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
      if strPrivateForums = "1" then
         strSql = strSql & ",    F_PRIVATEFORUMS = " & cLng("0" & Request.Form("AuthType"))
      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),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      err_Msg= ""
      if Err.description <> "" then
         Go_Result "There was an error = " & Err.description, 0
         Response.End
      else
         updateForumMembers Forum_ID
updateUGPerms Forum_ID        '#######    UserGroup MOD     #######
         if mLev = 4 then
            updateForumModerators Forum_ID
         end if
         Go_Result  "Updated OK", 1
      end if
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "Category" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin can create a category", 0
         Response.End
      case 3 '## Moderator
         Go_Result "Only an Admin can create a category", 0
         Response.End
      case 4 '## Admin
         '## Do Nothing
      case else
         Go_Result cstr(Member), 0
         Response.End
   end select
   txtSubject = chkString(Request.Form("Subject"),"SQLString")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if

   Err_Msg = ""
   if txtSubject = "" then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the New Category</li>"
   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_STATUS, CAT_SUBSCRIPTION, CAT_MODERATION, CAT_ORDER) "
         strSql = strSql & " VALUES ('" & txtSubject & "'"
                 strSql = strSql & ", 1"
           if strSubscription <> 0 and strEmail = "1" 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),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "EditCategory" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin can change a category", 0
         Response.End
      case 3 '## Moderator
         '## Do Nothing
         Go_Result "Only an Admin can change a category", 0
         Response.End
      case 4 '## Admin
         '## Do Nothing
      case else
         Go_Result cstr(Member), 0
         Response.End
   end select
   txtSubject = chkString(Request.Form("Subject"),"SQLString")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if

   Err_Msg = ""
   if txtSubject = "" then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the Category</li>"
   end if
        if strModeration <> 0 and Request.Form("Moderation") = 0 then
           if CheckForUnmoderatedPosts("CAT", Cat_ID, 0, 0) > 0 then
         Err_Msg = Err_Msg & "<li>Please Approve or Delete all UnModerated/Held posts in this Category before turning Moderation off</li>"
      end if
   end if
   if Err_Msg = "" then
      '## Forum_SQL - Do DB Update
      strSql = "UPDATE " & strTablePrefix & "CATEGORY "
      strSql = strSql & " SET CAT_NAME = '" & txtSubject & "'"
         ' DEM --> Start of Code added for moderation and subscription functionality
           if strModeration <> 0 then
                 strSql = strSql & ",   CAT_MODERATION = " & cLng("0" & Request.Form("Moderation"))
           end if
           if strSubscription <> 0 and strEmail = "1" then
                    strSql = strSql & ",   CAT_SUBSCRIPTION = " & cLng("0" & Request.Form("Subscription"))
         end if
           ' DEM --> End of code added for moderation and subscription functionality
      strSql = strSql & " WHERE CAT_ID = " & Cat_ID

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if
'set rs = nothing
WriteFooter
Response.End

sub Go_Result(str_err_Msg, boolOk)

   select case MethodType
      case "Topic", "TopicQuote", "Reply", "ReplyQuote"
         set rsFCountMP = my_Conn.Execute("SELECT F_COUNT_M_POSTS FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & Forum_ID)
         ForumCountMPosts = rsFCountMP("F_COUNT_M_POSTS")
         rsFCountMP.close
         set rsFCountMP = nothing
   end select

   Response.write    "      <table border=""0"" width=""100%"">" & vbNewLine & _
         "        <tr>" & vbNewLine & _
         "          <td width=""33%"" align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
         "          " & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp"">COMMUNITY HOME</a><br />" & vbNewLine
   if MethodType = "Topic" or _
      MethodType = "TopicQuote" or _
      MethodType = "Reply" or _
      MethodType = "ReplyQuote" or _
      MethodType = "Edit" or _
      MethodType = "EditTopic" then
         Response.Write "          " & getCurrentIcon(strIconBar,"","align=""absmiddle""")
         if blnCStatus <> 0 then
            Response.Write getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""")
         else
            Response.Write getCurrentIcon(strIconFolderClosed,"","align=""absmiddle""")
         end if
         Response.Write " <a href=""default.asp?CAT_ID=" & Cat_ID & """>" & ChkString(strCatTitle, "title") & "</a><br />" & vbNewLine
         Response.Write "          " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""")
         if blnFStatus <> 0 and blnCStatus <> 0 then
            Response.Write getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""")
         else
            Response.Write getCurrentIcon(strIconFolderClosed,"","align=""absmiddle""")
         end if
         Response.Write " <a href=""forum.asp?FORUM_ID=" & Forum_ID & """>" & ChkString(strForum_Title, "title") & "</a><br />" & vbNewLine
   end if
   if MethodType = "Reply" or _
      MethodType = "ReplyQuote" or _
      MethodType = "TopicQuote" or _
      MethodType = "Edit" or _
      MethodType = "EditTopic" then
            Response.Write "          " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""")
            if blnTStatus <> 0 and blnFStatus <> 0 and blnCStatus <> 0 then
               Response.Write getCurrentIcon(strIconFolderOpenTopic,"","align=""absmiddle""")
            else
               Response.Write getCurrentIcon(strIconFolderClosedTopic,"","align=""absmiddle""")
            end if
            Response.Write " <a href=""" & chkString(Request.Form("refer"),"refer") & """>" & ChkString(strTopicTitle,"title") & "</a>" & vbNewLine
   end if
   Response.write "          </font></td>" & vbNewLine & _
         "        </tr>" & vbNewLine & _
         "      </table>" & vbNewLine
   if boolOk = 1 then
      Response.write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>"
      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!")
                         '  ## Points Below
                        tNewRank = False
                        If ChkNewRank Then
                           Response.Write "<br><br><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & VbNewLine &_
                              " ****Congratulations You Got a New Rank!**** </font>"
                           tNewRank = True
                        End If
                        '  ## Points Above
                         DoPCount
               if ForumCountMPosts <> 0 then
                  '  ## Points Below
                  Call DoUCount(MemberID, "R", tNewRank)
                  '  ## Points Above
               end if
                 end if
               DoULastPost MemberID
         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!")
                         '  ## Points Below
                                 tNewRank = False
                                 If ChkNewRank Then
                                    Response.Write "<br><br><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & VbNewLine &_
                                       " ****Congratulations You Got a New Rank!**** </font>"
                                    tNewRank = True
                                 End If
                         '  ## Points Above
                         DoTCount
                         DoPCount
               if ForumCountMPosts <> 0 then
                  '  ## Points Below
                  Call DoUCount(MemberID, "T", tNewRank)
                  '  ## Points Above
               end if
                 end if
            DoULastPost MemberID
         case "Forum"
                 Response.Write("New Forum Created!")
         case "URL"
                 Response.Write("New URL Created!")
         case "Category"
                 Response.Write("New Category Created!")
         '############ Merge Topic Mod ################
         case "MergeTopic"
            Response.Write("Topics merged succesfully!")
            DoTCount
         '#############################################
         case else
                 Response.Write("Complete!")
                 'DoPCount
                 'DoUCount Request.Form("UserName")
                 'DoULastPost Request.Form("UserName")
      end select
      if MethodType = "Topic" then
         strReturnURL = "topic.asp?TOPIC_ID=" & NewTopicID
         strReturnTxt = "Go to new topic"
      elseif MethodType = "Reply" or MethodType = "ReplyQuote" or MethodType = "TopicQuote" then
         strReturnURL = "topic.asp?whichpage=-1&TOPIC_ID=" & Topic_ID & "&REPLY_ID=" & NewReplyID
         strReturnTxt = "Back to the topic"
      elseif MethodType = "EditTopic" then
         strReturnURL = "topic.asp?TOPIC_ID=" & Topic_ID
         strReturnTxt = "Back to the topic"
      elseif MethodType = "Edit" then
         strReturnURL = "topic.asp?whichpage=-1&TOPIC_ID=" & Topic_ID & "&REPLY_ID=" & Reply_ID
         strReturnTxt = "Back to the topic"
      else
         strReturnURL = chkString(Request.Form("refer"),"refer")
         strReturnTxt = "Back To Forum"
      end if
      Response.write "</font></p>" & vbNewLine & _
            "      <meta http-equiv=""Refresh"" content=""2; URL=" & strReturnURL & """>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>"
      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!")
      '########### Merge Topic Mod ###########
         case "MergeTopic"
            Response.Write(" ")
      '#######################################
         case else
            Response.Write("Have a nice day!")
      end select
      Response.write "</font></p>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""" & strReturnURL & """>" & strReturnTxt & "</a></font></p>" & vbNewLine
   else
      Response.write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There has been a problem!</font></p>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & str_err_Msg & "</font></p>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go back to correct the problem.</a></font></p>" & vbNewLine
   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),,adCmdText + adExecuteNoRecords
      if err.number <> 0 then
         Go_REsult err.description, 0
      end if
   next
   on error goto 0
end sub

sub updateForumMembers(fForumID)
   my_Conn.execute ("DELETE FROM " & strTablePrefix & "ALLOWED_MEMBERS WHERE FORUM_ID = " & fForumId),,adCmdText + adExecuteNoRecords
   newForumMembers(fForumID)
end sub
'#######    Begin UserGroup MOD     #######
sub newUGPerms(fForumID)
    on error resume next
    if mlev = 4 or (mlev = 3 and CInt(strUGModForums) = 2) then
    for each key in Request.Form
        if Left(key,5) = "Perms" and Request.Form(key) <> "notset" then
            strUGid = Trim(Mid(key,6))
            strSql = "INSERT INTO " & strTablePrefix & "ALLOWED_USERGROUPS ("
            strSql = strSql & "FORUM_ID, USERGROUP_ID, PERMS) VALUES ("
            strSql = strSql & fForumID & ", " & strUGid & ", " & Request.Form(key) & ")"
            my_Conn.execute(strSql)
        end if
    next
    end if
end sub

sub updateUGPerms(fForumID)
    if mlev = 4 then
        my_Conn.execute("DELETE FROM " & strTablePrefix & "ALLOWED_USERGROUPS WHERE FORUM_ID = " & fForumID)
        newUGPerms(fForumID)
    end if
    if (mlev = 3 and CInt(strUGModForums) = 2) then
        strSql = "SELECT UG.USERGROUP_ID FROM " & strTablePrefix & "USERGROUPS UG " &_
            "INNER JOIN " & strTablePrefix & "ALLOWED_USERGROUPS AUG " &_
            "ON UG.USERGROUP_ID = AUG.USERGROUP_ID WHERE AUG.FORUM_ID = " & fForumID &_
            " AND UG.MOD_HIDE = 0"
        set rsOK = my_Conn.execute(strSql)
        do while not rsOK.eof
            strSql = "DELETE FROM " & strTablePrefix & "ALLOWED_USERGROUPS " &_
                "WHERE FORUM_ID = " & fForumID & " AND USERGROUP_ID = " & rsOK("USERGROUP_ID")
            my_Conn.execute(strSql)
            rsOK.movenext
        loop
        rsOK.close
        set rsOK = nothing
        newUGPerms(fForumID)
    end if
end sub
'#######     End UserGroup MOD      #######
sub newForumModerators(fForumID)
   on error resume next
   if Request.Form("ForumMod") = "" then
      exit Sub
   end if
   Users = split(Request.Form("ForumMod"),",")
   for count = Lbound(Users) to Ubound(Users)
      strSql = "INSERT INTO " & strTablePrefix & "MODERATOR ("
      strSql = strSql & " MEMBER_ID, FORUM_ID) VALUES ( "& Users(count) & ", " & fForumID & ")"

      my_conn.execute (strSql),,adCmdText + adExecuteNoRecords
      if err.number <> 0 then
         Go_REsult err.description, 0
      end if
   next
   on error goto 0
end sub

sub updateForumModerators(fForumID)
   my_Conn.execute ("DELETE FROM " & strTablePrefix & "MODERATOR WHERE FORUM_ID = " & fForumId),,adCmdText + adExecuteNoRecords
   newForumModerators(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
   set rs2 = nothing
   if lcase(strEmail) = "1" then
      strRecipientsName = user_name
      strRecipients = email
      strSubject = strForumTitle & " - Topic Moved"
      strMessage = "Hello " & user_name & vbNewLine & vbNewLine
      strMessage = strMessage & "Your posting on " & strForumTitle & "." & vbNewLine
      strMessage = strMessage & "Regarding the subject - " & Topic_Title & "." & vbNewLine & vbNewLine

      if not(chkForumAccess(ForumID,Usernum,false)) then
         strMessage = strMessage & "Has been removed from public display, If you have any questions regarding this, please contact the Administrator of the forum" & vbNewLine
      else
         strMessage = strMessage & "Has been moved to a new forum, You can view it at " & vbNewLine & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "topic.asp?TOPIC_ID=" & TopicNum & vbNewLine
      end if
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
   end if
end sub

'## Subscribe checkbox start ##
sub DeleteSubscription(Level, MemberID, CatID, ForumID, TopicID)
         ' --- Delete the appropriate sublevel of subscriptions
         StrSql = "DELETE FROM " & strTablePrefix & "SUBSCRIPTIONS"
         StrSql = StrSql & " WHERE " & strTablePrefix & "SUBSCRIPTIONS.MEMBER_ID = " & MemberID
         if sublevel = "CAT" then
                 StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.CAT_ID = " & CatID
         elseif sublevel = "FORUM" then
                 StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.FORUM_ID = " & ForumID
         elseif sublevel = "TOPIC" then
                 StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.TOPIC_ID = " & TopicID
         end if
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
end sub

sub AddSubscription(SubLevel, MemberID, CatID, ForumID, TopicID)
         ' --- Insert the appropriate sublevel subscription
         StrSql = "INSERT INTO " & strTablePrefix & "SUBSCRIPTIONS"
         StrSql = StrSql & "(MEMBER_ID, CAT_ID, FORUM_ID, TOPIC_ID) VALUES (" & MemberID & ", "
         if sublevel = "BOARD" then
         StrSql = StrSql & "0, 0, 0)"
       elseif sublevel = "CAT" then
         StrSql = StrSql & CatID & ", 0, 0)"
         elseif sublevel = "FORUM" then
         StrSql = StrSql & CatID & ", " & ForumID & ", 0)"
         else
         StrSql = StrSql & CatID & ", " & ForumID & ", " & TopicID & ")"
         end if
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
end sub

'## Subscribe checkbox end ##
Function ChkNewRank()
   Dim arrRankLevels,intRank
   ChkNewRank = false
   arrRankLevels = array(intRankLevel1,intRankLevel2,intRankLevel3,intRankLevel4,intRankLevel5)
   For intRank = 0 To 4
      If cInt(intCurrPosts + 1) = cInt(arrRanklevels(intRank)) Then
         ChkNewRank = true
         Exit Function
      End If
   Next
End Function
%>



"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley

Edited by - MaGraham on 12 December 2013 03:25:11

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 December 2013 :  21:49:44  Show Profile
Since you didn't make any of the changes to the file, it's not surprising there are errors. You should go back and check the rest of them if you encounter more.


<%
'#################################################################################
'## Snitz Forums 2000 v3.4.07
'#################################################################################
'## Copyright (C) 2000-06 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
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<!--#INCLUDE FILE="inc_moderation.asp" -->
<!--#INCLUDE FILE="inc_subscription.asp" -->
<!--#INCLUDE FILE="inc_func_count.asp" -->
<!--#INCLUDE FILE="cal_post_info1.asp" -->
<%
if request("ARCHIVE") = "true" then
   strActivePrefix = strTablePrefix & "A_"
   ArchiveView = "true"
else
   strActivePrefix = strTablePrefix
   ArchiveView = ""
end if

'Topic Move Check
Dim blnTopicMoved
Dim fSubscription
'####### Poll Mod #########
Dim txtAns()
'##########################
'	##	Poll Below
If Request.Form("PEndDate")>"" Then
	If isNumeric(Request.Form("PEndDate")) and Request.Form("PEndDate")>"0" Then
		strNewDate=datetostr(DateAdd("d",cInt(Request.Form("PEndDate")),strtoDate(strForumTimeAdjust)))
	ElseIf Request.Form("PEndDate")="0" Then
		strNewDate=DatetoStr(strForumTimeAdjust)
	Else
		Go_Result	"Number of days must be an positive number.",0
	End If
End If
'	##	Poll Above

fsubscription = 1
blnTopicMoved = false

if strAuthType = "db" and strDBNTUserName = "" and len(Request.Form("Password")) <> 64 then
   strPassword = sha256("" & Request.Form("Password"))
else
   strPassword = ChkString(Request.Form("Password"),"SQLString")
end if

if strAuthType = "db" and strDBNTUserName = "" then
   strDBNTUserName = Request.Form("UserName")
   if mLev = 0 then mLev = cLng(chkUser(strDBNTUserName, strPassword,-1))
end if

MethodType = chkString(Request.Form("Method_Type"),"SQLString")

if Request.Form("CAT_ID") <> "" then
   if IsNumeric(Request.Form("CAT_ID")) = True then
      Cat_ID = cLng(Request.Form("CAT_ID"))
   else
      Response.Redirect("default.asp")
   end if
end if
if Request.Form("FORUM_ID") <> "" then
   if IsNumeric(Request.Form("FORUM_ID")) = True then
      Forum_ID = cLng(Request.Form("FORUM_ID"))
   else
      Response.Redirect("default.asp")
   end if
end if
if Request.Form("TOPIC_ID") <> "" then
   if IsNumeric(Request.Form("TOPIC_ID")) = True then
      Topic_ID = cLng(Request.Form("TOPIC_ID"))
   else
      Response.Redirect("default.asp")
   end if
end if
if Request.Form("REPLY_ID") <> "" then
   if IsNumeric(Request.Form("REPLY_ID")) = True then
      Reply_ID = cLng(Request.Form("REPLY_ID"))
   else
      Response.Redirect("default.asp")
   end if
end if
if Request.Form("Subscription") <> "" then
   fSubscription = cLng(Request.Form("Subscription"))
else
   fSubscription = 0
end if

if Request.Form("cookies") = "yes" then
   strSelectSize = Request.Form("SelectSize")
end if

if strSelectSize = "" or IsNull(strSelectSize) then
   strSelectSize = Request.Cookies(strUniqueID & "strSelectSize")
end if
if not(IsNull(strSelectSize)) and strSelectSize <> "" then
   if strSetCookieToForum = 1 then
         Response.Cookies(strUniqueID & "strSelectSize").Path = strCookieURL
   else
      Response.Cookies(strUniqueID & "strSelectSize").Path = "/"
   end if
   Response.Cookies(strUniqueID & "strSelectSize") = strSelectSize
   Response.Cookies(strUniqueID & "strSelectSize").expires = dateAdd("yyyy", 1, strForumTimeAdjust)
end if

if MethodType = "Edit" or _
MethodType = "EditTopic" or _
MethodType = "Reply" or _
MethodType = "ReplyQuote" or _
MethodType = "TopicQuote" then
   '## check if topic exists in TOPICS table
   set rsTCheck = my_Conn.Execute ("SELECT TOPIC_ID FROM " & strActivePrefix & "TOPICS WHERE TOPIC_ID = " & Topic_ID)
   if rsTCheck.EOF or rsTCheck.BOF then
      set rsTCheck = nothing
      Go_Result "Sorry, that Topic no longer exists in the Database", 0
   end if
   set rsTCheck = nothing
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 R_AUTHOR "
   strSql = strSql & " FROM " & strActivePrefix & "REPLY "
   strSql = strSql & " WHERE REPLY_ID = " & REPLY_ID

   set rsStatus = my_Conn.Execute(strSql)
   if rsStatus.EOF or rsStatus.BOF then
      rsStatus.close
      set rsStatus = nothing
      Go_Result "Please don't attempt to edit the URL<br />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 C.CAT_STATUS, C.CAT_NAME, " &_
      "F.FORUM_ID, F.F_STATUS, F.F_TYPE, F.F_SUBJECT, " &_
      "T.T_STATUS, T.T_AUTHOR, T.T_SUBJECT " &_
      " FROM " & strTablePrefix & "CATEGORY C, " &_
      strTablePrefix & "FORUM F, " &_
      strActivePrefix & "TOPICS T" &_
      " WHERE C.CAT_ID = T.CAT_ID " &_
      " AND F.FORUM_ID = T.FORUM_ID " &_
      " AND T.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 C.CAT_STATUS, C.CAT_NAME, " &_
      "F.FORUM_ID, F.F_STATUS, F.F_TYPE, F.F_SUBJECT " &_
      " FROM " & strTablePrefix & "CATEGORY C, " &_
      strTablePrefix & "FORUM F" &_
      " WHERE C.CAT_ID = F.CAT_ID " &_
      " AND F.FORUM_ID = " & Forum_ID & ""
        end if

   set rsStatus = my_Conn.Execute(strSql)
   if rsStatus.EOF or rsStatus.BOF then
      rsStatus.close
      set rsStatus = nothing
      Go_Result "Please don't attempt to edit the URL<br />to gain access to locked Forums/Categories.", 0
   else
      blnCStatus = rsStatus("CAT_STATUS")
      strCatTitle = rsStatus("CAT_NAME")
      blnFStatus = rsStatus("F_STATUS")
      Forum_ID = rsStatus("FORUM_ID")
      Forum_Type = rsStatus("F_TYPE")
      strForum_Title = rsStatus("F_SUBJECT")
      if MethodType <> "Topic" then
         blnTStatus = rsStatus("T_STATUS")
         strTopicAuthor = rsStatus("T_AUTHOR")
         strTopicTitle = rsStatus("T_SUBJECT")
      else
         blnTStatus = 1
      end if
      rsStatus.close
      set rsStatus = nothing
   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

   select case MethodType
      case "Topic"
         if (Forum_Type = 1) then
            Go_Result "You have attempted to post a New Topic to a Forum designated as a Web Link",0
         end if
         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
'#######    Begin UserGroup MOD     #######
    if isDeniedMember(Forum_ID,MemberID) = 1 then
        Go_Result "You have been denied access to this forum"
    end if
    if isReadOnly(Forum_ID,MemberID) = 1 then
        Go_Result "Your access to this forum is read-only"
    end if
'#######     End UserGroup MOD      #######
   if strPrivateForums = "1" and ForumChkSkipAllowed = 0 then
      if not(chkForumAccess(Forum_ID,MemberID,false)) then
            Go_Result "You do not have access to post to this forum", 0
      end if
   end if
end if
'##DRAFTS ## User Space Mod ## ADD line below ######################

 %><!--#INCLUDE FILE="inc_draft_info.asp" --><%

'## End ## Thats all for this file #############################

' If Creating a new topic or reply, the subscription and moderation capabilities will need to be checked.

Moderation = "No"
'############# Merge Topic Mod ################
'Added "or _ MethodType = "MergeTopic"" in following if...then statement
if MethodType = "Topic" or _
   MethodType = "Edit" or _
   MethodType = "Reply" or _
   MethodType = "ReplyQuote" or _
   MethodType = "TopicQuote" or _
   MethodType = "Forum" or _
   MethodType = "EditForum" or _
   MethodType = "MergeTopic" or _
   MethodType = "SplitTopic"  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?
            '####################### Merge Topic Mod #############################
            ' Added "or MethodType = "MergeTopic"" in following line
            elseif (ForumModeration = 1 or ForumModeration = 3) and (MethodType <> "Topic" or MethodType = "MergeTopic") then
            '#####################################################################
               Moderation = "Yes"
            end if
            end if
            end if
   end if
end if

if MethodType = "Edit" then
   member = cLng(ChkUser(strDBNTUserName, strPassword, 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 an Admin, a Moderator or 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 an Admin, a Moderator or the Author can change this post", 0
         end if
         if strReplyAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
            Go_Result "Only the website owner can change this post", 0
         end if
      case 4 '## Admin so OK
         if strReplyAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
            Go_Result "Only the website owner can change this post", 0
         end if
      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 & "<li>You Must Enter a Message for your Reply</li>"
   end if
   if Err_Msg = "" then
      '## Forum_SQL - Do DB Update
      strSql = "UPDATE " & strActivePrefix & "REPLY "
      strSql = strSql & " SET R_MESSAGE = '" & txtMessage & "'"
      strSql = strSql & ", R_MSGICON = " & cLng(Request.Form("strMessageIcon"))
      if Request.Form("sig") = "yes" and strDSignatures = "1" then
         strSql = strSql & ", R_SIG = 1"
      else
         strSql = strSql & ", R_SIG = 0"
      end if
      if mLev < 4 and strEditedByDate = "1" then
         strSql = strSql & ", R_LAST_EDIT = '"  & DateToStr(strForumTimeAdjust) & "'"
         strSql = strSql & ", R_LAST_EDITBY = "  & MemberID
      end if
      strSql = strSql & " WHERE REPLY_ID=" & Reply_ID

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      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 = " & MemberID
         strSql = strSql & ",    F_LAST_POST_TOPIC_ID = " & Topic_ID
         strSql = strSql & ",    F_LAST_POST_REPLY_ID = " & Reply_ID
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

         '## Forum_SQL - Update Last Post
         strSql = " UPDATE " & strActivePrefix & "TOPICS"
         strSql = strSql & " SET T_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
         strSql = strSql & ",    T_LAST_POST_AUTHOR = " & MemberID
         strSql = strSql & ",    T_LAST_POST_REPLY_ID = " & Reply_ID
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

      if Moderation = "No" then
         '## Subscribe checkbox start ##
         if request.form("TNotify") <> "" then
            if request.form("TNotify") = "1" then
               AddSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
            else
               DeleteSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
            end if
         end if
         '## Subscribe checkbox end ##
      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
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "EditTopic" then
   member = cLng(ChkUser(strDBNTUserName, strPassword, 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 an Admin, a Moderator or the Author can change this post", 0
         Response.End
      case 3 '## Moderator so
         if chkForumModerator(Forum_ID, strDBNTUserName) = "0" then
            Go_Result "Only an Admin, a Moderator or the Author can change this post", 0
         end if
         if strTopicAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
            Go_Result "Only the website owner can change this post", 0
         end if
      case 4 '## Admin so OK
         if strTopicAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
            Go_Result "Only the website owner can change this post", 0
         end if
         '## 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")
' ######################### Poll Mod ########################
   if Request.Form("poll") = "1" then
      count = Request.Form("count")
      ReDim txtAns(CInt(count))

      For i = 1 To CInt(count)
         if trim(Request.Form("answer" & CStr(i))) <> "" then
            txtAns(i) = Request.Form("answer" & CStr(i))
         else
            txtAns(i) = ""
         end if
      Next
   end if
' ###########################################################
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the Topic</li>"
   end if
   if Len(Request.Form("Subject")) > 50 then
      Err_Msg = Err_Msg & "<li>The Subject can not be greater than 50 characters</li>"
   end if
   if txtMessage = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Message for the Topic</li>"
   end if
' ######################### Poll Mod ########################
   if Request.Form("poll") = "1" then
      count = Request.Form("count")
      For i = 1 to CInt(count)
         if trim(Request.Form("answer" & CStr(i))) <> "" then
            intCount = intCount + 1
         end if
      Next
      if intCount < 2 then
         Err_Msg = Err_Msg & "<li>You Must Enter at least two Answers for the Poll</li>"
      end if
   end if
' ###########################################################
   if Err_Msg = "" then
      '##Get Status of this Topic
      strSql = "SELECT T_STATUS, T_UREPLIES"
      strSql = Strsql & " FROM " & strTablePrefix & "TOPICS "
      strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

      set rsTopicStatusCheck = my_Conn.Execute (strSql)

      Topic_Status = rsTopicStatusCheck("T_STATUS")
      Topic_UReplies = rsTopicStatusCheck("T_UREPLIES")

      rsTopicStatusCheck.Close
      set rsTopicStatusCheck = nothing

      '## 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 <> cLng(aryForum(1)) then
      '############################ Poll Mod ############################
         strSql = "SELECT " & strTablePrefix & "FORUM.F_POLLS "
         strSql = strsql & " FROM " & strTablePrefix & "FORUM "
         strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & aryForum(1)

         set rsPollCheck = my_Conn.Execute(strSql)

         ForumPolls = rsPollCheck("F_POLLS")

         rsPollCheck.close
         set rsPollCheck = nothing
      '##################################################################
         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" and Topic_Status > 0 then

            strSql = "SELECT " & strTablePrefix & "FORUM.F_MODERATION "
            strSql = Strsql & " FROM " & strTablePrefix & "FORUM "
            strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & cLng(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

      if Moderation = "Yes" and AutoApprove = "Yes" and Topic_UReplies > 0 then
         Go_Result "There was an error = The Topic you are attempting to move to an UnModerated Forum has UnModerated Replies<br />Please either approve or delete them and then try again.", 0
         Response.End
      end if

      '## Forum_SQL
      strSql = "UPDATE " & strActivePrefix & "TOPICS "
      strSql = strSql & " SET T_MESSAGE = '" & txtMessage & "'"
      strSql = strSql & ", T_SUBJECT = '" & txtSubject & "'"
      strSql = strSql & ", T_MSGICON = " & cLng(Request.Form("strMessageIcon"))
      if blnTopicMoved then
         strSql = strSql & ", CAT_ID = " & cLng(aryForum(0))
         strSql = strSql & ", FORUM_ID = " & cLng(aryForum(1))
         if AutoApprove = "Yes" then
            strSql = strSql & ", T_STATUS = 1 "
         end if
      end if
   '################# Poll Mod ###################
      if Request.Form("lockpoll") = "1" or ForumPolls = "0" then
         strSql = strSql & ", T_POLLSTATUS = 0"
      else
         strSql = strSql & ", T_POLLSTATUS = 1"
      end if
   '##############################################
      if Request.Form("sig") = "yes" and strDSignatures = "1" then
         strSql = strSql & ", T_SIG = 1"
      else
         strSql = strSql & ", T_SIG = 0"
      end if
   '########## Topic Rating ##########
      if Request.Form("AllowRating") = 1 then
         strSql = strSql & ", ALLOW_RATING = 1 "
      else
         strSql = strSql & ", ALLOW_RATING = 0 "
      end if
   '########## End Topic Rating ##########
      if mLev < 4 and strEditedByDate = "1" then
         strSql = strSql & ", T_LAST_EDIT = '"  & DateToStr(strForumTimeAdjust) & "'"
         strSql = strSql & ", T_LAST_EDITBY = "  & MemberID
      end if
      if ForumChkSkipAllowed = 1 then
         if Request.Form("sticky") = 1 then
            strSql = strSql & ", T_STICKY = " & 1
            strSql = strSql & ", T_ARCHIVE_FLAG = " & 0
         else
            strSql = strSql & ", T_STICKY = " & 0
            strSql = strSql & ", T_ARCHIVE_FLAG = " & 1
         end if
      end if
      strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

      my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
      %><!--#INCLUDE FILE="cal_post_info2.asp"--><%
   '############################ Poll Mod ###################################
      if Request.Form("poll") = "1" then
         '### Update poll answers and counts
         strSql = "UPDATE " & strTablePrefix & "POLLS "
				 strSql = strSql & " Set P_WHOVOTES = '" & chkString(Request.Form("WhoVotes"),"SQLString") & "', P_ENDDATE = '" & strNewDate & "', "
         strSql = strSql & "     CAT_ID = " & cLng(aryForum(0)) & ", "
         strSql = strSql & "     FORUM_ID = " & cLng(aryForum(1)) & ", "
         for i = 1 to CInt(Request.Form("count"))
            strSql = strSql & "ANSWER" & CStr(i) & " = '" & chkString(txtAns(i),"") & "'"
            if txtAns(i) = "" or chkString(Request.Form("resetpoll"),"SQLString") = "1" then
               strSql = strSql & ", COUNT" & CStr(i) & " = " & 0
            end if
            if ubound(txtAns) <> i then
               strSql = strSql & ", "
            end if
         next
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID
         my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

         if Request.Form("resetpoll") = "1" then
            '### Delete poll votes from POLL_VOTES table for this topic
            strSql = "DELETE FROM " & strTablePrefix & "POLL_VOTES "
            strSql = strSql & "WHERE " & strTablePrefix & "POLL_VOTES.TOPIC_ID = " & Topic_ID
            my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
         end if
      end if
   '#########################################################################

      '# Subscribe checkbox start ##
      if request.form("TNotify") <> "" then
         if request.form("TNotify") = "1" then
            AddSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
         elseif request.form("TNotify") = "0" then
            DeleteSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
         end if
      end if
      '## Subscribe checkbox end ##

      if blnTopicMoved then
         if strEmail = "1" and strMoveNotify = "1" then DoAutoMoveEmail(Topic_ID)
         strSQL = "SELECT F_SUBSCRIPTION FROM " & strTablePrefix & "FORUM WHERE FORUM_ID=" & cLng(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),,adCmdText + adExecuteNoRecords
         end if
         rs.close
         set rs = nothing
      end if
      if Forum_ID <> cLng(aryForum(1)) then
         '## Forum_SQL
         strSql = "UPDATE " & strActivePrefix & "REPLY "
         strSql = strSql & " SET CAT_ID = " & cLng(aryForum(0))
         strSql = strSql & ", FORUM_ID = " & cLng(aryForum(1))
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

         my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

         '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" or Topic_Status < 2 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 TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID "
            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_Topic_ID = rs("TOPIC_ID")
               strLast_Post = rs("T_LAST_POST")
               strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
               strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
            else
               strLast_Post_Topic_ID = 0
               strLast_Post = ""
               strLast_Post_Author = 0
               strLast_Post_Reply_ID = 0
            end if

            rs.Close
            set rs = nothing

               if Moderation = "No" or Topic_Status < 2 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
               strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
               my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

               '## 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),,adCmdText + adExecuteNoRecords

            end if

            strSql = "UPDATE " & strTablePrefix & "FORUM SET "
            '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 & ", F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID
            strSql = strSql & ", F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
            strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
            my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

            '## Forum_SQL - Get last_post and last_post_author for Forum
            strSql = "SELECT TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_AUTHOR, T_LAST_POST_REPLY_ID "
            strSql = strSql & " FROM " & strActivePrefix & "TOPICS "
            strSql = strSql & " WHERE FORUM_ID = " & cLng(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_Topic_ID = rs("TOPIC_ID")
               strLast_Post = rs("T_LAST_POST")
               strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
               strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
            else
               strAuthor = ""
               strLast_Post_Topic_ID = 0
               strLast_Post = ""
               strLast_Post_Author = ""
               strLast_Post_Reply_ID = 0
            end if

            rs.Close
            set rs = nothing
            'Huw -- Update member count
            if (AutoApprove = "Yes") and blnTStatus = 2 and blnTopicMoved then
               set rsFCountMP = my_Conn.Execute("SELECT F_COUNT_M_POSTS FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & cLng(aryForum(1)))
               ForumCountMPosts = rsFCountMP("F_COUNT_M_POSTS")
               rsFCountMP.close
               set rsFCountMP = nothing
               if ForumCountMPosts <> 0 then
                  '  ## Points Below
                  Call doUCount(strT_Last_Post_Author, "T", False)
                  '  ## Points Above
               end if
               doULastPost(strT_Last_Post_Author)
            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 & ")"
            strSql = strSql & ", F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID
            strSql = strSql & ", F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
            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 = " & cLng(aryForum(1))
            my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

            '## Forum_SQL
            strSql =  "UPDATE " & strTablePrefix & "FORUM SET "
            strSql = strSql & " F_TOPICS = F_TOPICS + 1 "
            strSql = strSql & " WHERE FORUM_ID = " & cLng(aryForum(1))
            my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
         end if
      else
         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 = " & MemberID
            strSql = strSql & ",    F_LAST_POST_TOPIC_ID = " & Topic_ID
            strSql = strSql & ",    F_LAST_POST_REPLY_ID = " & 0
            strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

            my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

            '## Forum_SQL - Update Last Post
            strSql = " UPDATE " & strActivePrefix & "TOPICS"
            strSql = strSql & " SET T_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
            strSql = strSql & ",    T_LAST_POST_AUTHOR = " & MemberID
            strSql = strSql & ",    T_LAST_POST_REPLY_ID = " & 0
            strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

            my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
         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
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "Topic" then
   '## Forum_SQL
   strSql = "SELECT MEMBER_ID, M_LEVEL, M_EMAIL, M_LASTPOSTDATE, " & 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(strPassword, "SQLString") &"'"
      QuoteOk = (ChkQuoteOk(strDBNTUserName) and ChkQuoteOk(strPassword))
   else
      QuoteOk = ChkQuoteOk(strDBNTUserName)
   end if

   set rs = my_Conn.Execute (strSql)

   if rs.BOF or rs.EOF or not(QuoteOk) or not (ChkQuoteOk(strPassword))then '##  Invalid Password
      rs.close
      set rs = nothing
      Go_Result "Invalid UserName or Password!", 0
      Response.End
   else
      if strPrivateForums = "1" and ForumChkSkipAllowed = 0 then
         if not(chkForumAccess(Forum_ID, MemberID,false)) then
            Go_Result "You are not allowed to post in this forum !", 0
         end if
      end if
      if strFloodCheck = 1 then
         if rs("M_LASTPOSTDATE") > DateToStr(DateAdd("s",strFloodCheckTime,strForumTimeAdjust)) and mLev < 3 then
            strTimeLimit = replace(strFloodCheckTime, "-", "")
            Go_Result "Sorry! We have flood control activated.<br />You cannot post within " & strTimeLimit & " seconds of your last post.<br />Please try again after this period of time elapses.", 0
         end if
      end if

      txtMessage = ChkString(Request.Form("Message"),"message")
      txtSubject = ChkString(Request.Form("Subject"),"SQLString")
      UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
      if UserIPAddress = "" then
         UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
      end if
   ' ##################### Poll Mod ######################
      if Request.Form("poll") = "1" then
         ReDim txtAns(strMaxVotes)
         for i = 1 to strMaxVotes
            if trim(Request.Form("answer" & CStr(i))) <> "" then
               txtAns(i) = Request.Form("answer" & CStr(i))
            else
               txtAns(i) = ""
            end if
         next
      end if
   ' #####################################################
      if strBadWordFilter = "1" then
         txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
      end if

      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 Len(Request.Form("Subject")) > 50 then
         Go_Result "The Subject can not be greater than 50 characters", 0
         Response.End
      end if
   ' ####################### Poll Mod ##########################
      if Request.Form("poll") = "1" then
         For i = 1 to strMaxVotes
            if trim(Request.Form("answer" & CStr(i))) <> "" then
               intCount = intCount + 1
            end if
         Next
         if intCount < 2 then
            Go_Result "You Must Enter at least two Answers for the Poll", 0
         end if
      end if
   ' ##########################################################
      if strSignatures = "1" and strDSignatures <> "1" then
         if Request.Form("sig") = "yes" and GetSig(strDBNTUserName) <> " " then
            txtMessage = txtMessage & vbNewline & vbNewline & ChkString(GetSig(strDBNTUserName), "signature" )
         end if
      end if

'Gatekeeper Mod
      if strLinkSpamGatekeeper = "1" then
         select case len(Request.Form("GateKeeperAnswer"))
         case "0"
            Go_Result "You have not entered an answer for the Antispam question. Please use your back button and try again.", 0
         case else
            if (lcase(Request.Form("GateKeeperAnswer")) <> lcase(strGatekeeperAnswer1)) and (lcase(Request.Form("GateKeeperAnswer")) <> lcase(strGatekeeperAnswer2)) then
               Go_Result "You have entered a wrong answer for the Antispam question. Please use your back button and try again.", 0
            end if
         end select
      end if
'Gatekeeper Mod

      '## 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"
   ' ############# Poll Mod #############
      strSql = strSql & ", T_ISPOLL"
      strSql = strSql & ", T_POLLSTATUS"
   ' ###################################
      strSql = strSql & ", T_AUTHOR"
      strSql = strSql & ", T_LAST_POST"
      strSql = strSql & ", T_LAST_POST_AUTHOR"
      strSql = strSql & ", T_LAST_POST_REPLY_ID"
      strSql = strSql & ", T_DATE"
      strSql = strSql & ", T_STATUS"
      if strIPLogging <> "0" then
         strSql = strSql & ", T_IP"
      end if
      strSql = strSql & ", T_STICKY"
      strSql = strSql & ", T_SIG"
      strSql = strSql & ", T_ARCHIVE_FLAG"
      strSql = strSql & ", T_REPLIES"
      strSql = strSql & ", T_UREPLIES"
   '########## Topic Rating ##########
      strSql = strSql & ", ALLOW_RATING"
  '########## End Topic Rating ##########
      strSql = strSql & ", T_MSGICON"
      strSql = strSql & ") VALUES ("
      strSql = strSql & Forum_ID
      strSql = strSql & ", " & Cat_ID
      strSql = strSql & ", '" & txtSubject & "'"
      strSql = strSql & ", '" & txtMessage & "'"
   ' ################ Poll Mod ###############
      if Request.Form("poll") = "1" then
         strSql = strSql & ", " & 1
      else
         strSql = strSql & ", " & 0
      end if
      if Request.Form("lockpoll") = "1" then
         strSql = strSql & ", " & 0
      else
         strSql = strSql & ", " & 1
      end if
   ' ##########################################
      strSql = strSql & ", " & rs("MEMBER_ID")
      strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
      strSql = strSql & ", " & rs("MEMBER_ID")
      strSql = strSql & ", 0 "
      strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
      if Request.Form("lock") = 1 and ForumChkSkipAllowed = 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 & ", '" & UserIPAddress & "'"
      end if
      if ForumChkSkipAllowed = 1 then
         if Request.Form("sticky") = 1 then
            strSql = strSql & ", 1 "
         else
            strSql = strSql & ", 0 "
         end if
      else
         strSql = strSql & ", 0 "
      end if
      if Request.Form("sig") = "yes" and strDSignatures = "1" then
         strSql = strSql & ", 1 "
      else
         strSql = strSql & ", 0 "
      end if
      if ForumChkSkipAllowed = 1 then
         if Request.Form("sticky") = 1 then
            strSql = strSql & ", 0 "
         else
            strSql = strSql & ", 1 "
         end if
      else
         strSql = strSql & ", 1 "
      end if
      strSql = strSql & ", 0 "
      strSql = strSql & ", 0 "
   '########## Topic Rating ##########
      if Request.Form("AllowRating") = 1 then
         strSql = strSql & ", 1 "
      else
         strSql = strSql & ", 0 "
      end if
  '########## End Topic Rating ##########
  strSql = strSql & ", " & cLng(Request.Form("strMessageIcon"))
         strSql = strSql & ")"

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      %><!--#INCLUDE FILE="cal_post_info2.asp"--><%
   '############################ Poll Mod ##############################
      if Request.Form("poll") = "1" then
         strSql = "SELECT " & strTablePrefix & "TOPICS.TOPIC_ID "
         strSql = strSql & "FROM " & strTablePrefix & "TOPICS "
         strSql = strSql & "WHERE " & strTablePrefix & "TOPICS.T_ISPOLL = " & 1 & " "
         strSql = strSql & "ORDER BY " & strTablePrefix & "TOPICS.T_DATE DESC"
         set rsPollID = my_Conn.Execute (strSql)
         PollID = rsPollID("TOPIC_ID")
         rsPollID.close
         set rsPollID = nothing
         '## Forum_SQL - Add new poll to Polls Table
         strSql = "INSERT INTO " & strTablePrefix & "POLLS (CAT_ID"
         strSql = strSql & ", FORUM_ID"
         strSql = strSql & ", TOPIC_ID"
         strSql = strSql & ", P_WHOVOTES"
			   strSql = strSql & ", P_ENDDATE"
         for i = 1 to ubound(txtAns)
            strSql = strSql & ", ANSWER" & CStr(i)
            strSql = strSql & ", COUNT" & CStr(i)
         next
         strSql = strSql & ") VALUES ("
         strSql = strSql & Cat_ID
         strSql = strSql & ", " & Forum_ID
         strSql = strSql & ", " & PollID
         strSql = strSql & ", '" & chkString(Request.Form("WhoVotes"),"SQLString") & "'"
			   strSql = strSql & ", '" & strNewDate & "'"
         for i = 1 to ubound(txtAns)
            strSql = strSql & ", '" & chkString(txtAns(i),"") & "'"
            strSql = strSql & ", " & 0
         next
         strSql = strSql & ")"
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if
   '####################################################################
      if Err.description <> "" then
         err_Msg = "There was an error = " & Err.description
      else
         err_Msg = "Updated OK"
      end if

      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

      ' 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 & ",    F_LAST_POST_TOPIC_ID = " & NewTopicID
         strSql = strSql & ",    F_LAST_POST_REPLY_ID = " & 0
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

      ProcessSubscriptions rs("MEMBER_ID"), Cat_ID, Forum_ID, NewTopicID, Moderation

      if Moderation = "No" then
         '## Subscribe checkbox ##
         if request.form("TNotify") <> "" then
            if request.form("TNotify") = "1" then
               AddSubscription "TOPIC", rs("MEMBER_ID"), Cat_ID, Forum_ID, NewTopicID
            elseif request.form("TNotify") = "0" then
               DeleteSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, NewTopicID
            end if
         end if
         '## Subscribe checkbox end ##
      end if

      Go_Result err_Msg, 1
      Response.End
   end if
end if


'#################### Merge Topic Mod ###################
if MethodType = "MergeTopic" then
   lngMember = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   select case lngMember
      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 Authorized
         Go_Result "Only an Admin or Moderator can Merge Topics", 0
         Response.End
      case 3 '## Moderator - Authorized
         '## Do Nothing
      case 4 '## Admin
         '## Do Nothing
      case else
         Go_Result cstr(lngMember), 0
         Response.End
   end select

   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("subject")),"SQLString")
   else
      txtSubject = chkString(Request.Form("subject"),"SQLString")
   end if
   if txtSubject = " " then
      Go_Result "You must post a subject!", 0
      Response.End
   end if
   if Len(Request.Form("subject")) > 50 then
      Go_Result "The subject can not be greater than 50 characters", 0
      Response.End
   end if
   if IsNumeric(Request.Form("MERGE_TOPIC_ID")) = True then
      MergeWithTopicID = cLng(Request.Form("MERGE_TOPIC_ID"))
   else
      Go_Result "You entered an incorrect URL of a topic. Please go back and correct it.", 0
   end if

   'Notes
   '- Check/Move subscriptions for the topics.
   '- Topic starter needs to be notified via email that topic was merged with another
   '- that it?

   '## Get info from database on both topics
   strSql = "SELECT TOPIC_ID, FORUM_ID, CAT_ID, T_IP, T_LAST_EDIT, T_LAST_POST, T_LAST_EDITBY, T_AUTHOR, T_DATE, T_REPLIES, T_SIG, T_VIEW_COUNT, T_MESSAGE "
   strSql = strSql & "FROM " & strTablePrefix & "TOPICS "
   strSql = strSql & "WHERE TOPIC_ID = " & MergeWithTopicID & " "
   strSql = strSql & "OR TOPIC_ID = " & Topic_ID
   'SELECT T_IP, T_LAST_EDIT, T_LAST_EDITBY, T_AUTHOR, T_DATE, T_REPLIES, T_SIG, T_VIEW_COUNT, T_MESSAGE FROM FORUM_TOPICS WHERE TOPIC_ID = 36 AND TOPIC_ID = 35
   'Response.Write strSql & "<br>"
   Set rs = Server.CreateObject("ADODB.Recordset")
   rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

   if rs.EOF then
      recCount = "-1"
   else
      allRec = rs.GetRows(adGetRowsRest)
      recCount = UBound(allRec,2)
   end if

   rs.close
   set rs = nothing
   'Response.Write strSql
   'Response.End

   '## Loop through data
   if recCount <> "-1" then
      Dim RowCount : RowCount = 0
      Dim blnInSameForum : blnInSameForum = true
      Dim intOlderTopic, intOtherTopic

      'Assign numerical locator for the array to variables
      TopicID = 0
      ForumID = 1
      CatID = 2
      Topic_IP = 3
      Topic_LastEdit = 4
      Topic_LastPost = 5
      Topic_LastEditBy = 6
      Topic_Author = 7
      Topic_Date = 8
      Topic_Replies = 9
      Topic_Sig = 10
      Topic_ViewCount = 11
      Topic_Message = 12

      'Check the posted date of both topics. The older topic remains as a topic.
      'I am assigning the row count for each topic in the allRec() array.
      if allRec(Topic_Date,0) < allRec(Topic_Date,1) then
         intOlderTopic = 0
         intOtherTopic = 1
      else
         intOlderTopic = 1
         intOtherTopic = 0
      end if

      'This is needed to get the forum and cat id for the
      'target topic when merging between 2 forums.
      if CLng(allRec(TopicID, 0)) = Topic_ID then
         intTargetTopic = 0
         intNotTargetTopic = 1
      else
         intTargetTopic = 1
         intNotTargetTopic = 0
      end if

      'Check if both topics are in the same forum
      if allRec(ForumID, intOlderTopic) <> allRec(ForumID, intOtherTopic) then
         blnInSameForum = false
      end if

      'if merging between 2 forums, change the forum id and cat id, to the
      'target topic, effectively moving the target topic to the correct forum
      if blnInSameForum = false then
         strSql = "UPDATE " & strTablePrefix & "TOPICS "
         strSql = strSql & " SET FORUM_ID = " & allRec(ForumID, intTargetTopic)
         strSql = strSql & ", CAT_ID = " & allRec(CatID, intTargetTopic)
         strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intNotTargetTopic)
         'Response.Write strSql & "<br>"
         'Response.End
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

      'Following query moves the topic to the reply table
      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"
      strSql = strSql & ", R_IP"
      strSql = strSql & ", R_STATUS"
      strSql = strSql & ", R_SIG"
      strSql = strSql & ", R_MESSAGE"
      strSql = strSql & ", R_MSGICON"
      strSql = strSql & ") VALUES ("
      strSql = strSql & allRec(TopicID, intOlderTopic)
      strSql = strSql & ", " & allRec(ForumID, intOlderTopic)
      strSql = strSql & ", " & allRec(CatID, intOlderTopic)
      strSql = strSql & ", " & allRec(Topic_Author, intOtherTopic)
      strSql = strSql & ", '" & allRec(Topic_Date, intOtherTopic) & "'"
      strSql = strSql & ", '" & allRec(Topic_IP, intOtherTopic) & "'"
      strSql = strSql & ", 1"
      strSql = strSql & ", " & allRec(Topic_Sig, intOtherTopic)
      strSql = strSql & ", '" & chkString(allRec(Topic_Message, intOtherTopic),"message") & "'"
      strSql = strSql & ", " & cLng(Request.Form("strMessageIcon")) & ")"
      'Response.Write strSql & "<br>"
      'Response.End
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'Change the replies topic id from the topic we merging to,
      'to the current topic, effectively moving them from one topic
      'to the other.
      strSql = "UPDATE " & strTablePrefix & "REPLY"
      strSql = strSql & " SET TOPIC_ID = " & allRec(TopicID, intOlderTopic)
      if blnInSameForum = false then
         strSql = strSql & ", FORUM_ID = " & allRec(ForumID, intOlderTopic)
         strSql = strSql & ", CAT_ID = " & allRec(CatID, intOlderTopic)
      end if
      strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intOtherTopic)
      'Response.Write strSql & "<br>"
      'Response.End
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'Update any subscriptions for the topic we are merging with and transfer them
      'to the existing topic.
      strSql = "UPDATE " & strTablePrefix & "SUBSCRIPTIONS"
      strSql = strSql & " SET TOPIC_ID = " & allRec(TopicID, intOlderTopic)
      strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intOtherTopic)
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'Update total # of TOPICS by - 1
      strSql = "UPDATE " & strTablePrefix & "TOTALS "
      strSql = strSql & " SET T_COUNT = T_COUNT - 1"
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'count how many replies are now in the topic
      'get the last reply from the reply table
      strSql = "SELECT Count(REPLY_ID) as TotalReplies "
      strSql = strSql & " FROM " & strTablePrefix & "REPLY "
      strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intOlderTopic)
      'Response.Write strSql & "<br>"
      'Response.End
      set rsTotal = my_Conn.Execute (strSql)

      TotalReplies = rsTotal("TotalReplies") 'holds the number of replies in the current topic

      rsTotal.close
      set rsTotal = nothing

      'Get info about the last reply in the REPLY table
      strSql = "SELECT REPLY_ID, R_AUTHOR, R_DATE, R_LAST_EDIT, R_LAST_EDITBY "
      strSql = strSql & "FROM " & strTablePrefix & "REPLY "
      strSql = strSql & "WHERE TOPIC_ID = " & allRec(TopicID, intOlderTopic) & " "
      strSql = strSql & "AND R_STATUS <= 1 "
      strSql = strSql & "ORDER BY R_DATE DESC"
      'Response.Write strSql & "<br>"
      'Response.End
      set rsLastReply = my_Conn.Execute (strSql)

      LatestReplyID = rsLastReply("REPLY_ID") 'holds the id of the last reply in the current topic
      LastReplyAuthor = rsLastReply("R_AUTHOR")
      LastReplyDate = rsLastReply("R_DATE")
      LastReplyEdit = rsLastReply("R_LAST_EDIT")
      LastReplyEditBy = rsLastReply("R_LAST_EDITBY")

      rsLastReply.close
      set rsLastReply = nothing

      'Update topic with the info about the last post date, and author.
      strSql = "UPDATE " & strTablePrefix & "TOPICS "
      strSql = strSql & "SET T_SUBJECT = '" & txtSubject & "'"
      strSql = strSql & ", T_VIEW_COUNT = T_VIEW_COUNT + " & cLng(allRec(Topic_ViewCount, intOtherTopic))
      strSql = strSql & ", T_LAST_POST_AUTHOR = " & LastReplyAuthor
      strSql = strSql & ", T_LAST_POST = '" & LastReplyDate & "'"
      strSql = strSql & ", T_LAST_POST_REPLY_ID = " & LatestReplyID
      if LastReplyEdit <> "" then
         strSql = strSql & ", T_LAST_EDIT = '" & LastReplyEdit & "'"
         if LastReplyEditBy <> "" then
            strSql = strSql & ", T_LAST_EDITBY = " & LastReplyEditBy
         end if
      end if
      strSql = strSql & ", T_REPLIES = " & TotalReplies
      strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intOlderTopic)
      'Response.Write strSql & "<br>"
      'Response.End
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'delete old topic from topic table
      strSql = "DELETE FROM " & strTablePrefix & "TOPICS "
      strSql = strSql & "WHERE TOPIC_ID = " & allRec(TopicID, intOtherTopic)
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'Get last_post and last_post_author for Forum
      strSql = "SELECT TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID"
      strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
      strSql = strSql & " WHERE FORUM_ID = " & allRec(ForumID, intTargetTopic) & " "
      strSql = strSql & " ORDER BY T_LAST_POST DESC"
      'Response.Write strSql & "<br>"
      set rs = my_Conn.Execute (strSql)

      if not rs.eof then
         rs.movefirst
         strLast_Post = rs("T_LAST_POST")
         strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
         strLast_Post_Topic_ID = rs("TOPIC_ID")
         strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
      else
         strLast_Post = ""
         strLast_Post_Author = "NULL"
         strLast_Post_Topic_ID = 0
         strLast_Post_Reply_ID = 0
      end if

      rs.Close
      set rs = nothing

      'Update the # of posts count for the forum and # of topics for the forum
      strSql = "UPDATE " & strTablePrefix & "FORUM SET"
      if blnInSameForum then
         strSql = strSql & " F_TOPICS = F_TOPICS - 1,"
      else
         strSql = strSql & " F_COUNT = F_COUNT + " & cLng(allRec(Topic_Replies, intOtherTopic) + 1) & ","
      end if
      strSql = strSql & " F_LAST_POST = '" & strLast_Post & "',"
      strSql = strSql & " F_LAST_POST_AUTHOR = " & strLast_Post_Author & ","
      strSql = strSql & " F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID & ","
      strSql = strSql & " F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
      strSql = strSql & " WHERE FORUM_ID = " & allRec(ForumID, intTargetTopic)
      'Response.Write strSql & "<br>"
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'If the topic we merging with is in a different forum, update forum counts for that forum.
      if blnInSameForum = false then
         'Get last_post and last_post_author for Forum
         strSql = "SELECT TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID"
         strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
         strSql = strSql & " WHERE FORUM_ID = " & allRec(ForumID, intNotTargetTopic) & " "
         strSql = strSql & " ORDER BY T_LAST_POST DESC"
         'Response.Write strSql & "<br>"
         'Response.End
         set rs = my_Conn.Execute (strSql)

         if not rs.eof then
            rs.movefirst
            strLast_Post = rs("T_LAST_POST")
            strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
            strLast_Post_Topic_ID = rs("TOPIC_ID")
            strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
         else
            strLast_Post = ""
            strLast_Post_Author = "NULL"
            strLast_Post_Topic_ID = 0
            strLast_Post_Reply_ID = 0
         end if

         rs.Close
         set rs = nothing

         'Update the # of posts count for the forum and # of topics for the forum
         strSql = "UPDATE " & strTablePrefix & "FORUM"
         strSql = strSql & " SET F_TOPICS = F_TOPICS - 1,"
         strSql = strSql & " F_COUNT = F_COUNT - " & cLng(allRec(Topic_Replies, intOtherTopic) + 1) & ","
         strSql = strSql & " F_LAST_POST = '" & strLast_Post & "',"
         strSql = strSql & " F_LAST_POST_AUTHOR = " & strLast_Post_Author & ","
         strSql = strSql & " F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID & ","
         strSql = strSql & " F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
         strSql = strSql & " WHERE FORUM_ID = " & allRec(ForumID, intNotTargetTopic)
         'Response.Write strSql & "<br>"
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

      if lcase(strEmail) = "100" then 'not implemented yet
         'Send mail to author letting him know his topic was merged with another.
         'DoAutoMoveEmail(allRec(Topic_ID, intOlderTopic))
         strSql  = "SELECT M.MEMBER_ID, M.M_NAME, M.M_EMAIL, T.FORUM_ID, T.T_SUBJECT "
         strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS M, " & strActivePrefix & "TOPICS T "
         strSql = strSql & " WHERE M.MEMBER_ID = T.T_AUTHOR "
         strSql = strSql & " AND T.TOPIC_ID = " & TopicNum
         'Response.Write strSql
         'Response.End
         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

         strRecipientsName = user_name
         strRecipients = email
         strSubject = strForumTitle & " - Topic Moved"
         strMessage = "Hello " & user_name & vbNewLine & vbNewLine
         strMessage = strMessage & "Your posting on " & strForumTitle & "." & vbNewLine
         strMessage = strMessage & "Regarding the subject - " & Topic_Title & "." & vbNewLine & vbNewLine

         if not(chkForumAccess(ForumID,Usernum,false)) then
            strMessage = strMessage & "Has been removed from public display. If you have any questions regarding this, please contact the Administrator of the forum" & vbNewLine
         else
            strMessage = strMessage & "Has been moved to a new forum, You can view it at " & vbNewLine & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "topic.asp?TOPIC_ID=" & TopicNum & vbNewLine
         end if
   %>
   <!--#INCLUDE FILE="inc_mail.asp" -->
   <%
      end if

      'ProcessSubscriptions Reply_Author, Cat_ID, Forum_ID, NewTopicID, Moderation
   else
      Go_Result "That topic does not exist in the database. Make sure the url you entered has the correct ID of the topic.", 0
   end if
   'Response.End
   Go_Result err_Msg, 1
   Response.End
end if
'########################################################


if MethodType = "Reply" or MethodType = "ReplyQuote" or MethodType = "TopicQuote" then
   '## Forum_SQL
   strSql = "SELECT MEMBER_ID, M_LEVEL, M_EMAIL, M_LASTPOSTDATE, " & 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(strPassword, "SQLString") &"'"
      QuoteOk = (ChkQuoteOk(strDBNTUserName) and ChkQuoteOk(strPassword))
   else
      QuoteOk = ChkQuoteOk(strDBNTUserName)
   end if

   set rs = my_Conn.Execute (strSql)

   if rs.BOF or rs.EOF or not(QuoteOk) or not(ChkQuoteOk(strPassword)) then '##  Invalid Password
      rs.close
      set rs = nothing
      err_Msg = "Invalid Password or User Name"
      Go_Result(err_Msg), 0
      Response.End
   else

      if strPrivateForums = "1" and ForumChkSkipAllowed = 0 then
         if not(chkForumAccess(Forum_ID,MemberID,false)) then
            Go_Result "You are not allowed to post in this forum !", 0
         end if
      end if

      if strFloodCheck = 1 then
         if rs("M_LASTPOSTDATE") > DateToStr(DateAdd("s",strFloodCheckTime,strForumTimeAdjust)) and mLev < 3 then
            strTimeLimit = replace(strFloodCheckTime, "-", "")
            Go_Result "Sorry! We have flood control activated.<br />You cannot post within " & strTimeLimit & " seconds of your last post.<br />Please try again after this period of time elapses.", 0
         end if
      end if

      txtMessage = ChkString(Request.Form("Message"),"message")
      UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
      if UserIPAddress = "" then
         UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
      end if
      if txtMessage = " " then
         Go_Result "You must post a message!", 0
         Response.End
      end if

      if strSignatures = "1" and strDSignatures <> "1" then
         if Request.Form("sig") = "yes" and GetSig(strDBNTUserName) <> " " then
            txtMessage = txtMessage & vbNewline & vbNewline & ChkString(GetSig(strDBNTUserName), "signature" )
         end if
      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_SIG"
      strSql = strSql & ", R_MESSAGE"
     strSql = strSql & ", R_MSGICON"
      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 & ", " & "'" & UserIPAddress & "'"
      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
      if Request.Form("sig") = "yes" and strDSignatures = "1" then
         strSql = strSql & ", 1 "
      else
         strSql = strSql & ", 0 "
      end if
      strSql = strSql & ", " & "'" & txtMessage & "'"
      strSql = strSql & ", " & cLng(Request.Form("strMessageIcon"))
      strSql = strSql & ")"

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      ' DEM --> Do not update totals on topics and forums database if post is moderated...Added if and end if
      if Moderation = "No" then
         strSql = "SELECT Max(REPLY_ID) as NewReplyID "
         strSql = strSql & " FROM " & strActivePrefix & "REPLY "
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
         strSql = strSql & "   and R_AUTHOR = " & rs("MEMBER_ID")
         set rs9 = my_Conn.Execute (strSql)
         NewReplyID = rs9("NewReplyID")
         rs9.close
         set rs9 = nothing

         '## 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")
         strSql = strSql & ",    T_LAST_POST_REPLY_ID = " & NewReplyID
         if Request.Form("lock") = 1 and ForumChkSkipAllowed = 1 then
            strSql = strSql & ",        T_STATUS = 0 "
         end if
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

         '## Subscribe checkbox start ##
         if request.form("TNotify") <> "" then
            if request.form("TNotify") = "1" then
               AddSubscription "TOPIC", rs("MEMBER_ID"), Cat_ID, Forum_ID, Topic_ID
            elseif request.form("TNotify") = "0" then
               DeleteSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
            end if
         end if
         '## Subscribe checkbox end ##

         '## 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_LAST_POST_TOPIC_ID = " & Topic_ID
         strSql = strSql & ",    F_LAST_POST_REPLY_ID = " & NewReplyID
         strSql = strSql & ",    F_COUNT = F_COUNT + 1 "
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      else
         '## Forum_SQL - Update Unmoderated post count
         strSql = "UPDATE " & strActivePrefix & "TOPICS "
         strSql = strSql & " SET T_UREPLIES = T_UREPLIES + 1 "
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_IDstrSql = strSql & Cat_ID



         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      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, Moderation
         'end if
         Go_Result  "Updated OK", 1
         Response.End
      end if
 end if
  end if

'Parent Location Stuff MOD
strParent = replace(request.form("Parent"), "'", "''")
if strParent <> "" then
  strParentType = left(strParent, 1)
  strParentValue = right(strParent, len(strParent) - 1)
end if
if strParentType = "F" then
  '## Forum_SQL - Find the CAT_ID if forum is now a subforum
  strSQL = "SELECT CAT_ID FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & strParentValue & ";"
  set rsFindCat = my_Conn.Execute(strSQL)
  if not rsFindCat.eof then
    intCategoryValue = rsFindCat("CAT_ID")
  end if
  set rsFindCat = Nothing
  intSetParent = strParentValue
  intSetCategory = intCategoryValue
else
  intSetParent = NULL
  intSetCategory = strParentValue
end if
'End parent location stuff mod - Change variables below for adding a forum

if MethodType = "Forum" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Authorized
         Go_Result "Only an Admin can create a Forum", 0
         Response.End
      case 3 '## Moderator - Not Authorized
         Go_Result "Only an Admin can create a Forum", 0
         Response.End
      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")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the New Forum</li>"
   end if
   if Err_Msg = "" then
      '## Forum_SQL - Do DB Update
      strSql = "INSERT INTO " & strTablePrefix & "FORUM "
      strSql = strSql & "(CAT_ID"
      if isnull(intSetParent) = FALSE then
  strSql = strSql & ", F_PARENT"
end if
      strSql = strSql & ", F_STATUS"
      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 "
   '############ Poll Mod #################
      strSql = strSql & ", F_POLLS "
   '#######################################
      strSql = strSql & ", F_DEFAULTDAYS "
      strSql = strSql & ", F_COUNT_M_POSTS "
      strSql = strSql & ", F_ALLOWEVENTS "
  '############### Topic Rating Mod ###########################
      strSql = strSql & ", F_RATING_AUTH"
  '############### End Topic Rating Mod ###########################

      strSql = strSql & ") VALUES ("
      strSql = strSql & intSetCategory
if isnull(intSetParent) = FALSE then
  strSql = strSql & ", " & intSetParent
end if
      strSql = strSql & ", 1 "
      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 & ", 0"
      strSql = strSql & ", '' "
      strSql = strSql & ", 30 "
      strSql = strSql & ", '' "
      strSql = strSql & ", 365 "
           ' DEM --> Start of Code added for moderation and subscription
           if strSubscription > 0 and CatSubscription > 0 and strEmail = "1" 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 "
   '################ Poll Mod ##################
      if Request.Form("PollAuth") <> "" then
         strSql = strSql & ", " & chkString(Request.Form("PollAuth"),"SQLString")
      else
         strSql = strSql & ", 0 "
      end if
   '############################################
      strSql = strSql & ", " & ChkString(Request.Form("DefaultDays"), "SQLString")
      strSql = strSql & ", " & ChkString(Request.Form("ForumCntMPosts"), "SQLString")
      If CLng(Request.Form("allowevents")) = 1 then StrSql = strSql & ", 1" Else strSql = strSql & ", 0"
    '############### Topic Rating Mod ###########################
      if Request.Form("RatingAuth") = 1 then
         strSql = strSql & ", 1 "
      else
         strSql = strSql & ", 0 "
      end if
    '############### End Topic Rating Mod ###########################

           strSql = strSql & ")"

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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")
newUGPerms rsCount("maxForumId")        '#######    UserGroup MOD     #######
         newForumModerators rsCount("maxForumId")
         set rsCount = nothing
         Go_Result  "Updated OK", 1
      end if
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "URL" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin can create a web link", 0
         Response.End
      case 3 '## Moderator
         Go_Result "Only an Admin can create a web link", 0
         Response.End
      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"),"SQLString")
   txtSubject = ChkString(Request.Form("Subject"),"SQLString")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the New URL</li>"
   end if
   if txtAddress = " " or lcase(txtAddress) = "http://" or lcase(txtAddress) = "https://" or lcase(txtAddress) = "file:///" then
      Err_Msg = Err_Msg & "<li>You Must Enter an Address for the New URL</li>"
   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 & "<li>You Must prefix the Address with <b>http://</b>, <b>https://</b> or <b>file:///</b></li>"
   end if
   if Err_Msg = "" then
      '## Forum_SQL - Do DB Update
      strSql = "INSERT INTO " & strTablePrefix & "FORUM "
      strSql = strSql & "(CAT_ID"
      if isnull(intSetParent) = FALSE then
  strSql = strSql & ", F_PARENT"
end if
      strSql = strSql & ", F_STATUS"
      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_DELETE_SCHED "
           strSql = strSql & ", F_SUBSCRIPTION, F_MODERATION"
      strSql = strSql & ", F_ORDER "
      strSql = strSql & ", F_DEFAULTDAYS "
      strSql = strSql & ")  VALUES ("
      strSql = strSql & intSetCategory
if isnull(intSetParent) = FALSE then
  strSql = strSql & ", " & intSetParent
end if
           strSql = strSql & ", 1"
      if strPrivateForums = "1" then
         strSql = strSql & ", " & ChkString(Request.Form("AuthType"), "SQLString") & ""
      end if
      strSql = strSql & ", " & "'" & DateToStr(strForumTimeAdjust) & "'"
      strSql = strSql & ", " & MemberID & " "
      strSql = strSql & ", " & "'" & txtSubject & "'"
      strSql = strSql & ", " & "'" & txtAddress & "'"
      strSql = strSql & ", " & "'" & txtMessage & "'"
      strSql = strSql & ", 1"
           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 & ", 30"
      strSql = strSql & ") "

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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")
newUGPerms rsCount("maxForumId")        '#######    UserGroup MOD     #######
         newForumModerators rsCount("maxForumId")
         set rsCount = nothing
         Go_Result  "Updated OK", 1
      end if
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "EditForum" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin or a Moderator can change this Forum", 0
         Response.End
      case 3 '## Moderator
         if chkForumModerator(Forum_ID, strDBNTUserName) = "0" then
            Go_Result "Only an Admin or a Moderator can 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")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the Forum</li>"
   end if

        if strModeration <> 0 and Request.Form("Moderation") = 0 then
            if CheckForUnModeratedPosts("FORUM", Cat_ID, Forum_ID, 0) > 0 then
         Err_Msg = Err_Msg & "<li>Please Approve or Delete all UnModerated/Held posts in this Forum before turning Moderation off</li>"
      end if
   end if

   if Err_Msg = "" then'Parent Location Stuff MOD
'## Forum_SQL - Update forum parent and cat_id in db
'We changed lines from request.form("Category") to intSetCategory
'Update parent id
if isnull(intSetParent) = FALSE then
  strSQL = "UPDATE " & strTablePrefix & "FORUM SET F_PARENT = " & intSetParent & " WHERE FORUM_ID = " & Forum_ID
else
  strSQL = "UPDATE " & strTablePrefix & "FORUM SET F_PARENT = NULL WHERE FORUM_ID = " & Forum_ID
end if
my_Conn.Execute(strSQL)
'End parent mod code -- JUST MAKE SURE YOU CHANGE THAT request.form variable!

      '## 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(intSetCategory, "SQLString"))
      rsCatIDCheck.Close
      set rsCatIDCheck = Nothing

      '## Forum_SQL - Do DB Update
      strSql = "UPDATE " & strTablePrefix & "FORUM "
      strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
   '############################ Poll Mod ###########################
      if Request.Form("PollAuth") <> "" then
         strSql = strSql & ", F_POLLS = " & chkString(Request.Form("PollAuth"),"SQLString") & ""
      end if
   '#################################################################
      if strPrivateForums = "1" then
         strSql = strSql & ", F_PRIVATEFORUMS = " & cLng("0" & Request.Form("AuthType"))
         if Request.Form("AuthPassword") <> " " then
            strSql = strSql & ", F_PASSWORD_NEW = '" & ChkString(Request.Form("AuthPassword"),"SQLString") & "'"
         end if
      end if
   '############### Topic Rating Mod ##################################
      if Request.Form("RatingAuth") = 1 then
         strSql = strSql & ", F_RATING_AUTH = 1 "
      else
         strSql = strSql & ", F_RATING_AUTH = 0 "
      end if
  '############### End Topic Rating Mod ##################################
      strSql = strSql & ", F_SUBJECT = '" & txtSubject & "'"
      strSql = strSql & ", F_DESCRIPTION = '" & txtMessage & "'"
      if Request.Form("Moderation") <> "" then
              strSql = strSql & ",    F_MODERATION = " & cLng("0" & Request.Form("Moderation"))
      end if
      if fSubscription <> "" then
              strSql = strSql & ",    F_SUBSCRIPTION = " & cLng("0" & fSubscription)
      end if
      strSql = strSql & ",   F_DEFAULTDAYS = " & cLng(Request.Form("DefaultDays"))
      strSql = strSql & ",   F_COUNT_M_POSTS = " & cLng("0" & Request.Form("ForumCntMPosts"))
      If CLng(Request.Form("allowevents")) = 1 then strSql = strSql & ", F_ALLOWEVENTS = 1" Else strSql = strSql & ", F_ALLOWEVENTS = 0"
      strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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=" & cLng("0" & intSetCategory)
         set rs = my_conn.execute(strSQL)
         intCatSubs = rs("CAT_SUBSCRIPTION")
         intCatMod = rs("CAT_MODERATION")
         rs.close
         set rs = nothing
         if intCatSubs < fSubscription then
            strSQL = "UPDATE " & strTablePrefix & "CATEGORY SET " & strTablePrefix & "CATEGORY.CAT_SUBSCRIPTION = " & fSubscription

            my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
         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),,adCmdText + adExecuteNoRecords
         end if
         '## Forum_SQL - Do DB Update
         strSql = "UPDATE " & strActivePrefix & "TOPICS "
         strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

         '## Forum_SQL - Do DB Update
         strSql = "UPDATE " & strActivePrefix & "REPLY "
         strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

         ' DEM --> Added _SUBSCRIPTIONS table
         '## Forum_SQL - Do DB Update
         strSql = "UPDATE " & strTablePrefix & "SUBSCRIPTIONS "
         strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

       err_Msg= ""
      if Err.description <> "" then
         Go_Result "There was an error = " & Err.description, 0
         Response.End
      else
         updateForumMembers Forum_ID
updateUGPerms Forum_ID        '#######    UserGroup MOD     #######
         if mLev = 4 then
            updateForumModerators Forum_ID
         end if
         Go_Result  "Updated OK", 1
      end if
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "EditURL" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin or a Moderator can change this web link", 0
         Response.End
      case 3 '## Moderator
         if chkForumModerator(Forum_ID, strDBNTUserName) = "0" then
            Go_Result "Only an Admin or a Moderator can change this 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"),"SQLString")
   txtSubject = ChkString(Request.Form("Subject"),"SQLString")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the New URL</li>"
   end if
   if txtAddress = " " or lcase(txtAddress) = "http://" or lcase(txtAddress) = "https://" or lcase(txtAddress) = "file:///" then
      Err_Msg = Err_Msg & "<li>You Must Enter an Address for the New URL</li>"
   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 & "<li>You Must prefix the Address with <b>http://</b>, <b>https://</b> or <b>file:///</b></li>"
   end if
   if Err_Msg = "" then
   'Update parent id
if isnull(intSetParent) = FALSE then
  strSQL = "UPDATE " & strTablePrefix & "FORUM SET F_PARENT = " & intSetParent & " WHERE FORUM_ID = " & Forum_ID
else
  strSQL = "UPDATE " & strTablePrefix & "FORUM SET F_PARENT = NULL WHERE FORUM_ID = " & Forum_ID
end if
my_Conn.Execute(strSQL)
'End parent mod code -- JUST MAKE SURE YOU CHANGE THAT request.form variable!

      '## Forum_SQL - Do DB Update
      strSql = "UPDATE " & strTablePrefix & "FORUM "
      strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
      if strPrivateForums = "1" then
         strSql = strSql & ",    F_PRIVATEFORUMS = " & cLng("0" & Request.Form("AuthType"))
      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),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      err_Msg= ""
      if Err.description <> "" then
         Go_Result "There was an error = " & Err.description, 0
         Response.End
      else
         updateForumMembers Forum_ID
updateUGPerms Forum_ID        '#######    UserGroup MOD     #######
         if mLev = 4 then
            updateForumModerators Forum_ID
         end if
         Go_Result  "Updated OK", 1
      end if
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "Category" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin can create a category", 0
         Response.End
      case 3 '## Moderator
         Go_Result "Only an Admin can create a category", 0
         Response.End
      case 4 '## Admin
         '## Do Nothing
      case else
         Go_Result cstr(Member), 0
         Response.End
   end select
   txtSubject = chkString(Request.Form("Subject"),"SQLString")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if

   Err_Msg = ""
   if txtSubject = "" then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the New Category</li>"
   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_STATUS, CAT_SUBSCRIPTION, CAT_MODERATION, CAT_ORDER) "
         strSql = strSql & " VALUES ('" & txtSubject & "'"
                 strSql = strSql & ", 1"
           if strSubscription <> 0 and strEmail = "1" 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),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "EditCategory" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin can change a category", 0
         Response.End
      case 3 '## Moderator
         '## Do Nothing
         Go_Result "Only an Admin can change a category", 0
         Response.End
      case 4 '## Admin
         '## Do Nothing
      case else
         Go_Result cstr(Member), 0
         Response.End
   end select
   txtSubject = chkString(Request.Form("Subject"),"SQLString")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if

   Err_Msg = ""
   if txtSubject = "" then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the Category</li>"
   end if
        if strModeration <> 0 and Request.Form("Moderation") = 0 then
           if CheckForUnmoderatedPosts("CAT", Cat_ID, 0, 0) > 0 then
         Err_Msg = Err_Msg & "<li>Please Approve or Delete all UnModerated/Held posts in this Category before turning Moderation off</li>"
      end if
   end if
   if Err_Msg = "" then
      '## Forum_SQL - Do DB Update
      strSql = "UPDATE " & strTablePrefix & "CATEGORY "
      strSql = strSql & " SET CAT_NAME = '" & txtSubject & "'"
         ' DEM --> Start of Code added for moderation and subscription functionality
           if strModeration <> 0 then
                 strSql = strSql & ",   CAT_MODERATION = " & cLng("0" & Request.Form("Moderation"))
           end if
           if strSubscription <> 0 and strEmail = "1" then
                    strSql = strSql & ",   CAT_SUBSCRIPTION = " & cLng("0" & Request.Form("Subscription"))
         end if
           ' DEM --> End of code added for moderation and subscription functionality
      strSql = strSql & " WHERE CAT_ID = " & Cat_ID

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if
'set rs = nothing
WriteFooter
Response.End

sub Go_Result(str_err_Msg, boolOk)

   select case MethodType
      case "Topic", "TopicQuote", "Reply", "ReplyQuote"
         set rsFCountMP = my_Conn.Execute("SELECT F_COUNT_M_POSTS FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & Forum_ID)
         ForumCountMPosts = rsFCountMP("F_COUNT_M_POSTS")
         rsFCountMP.close
         set rsFCountMP = nothing
   end select

   Response.write    "      <table border=""0"" width=""100%"">" & vbNewLine & _
         "        <tr>" & vbNewLine & _
         "          <td width=""33%"" align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
         "          " & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp"">COMMUNITY HOME</a><br />" & vbNewLine
   if MethodType = "Topic" or _
      MethodType = "TopicQuote" or _
      MethodType = "Reply" or _
      MethodType = "ReplyQuote" or _
      MethodType = "Edit" or _
      MethodType = "EditTopic" then
         Response.Write "          " & getCurrentIcon(strIconBar,"","align=""absmiddle""")
         if blnCStatus <> 0 then
            Response.Write getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""")
         else
            Response.Write getCurrentIcon(strIconFolderClosed,"","align=""absmiddle""")
         end if
         Response.Write " <a href=""default.asp?CAT_ID=" & Cat_ID & """>" & ChkString(strCatTitle, "title") & "</a><br />" & vbNewLine
         Response.Write "          " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""")
         if blnFStatus <> 0 and blnCStatus <> 0 then
            Response.Write getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""")
         else
            Response.Write getCurrentIcon(strIconFolderClosed,"","align=""absmiddle""")
         end if
         Response.Write " <a href=""forum.asp?FORUM_ID=" & Forum_ID & """>" & ChkString(strForum_Title, "title") & "</a><br />" & vbNewLine
   end if
   if MethodType = "Reply" or _
      MethodType = "ReplyQuote" or _
      MethodType = "TopicQuote" or _
      MethodType = "Edit" or _
      MethodType = "EditTopic" then
            Response.Write "          " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""")
            if blnTStatus <> 0 and blnFStatus <> 0 and blnCStatus <> 0 then
               Response.Write getCurrentIcon(strIconFolderOpenTopic,"","align=""absmiddle""")
            else
               Response.Write getCurrentIcon(strIconFolderClosedTopic,"","align=""absmiddle""")
            end if
            Response.Write " <a href=""" & chkString(Request.Form("refer"),"refer") & """>" & ChkString(strTopicTitle,"title") & "</a>" & vbNewLine
   end if
   Response.write "          </font></td>" & vbNewLine & _
         "        </tr>" & vbNewLine & _
         "      </table>" & vbNewLine
   if boolOk = 1 then
      Response.write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>"
      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!")
                         '  ## Points Below
                        tNewRank = False
                        If ChkNewRank Then
                           Response.Write "<br><br><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & VbNewLine &_
                              " ****Congratulations You Got a New Rank!**** </font>"
                           tNewRank = True
                        End If
                        '  ## Points Above
                         DoPCount
               if ForumCountMPosts <> 0 then
                  '  ## Points Below
                  Call DoUCount(MemberID, "R", tNewRank)
                  '  ## Points Above
               end if
                 end if
               DoULastPost MemberID
         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!")
                         '  ## Points Below
                                 tNewRank = False
                                 If ChkNewRank Then
                                    Response.Write "<br><br><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & VbNewLine &_
                                       " ****Congratulations You Got a New Rank!**** </font>"
                                    tNewRank = True
                                 End If
                         '  ## Points Above
                         DoTCount
                         DoPCount
               if ForumCountMPosts <> 0 then
                  '  ## Points Below
                  Call DoUCount(MemberID, "T", tNewRank)
                  '  ## Points Above
               end if
                 end if
            DoULastPost MemberID
         case "Forum"
                 Response.Write("New Forum Created!")
         case "URL"
                 Response.Write("New URL Created!")
         case "Category"
                 Response.Write("New Category Created!")
         '############ Merge Topic Mod ################
         case "MergeTopic"
            Response.Write("Topics merged succesfully!")
            DoTCount
         '#############################################
         case else
                 Response.Write("Complete!")
                 'DoPCount
                 'DoUCount Request.Form("UserName")
                 'DoULastPost Request.Form("UserName")
      end select
      if MethodType = "Topic" then
         strReturnURL = "topic.asp?TOPIC_ID=" & NewTopicID
         strReturnTxt = "Go to new topic"
      elseif MethodType = "Reply" or MethodType = "ReplyQuote" or MethodType = "TopicQuote" then
         strReturnURL = "topic.asp?whichpage=-1&TOPIC_ID=" & Topic_ID & "&REPLY_ID=" & NewReplyID
         strReturnTxt = "Back to the topic"
      elseif MethodType = "EditTopic" then
         strReturnURL = "topic.asp?TOPIC_ID=" & Topic_ID
         strReturnTxt = "Back to the topic"
      elseif MethodType = "Edit" then
         strReturnURL = "topic.asp?whichpage=-1&TOPIC_ID=" & Topic_ID & "&REPLY_ID=" & Reply_ID
         strReturnTxt = "Back to the topic"
      else
         strReturnURL = chkString(Request.Form("refer"),"refer")
         strReturnTxt = "Back To Forum"
      end if
      Response.write "</font></p>" & vbNewLine & _
            "      <meta http-equiv=""Refresh"" content=""2; URL=" & strReturnURL & """>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>"
      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!")
      '########### Merge Topic Mod ###########
         case "MergeTopic"
            Response.Write(" ")
      '#######################################
         case else
            Response.Write("Have a nice day!")
      end select
      Response.write "</font></p>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""" & strReturnURL & """>" & strReturnTxt & "</a></font></p>" & vbNewLine
   else
      Response.write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There has been a problem!</font></p>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & str_err_Msg & "</font></p>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go back to correct the problem.</a></font></p>" & vbNewLine
   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),,adCmdText + adExecuteNoRecords
      if err.number <> 0 then
         Go_REsult err.description, 0
      end if
   next
   on error goto 0
end sub

sub updateForumMembers(fForumID)
   my_Conn.execute ("DELETE FROM " & strTablePrefix & "ALLOWED_MEMBERS WHERE FORUM_ID = " & fForumId),,adCmdText + adExecuteNoRecords
   newForumMembers(fForumID)
end sub
'#######    Begin UserGroup MOD     #######
sub newUGPerms(fForumID)
    on error resume next
    if mlev = 4 or (mlev = 3 and CInt(strUGModForums) = 2) then
    for each key in Request.Form
        if Left(key,5) = "Perms" and Request.Form(key) <> "notset" then
            strUGid = Trim(Mid(key,6))
            strSql = "INSERT INTO " & strTablePrefix & "ALLOWED_USERGROUPS ("
            strSql = strSql & "FORUM_ID, USERGROUP_ID, PERMS) VALUES ("
            strSql = strSql & fForumID & ", " & strUGid & ", " & Request.Form(key) & ")"
            my_Conn.execute(strSql)
        end if
    next
    end if
end sub

sub updateUGPerms(fForumID)
    if mlev = 4 then
        my_Conn.execute("DELETE FROM " & strTablePrefix & "ALLOWED_USERGROUPS WHERE FORUM_ID = " & fForumID)
        newUGPerms(fForumID)
    end if
    if (mlev = 3 and CInt(strUGModForums) = 2) then
        strSql = "SELECT UG.USERGROUP_ID FROM " & strTablePrefix & "USERGROUPS UG " &_
            "INNER JOIN " & strTablePrefix & "ALLOWED_USERGROUPS AUG " &_
            "ON UG.USERGROUP_ID = AUG.USERGROUP_ID WHERE AUG.FORUM_ID = " & fForumID &_
            " AND UG.MOD_HIDE = 0"
        set rsOK = my_Conn.execute(strSql)
        do while not rsOK.eof
            strSql = "DELETE FROM " & strTablePrefix & "ALLOWED_USERGROUPS " &_
                "WHERE FORUM_ID = " & fForumID & " AND USERGROUP_ID = " & rsOK("USERGROUP_ID")
            my_Conn.execute(strSql)
            rsOK.movenext
        loop
        rsOK.close
        set rsOK = nothing
        newUGPerms(fForumID)
    end if
end sub
'#######     End UserGroup MOD      #######
sub newForumModerators(fForumID)
   on error resume next
   if Request.Form("ForumMod") = "" then
      exit Sub
   end if
   Users = split(Request.Form("ForumMod"),",")
   for count = Lbound(Users) to Ubound(Users)
      strSql = "INSERT INTO " & strTablePrefix & "MODERATOR ("
      strSql = strSql & " MEMBER_ID, FORUM_ID) VALUES ( "& Users(count) & ", " & fForumID & ")"

      my_conn.execute (strSql),,adCmdText + adExecuteNoRecords
      if err.number <> 0 then
         Go_REsult err.description, 0
      end if
   next
   on error goto 0
end sub

sub updateForumModerators(fForumID)
   my_Conn.execute ("DELETE FROM " & strTablePrefix & "MODERATOR WHERE FORUM_ID = " & fForumId),,adCmdText + adExecuteNoRecords
   newForumModerators(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
   set rs2 = nothing
   if lcase(strEmail) = "1" then
      strRecipientsName = user_name
      strRecipients = email
      strSubject = strForumTitle & " - Topic Moved"
      strMessage = "Hello " & user_name & vbNewLine & vbNewLine
      strMessage = strMessage & "Your posting on " & strForumTitle & "." & vbNewLine
      strMessage = strMessage & "Regarding the subject - " & Topic_Title & "." & vbNewLine & vbNewLine

      if not(chkForumAccess(ForumID,Usernum,false)) then
         strMessage = strMessage & "Has been removed from public display, If you have any questions regarding this, please contact the Administrator of the forum" & vbNewLine
      else
         strMessage = strMessage & "Has been moved to a new forum, You can view it at " & vbNewLine & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "topic.asp?TOPIC_ID=" & TopicNum & vbNewLine
      end if
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
   end if
end sub

'## Subscribe checkbox start ##
sub DeleteSubscription(Level, MemberID, CatID, ForumID, TopicID)
         ' --- Delete the appropriate sublevel of subscriptions
         StrSql = "DELETE FROM " & strTablePrefix & "SUBSCRIPTIONS"
         StrSql = StrSql & " WHERE " & strTablePrefix & "SUBSCRIPTIONS.MEMBER_ID = " & MemberID
         if sublevel = "CAT" then
                 StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.CAT_ID = " & CatID
         elseif sublevel = "FORUM" then
                 StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.FORUM_ID = " & ForumID
         elseif sublevel = "TOPIC" then
                 StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.TOPIC_ID = " & TopicID
         end if
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
end sub

sub AddSubscription(SubLevel, MemberID, CatID, ForumID, TopicID)
         ' --- Insert the appropriate sublevel subscription
         StrSql = "INSERT INTO " & strTablePrefix & "SUBSCRIPTIONS"
         StrSql = StrSql & "(MEMBER_ID, CAT_ID, FORUM_ID, TOPIC_ID) VALUES (" & MemberID & ", "
         if sublevel = "BOARD" then
         StrSql = StrSql & "0, 0, 0)"
       elseif sublevel = "CAT" then
         StrSql = StrSql & CatID & ", 0, 0)"
         elseif sublevel = "FORUM" then
         StrSql = StrSql & CatID & ", " & ForumID & ", 0)"
         else
         StrSql = StrSql & CatID & ", " & ForumID & ", " & TopicID & ")"
         end if
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
end sub

'## Subscribe checkbox end ##
Function ChkNewRank()
   Dim arrRankLevels,intRank
   ChkNewRank = false
   arrRankLevels = array(intRankLevel1,intRankLevel2,intRankLevel3,intRankLevel4,intRankLevel5)
   For intRank = 0 To 4
      If cInt(intCurrPosts + 1) = cInt(arrRanklevels(intRank)) Then
         ChkNewRank = true
         Exit Function
      End If
   Next
End Function
%>
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 10 December 2013 :  23:54:33  Show Profile

So sorry, Carefree! I posted the wrong file, the one before my modifications.

Here's the correct file.


<%
'#################################################################################
'## Snitz Forums 2000 v3.4.07
'#################################################################################
'## Copyright (C) 2000-06 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
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<!--#INCLUDE FILE="inc_moderation.asp" -->
<!--#INCLUDE FILE="inc_subscription.asp" -->
<!--#INCLUDE FILE="inc_func_count.asp" -->
<!--#INCLUDE FILE="cal_post_info1.asp" -->
<%
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" and strDBNTUserName = "" and len(Request.Form("Password")) <> 64 then
   strPassword = sha256("" & Request.Form("Password"))
else
   strPassword = ChkString(Request.Form("Password"),"SQLString")
end if

if strAuthType = "db" and strDBNTUserName = "" then
   strDBNTUserName = Request.Form("UserName")
   if mLev = 0 then mLev = cLng(chkUser(strDBNTUserName, strPassword,-1))
end if

MethodType = chkString(Request.Form("Method_Type"),"SQLString")
'  ## Poll Below
If Request.Form("PEndDate")>"" Then
   If isNumeric(Request.Form("PEndDate")) and Request.Form("PEndDate")>"0" Then
      strNewDate=datetostr(DateAdd("d",cInt(Request.Form("PEndDate")),strtoDate(strForumTimeAdjust)))
   ElseIf Request.Form("PEndDate")="0" Then
      strNewDate=DatetoStr(strForumTimeAdjust)
   Else
      Go_Result   "Number of days must be an positive number.",0
   End If
End If
'  ## Poll Above
if Request.Form("CAT_ID") <> "" then
   if IsNumeric(Request.Form("CAT_ID")) = True then
      Cat_ID = cLng(Request.Form("CAT_ID"))
   else
      Response.Redirect("default.asp")
   end if
end if
if Request.Form("FORUM_ID") <> "" then
   if IsNumeric(Request.Form("FORUM_ID")) = True then
      Forum_ID = cLng(Request.Form("FORUM_ID"))
   else
      Response.Redirect("default.asp")
   end if
end if
if Request.Form("TOPIC_ID") <> "" then
   if IsNumeric(Request.Form("TOPIC_ID")) = True then
      Topic_ID = cLng(Request.Form("TOPIC_ID"))
   else
      Response.Redirect("default.asp")
   end if
end if
if Request.Form("REPLY_ID") <> "" then
   if IsNumeric(Request.Form("REPLY_ID")) = True then
      Reply_ID = cLng(Request.Form("REPLY_ID"))
   else
      Response.Redirect("default.asp")
   end if
end if
if Request.Form("Subscription") <> "" then
   fSubscription = cLng(Request.Form("Subscription"))
else
   fSubscription = 0
end if

if Request.Form("cookies") = "yes" then
   strSelectSize = Request.Form("SelectSize")
end if

if strSelectSize = "" or IsNull(strSelectSize) then
   strSelectSize = Request.Cookies(strUniqueID & "strSelectSize")
end if
if not(IsNull(strSelectSize)) and strSelectSize <> "" then
   if strSetCookieToForum = 1 then
         Response.Cookies(strUniqueID & "strSelectSize").Path = strCookieURL
   else
      Response.Cookies(strUniqueID & "strSelectSize").Path = "/"
   end if
   Response.Cookies(strUniqueID & "strSelectSize") = strSelectSize
   Response.Cookies(strUniqueID & "strSelectSize").expires = dateAdd("yyyy", 1, strForumTimeAdjust)
end if

if MethodType = "Edit" or _
MethodType = "EditTopic" or _
MethodType = "Reply" or _
MethodType = "ReplyQuote" or _
MethodType = "TopicQuote" then
   '## check if topic exists in TOPICS table
   set rsTCheck = my_Conn.Execute ("SELECT TOPIC_ID FROM " & strActivePrefix & "TOPICS WHERE TOPIC_ID = " & Topic_ID)
   if rsTCheck.EOF or rsTCheck.BOF then
      set rsTCheck = nothing
      Go_Result "Sorry, that Topic no longer exists in the Database", 0
   end if
   set rsTCheck = nothing
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 R_AUTHOR "
   strSql = strSql & " FROM " & strActivePrefix & "REPLY "
   strSql = strSql & " WHERE REPLY_ID = " & REPLY_ID

   set rsStatus = my_Conn.Execute(strSql)
   if rsStatus.EOF or rsStatus.BOF then
      rsStatus.close
      set rsStatus = nothing
      Go_Result "Please don't attempt to edit the URL<br />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 C.CAT_STATUS, C.CAT_NAME, " &_
      "F.FORUM_ID, F.F_STATUS, F.F_TYPE, F.F_SUBJECT, " &_
      "T.T_STATUS, T.T_AUTHOR, T.T_SUBJECT " &_
      " FROM " & strTablePrefix & "CATEGORY C, " &_
      strTablePrefix & "FORUM F, " &_
      strActivePrefix & "TOPICS T" &_
      " WHERE C.CAT_ID = T.CAT_ID " &_
      " AND F.FORUM_ID = T.FORUM_ID " &_
      " AND T.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 C.CAT_STATUS, C.CAT_NAME, " &_
      "F.FORUM_ID, F.F_STATUS, F.F_TYPE, F.F_SUBJECT " &_
      " FROM " & strTablePrefix & "CATEGORY C, " &_
      strTablePrefix & "FORUM F" &_
      " WHERE C.CAT_ID = F.CAT_ID " &_
      " AND F.FORUM_ID = " & Forum_ID & ""
        end if

   set rsStatus = my_Conn.Execute(strSql)
   if rsStatus.EOF or rsStatus.BOF then
      rsStatus.close
      set rsStatus = nothing
      Go_Result "Please don't attempt to edit the URL<br />to gain access to locked Forums/Categories.", 0
   else
      blnCStatus = rsStatus("CAT_STATUS")
      strCatTitle = rsStatus("CAT_NAME")
      blnFStatus = rsStatus("F_STATUS")
      Forum_ID = rsStatus("FORUM_ID")
      Forum_Type = rsStatus("F_TYPE")
      strForum_Title = rsStatus("F_SUBJECT")
      if MethodType <> "Topic" then
         blnTStatus = rsStatus("T_STATUS")
         strTopicAuthor = rsStatus("T_AUTHOR")
         strTopicTitle = rsStatus("T_SUBJECT")
      else
         blnTStatus = 1
      end if
      rsStatus.close
      set rsStatus = nothing
   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

   select case MethodType
      case "Topic"
         if (Forum_Type = 1) then
            Go_Result "You have attempted to post a New Topic to a Forum designated as a Web Link",0
         end if
         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
'#######    Begin UserGroup MOD     #######
    if isDeniedMember(Forum_ID,MemberID) = 1 then
        Go_Result "You have been denied access to this forum"
    end if
    if isReadOnly(Forum_ID,MemberID) = 1 then
        Go_Result "Your access to this forum is read-only"
    end if
'#######     End UserGroup MOD      #######
   if strPrivateForums = "1" and ForumChkSkipAllowed = 0 then
      if not(chkForumAccess(Forum_ID,MemberID,false)) then
            Go_Result "You do not have access to post to this forum", 0
      end if
   end if
end if
'##DRAFTS ## User Space Mod ## ADD line below ######################

 %><!--#INCLUDE FILE="inc_draft_info.asp" --><%

'## End ## Thats all for this file #############################

' If Creating a new topic or reply, the subscription and moderation capabilities will need to be checked.

Moderation = "No"
'############# Merge Topic Mod ################
'Added "or _ MethodType = "MergeTopic"" in following if...then statement
if MethodType = "Topic" or _
   MethodType = "Edit" or _
   MethodType = "Reply" or _
   MethodType = "ReplyQuote" or _
   MethodType = "TopicQuote" or _
   MethodType = "Forum" or _
   MethodType = "EditForum" or _
   MethodType = "MergeTopic" or _
   MethodType = "SplitTopic"  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?
            '####################### Merge Topic Mod #############################
            ' Added "or MethodType = "MergeTopic"" in following line
            elseif (ForumModeration = 1 or ForumModeration = 3) and (MethodType <> "Topic" or MethodType = "MergeTopic") then
            '#####################################################################
               Moderation = "Yes"
            end if
            end if
            end if
   end if
end if

if MethodType = "Edit" then
   member = cLng(ChkUser(strDBNTUserName, strPassword, 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 an Admin, a Moderator or 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 an Admin, a Moderator or the Author can change this post", 0
         end if
         if strReplyAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
            Go_Result "Only the website owner can change this post", 0
         end if
      case 4 '## Admin so OK
         if strReplyAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
            Go_Result "Only the website owner can change this post", 0
         end if
      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 & "<li>You Must Enter a Message for your Reply</li>"
   end if
   if Err_Msg = "" then
      '## Forum_SQL - Do DB Update
      strSql = "UPDATE " & strActivePrefix & "REPLY "
      strSql = strSql & " SET R_MESSAGE = '" & txtMessage & "'"
      strSql = strSql & ", R_MSGICON = " & cLng(Request.Form("strMessageIcon"))
      if Request.Form("sig") = "yes" and strDSignatures = "1" then
         strSql = strSql & ", R_SIG = 1"
      else
         strSql = strSql & ", R_SIG = 0"
      end if
      if mLev < 4 and strEditedByDate = "1" then
         strSql = strSql & ", R_LAST_EDIT = '"  & DateToStr(strForumTimeAdjust) & "'"
         strSql = strSql & ", R_LAST_EDITBY = "  & MemberID
      end if
      strSql = strSql & " WHERE REPLY_ID=" & Reply_ID

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      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 = " & MemberID
         strSql = strSql & ",    F_LAST_POST_TOPIC_ID = " & Topic_ID
         strSql = strSql & ",    F_LAST_POST_REPLY_ID = " & Reply_ID
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

         '## Forum_SQL - Update Last Post
         strSql = " UPDATE " & strActivePrefix & "TOPICS"
         strSql = strSql & " SET T_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
         strSql = strSql & ",    T_LAST_POST_AUTHOR = " & MemberID
         strSql = strSql & ",    T_LAST_POST_REPLY_ID = " & Reply_ID
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

      if Moderation = "No" then
         '## Subscribe checkbox start ##
         if request.form("TNotify") <> "" then
            if request.form("TNotify") = "1" then
               AddSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
            else
               DeleteSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
            end if
         end if
         '## Subscribe checkbox end ##
      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
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if
'  ## Poll Below
If Request("Ppoll")>"" Then
   PCount = cInt(Request.Form("PCount"))
   ReDim txtAns(PCount)
   For i = 1 To PCount
      If trim(Request.Form("answer" & cStr(i))) <> "" Then
         txtAns(i) = trim(Request.Form("answer" & cStr(i)))
      Else
         txtAns(i) = ""
      End If
   Next
End If
'  ## Poll Above
if MethodType = "EditTopic" then
   member = cLng(ChkUser(strDBNTUserName, strPassword, 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 an Admin, a Moderator or the Author can change this post", 0
         Response.End
      case 3 '## Moderator so
         if chkForumModerator(Forum_ID, strDBNTUserName) = "0" then
            Go_Result "Only an Admin, a Moderator or the Author can change this post", 0
         end if
         if strTopicAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
            Go_Result "Only the website owner can change this post", 0
         end if
      case 4 '## Admin so OK
         if strTopicAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
            Go_Result "Only the website owner can change this post", 0
         end if
         '## 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")

   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the Topic</li>"
   end if
   if Len(Request.Form("Subject")) > 50 then
      Err_Msg = Err_Msg & "<li>The Subject can not be greater than 50 characters</li>"
   end if
   if txtMessage = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Message for the Topic</li>"
   end if
   if Err_Msg = "" then
      '##Get Status of this Topic
      strSql = "SELECT T_STATUS, T_UREPLIES"
      strSql = Strsql & " FROM " & strTablePrefix & "TOPICS "
      strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

      set rsTopicStatusCheck = my_Conn.Execute (strSql)

      Topic_Status = rsTopicStatusCheck("T_STATUS")
      Topic_UReplies = rsTopicStatusCheck("T_UREPLIES")

      rsTopicStatusCheck.Close
      set rsTopicStatusCheck = nothing

      '## 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 <> cLng(aryForum(1)) then
  '  ## Poll Below
         strSql = "SELECT " & strTablePrefix & "FORUM.F_POLLS "
         strSql = strsql & " FROM " & strTablePrefix & "FORUM "
         strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & aryForum(1)

         set rsPollCheck = my_Conn.Execute(strSql)

         ForumPolls = rsPollCheck("F_POLLS")

         rsPollCheck.close
         set rsPollCheck = nothing
   '  ## Poll Above
         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" and Topic_Status > 0 then

            strSql = "SELECT " & strTablePrefix & "FORUM.F_MODERATION "
            strSql = Strsql & " FROM " & strTablePrefix & "FORUM "
            strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & cLng(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

      if Moderation = "Yes" and AutoApprove = "Yes" and Topic_UReplies > 0 then
         Go_Result "There was an error = The Topic you are attempting to move to an UnModerated Forum has UnModerated Replies<br />Please either approve or delete them and then try again.", 0
         Response.End
      end if

      '## Forum_SQL
      strSql = "UPDATE " & strActivePrefix & "TOPICS "
      strSql = strSql & " SET T_MESSAGE = '" & txtMessage & "'"
      strSql = strSql & ", T_SUBJECT = '" & txtSubject & "'"
      strSql = strSql & ", T_MSGICON = " & cLng(Request.Form("strMessageIcon"))
      if blnTopicMoved then
         strSql = strSql & ", CAT_ID = " & cLng(aryForum(0))
         strSql = strSql & ", FORUM_ID = " & cLng(aryForum(1))
         if AutoApprove = "Yes" then
            strSql = strSql & ", T_STATUS = 1 "
         end if
      end if
  '  ## Poll Below
      if Request.Form("lockpoll") = "1" or ForumPolls = "0" then
         strSql = strSql & ", T_POLLSTATUS = 0"
      else
         strSql = strSql & ", T_POLLSTATUS = 1"
      end if
  '  ## Poll Above
      if Request.Form("sig") = "yes" and strDSignatures = "1" then
         strSql = strSql & ", T_SIG = 1"
      else
         strSql = strSql & ", T_SIG = 0"
      end if
   '########## Topic Rating ##########
      if Request.Form("AllowRating") = 1 then
         strSql = strSql & ", ALLOW_RATING = 1 "
      else
         strSql = strSql & ", ALLOW_RATING = 0 "
      end if
   '########## End Topic Rating ##########
      if mLev < 4 and strEditedByDate = "1" then
         strSql = strSql & ", T_LAST_EDIT = '"  & DateToStr(strForumTimeAdjust) & "'"
         strSql = strSql & ", T_LAST_EDITBY = "  & MemberID
      end if
      if ForumChkSkipAllowed = 1 then
         if Request.Form("sticky") = 1 then
            strSql = strSql & ", T_STICKY = " & 1
            strSql = strSql & ", T_ARCHIVE_FLAG = " & 0
         else
            strSql = strSql & ", T_STICKY = " & 0
            strSql = strSql & ", T_ARCHIVE_FLAG = " & 1
         end if
      end if
      strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

      my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
      %><!--#INCLUDE FILE="cal_post_info2.asp"--><%
      '  ## Poll Below
      If Request("Ppoll") = "1" Then
         strSql = "UPDATE " & strTablePrefix & "POLLS "
         strSql = strSql & " Set P_WHOVOTES = '" & chkString(Request.Form("WhoVotes"),"SQLString") & "', P_ENDDATE = '" & strNewDate & "', "
         strSql = strSql & "     CAT_ID = " & cLng(aryForum(0)) & ", "
         strSql = strSql & "     FORUM_ID = " & cLng(aryForum(1)) & ", "
         For j = 1 to PCount
            strSql = strSql & "ANSWER" & cStr(j) & " = '" & chkString(txtAns(j),"") & "'"
            If txtAns(j) = "" or chkString(Request.Form("resetpoll"),"SQLString") = "1" Then
               strSql = strSql & ", COUNT" & cStr(j) & " = " & 0
            End If
            If uBound(txtAns) <> j Then
               strSql = strSql & ", "
            End If
         Next
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID
         my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
         If Request.Form("resetpoll") = "1" Then
            strSql = "DELETE FROM " & strTablePrefix & "POLL_VOTES "
            strSql = strSql & "WHERE " & strTablePrefix & "POLL_VOTES.TOPIC_ID = " & Topic_ID
            my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
         End If
      End If
      '  ## Poll Above
      '# Subscribe checkbox start ##
      if request.form("TNotify") <> "" then
         if request.form("TNotify") = "1" then
            AddSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
         elseif request.form("TNotify") = "0" then
            DeleteSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
         end if
      end if
      '## Subscribe checkbox end ##

      if blnTopicMoved then
         if strEmail = "1" and strMoveNotify = "1" then DoAutoMoveEmail(Topic_ID)
         strSQL = "SELECT F_SUBSCRIPTION FROM " & strTablePrefix & "FORUM WHERE FORUM_ID=" & cLng(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),,adCmdText + adExecuteNoRecords
         end if
         rs.close
         set rs = nothing
      end if
      if Forum_ID <> cLng(aryForum(1)) then
         '## Forum_SQL
         strSql = "UPDATE " & strActivePrefix & "REPLY "
         strSql = strSql & " SET CAT_ID = " & cLng(aryForum(0))
         strSql = strSql & ", FORUM_ID = " & cLng(aryForum(1))
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

         my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

         '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" or Topic_Status < 2 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 TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID "
            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_Topic_ID = rs("TOPIC_ID")
               strLast_Post = rs("T_LAST_POST")
               strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
               strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
            else
               strLast_Post_Topic_ID = 0
               strLast_Post = ""
               strLast_Post_Author = 0
               strLast_Post_Reply_ID = 0
            end if

            rs.Close
            set rs = nothing

               if Moderation = "No" or Topic_Status < 2 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
               strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
               my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

               '## 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),,adCmdText + adExecuteNoRecords

            end if

            strSql = "UPDATE " & strTablePrefix & "FORUM SET "
            '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 & ", F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID
            strSql = strSql & ", F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
            strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
            my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

            '## Forum_SQL - Get last_post and last_post_author for Forum
            strSql = "SELECT TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_AUTHOR, T_LAST_POST_REPLY_ID "
            strSql = strSql & " FROM " & strActivePrefix & "TOPICS "
            strSql = strSql & " WHERE FORUM_ID = " & cLng(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_Topic_ID = rs("TOPIC_ID")
               strLast_Post = rs("T_LAST_POST")
               strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
               strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
            else
               strAuthor = ""
               strLast_Post_Topic_ID = 0
               strLast_Post = ""
               strLast_Post_Author = ""
               strLast_Post_Reply_ID = 0
            end if

            rs.Close
            set rs = nothing
            'Huw -- Update member count
            if (AutoApprove = "Yes") and blnTStatus = 2 and blnTopicMoved then
               set rsFCountMP = my_Conn.Execute("SELECT F_COUNT_M_POSTS FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & cLng(aryForum(1)))
               ForumCountMPosts = rsFCountMP("F_COUNT_M_POSTS")
               rsFCountMP.close
               set rsFCountMP = nothing
               if ForumCountMPosts <> 0 then
                  '  ## Points Below
                  Call doUCount(strT_Last_Post_Author, "T", False)
                  '  ## Points Above
               end if
               doULastPost(strT_Last_Post_Author)
            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 & ")"
            strSql = strSql & ", F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID
            strSql = strSql & ", F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
            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 = " & cLng(aryForum(1))
            my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords

            '## Forum_SQL
            strSql =  "UPDATE " & strTablePrefix & "FORUM SET "
            strSql = strSql & " F_TOPICS = F_TOPICS + 1 "
            strSql = strSql & " WHERE FORUM_ID = " & cLng(aryForum(1))
            my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
         end if
      else
         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 = " & MemberID
            strSql = strSql & ",    F_LAST_POST_TOPIC_ID = " & Topic_ID
            strSql = strSql & ",    F_LAST_POST_REPLY_ID = " & 0
            strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

            my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

            '## Forum_SQL - Update Last Post
            strSql = " UPDATE " & strActivePrefix & "TOPICS"
            strSql = strSql & " SET T_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
            strSql = strSql & ",    T_LAST_POST_AUTHOR = " & MemberID
            strSql = strSql & ",    T_LAST_POST_REPLY_ID = " & 0
            strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

            my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
         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
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "Topic" then
   '## Forum_SQL
   strSql = "SELECT MEMBER_ID, M_LEVEL, M_EMAIL, M_LASTPOSTDATE, " & 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(strPassword, "SQLString") &"'"
      QuoteOk = (ChkQuoteOk(strDBNTUserName) and ChkQuoteOk(strPassword))
   else
      QuoteOk = ChkQuoteOk(strDBNTUserName)
   end if

   set rs = my_Conn.Execute (strSql)

   if rs.BOF or rs.EOF or not(QuoteOk) or not (ChkQuoteOk(strPassword))then '##  Invalid Password
      rs.close
      set rs = nothing
      Go_Result "Invalid UserName or Password!", 0
      Response.End
   else
      if strPrivateForums = "1" and ForumChkSkipAllowed = 0 then
         if not(chkForumAccess(Forum_ID, MemberID,false)) then
            Go_Result "You are not allowed to post in this forum !", 0
         end if
      end if
      if strFloodCheck = 1 then
         if rs("M_LASTPOSTDATE") > DateToStr(DateAdd("s",strFloodCheckTime,strForumTimeAdjust)) and mLev < 3 then
            strTimeLimit = replace(strFloodCheckTime, "-", "")
            Go_Result "Sorry! We have flood control activated.<br />You cannot post within " & strTimeLimit & " seconds of your last post.<br />Please try again after this period of time elapses.", 0
         end if
      end if

      txtMessage = ChkString(Request.Form("Message"),"message")
      txtSubject = ChkString(Request.Form("Subject"),"SQLString")
      UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
      if UserIPAddress = "" then
         UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
      end if
 '  ## Poll Below
      If Request("Ppoll") = "1" Then
         ReDim txtAns(strMaxVotes)
         For i = 1 to strMaxVotes
            If trim(Request.Form("answer" & cStr(i))) <> "" Then
               txtAns(i) = Request.Form("answer" & cStr(i))
            Else
               txtAns(i) = ""
            End If
         Next
      End If
 '  ## Poll Above
      if strBadWordFilter = "1" then
         txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
      end if

      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 Len(Request.Form("Subject")) > 50 then
         Go_Result "The Subject can not be greater than 50 characters", 0
         Response.End
      end if
  '  ## Poll Below
      If Request("Ppoll") = "1" Then
         For i = 1 to strMaxVotes
            If trim(Request.Form("answer" & cStr(i))) <> "" Then
               intCount = intCount + 1
            End If
         Next
         If intCount < 2 Then
            Go_Result "You must enter at least two answers for the poll.", 0
         End If
      End If
  '  ## Poll Above
      if strSignatures = "1" and strDSignatures <> "1" then
         if Request.Form("sig") = "yes" and GetSig(strDBNTUserName) <> " " then
            txtMessage = txtMessage & vbNewline & vbNewline & ChkString(GetSig(strDBNTUserName), "signature" )
         end if
      end if

'Gatekeeper Mod
      if strLinkSpamGatekeeper = "1" then
         select case len(Request.Form("GateKeeperAnswer"))
         case "0"
            Go_Result "You have not entered an answer for the Antispam question. Please use your back button and try again.", 0
         case else
            if (lcase(Request.Form("GateKeeperAnswer")) <> lcase(strGatekeeperAnswer1)) and (lcase(Request.Form("GateKeeperAnswer")) <> lcase(strGatekeeperAnswer2)) then
               Go_Result "You have entered a wrong answer for the Antispam question. Please use your back button and try again.", 0
            end if
         end select
      end if
'Gatekeeper Mod

      '## 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"
  '  ## Poll Below
      strSql = strSql & ", T_ISPOLL"
      strSql = strSql & ", T_POLLSTATUS"
  '  ## Poll Above
      strSql = strSql & ", T_AUTHOR"
      strSql = strSql & ", T_LAST_POST"
      strSql = strSql & ", T_LAST_POST_AUTHOR"
      strSql = strSql & ", T_LAST_POST_REPLY_ID"
      strSql = strSql & ", T_DATE"
      strSql = strSql & ", T_STATUS"
      if strIPLogging <> "0" then
         strSql = strSql & ", T_IP"
      end if
      strSql = strSql & ", T_STICKY"
      strSql = strSql & ", T_SIG"
      strSql = strSql & ", T_ARCHIVE_FLAG"
      strSql = strSql & ", T_REPLIES"
      strSql = strSql & ", T_UREPLIES"
   '########## Topic Rating ##########
      strSql = strSql & ", ALLOW_RATING"
  '########## End Topic Rating ##########
      strSql = strSql & ", T_MSGICON"
      strSql = strSql & ") VALUES ("
      strSql = strSql & Forum_ID
      strSql = strSql & ", " & Cat_ID
      strSql = strSql & ", '" & txtSubject & "'"
      strSql = strSql & ", '" & txtMessage & "'"
  '  ## Poll Below
      If Request("Ppoll") = "1" Then
         strSql = strSql & ", " & 1
      Else
         strSql = strSql & ", " & 0
      End If
      If Request.Form("lockpoll") = "1" Then
         strSql = strSql & ", " & 0
      Else
         strSql = strSql & ", " & 1
      End If
   '  ## Poll Above
      strSql = strSql & ", " & rs("MEMBER_ID")
      strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
      strSql = strSql & ", " & rs("MEMBER_ID")
      strSql = strSql & ", 0 "
      strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
      if Request.Form("lock") = 1 and ForumChkSkipAllowed = 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 & ", '" & UserIPAddress & "'"
      end if
      if ForumChkSkipAllowed = 1 then
         if Request.Form("sticky") = 1 then
            strSql = strSql & ", 1 "
         else
            strSql = strSql & ", 0 "
         end if
      else
         strSql = strSql & ", 0 "
      end if
      if Request.Form("sig") = "yes" and strDSignatures = "1" then
         strSql = strSql & ", 1 "
      else
         strSql = strSql & ", 0 "
      end if
      if ForumChkSkipAllowed = 1 then
         if Request.Form("sticky") = 1 then
            strSql = strSql & ", 0 "
         else
            strSql = strSql & ", 1 "
         end if
      else
         strSql = strSql & ", 1 "
      end if
      strSql = strSql & ", 0 "
      strSql = strSql & ", 0 "
   '########## Topic Rating ##########
      if Request.Form("AllowRating") = 1 then
         strSql = strSql & ", 1 "
      else
         strSql = strSql & ", 0 "
      end if
  '########## End Topic Rating ##########
  strSql = strSql & ", " & cLng(Request.Form("strMessageIcon"))
         strSql = strSql & ")"

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      %><!--#INCLUDE FILE="cal_post_info2.asp"--><%
  '  Poll Below
      If Request("Ppoll") = "1" Then
         strSql = "SELECT " & strTablePrefix & "TOPICS.TOPIC_ID "
         strSql = strSql & "FROM " & strTablePrefix & "TOPICS "
         strSql = strSql & "WHERE " & strTablePrefix & "TOPICS.T_ISPOLL = " & 1 & " "
         strSql = strSql & "ORDER BY " & strTablePrefix & "TOPICS.T_DATE DESC"
         Set rsPollID = my_Conn.Execute (strSql)
         PollID = rsPollID("TOPIC_ID")
         rsPollID.Close
         Set rsPollID = Nothing
         strSql = "INSERT INTO " & strTablePrefix & "POLLS (CAT_ID"
         strSql = strSql & ", FORUM_ID"
         strSql = strSql & ", TOPIC_ID"
         strSql = strSql & ", P_WHOVOTES"
         strSql = strSql & ", P_ENDDATE"
         For i = 1 to PCount
            strSql = strSql & ", ANSWER" & cStr(i)
            strSql = strSql & ", COUNT" & cStr(i)
         Next
         strSql = strSql & ") VALUES ("
         strSql = strSql & Cat_ID
         strSql = strSql & ", " & Forum_ID
         strSql = strSql & ", " & PollID
         strSql = strSql & ", '" & chkString(Request.Form("WhoVotes"),"SQLString") & "'"
         strSql = strSql & ", '" & strNewDate & "'"
         For j = 1 to PCount
            strSql = strSql & ", '" & chkString(txtAns(j),"") & "'"
            strSql = strSql & ", " & 0
         Next
         strSql = strSql & ")"
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      End If
  '  ## Poll Above
      if Err.description <> "" then
         err_Msg = "There was an error = " & Err.description
      else
         err_Msg = "Updated OK"
      end if

      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

      ' 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 & ",    F_LAST_POST_TOPIC_ID = " & NewTopicID
         strSql = strSql & ",    F_LAST_POST_REPLY_ID = " & 0
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

      ProcessSubscriptions rs("MEMBER_ID"), Cat_ID, Forum_ID, NewTopicID, Moderation

      if Moderation = "No" then
         '## Subscribe checkbox ##
         if request.form("TNotify") <> "" then
            if request.form("TNotify") = "1" then
               AddSubscription "TOPIC", rs("MEMBER_ID"), Cat_ID, Forum_ID, NewTopicID
            elseif request.form("TNotify") = "0" then
               DeleteSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, NewTopicID
            end if
         end if
         '## Subscribe checkbox end ##
      end if

      Go_Result err_Msg, 1
      Response.End
   end if
end if


'#################### Merge Topic Mod ###################
if MethodType = "MergeTopic" then
   lngMember = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   select case lngMember
      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 Authorized
         Go_Result "Only an Admin or Moderator can Merge Topics", 0
         Response.End
      case 3 '## Moderator - Authorized
         '## Do Nothing
      case 4 '## Admin
         '## Do Nothing
      case else
         Go_Result cstr(lngMember), 0
         Response.End
   end select

   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("subject")),"SQLString")
   else
      txtSubject = chkString(Request.Form("subject"),"SQLString")
   end if
   if txtSubject = " " then
      Go_Result "You must post a subject!", 0
      Response.End
   end if
   if Len(Request.Form("subject")) > 50 then
      Go_Result "The subject can not be greater than 50 characters", 0
      Response.End
   end if
   if IsNumeric(Request.Form("MERGE_TOPIC_ID")) = True then
      MergeWithTopicID = cLng(Request.Form("MERGE_TOPIC_ID"))
   else
      Go_Result "You entered an incorrect URL of a topic. Please go back and correct it.", 0
   end if

   'Notes
   '- Check/Move subscriptions for the topics.
   '- Topic starter needs to be notified via email that topic was merged with another
   '- that it?

   '## Get info from database on both topics
   strSql = "SELECT TOPIC_ID, FORUM_ID, CAT_ID, T_IP, T_LAST_EDIT, T_LAST_POST, T_LAST_EDITBY, T_AUTHOR, T_DATE, T_REPLIES, T_SIG, T_VIEW_COUNT, T_MESSAGE "
   strSql = strSql & "FROM " & strTablePrefix & "TOPICS "
   strSql = strSql & "WHERE TOPIC_ID = " & MergeWithTopicID & " "
   strSql = strSql & "OR TOPIC_ID = " & Topic_ID
   'SELECT T_IP, T_LAST_EDIT, T_LAST_EDITBY, T_AUTHOR, T_DATE, T_REPLIES, T_SIG, T_VIEW_COUNT, T_MESSAGE FROM FORUM_TOPICS WHERE TOPIC_ID = 36 AND TOPIC_ID = 35
   'Response.Write strSql & "<br>"
   Set rs = Server.CreateObject("ADODB.Recordset")
   rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

   if rs.EOF then
      recCount = "-1"
   else
      allRec = rs.GetRows(adGetRowsRest)
      recCount = UBound(allRec,2)
   end if

   rs.close
   set rs = nothing
   'Response.Write strSql
   'Response.End

   '## Loop through data
   if recCount <> "-1" then
      Dim RowCount : RowCount = 0
      Dim blnInSameForum : blnInSameForum = true
      Dim intOlderTopic, intOtherTopic

      'Assign numerical locator for the array to variables
      TopicID = 0
      ForumID = 1
      CatID = 2
      Topic_IP = 3
      Topic_LastEdit = 4
      Topic_LastPost = 5
      Topic_LastEditBy = 6
      Topic_Author = 7
      Topic_Date = 8
      Topic_Replies = 9
      Topic_Sig = 10
      Topic_ViewCount = 11
      Topic_Message = 12

      'Check the posted date of both topics. The older topic remains as a topic.
      'I am assigning the row count for each topic in the allRec() array.
      if allRec(Topic_Date,0) < allRec(Topic_Date,1) then
         intOlderTopic = 0
         intOtherTopic = 1
      else
         intOlderTopic = 1
         intOtherTopic = 0
      end if

      'This is needed to get the forum and cat id for the
      'target topic when merging between 2 forums.
      if CLng(allRec(TopicID, 0)) = Topic_ID then
         intTargetTopic = 0
         intNotTargetTopic = 1
      else
         intTargetTopic = 1
         intNotTargetTopic = 0
      end if

      'Check if both topics are in the same forum
      if allRec(ForumID, intOlderTopic) <> allRec(ForumID, intOtherTopic) then
         blnInSameForum = false
      end if

      'if merging between 2 forums, change the forum id and cat id, to the
      'target topic, effectively moving the target topic to the correct forum
      if blnInSameForum = false then
         strSql = "UPDATE " & strTablePrefix & "TOPICS "
         strSql = strSql & " SET FORUM_ID = " & allRec(ForumID, intTargetTopic)
         strSql = strSql & ", CAT_ID = " & allRec(CatID, intTargetTopic)
         strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intNotTargetTopic)
         'Response.Write strSql & "<br>"
         'Response.End
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

      'Following query moves the topic to the reply table
      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"
      strSql = strSql & ", R_IP"
      strSql = strSql & ", R_STATUS"
      strSql = strSql & ", R_SIG"
      strSql = strSql & ", R_MESSAGE"
      strSql = strSql & ", R_MSGICON"
      strSql = strSql & ") VALUES ("
      strSql = strSql & allRec(TopicID, intOlderTopic)
      strSql = strSql & ", " & allRec(ForumID, intOlderTopic)
      strSql = strSql & ", " & allRec(CatID, intOlderTopic)
      strSql = strSql & ", " & allRec(Topic_Author, intOtherTopic)
      strSql = strSql & ", '" & allRec(Topic_Date, intOtherTopic) & "'"
      strSql = strSql & ", '" & allRec(Topic_IP, intOtherTopic) & "'"
      strSql = strSql & ", 1"
      strSql = strSql & ", " & allRec(Topic_Sig, intOtherTopic)
      strSql = strSql & ", '" & chkString(allRec(Topic_Message, intOtherTopic),"message") & "'"
      strSql = strSql & ", " & cLng(Request.Form("strMessageIcon")) & ")"
      'Response.Write strSql & "<br>"
      'Response.End
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'Change the replies topic id from the topic we merging to,
      'to the current topic, effectively moving them from one topic
      'to the other.
      strSql = "UPDATE " & strTablePrefix & "REPLY"
      strSql = strSql & " SET TOPIC_ID = " & allRec(TopicID, intOlderTopic)
      if blnInSameForum = false then
         strSql = strSql & ", FORUM_ID = " & allRec(ForumID, intOlderTopic)
         strSql = strSql & ", CAT_ID = " & allRec(CatID, intOlderTopic)
      end if
      strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intOtherTopic)
      'Response.Write strSql & "<br>"
      'Response.End
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'Update any subscriptions for the topic we are merging with and transfer them
      'to the existing topic.
      strSql = "UPDATE " & strTablePrefix & "SUBSCRIPTIONS"
      strSql = strSql & " SET TOPIC_ID = " & allRec(TopicID, intOlderTopic)
      strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intOtherTopic)
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'Update total # of TOPICS by - 1
      strSql = "UPDATE " & strTablePrefix & "TOTALS "
      strSql = strSql & " SET T_COUNT = T_COUNT - 1"
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'count how many replies are now in the topic
      'get the last reply from the reply table
      strSql = "SELECT Count(REPLY_ID) as TotalReplies "
      strSql = strSql & " FROM " & strTablePrefix & "REPLY "
      strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intOlderTopic)
      'Response.Write strSql & "<br>"
      'Response.End
      set rsTotal = my_Conn.Execute (strSql)

      TotalReplies = rsTotal("TotalReplies") 'holds the number of replies in the current topic

      rsTotal.close
      set rsTotal = nothing

      'Get info about the last reply in the REPLY table
      strSql = "SELECT REPLY_ID, R_AUTHOR, R_DATE, R_LAST_EDIT, R_LAST_EDITBY "
      strSql = strSql & "FROM " & strTablePrefix & "REPLY "
      strSql = strSql & "WHERE TOPIC_ID = " & allRec(TopicID, intOlderTopic) & " "
      strSql = strSql & "AND R_STATUS <= 1 "
      strSql = strSql & "ORDER BY R_DATE DESC"
      'Response.Write strSql & "<br>"
      'Response.End
      set rsLastReply = my_Conn.Execute (strSql)

      LatestReplyID = rsLastReply("REPLY_ID") 'holds the id of the last reply in the current topic
      LastReplyAuthor = rsLastReply("R_AUTHOR")
      LastReplyDate = rsLastReply("R_DATE")
      LastReplyEdit = rsLastReply("R_LAST_EDIT")
      LastReplyEditBy = rsLastReply("R_LAST_EDITBY")

      rsLastReply.close
      set rsLastReply = nothing

      'Update topic with the info about the last post date, and author.
      strSql = "UPDATE " & strTablePrefix & "TOPICS "
      strSql = strSql & "SET T_SUBJECT = '" & txtSubject & "'"
      strSql = strSql & ", T_VIEW_COUNT = T_VIEW_COUNT + " & cLng(allRec(Topic_ViewCount, intOtherTopic))
      strSql = strSql & ", T_LAST_POST_AUTHOR = " & LastReplyAuthor
      strSql = strSql & ", T_LAST_POST = '" & LastReplyDate & "'"
      strSql = strSql & ", T_LAST_POST_REPLY_ID = " & LatestReplyID
      if LastReplyEdit <> "" then
         strSql = strSql & ", T_LAST_EDIT = '" & LastReplyEdit & "'"
         if LastReplyEditBy <> "" then
            strSql = strSql & ", T_LAST_EDITBY = " & LastReplyEditBy
         end if
      end if
      strSql = strSql & ", T_REPLIES = " & TotalReplies
      strSql = strSql & " WHERE TOPIC_ID = " & allRec(TopicID, intOlderTopic)
      'Response.Write strSql & "<br>"
      'Response.End
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'delete old topic from topic table
      strSql = "DELETE FROM " & strTablePrefix & "TOPICS "
      strSql = strSql & "WHERE TOPIC_ID = " & allRec(TopicID, intOtherTopic)
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'Get last_post and last_post_author for Forum
      strSql = "SELECT TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID"
      strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
      strSql = strSql & " WHERE FORUM_ID = " & allRec(ForumID, intTargetTopic) & " "
      strSql = strSql & " ORDER BY T_LAST_POST DESC"
      'Response.Write strSql & "<br>"
      set rs = my_Conn.Execute (strSql)

      if not rs.eof then
         rs.movefirst
         strLast_Post = rs("T_LAST_POST")
         strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
         strLast_Post_Topic_ID = rs("TOPIC_ID")
         strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
      else
         strLast_Post = ""
         strLast_Post_Author = "NULL"
         strLast_Post_Topic_ID = 0
         strLast_Post_Reply_ID = 0
      end if

      rs.Close
      set rs = nothing

      'Update the # of posts count for the forum and # of topics for the forum
      strSql = "UPDATE " & strTablePrefix & "FORUM SET"
      if blnInSameForum then
         strSql = strSql & " F_TOPICS = F_TOPICS - 1,"
      else
         strSql = strSql & " F_COUNT = F_COUNT + " & cLng(allRec(Topic_Replies, intOtherTopic) + 1) & ","
      end if
      strSql = strSql & " F_LAST_POST = '" & strLast_Post & "',"
      strSql = strSql & " F_LAST_POST_AUTHOR = " & strLast_Post_Author & ","
      strSql = strSql & " F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID & ","
      strSql = strSql & " F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
      strSql = strSql & " WHERE FORUM_ID = " & allRec(ForumID, intTargetTopic)
      'Response.Write strSql & "<br>"
      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      'If the topic we merging with is in a different forum, update forum counts for that forum.
      if blnInSameForum = false then
         'Get last_post and last_post_author for Forum
         strSql = "SELECT TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID"
         strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
         strSql = strSql & " WHERE FORUM_ID = " & allRec(ForumID, intNotTargetTopic) & " "
         strSql = strSql & " ORDER BY T_LAST_POST DESC"
         'Response.Write strSql & "<br>"
         'Response.End
         set rs = my_Conn.Execute (strSql)

         if not rs.eof then
            rs.movefirst
            strLast_Post = rs("T_LAST_POST")
            strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
            strLast_Post_Topic_ID = rs("TOPIC_ID")
            strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
         else
            strLast_Post = ""
            strLast_Post_Author = "NULL"
            strLast_Post_Topic_ID = 0
            strLast_Post_Reply_ID = 0
         end if

         rs.Close
         set rs = nothing

         'Update the # of posts count for the forum and # of topics for the forum
         strSql = "UPDATE " & strTablePrefix & "FORUM"
         strSql = strSql & " SET F_TOPICS = F_TOPICS - 1,"
         strSql = strSql & " F_COUNT = F_COUNT - " & cLng(allRec(Topic_Replies, intOtherTopic) + 1) & ","
         strSql = strSql & " F_LAST_POST = '" & strLast_Post & "',"
         strSql = strSql & " F_LAST_POST_AUTHOR = " & strLast_Post_Author & ","
         strSql = strSql & " F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID & ","
         strSql = strSql & " F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID
         strSql = strSql & " WHERE FORUM_ID = " & allRec(ForumID, intNotTargetTopic)
         'Response.Write strSql & "<br>"
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

      if lcase(strEmail) = "100" then 'not implemented yet
         'Send mail to author letting him know his topic was merged with another.
         'DoAutoMoveEmail(allRec(Topic_ID, intOlderTopic))
         strSql  = "SELECT M.MEMBER_ID, M.M_NAME, M.M_EMAIL, T.FORUM_ID, T.T_SUBJECT "
         strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS M, " & strActivePrefix & "TOPICS T "
         strSql = strSql & " WHERE M.MEMBER_ID = T.T_AUTHOR "
         strSql = strSql & " AND T.TOPIC_ID = " & TopicNum
         'Response.Write strSql
         'Response.End
         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

         strRecipientsName = user_name
         strRecipients = email
         strSubject = strForumTitle & " - Topic Moved"
         strMessage = "Hello " & user_name & vbNewLine & vbNewLine
         strMessage = strMessage & "Your posting on " & strForumTitle & "." & vbNewLine
         strMessage = strMessage & "Regarding the subject - " & Topic_Title & "." & vbNewLine & vbNewLine

         if not(chkForumAccess(ForumID,Usernum,false)) then
            strMessage = strMessage & "Has been removed from public display. If you have any questions regarding this, please contact the Administrator of the forum" & vbNewLine
         else
            strMessage = strMessage & "Has been moved to a new forum, You can view it at " & vbNewLine & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "topic.asp?TOPIC_ID=" & TopicNum & vbNewLine
         end if
   %>
   <!--#INCLUDE FILE="inc_mail.asp" -->
   <%
      end if

      'ProcessSubscriptions Reply_Author, Cat_ID, Forum_ID, NewTopicID, Moderation
   else
      Go_Result "That topic does not exist in the database. Make sure the url you entered has the correct ID of the topic.", 0
   end if
   'Response.End
   Go_Result err_Msg, 1
   Response.End
end if
'########################################################


if MethodType = "Reply" or MethodType = "ReplyQuote" or MethodType = "TopicQuote" then
   '## Forum_SQL
   strSql = "SELECT MEMBER_ID, M_LEVEL, M_EMAIL, M_LASTPOSTDATE, " & 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(strPassword, "SQLString") &"'"
      QuoteOk = (ChkQuoteOk(strDBNTUserName) and ChkQuoteOk(strPassword))
   else
      QuoteOk = ChkQuoteOk(strDBNTUserName)
   end if

   set rs = my_Conn.Execute (strSql)

   if rs.BOF or rs.EOF or not(QuoteOk) or not(ChkQuoteOk(strPassword)) then '##  Invalid Password
      rs.close
      set rs = nothing
      err_Msg = "Invalid Password or User Name"
      Go_Result(err_Msg), 0
      Response.End
   else

      if strPrivateForums = "1" and ForumChkSkipAllowed = 0 then
         if not(chkForumAccess(Forum_ID,MemberID,false)) then
            Go_Result "You are not allowed to post in this forum !", 0
         end if
      end if

      if strFloodCheck = 1 then
         if rs("M_LASTPOSTDATE") > DateToStr(DateAdd("s",strFloodCheckTime,strForumTimeAdjust)) and mLev < 3 then
            strTimeLimit = replace(strFloodCheckTime, "-", "")
            Go_Result "Sorry! We have flood control activated.<br />You cannot post within " & strTimeLimit & " seconds of your last post.<br />Please try again after this period of time elapses.", 0
         end if
      end if

      txtMessage = ChkString(Request.Form("Message"),"message")
      UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
      if UserIPAddress = "" then
         UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
      end if
      if txtMessage = " " then
         Go_Result "You must post a message!", 0
         Response.End
      end if

      if strSignatures = "1" and strDSignatures <> "1" then
         if Request.Form("sig") = "yes" and GetSig(strDBNTUserName) <> " " then
            txtMessage = txtMessage & vbNewline & vbNewline & ChkString(GetSig(strDBNTUserName), "signature" )
         end if
      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_SIG"
      strSql = strSql & ", R_MESSAGE"
     strSql = strSql & ", R_MSGICON"
      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 & ", " & "'" & UserIPAddress & "'"
      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
      if Request.Form("sig") = "yes" and strDSignatures = "1" then
         strSql = strSql & ", 1 "
      else
         strSql = strSql & ", 0 "
      end if
      strSql = strSql & ", " & "'" & txtMessage & "'"
      strSql = strSql & ", " & cLng(Request.Form("strMessageIcon"))
      strSql = strSql & ")"

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      ' DEM --> Do not update totals on topics and forums database if post is moderated...Added if and end if
      if Moderation = "No" then
         strSql = "SELECT Max(REPLY_ID) as NewReplyID "
         strSql = strSql & " FROM " & strActivePrefix & "REPLY "
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
         strSql = strSql & "   and R_AUTHOR = " & rs("MEMBER_ID")
         set rs9 = my_Conn.Execute (strSql)
         NewReplyID = rs9("NewReplyID")
         rs9.close
         set rs9 = nothing

         '## 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")
         strSql = strSql & ",    T_LAST_POST_REPLY_ID = " & NewReplyID
         if Request.Form("lock") = 1 and ForumChkSkipAllowed = 1 then
            strSql = strSql & ",        T_STATUS = 0 "
         end if
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

         '## Subscribe checkbox start ##
         if request.form("TNotify") <> "" then
            if request.form("TNotify") = "1" then
               AddSubscription "TOPIC", rs("MEMBER_ID"), Cat_ID, Forum_ID, Topic_ID
            elseif request.form("TNotify") = "0" then
               DeleteSubscription "TOPIC", MemberID, Cat_ID, Forum_ID, Topic_ID
            end if
         end if
         '## Subscribe checkbox end ##

         '## 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_LAST_POST_TOPIC_ID = " & Topic_ID
         strSql = strSql & ",    F_LAST_POST_REPLY_ID = " & NewReplyID
         strSql = strSql & ",    F_COUNT = F_COUNT + 1 "
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      else
         '## Forum_SQL - Update Unmoderated post count
         strSql = "UPDATE " & strActivePrefix & "TOPICS "
         strSql = strSql & " SET T_UREPLIES = T_UREPLIES + 1 "
         strSql = strSql & " WHERE TOPIC_ID = " & Topic_IDstrSql = strSql & Cat_ID



         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      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, Moderation
         'end if
         Go_Result  "Updated OK", 1
         Response.End
      end if
 end if
  end if

'Parent Location Stuff MOD
strParent = replace(request.form("Parent"), "'", "''")
if strParent <> "" then
  strParentType = left(strParent, 1)
  strParentValue = right(strParent, len(strParent) - 1)
end if
if strParentType = "F" then
  '## Forum_SQL - Find the CAT_ID if forum is now a subforum
  strSQL = "SELECT CAT_ID FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & strParentValue & ";"
  set rsFindCat = my_Conn.Execute(strSQL)
  if not rsFindCat.eof then
    intCategoryValue = rsFindCat("CAT_ID")
  end if
  set rsFindCat = Nothing
  intSetParent = strParentValue
  intSetCategory = intCategoryValue
else
  intSetParent = NULL
  intSetCategory = strParentValue
end if
'End parent location stuff mod - Change variables below for adding a forum

if MethodType = "Forum" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Authorized
         Go_Result "Only an Admin can create a Forum", 0
         Response.End
      case 3 '## Moderator - Not Authorized
         Go_Result "Only an Admin can create a Forum", 0
         Response.End
      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")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the New Forum</li>"
   end if
   if Err_Msg = "" then
      '## Forum_SQL - Do DB Update
      strSql = "INSERT INTO " & strTablePrefix & "FORUM "
      strSql = strSql & "(CAT_ID"
      if isnull(intSetParent) = FALSE then
  strSql = strSql & ", F_PARENT"
end if
      strSql = strSql & ", F_STATUS"
      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 "
 '  ## Poll Below
      strSql = strSql & ", F_POLLS "
 '  ## Poll Above
      strSql = strSql & ", F_DEFAULTDAYS "
      strSql = strSql & ", F_COUNT_M_POSTS "
      strSql = strSql & ", F_ALLOWEVENTS "
  '############### Topic Rating Mod ###########################
      strSql = strSql & ", F_RATING_AUTH"
  '############### End Topic Rating Mod ###########################

      strSql = strSql & ") VALUES ("
      strSql = strSql & intSetCategory
if isnull(intSetParent) = FALSE then
  strSql = strSql & ", " & intSetParent
end if
      strSql = strSql & ", 1 "
      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 & ", 0"
      strSql = strSql & ", '' "
      strSql = strSql & ", 30 "
      strSql = strSql & ", '' "
      strSql = strSql & ", 365 "
           ' DEM --> Start of Code added for moderation and subscription
           if strSubscription > 0 and CatSubscription > 0 and strEmail = "1" 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 "
 '  ## Poll Below
      If Request.Form("PollAuth") <> "" Then
         strSql = strSql & ", " & chkString(Request.Form("PollAuth"),"SQLString")
      Else
         strSql = strSql & ", 0 "
      End If
 '  ## Poll Above
      strSql = strSql & ", " & ChkString(Request.Form("DefaultDays"), "SQLString")
      strSql = strSql & ", " & ChkString(Request.Form("ForumCntMPosts"), "SQLString")
      If CLng(Request.Form("allowevents")) = 1 then StrSql = strSql & ", 1" Else strSql = strSql & ", 0"
    '############### Topic Rating Mod ###########################
      if Request.Form("RatingAuth") = 1 then
         strSql = strSql & ", 1 "
      else
         strSql = strSql & ", 0 "
      end if
    '############### End Topic Rating Mod ###########################

           strSql = strSql & ")"

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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")
newUGPerms rsCount("maxForumId")        '#######    UserGroup MOD     #######
         newForumModerators rsCount("maxForumId")
         set rsCount = nothing
         Go_Result  "Updated OK", 1
      end if
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "URL" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin can create a web link", 0
         Response.End
      case 3 '## Moderator
         Go_Result "Only an Admin can create a web link", 0
         Response.End
      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"),"SQLString")
   txtSubject = ChkString(Request.Form("Subject"),"SQLString")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the New URL</li>"
   end if
   if txtAddress = " " or lcase(txtAddress) = "http://" or lcase(txtAddress) = "https://" or lcase(txtAddress) = "file:///" then
      Err_Msg = Err_Msg & "<li>You Must Enter an Address for the New URL</li>"
   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 & "<li>You Must prefix the Address with <b>http://</b>, <b>https://</b> or <b>file:///</b></li>"
   end if
   if Err_Msg = "" then
      '## Forum_SQL - Do DB Update
      strSql = "INSERT INTO " & strTablePrefix & "FORUM "
      strSql = strSql & "(CAT_ID"
      if isnull(intSetParent) = FALSE then
  strSql = strSql & ", F_PARENT"
end if
      strSql = strSql & ", F_STATUS"
      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_DELETE_SCHED "
           strSql = strSql & ", F_SUBSCRIPTION, F_MODERATION"
      strSql = strSql & ", F_ORDER "
      strSql = strSql & ", F_DEFAULTDAYS "
      strSql = strSql & ")  VALUES ("
      strSql = strSql & intSetCategory
if isnull(intSetParent) = FALSE then
  strSql = strSql & ", " & intSetParent
end if
           strSql = strSql & ", 1"
      if strPrivateForums = "1" then
         strSql = strSql & ", " & ChkString(Request.Form("AuthType"), "SQLString") & ""
      end if
      strSql = strSql & ", " & "'" & DateToStr(strForumTimeAdjust) & "'"
      strSql = strSql & ", " & MemberID & " "
      strSql = strSql & ", " & "'" & txtSubject & "'"
      strSql = strSql & ", " & "'" & txtAddress & "'"
      strSql = strSql & ", " & "'" & txtMessage & "'"
      strSql = strSql & ", 1"
           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 & ", 30"
      strSql = strSql & ") "

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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")
newUGPerms rsCount("maxForumId")        '#######    UserGroup MOD     #######
         newForumModerators rsCount("maxForumId")
         set rsCount = nothing
         Go_Result  "Updated OK", 1
      end if
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "EditForum" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin or a Moderator can change this Forum", 0
         Response.End
      case 3 '## Moderator
         if chkForumModerator(Forum_ID, strDBNTUserName) = "0" then
            Go_Result "Only an Admin or a Moderator can 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")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the Forum</li>"
   end if

        if strModeration <> 0 and Request.Form("Moderation") = 0 then
            if CheckForUnModeratedPosts("FORUM", Cat_ID, Forum_ID, 0) > 0 then
         Err_Msg = Err_Msg & "<li>Please Approve or Delete all UnModerated/Held posts in this Forum before turning Moderation off</li>"
      end if
   end if

   if Err_Msg = "" then'Parent Location Stuff MOD
'## Forum_SQL - Update forum parent and cat_id in db
'We changed lines from request.form("Category") to intSetCategory
'Update parent id
if isnull(intSetParent) = FALSE then
  strSQL = "UPDATE " & strTablePrefix & "FORUM SET F_PARENT = " & intSetParent & " WHERE FORUM_ID = " & Forum_ID
else
  strSQL = "UPDATE " & strTablePrefix & "FORUM SET F_PARENT = NULL WHERE FORUM_ID = " & Forum_ID
end if
my_Conn.Execute(strSQL)
'End parent mod code -- JUST MAKE SURE YOU CHANGE THAT request.form variable!

      '## 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(intSetCategory, "SQLString"))
      rsCatIDCheck.Close
      set rsCatIDCheck = Nothing

      '## Forum_SQL - Do DB Update
      strSql = "UPDATE " & strTablePrefix & "FORUM "
      strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
 '  ## Poll Below
      If Request.Form("PollAuth") <> "" Then
         strSql = strSql & ", F_POLLS = " & chkString(Request.Form("PollAuth"),"SQLString") & ""
      End If
 '  ## Poll Above
      if strPrivateForums = "1" then
         strSql = strSql & ", F_PRIVATEFORUMS = " & cLng("0" & Request.Form("AuthType"))
         if Request.Form("AuthPassword") <> " " then
            strSql = strSql & ", F_PASSWORD_NEW = '" & ChkString(Request.Form("AuthPassword"),"SQLString") & "'"
         end if
      end if
   '############### Topic Rating Mod ##################################
      if Request.Form("RatingAuth") = 1 then
         strSql = strSql & ", F_RATING_AUTH = 1 "
      else
         strSql = strSql & ", F_RATING_AUTH = 0 "
      end if
  '############### End Topic Rating Mod ##################################
      strSql = strSql & ", F_SUBJECT = '" & txtSubject & "'"
      strSql = strSql & ", F_DESCRIPTION = '" & txtMessage & "'"
      if Request.Form("Moderation") <> "" then
              strSql = strSql & ",    F_MODERATION = " & cLng("0" & Request.Form("Moderation"))
      end if
      if fSubscription <> "" then
              strSql = strSql & ",    F_SUBSCRIPTION = " & cLng("0" & fSubscription)
      end if
      strSql = strSql & ",   F_DEFAULTDAYS = " & cLng(Request.Form("DefaultDays"))
      strSql = strSql & ",   F_COUNT_M_POSTS = " & cLng("0" & Request.Form("ForumCntMPosts"))
      If CLng(Request.Form("allowevents")) = 1 then strSql = strSql & ", F_ALLOWEVENTS = 1" Else strSql = strSql & ", F_ALLOWEVENTS = 0"
      strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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=" & cLng("0" & intSetCategory)
         set rs = my_conn.execute(strSQL)
         intCatSubs = rs("CAT_SUBSCRIPTION")
         intCatMod = rs("CAT_MODERATION")
         rs.close
         set rs = nothing
         if intCatSubs < fSubscription then
            strSQL = "UPDATE " & strTablePrefix & "CATEGORY SET " & strTablePrefix & "CATEGORY.CAT_SUBSCRIPTION = " & fSubscription

            my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
         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),,adCmdText + adExecuteNoRecords
         end if
         '## Forum_SQL - Do DB Update
         strSql = "UPDATE " & strActivePrefix & "TOPICS "
         strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

         '## Forum_SQL - Do DB Update
         strSql = "UPDATE " & strActivePrefix & "REPLY "
         strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

         ' DEM --> Added _SUBSCRIPTIONS table
         '## Forum_SQL - Do DB Update
         strSql = "UPDATE " & strTablePrefix & "SUBSCRIPTIONS "
         strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
         strSql = strSql & " WHERE FORUM_ID = " & Forum_ID
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
      end if

       err_Msg= ""
      if Err.description <> "" then
         Go_Result "There was an error = " & Err.description, 0
         Response.End
      else
         updateForumMembers Forum_ID
updateUGPerms Forum_ID        '#######    UserGroup MOD     #######
         if mLev = 4 then
            updateForumModerators Forum_ID
         end if
         Go_Result  "Updated OK", 1
      end if
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "EditURL" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin or a Moderator can change this web link", 0
         Response.End
      case 3 '## Moderator
         if chkForumModerator(Forum_ID, strDBNTUserName) = "0" then
            Go_Result "Only an Admin or a Moderator can change this 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"),"SQLString")
   txtSubject = ChkString(Request.Form("Subject"),"SQLString")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if
   Err_Msg = ""

   if txtSubject = " " then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the New URL</li>"
   end if
   if txtAddress = " " or lcase(txtAddress) = "http://" or lcase(txtAddress) = "https://" or lcase(txtAddress) = "file:///" then
      Err_Msg = Err_Msg & "<li>You Must Enter an Address for the New URL</li>"
   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 & "<li>You Must prefix the Address with <b>http://</b>, <b>https://</b> or <b>file:///</b></li>"
   end if
   if Err_Msg = "" then
   'Update parent id
if isnull(intSetParent) = FALSE then
  strSQL = "UPDATE " & strTablePrefix & "FORUM SET F_PARENT = " & intSetParent & " WHERE FORUM_ID = " & Forum_ID
else
  strSQL = "UPDATE " & strTablePrefix & "FORUM SET F_PARENT = NULL WHERE FORUM_ID = " & Forum_ID
end if
my_Conn.Execute(strSQL)
'End parent mod code -- JUST MAKE SURE YOU CHANGE THAT request.form variable!

      '## Forum_SQL - Do DB Update
      strSql = "UPDATE " & strTablePrefix & "FORUM "
      strSql = strSql & " SET CAT_ID = " & cLng("0" & intSetCategory)
      if strPrivateForums = "1" then
         strSql = strSql & ",    F_PRIVATEFORUMS = " & cLng("0" & Request.Form("AuthType"))
      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),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      err_Msg= ""
      if Err.description <> "" then
         Go_Result "There was an error = " & Err.description, 0
         Response.End
      else
         updateForumMembers Forum_ID
updateUGPerms Forum_ID        '#######    UserGroup MOD     #######
         if mLev = 4 then
            updateForumModerators Forum_ID
         end if
         Go_Result  "Updated OK", 1
      end if
   else
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "Category" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin can create a category", 0
         Response.End
      case 3 '## Moderator
         Go_Result "Only an Admin can create a category", 0
         Response.End
      case 4 '## Admin
         '## Do Nothing
      case else
         Go_Result cstr(Member), 0
         Response.End
   end select
   txtSubject = chkString(Request.Form("Subject"),"SQLString")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if

   Err_Msg = ""
   if txtSubject = "" then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the New Category</li>"
   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_STATUS, CAT_SUBSCRIPTION, CAT_MODERATION, CAT_ORDER) "
         strSql = strSql & " VALUES ('" & txtSubject & "'"
                 strSql = strSql & ", 1"
           if strSubscription <> 0 and strEmail = "1" 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),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if

if MethodType = "EditCategory" then
   member = cLng(ChkUser(strDBNTUserName, strPassword,-1))
   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 Admin can change a category", 0
         Response.End
      case 3 '## Moderator
         '## Do Nothing
         Go_Result "Only an Admin can change a category", 0
         Response.End
      case 4 '## Admin
         '## Do Nothing
      case else
         Go_Result cstr(Member), 0
         Response.End
   end select
   txtSubject = chkString(Request.Form("Subject"),"SQLString")
   if strBadWordFilter = "1" then
      txtSubject = chkString(ChkBadWords(Request.Form("Subject")),"SQLString")
   end if

   Err_Msg = ""
   if txtSubject = "" then
      Err_Msg = Err_Msg & "<li>You Must Enter a Subject for the Category</li>"
   end if
        if strModeration <> 0 and Request.Form("Moderation") = 0 then
           if CheckForUnmoderatedPosts("CAT", Cat_ID, 0, 0) > 0 then
         Err_Msg = Err_Msg & "<li>Please Approve or Delete all UnModerated/Held posts in this Category before turning Moderation off</li>"
      end if
   end if
   if Err_Msg = "" then
      '## Forum_SQL - Do DB Update
      strSql = "UPDATE " & strTablePrefix & "CATEGORY "
      strSql = strSql & " SET CAT_NAME = '" & txtSubject & "'"
         ' DEM --> Start of Code added for moderation and subscription functionality
           if strModeration <> 0 then
                 strSql = strSql & ",   CAT_MODERATION = " & cLng("0" & Request.Form("Moderation"))
           end if
           if strSubscription <> 0 and strEmail = "1" then
                    strSql = strSql & ",   CAT_SUBSCRIPTION = " & cLng("0" & Request.Form("Subscription"))
         end if
           ' DEM --> End of code added for moderation and subscription functionality
      strSql = strSql & " WHERE CAT_ID = " & Cat_ID

      my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

      Application.Lock
      Application(strCookieURL & "JumpBoxChanged")= DateToStr(strForumTimeAdjust)
      Application.UnLock

      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
      Response.Write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
            "      <table align=""center"" border=""0"">" & vbNewLine & _
            "        <tr>" & vbNewLine & _
            "          <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
            "        </tr>" & vbNewLine & _
            "      </table>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
   end if
end if
'set rs = nothing
WriteFooter
Response.End

sub Go_Result(str_err_Msg, boolOk)

   select case MethodType
      case "Topic", "TopicQuote", "Reply", "ReplyQuote"
         set rsFCountMP = my_Conn.Execute("SELECT F_COUNT_M_POSTS FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & Forum_ID)
         ForumCountMPosts = rsFCountMP("F_COUNT_M_POSTS")
         rsFCountMP.close
         set rsFCountMP = nothing
   end select

   Response.write    "      <table border=""0"" width=""100%"">" & vbNewLine & _
         "        <tr>" & vbNewLine & _
         "          <td width=""33%"" align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
         "          " & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp"">COMMUNITY HOME</a><br />" & vbNewLine
   if MethodType = "Topic" or _
      MethodType = "TopicQuote" or _
      MethodType = "Reply" or _
      MethodType = "ReplyQuote" or _
      MethodType = "Edit" or _
      MethodType = "EditTopic" then
         Response.Write "          " & getCurrentIcon(strIconBar,"","align=""absmiddle""")
         if blnCStatus <> 0 then
            Response.Write getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""")
         else
            Response.Write getCurrentIcon(strIconFolderClosed,"","align=""absmiddle""")
         end if
         Response.Write " <a href=""default.asp?CAT_ID=" & Cat_ID & """>" & ChkString(strCatTitle, "title") & "</a><br />" & vbNewLine
         Response.Write "          " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""")
         if blnFStatus <> 0 and blnCStatus <> 0 then
            Response.Write getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""")
         else
            Response.Write getCurrentIcon(strIconFolderClosed,"","align=""absmiddle""")
         end if
         Response.Write " <a href=""forum.asp?FORUM_ID=" & Forum_ID & """>" & ChkString(strForum_Title, "title") & "</a><br />" & vbNewLine
   end if
   if MethodType = "Reply" or _
      MethodType = "ReplyQuote" or _
      MethodType = "TopicQuote" or _
      MethodType = "Edit" or _
      MethodType = "EditTopic" then
            Response.Write "          " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""")
            if blnTStatus <> 0 and blnFStatus <> 0 and blnCStatus <> 0 then
               Response.Write getCurrentIcon(strIconFolderOpenTopic,"","align=""absmiddle""")
            else
               Response.Write getCurrentIcon(strIconFolderClosedTopic,"","align=""absmiddle""")
            end if
            Response.Write " <a href=""" & chkString(Request.Form("refer"),"refer") & """>" & ChkString(strTopicTitle,"title") & "</a>" & vbNewLine
   end if
   Response.write "          </font></td>" & vbNewLine & _
         "        </tr>" & vbNewLine & _
         "      </table>" & vbNewLine
   if boolOk = 1 then
      Response.write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>"
      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!")
                         '  ## Points Below
                        tNewRank = False
                        If ChkNewRank Then
                           Response.Write "<br><br><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & VbNewLine &_
                              " ****Congratulations You Got a New Rank!**** </font>"
                           tNewRank = True
                        End If
                        '  ## Points Above
                         DoPCount
               if ForumCountMPosts <> 0 then
                  '  ## Points Below
                  Call DoUCount(MemberID, "R", tNewRank)
                  '  ## Points Above
               end if
                 end if
               DoULastPost MemberID
         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!")
                         '  ## Points Below
                                 tNewRank = False
                                 If ChkNewRank Then
                                    Response.Write "<br><br><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & VbNewLine &_
                                       " ****Congratulations You Got a New Rank!**** </font>"
                                    tNewRank = True
                                 End If
                         '  ## Points Above
                         DoTCount
                         DoPCount
               if ForumCountMPosts <> 0 then
                  '  ## Points Below
                  Call DoUCount(MemberID, "T", tNewRank)
                  '  ## Points Above
               end if
                 end if
            DoULastPost MemberID
         case "Forum"
                 Response.Write("New Forum Created!")
         case "URL"
                 Response.Write("New URL Created!")
         case "Category"
                 Response.Write("New Category Created!")
         '############ Merge Topic Mod ################
         case "MergeTopic"
            Response.Write("Topics merged succesfully!")
            DoTCount
         '#############################################
         case else
                 Response.Write("Complete!")
                 'DoPCount
                 'DoUCount Request.Form("UserName")
                 'DoULastPost Request.Form("UserName")
      end select
      if MethodType = "Topic" then
         strReturnURL = "topic.asp?TOPIC_ID=" & NewTopicID
         strReturnTxt = "Go to new topic"
      elseif MethodType = "Reply" or MethodType = "ReplyQuote" or MethodType = "TopicQuote" then
         strReturnURL = "topic.asp?whichpage=-1&TOPIC_ID=" & Topic_ID & "&REPLY_ID=" & NewReplyID
         strReturnTxt = "Back to the topic"
      elseif MethodType = "EditTopic" then
         strReturnURL = "topic.asp?TOPIC_ID=" & Topic_ID
         strReturnTxt = "Back to the topic"
      elseif MethodType = "Edit" then
         strReturnURL = "topic.asp?whichpage=-1&TOPIC_ID=" & Topic_ID & "&REPLY_ID=" & Reply_ID
         strReturnTxt = "Back to the topic"
      else
         strReturnURL = chkString(Request.Form("refer"),"refer")
         strReturnTxt = "Back To Forum"
      end if
      Response.write "</font></p>" & vbNewLine & _
            "      <meta http-equiv=""Refresh"" content=""2; URL=" & strReturnURL & """>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>"
      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!")
      '########### Merge Topic Mod ###########
         case "MergeTopic"
            Response.Write(" ")
      '#######################################
         case else
            Response.Write("Have a nice day!")
      end select
      Response.write "</font></p>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""" & strReturnURL & """>" & strReturnTxt & "</a></font></p>" & vbNewLine
   else
      Response.write "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There has been a problem!</font></p>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & str_err_Msg & "</font></p>" & vbNewLine & _
            "      <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go back to correct the problem.</a></font></p>" & vbNewLine
   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),,adCmdText + adExecuteNoRecords
      if err.number <> 0 then
         Go_REsult err.description, 0
      end if
   next
   on error goto 0
end sub

sub updateForumMembers(fForumID)
   my_Conn.execute ("DELETE FROM " & strTablePrefix & "ALLOWED_MEMBERS WHERE FORUM_ID = " & fForumId),,adCmdText + adExecuteNoRecords
   newForumMembers(fForumID)
end sub
'#######    Begin UserGroup MOD     #######
sub newUGPerms(fForumID)
    on error resume next
    if mlev = 4 or (mlev = 3 and CInt(strUGModForums) = 2) then
    for each key in Request.Form
        if Left(key,5) = "Perms" and Request.Form(key) <> "notset" then
            strUGid = Trim(Mid(key,6))
            strSql = "INSERT INTO " & strTablePrefix & "ALLOWED_USERGROUPS ("
            strSql = strSql & "FORUM_ID, USERGROUP_ID, PERMS) VALUES ("
            strSql = strSql & fForumID & ", " & strUGid & ", " & Request.Form(key) & ")"
            my_Conn.execute(strSql)
        end if
    next
    end if
end sub

sub updateUGPerms(fForumID)
    if mlev = 4 then
        my_Conn.execute("DELETE FROM " & strTablePrefix & "ALLOWED_USERGROUPS WHERE FORUM_ID = " & fForumID)
        newUGPerms(fForumID)
    end if
    if (mlev = 3 and CInt(strUGModForums) = 2) then
        strSql = "SELECT UG.USERGROUP_ID FROM " & strTablePrefix & "USERGROUPS UG " &_
            "INNER JOIN " & strTablePrefix & "ALLOWED_USERGROUPS AUG " &_
            "ON UG.USERGROUP_ID = AUG.USERGROUP_ID WHERE AUG.FORUM_ID = " & fForumID &_
            " AND UG.MOD_HIDE = 0"
        set rsOK = my_Conn.execute(strSql)
        do while not rsOK.eof
            strSql = "DELETE FROM " & strTablePrefix & "ALLOWED_USERGROUPS " &_
                "WHERE FORUM_ID = " & fForumID & " AND USERGROUP_ID = " & rsOK("USERGROUP_ID")
            my_Conn.execute(strSql)
            rsOK.movenext
        loop
        rsOK.close
        set rsOK = nothing
        newUGPerms(fForumID)
    end if
end sub
'#######     End UserGroup MOD      #######
sub newForumModerators(fForumID)
   on error resume next
   if Request.Form("ForumMod") = "" then
      exit Sub
   end if
   Users = split(Request.Form("ForumMod"),",")
   for count = Lbound(Users) to Ubound(Users)
      strSql = "INSERT INTO " & strTablePrefix & "MODERATOR ("
      strSql = strSql & " MEMBER_ID, FORUM_ID) VALUES ( "& Users(count) & ", " & fForumID & ")"

      my_conn.execute (strSql),,adCmdText + adExecuteNoRecords
      if err.number <> 0 then
         Go_REsult err.description, 0
      end if
   next
   on error goto 0
end sub

sub updateForumModerators(fForumID)
   my_Conn.execute ("DELETE FROM " & strTablePrefix & "MODERATOR WHERE FORUM_ID = " & fForumId),,adCmdText + adExecuteNoRecords
   newForumModerators(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
   set rs2 = nothing
   if lcase(strEmail) = "1" then
      strRecipientsName = user_name
      strRecipients = email
      strSubject = strForumTitle & " - Topic Moved"
      strMessage = "Hello " & user_name & vbNewLine & vbNewLine
      strMessage = strMessage & "Your posting on " & strForumTitle & "." & vbNewLine
      strMessage = strMessage & "Regarding the subject - " & Topic_Title & "." & vbNewLine & vbNewLine

      if not(chkForumAccess(ForumID,Usernum,false)) then
         strMessage = strMessage & "Has been removed from public display, If you have any questions regarding this, please contact the Administrator of the forum" & vbNewLine
      else
         strMessage = strMessage & "Has been moved to a new forum, You can view it at " & vbNewLine & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "topic.asp?TOPIC_ID=" & TopicNum & vbNewLine
      end if
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
   end if
end sub

'## Subscribe checkbox start ##
sub DeleteSubscription(Level, MemberID, CatID, ForumID, TopicID)
         ' --- Delete the appropriate sublevel of subscriptions
         StrSql = "DELETE FROM " & strTablePrefix & "SUBSCRIPTIONS"
         StrSql = StrSql & " WHERE " & strTablePrefix & "SUBSCRIPTIONS.MEMBER_ID = " & MemberID
         if sublevel = "CAT" then
                 StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.CAT_ID = " & CatID
         elseif sublevel = "FORUM" then
                 StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.FORUM_ID = " & ForumID
         elseif sublevel = "TOPIC" then
                 StrSql = StrSQL & " AND " & strTablePrefix & "SUBSCRIPTIONS.TOPIC_ID = " & TopicID
         end if
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
end sub

sub AddSubscription(SubLevel, MemberID, CatID, ForumID, TopicID)
         ' --- Insert the appropriate sublevel subscription
         StrSql = "INSERT INTO " & strTablePrefix & "SUBSCRIPTIONS"
         StrSql = StrSql & "(MEMBER_ID, CAT_ID, FORUM_ID, TOPIC_ID) VALUES (" & MemberID & ", "
         if sublevel = "BOARD" then
         StrSql = StrSql & "0, 0, 0)"
       elseif sublevel = "CAT" then
         StrSql = StrSql & CatID & ", 0, 0)"
         elseif sublevel = "FORUM" then
         StrSql = StrSql & CatID & ", " & ForumID & ", 0)"
         else
         StrSql = StrSql & CatID & ", " & ForumID & ", " & TopicID & ")"
         end if
         my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
end sub

'## Subscribe checkbox end ##
Function ChkNewRank()
   Dim arrRankLevels,intRank
   ChkNewRank = false
   arrRankLevels = array(intRankLevel1,intRankLevel2,intRankLevel3,intRankLevel4,intRankLevel5)
   For intRank = 0 To 4
      If cInt(intCurrPosts + 1) = cInt(arrRanklevels(intRank)) Then
         ChkNewRank = true
         Exit Function
      End If
   Next
End Function
%>




"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley

Edited by - MaGraham on 12 December 2013 12:53:22
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 12 December 2013 :  02:41:04  Show Profile
OK, now the error means that either you didn't run the dbs file or there was an error when you did run it. Try running it again.
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 12 December 2013 :  03:25:53  Show Profile

If I hadn't already ran the database, I wouldn't have had the duration option when creating a poll, Carefree.

Just now ran it again.




Poll End Date v3.4.07

Adding Column P_ENDDATE...
ALTER TABLE FORUM_POLLS ADD P_ENDDATE varchar(14) NOT NULL DEFAULT NULL
ALTER TABLE FORUM_POLLS ADD P_ENDDATE varchar(14) NOT NULL DEFAULT NULL
-2147467259 | [MySQL][ODBC 5.1 Driver][mysqld-5.5.28]Invalid default value for 'P_ENDDATE'

If there were errors please post a question in the MOD Implementation Forum at



Still receiving the same error as mentioned above.



"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley

Edited by - MaGraham on 12 December 2013 11:33:20
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 12 December 2013 :  07:10:17  Show Profile
That doesn't look like the right DBS file MaGraham. The error is talking about the P_ENDDATE database field is missing, so we're looking for the DBS file that will add the P_ENDDATE to the database. That 1 you just posted, doesn't show anything about P_ENDDATE being added to the database.

Support Snitz Forums
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 12 December 2013 :  11:40:52  Show Profile

You're obviously correct, Davio! LOL THANK YOU!!

I was up with a sick grandbaby and after getting him back to sleep I thought I would come here. I'll refrain from doing that next time! LOL

I've corrected my post above.

Still receiving the same error message.


"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 12 December 2013 :  16:34:37  Show Profile
Notice this little message from the dbs installation?

quote:
If there were errors please post a question in the MOD Implementation Forum at ....


Since you received an error adding the field when running the DBS file, the field wasn't added at all. It should not reflect "NOT NULL", though, since I have it set to NULL. Thus, the error in "post_info.asp" would still exist.

Davio ... the line in question from the dbs file reads
ADD#P_ENDDATE#varchar(14)##NULL#


Any idea why MySQL is being retarded?

Ma, here's a program to manually insert it, hopefully it'll not generate an error.


<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
my_Conn.Execute("ALTER TABLE " & strTablePrefix & "POLLS ADD COLUMN (P_ENDDATE) VARCHAR(14) DEFAULT ''")
WriteFooter
%>


Edited by - Carefree on 12 December 2013 22:30:01
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 12 December 2013 :  17:40:01  Show Profile
Yeah Carefree, MySQL doesn't like putting NULL as default. Use '' instead for the default, for MySQL.

Support Snitz Forums
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 12 December 2013 :  19:59:48  Show Profile

I received this error message below.


Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 5.1 Driver][mysqld-5.5.28]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') VARCHAR(14) DEFAULT '' NULL' at line 1

/fp/poll_enddate_fix.asp, line 4



"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 12 December 2013 :  22:29:44  Show Profile
quote:
Originally posted by Davio

Yeah Carefree, MySQL doesn't like putting NULL as default. Use '' instead for the default, for MySQL.



That wasn't the default value, but the NULL allowed field. So for MySQL, use which of these?
ADD#P_ENDDATE#varchar(14)##''#

or this

ADD#P_ENDDATE#varchar(14)###''


Ma, try the amended version just above.

Edited by - Carefree on 12 December 2013 22:34:42
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 12 December 2013 :  23:27:22  Show Profile
Use the 2nd one, and see if it works.

Support Snitz Forums
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 12 December 2013 :  23:55:44  Show Profile
Like this?


<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
my_Conn.Execute("ALTER TABLE " & strTablePrefix & "POLLS ADD COLUMN (ADD#P_ENDDATE#varchar(14)###'")
WriteFooter
%>



"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 13 December 2013 :  02:05:18  Show Profile
No, like the one I edited above:

<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
my_Conn.Execute("ALTER TABLE " & strTablePrefix & "POLLS ADD COLUMN (P_ENDDATE) VARCHAR(14) DEFAULT ''")
WriteFooter
%>


The dbs file would look like this:


Poll End Date v3.4.07
[ALTER]
POLLS
ADD#P_ENDDATE#varchar(14)###''
[END]

Edited by - Carefree on 13 December 2013 02:09:01
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 13 December 2013 :  08:52:45  Show Profile

I ran the database. No errors!


Poll End Date v3.4.07

Adding Column P_ENDDATE...
ALTER TABLE FORUM_POLLS ADD P_ENDDATE varchar(14) NOT NULL
Column added successfully

Database setup finished




I was then able to do a poll and it seemed to work in not showing the results.

Poll Question:
Testing this. . .

Results:
Poll not yet closed. Results not available.






But at the bottom of my post was this, which those numbers made no sense.


Poll Status: Open #187;#187; Total Votes: 1 counted #187;#187;





Then, since there were 8 possible answers for the polls I thought I would go into my Admin Options and possibly change some settings but I received this error message when I clicked on Polls.



Microsoft VBScript compilation error '800a0411'

Name redefined

/fp/admin_poll.asp, line 161

Dim vAnswers(20)
----^



Here's my admin_poll.asp.



<%
'#################################################################################
'## Snitz Forums 2000 v3.4.06
'#################################################################################
'## Copyright (C) 2000-06 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
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_admin.asp" -->
<% 
if Session(strCookieURL & "Approval") <> "15916941253" then
	scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
	Response.Redirect "admin_login.asp?target=" & scriptname(ubound(scriptname))
end if

Response.Write "<script language=""JavaScript"">" & vbNewLine & _
	"<!--" & vbNewLine & _
	"function setDays() {document.PollFilter.submit(); return 0;}" & vbNewLine & _
	"// -->" & vbNewLine & _
	"</script>" & vbNewLine & _
	"<table border=""0"" width=""100%"">" & vbNewLine & _
	"  <tr>" & vbNewLine & _
	"    <td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"		" & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
	"		" & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""admin_home.asp"">Admin Section</a><br />" & vbNewLine & _
	"		" & getCurrentIcon(strIconBlank,"","") & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpenTopic,"","") & " Poll Configuration<br />" & vbNewLine & _
	"    </font></td>" & vbNewLine & _
	"  </tr>" & vbNewLine & _
	"</table>" & vbNewLine

nDays = Request.Cookies(strCookieURL & "PollDays")

if Request.form("cookie") = 1 then
	if strSetCookieToForum = "1" then
		Response.Cookies(strCookieURL & "PollDays").Path = strCookieURL
	end if
	Response.Cookies(strCookieURL & "PollDays") = Request.Form("PollDays")
	Response.Cookies(strCookieURL & "PollDays").expires = strForumTimeAdjust + 365
	nDays = Request.Form("PollDays")
end if

if nDays = "" then
	nDays = 30
end if

defDate = DateToStr(dateadd("d", -(nDays), strForumTimeAdjust))

if Request.Form("Save_Active") = "yes" then
		'## Update config table
		strSql = "UPDATE " & strTablePrefix & "CONFIG_NEW "
		if trim(Request.Form("strFeaturedPollID")) <> "" then
			strSql = strSql & " SET C_VALUE = '" & chkString(Request.Form("strFeaturedPollID"),"SQLString") & "'"
		else
			strSql = strSql & " SET C_VALUE = '" & chkString(Request.Form("strPollID"),"SQLString") & "'"
		end if
		strSql = strSql & " WHERE C_VARIABLE = 'strFeaturedPollID'"

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		
		Application(strCookieURL & "ConfigLoaded") = ""

Response.Write "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Featured Poll Has Been Set!</font></p>" & vbNewLine & _
		"<meta http-equiv=""Refresh"" content=""2; URL=admin_poll.asp"">" & vbNewLine & _
		"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Congratulations!</font></p>" & vbNewLine & _
		"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""admin_home.asp"">Back To Admin Home</font></a></p>" & vbNewLine
	WriteFooter
	Response.End
elseif Request.Form("Method_Type") = "Write_Configuration" then	
	Err_Msg = ""
	if Request.Form("strFPollWindow") = "1" and Request.Form("strFeaturedPoll") = "0" then
		Err_Msg = Err_Msg & "<li>The ""Featured Poll in New Window"" option requires the ""Show Featured Poll"" option to be turned on.</li>"
	end if
	
	if Err_Msg = "" then
		for each key in Request.Form 
			if left(key,3) = "str" or left(key,3) = "int" then
				strDummy = SetConfigValue(1, key, ChkString(Request.Form(key),"SQLstring"))
			end if
		next
		Application(strCookieURL & "ConfigLoaded") = ""

		Response.Write "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Configuration Posted!</font></p>" & vbNewLine & _
				"<meta http-equiv=""Refresh"" content=""2; URL=admin_poll.asp"">" & vbNewLine & _
				"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Congratulations!</font></p>" & vbNewLine & _
				"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""admin_home.asp"">Back To Admin Home</font></a></p>" & vbNewLine
			WriteFooter
			Response.End
	else
		Response.Write "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
				"<table align=""center"" border=""0"">" & vbNewLine & _
				"  <tr>" & vbNewLine & _
				"    <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
				"  </tr>" & vbNewLine & _
				"</table>" & vbNewLine & _
				"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
			WriteFooter
			Response.End
	end if
end if
 
'## Forum_SQL - Find all records with the search criteria in them
strSql = "SELECT C.CAT_NAME, F.FORUM_ID, F.F_SUBJECT, T.TOPIC_ID, T.T_SUBJECT, P.P_LASTVOTE, P.P_WHOVOTES"
for nCount = 1 to 15
	strSql = strSql & ", P.ANSWER" & CStr(nCount)
	strSql = strSql & ", P.COUNT" & CStr(nCount)
next
strSql = strSql & ", M.M_NAME " & _
	"FROM " & strTablePrefix & "CATEGORY AS C, " & strTablePrefix & "FORUM AS F, " & _
	 		strTablePrefix & "TOPICS AS T, " & strTablePrefix & "POLLS AS P, " & _
			strMemberTablePrefix & "MEMBERS AS M " & _
	"WHERE C.CAT_ID = T.CAT_ID AND F.FORUM_ID = T.FORUM_ID " & _
	"AND P.TOPIC_ID = T.TOPIC_ID AND M.MEMBER_ID = T.T_AUTHOR AND T.T_ISPOLL = 1 AND T.T_POLLSTATUS = 1"
if nDays > 0 then
	strSql = strSql & " AND (P.P_LASTVOTE > '" & defDate & "' OR T.T_DATE > '" & defDate & "')"
end if
strSql = strSql & " ORDER BY C.CAT_ORDER, C.CAT_NAME, F.F_ORDER, F.F_SUBJECT, P.P_LASTVOTE DESC"

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

if rs.EOF then
	recPollsCount = ""
else
	allPolls = rs.GetRows(adGetRowsRest)
	recPollsCount = UBound(allPolls,2)
end if

rs.close
set rs = nothing

Dim vAnswers(20)
Dim vCount(20)
Dim nCount
Dim nTotal

Response.Write "<br />" & vbNewLine & _
	"<form method=""POST"" action=""admin_poll.asp"">" & vbNewLine & _
	"<input type=""hidden"" name=""Method_Type"" value=""Write_Configuration"">" & vbNewLine & _
	"<table border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"" width=""70%"">" & vbNewLine & _
	"  <tr>" & vbNewLine & _
	"    <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
	"<table align=""center"" border=""0"" cellPadding=""1"" cellSpacing=""1"" width=""100%"">" & vbNewLine & _
	"	<tr>" & vbNewLine & _
	"		<td bgcolor=""" & strHeadCellColor & """ align=""center"" vAlign=""top"" colspan=""2"">" & vbNewLine & _
	"  		<font color=""" & strCategoryFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Poll Configuration</b></font>" & vbNewLine & _
	"		</td>" & vbNewLine & _
	"	</tr>" & vbNewLine & _
	"	<tr valign=""top"">" & vbNewLine & _
	"    	<td bgColor=""" & strPopUpTableColor & """ align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Polls:</b> </font></td>" & vbNewLine & _
	"    	<td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"    	On: <input type=""radio"" name=""strPolls"" value=""1"""
if strPolls = "1" then Response.Write(" checked")
Response.Write ">Off: <input type=""radio"" name=""strPolls"" value=""0"""
if strPolls <> "1" then Response.Write(" checked")
Response.Write "></font><a href=""JavaScript:openWindow3('pop_config_help.asp?mode=pollmod#polls')"">" & getCurrentIcon(strIconSmileQuestion,"","") & "</a>" & vbNewLine & _
	"		</td>" & vbNewLine & _
	"  </tr>" & vbNewLine & _
	"  <tr valign=""top"">" & vbNewLine & _
	"    	<td bgColor=""" & strPopUpTableColor & """ align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Show Featured Poll:</b> </font></td>" & vbNewLine & _
	"    	<td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"    	On: <input type=""radio"" name=""strFeaturedPoll"" value=""1"""
if strFeaturedPoll = "1" then Response.Write(" checked")
Response.Write ">Off: <input type=""radio"" name=""strFeaturedPoll"" value=""0"""
if strFeaturedPoll <> "1" then Response.Write(" checked")
Response.Write "></font><a href=""JavaScript:openWindow3('pop_config_help.asp?mode=pollmod#featuredpoll')"">" & getCurrentIcon(strIconSmileQuestion,"","") & "</a>" & vbNewLine & _
	"    	</td>" & vbNewLine & _
	"  </tr>" & vbNewLine & _
	"	<tr valign=""top"">" & vbNewLine & _
	"    	<td bgColor=""" & strPopUpTableColor & """ align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Show Featured Poll in seperate table:</b> </font></td>" & vbNewLine & _
	"    	<td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"    	On: <input type=""radio"" name=""strFPollTable"" value=""1"""
if strFPollTable = "1" then Response.Write(" checked")
Response.Write ">Off: <input type=""radio"" name=""strFPollTable"" value=""0"""
if strFPollTable <> "1" then Response.Write(" checked")
Response.Write "></font><a href=""JavaScript:openWindow3('pop_config_help.asp?mode=pollmod#fpolltable')"">" & getCurrentIcon(strIconSmileQuestion,"","") & "</a>" & vbNewLine & _
	"    	</td>" & vbNewLine & _
	"  </tr>" & vbNewLine & _
	"	<tr valign=""top"">" & vbNewLine & _
	"    	<td bgColor=""" & strPopUpTableColor & """ align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Open Featured Poll in New Window:</b> </font></td>" & vbNewLine & _
	"    	<td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"    	On: <input type=""radio"" name=""strFPollWindow"" value=""1"""
if strFPollWindow = "1" then Response.Write(" checked")
Response.Write ">Off: <input type=""radio"" name=""strFPollWindow"" value=""0"""
if strFPollWindow <> "1" then Response.Write(" checked")
Response.Write "></font><a href=""JavaScript:openWindow3('pop_config_help.asp?mode=pollmod#fpollwindow')"">" & getCurrentIcon(strIconSmileQuestion,"","") & "</a>" & vbNewLine & _
	"    	</td>" & vbNewLine & _
	"  </tr>" & vbNewLine & _
	"	<tr valign=""top"">" & vbNewLine & _
	"    	<td bgColor=""" & strPopUpTableColor & """ align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Hide Featured Poll after voting:</b> </font></td>" & vbNewLine & _
	"    	<td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"    	On: <input type=""radio"" name=""strHidePoll"" value=""1"""
if strHidePoll = "1" then Response.Write(" checked")
Response.Write ">Off: <input type=""radio"" name=""strHidePoll"" value=""0"""
if strHidePoll <> "1" then Response.Write(" checked")
Response.Write "></font><a href=""JavaScript:openWindow3('pop_config_help.asp?mode=pollmod#hidepoll')"">" & getCurrentIcon(strIconSmileQuestion,"","") & "</a>" & vbNewLine & _
	"    	</td>" & vbNewLine & _
	"	</tr>" & vbNewLine & _
	"	<tr valign=""top"">" & vbNewLine & _
	"    	<td bgColor=""" & strPopUpTableColor & """ align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Allow Users to View Poll Results Before Voting:</b> </font></td>" & vbNewLine & _
	"    	<td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"    	On: <input type=""radio"" name=""strVResults"" value=""1"""
if strVResults = "1" then Response.Write(" checked")
Response.Write ">Off: <input type=""radio"" name=""strVResults"" value=""0"""
if strVResults <> "1" then Response.Write(" checked")
Response.Write "></font><a href=""JavaScript:openWindow3('pop_config_help.asp?mode=pollmod#viewresults')"">" & getCurrentIcon(strIconSmileQuestion,"","") & "</a>" & vbNewLine & _
	"    	</td>" & vbNewLine & _
	"  </tr>" & vbNewLine & _
	"	<tr valign=""top"">" & vbNewLine & _
	"		<td bgColor=""" & strPopUpTableColor & """ align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Max. Number of Poll Answers:</b> </font></td>" & vbNewLine & _
	"		<td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"		<select name=""strMaxVotes"">" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,2) & " value=""2"">2</option>" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,3) & " value=""3"">3</option>" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,4) & " value=""4"">4</option>" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,5) & " value=""5"">5</option>" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,6) & " value=""6"">6</option>" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,7) & " value=""7"">7</option>" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,8) & " value=""8"">8</option>" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,9) & " value=""9"">9</option>" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,10) & " value=""10"">10</option>" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,11) & " value=""11"">11</option>" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,12) & " value=""12"">12</option>" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,13) & " value=""13"">13</option>" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,14) & " value=""14"">14</option>" & vbNewLine & _
	"				<option" & checkSelected(strMaxVotes,15) & " value=""15"">15</option>" & vbNewLine & _
	"    	</select>" & vbNewLine & _
	"		</font><a href=""JavaScript:openWindow3('pop_config_help.asp?mode=pollmod#maxvotes')"">" & getCurrentIcon(strIconSmileQuestion,"","") & "</a>" & vbNewLine & _
	"    	</td>" & vbNewLine & _
	"  </tr>" & vbNewLine & _
	"	<tr valign=""top"">" & vbNewLine & _
	"    	<td bgColor=""" & strPopUpTableColor & """ colspan=""2"" align=""center""><input type=""submit"" value=""Submit Poll Config""> <input type=""reset"" value=""Reset""></td>" & vbNewLine & _
	"  </tr>" & vbNewLine & _
	"</table>" & vbNewLine & _
	"		</td>" & vbNewLine & _
	"	</tr>" & vbNewLine & _
	"</table>" & vbNewLine & _
	"</form>" & vbNewLine & _
vbNewLine & _
	"<table border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"" width=""90%"">" & vbNewLine & _
	"  <tr>" & vbNewLine & _
	"    <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
	"<table align=""center"" border=""0"" cellPadding=""1"" cellSpacing=""1"" width=""100%"">" & vbNewLine & _
	"	<tr>" & vbNewLine & _
	"		<td bgcolor=""" & strHeadCellColor & """ align=""center"" vAlign=""top"" colspan=""2"">" & vbNewLine & _
	"  	<font color=""" & strCategoryFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Set Featured Poll</b></font>" & vbNewLine & _
	"		<a href=""JavaScript:openWindow3('pop_config_help.asp?mode=pollmod#setfeaturedpoll')"">" & getCurrentIcon(strIconSmileQuestion,"","") & "</a>" & vbNewLine & _
	"		</td>" & vbNewLine & _
	"	</tr>" & vbNewLine & _
	"	<tr>" & vbNewLine & _
	"		<td bgcolor=""" & strPopUpTableColor & """ vAlign=""top"" width=""100%"" colspan=""2"">" & vbNewLine & _
	"        <table border=""0"" width=""100%"">" & vbNewLine & _
	"            <tr>" & vbNewLine & _
	"                <td width=""70%"">" & vbNewLine & _
	"<form action=""admin_poll.asp"" method=""post"" name=""PollFilter"">" & vbNewLine & _
	"<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Show Active Polls</b></font>" & vbNewLine & _
	"    <select name=""PollDays"" onchange=""javascript:setDays();"">" & vbNewLine & _
	"      <option value=""0""" & checkSelected(ndays,0) & ">All Polls</option>" & vbNewLine & _
	"      <option value=""1""" & checkSelected(ndays,1) & ">From yesterday</option>" & vbNewLine & _
	"      <option value=""7""" & checkSelected(ndays,7) & ">From last 7 days</option>" & vbNewLine & _
	"      <option value=""14""" & checkSelected(ndays,14) & ">From last 14 days</option>" & vbNewLine & _
	"      <option value=""30""" & checkSelected(ndays,30) & ">From last 30 days</option>" & vbNewLine & _
	"      <option value=""60""" & checkSelected(ndays,60) & ">From last 60 days</option>" & vbNewLine & _
	"      <option value=""120""" & checkSelected(ndays,120) & ">From last 120 days</option>" & vbNewLine & _
	"      <option value=""365""" & checkSelected(ndays,365) & ">From last year</option>" & vbNewLine & _
	"    </select>" & vbNewLine & _
	"    <input type=""hidden"" name=""Cookie"" value=""1"">" & vbNewLine & _
	"</form>" & vbNewLine & _
vbNewLine & _
	"<form method=""POST"" action=""admin_poll.asp"">" & vbNewLine & _
	"<input type=""hidden"" name=""Save_Active"" value=""yes"">" & vbNewLine & _
	"<input type=""hidden"" name=""strPollID"" value=""" & strFeaturedPollID & """>" & vbNewLine & _
	"<table border=""0"" width=""95%"" 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 & """> </td>" & vbNewLine & _
	"        		<td align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Poll Name</font></b></td>" & vbNewLine & _
	"    				<td align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Posted By</font></b></td>" & vbNewLine & _
	"					<td align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Total Votes</font></b></td>" & vbNewLine & _
	"					<td align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Last Vote</font></b></td>" & vbNewLine & _
	"					<td align=""center"" bgcolor=""" & strHeadCellColor & """> </td>" & vbNewLine & _
	"				</tr>" & vbNewLine
if recPollsCount = "" then  '## No polls found in DB
	Response.Write "				<tr>" & vbNewLine & _
		"				<td bgcolor=""" & strForumCellColor & """ colspan=""6""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>No Polls Found</b></font></td>" & vbNewLine & _
		"				</tr>" & vbNewLine
else
	showbut = 1
	currForum = 0
		
	for Rowcount = 0 to recPollsCount
		Cat_Name = allPolls(0,Rowcount)
		Forum_ID = allPolls(1,Rowcount)
		Forum_Subject = allPolls(2,Rowcount)
		Topic_ID = allPolls(3,Rowcount)
		Topic_Subject = allPolls(4,Rowcount)
		Last_Vote = allPolls(5,Rowcount)
		Who_Votes = allPolls(6,Rowcount)
		nCount = 7
		for i = 1 to 15
			vAnswers(i) = allPolls(nCount,Rowcount)
			nCount = nCount + 1
			vCount(i) = allPolls(nCount,Rowcount)
			nCount = nCount + 1
		next
		Member_Name = allPolls(37,Rowcount)
		
		if currForum <> Forum_ID then
			Response.Write "	<tr>" & vbNewLine & _
				"		<td height=""20"" colspan=""6"" bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>" & ChkString(Cat_Name,"display") & "</b> / <b>" & chkString(Forum_Subject,"display") & "</b></font></td>" & vbNewLine & _
				"	</tr>" & vbNewLine
		end if
		
		'Go through all and get total
		nTotal = 0
		for nCount = 1 to 15
			if trim(vAnswers(nCount)) <> "" then
				nTotal = nTotal + vCount(nCount)
			end if
		next
		Response.Write "	<tr>" & vbNewLine & _
			"		<td bgcolor=""" & strForumCellColor & """ align=""center"">" & vbNewLine & _
			"			<input type=""radio"" value=""" & Topic_ID & """ name=""strFeaturedPollID"""
		if cint(strFeaturedPollID) = Topic_ID then Response.Write(" checked")
		Response.Write "></a></td>" & vbNewLine & _
			"		<td bgcolor=""" & strForumCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""javascript:openPollWindow('pop_poll.asp?TOPIC_ID=" & Topic_ID & "&p=p','650','400')"">" & chkString(left(Topic_Subject, 50),"display") & "</a> </font>"
		if Who_Votes = "members" then
			Response.write " <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """>(members only)</font>"
		end if
		Response.Write "</td>" & vbNewLine & _
			"		<td bgcolor=""" & strForumCellColor & """ valign=""top"" align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & chkString(Member_Name,"display") & "</font></td>" & vbNewLine & _
			"		<td bgcolor=""" & strForumCellColor & """ valign=""top"" align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & nTotal & "</font></td>" & vbNewLine & _
			"		<td bgcolor=""" & strForumCellColor & """ valign=""top"" align=""center"" nowrap><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strFooterFontSize & """><b>"
		if cint(nTotal) > 0 then Response.Write ChkDate(Last_Vote," ", true) else Response.Write("Never")
		Response.Write "</b></font></td>" & vbNewLine & _
			"		<td bgcolor=""" & strForumCellColor & """ valign=""top"" align=""center""><a href=""javaScript:openWindow('pop_delete.asp?poll=1&mode=Topic&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & "')"">" & getCurrentIcon(strIconTrashcan, "Delete Poll", "") & "</a></td>" & vbNewLine & _
			"	</tr>" & vbNewLine
		currForum = Forum_ID

	next
end if
Response.Write	"</table>" & vbNewLine & _
	"		</td>" & vbNewLine & _
	"	</tr>" & vbNewLine & _
	"</table>" & vbNewLine
if showbut = 1 then
	Response.Write "<br />" & vbNewLine & _
		"<div align=""center""><input type=""submit"" value=""Set Featured Poll"" name=""B1""></div>" & vbNewLine
end if
Response.Write "</form>" & vbNewLine

'on error resume next
Response.Write "				</td>" & vbNewLine & _
	"			</tr>" & vbNewLine & _
	"		</table>" & vbNewLine & _
	"		</td>" & vbNewLine & _
	"	</tr>" & vbNewLine & _
	"</table>" & vbNewLine & _
	"		</td>" & vbNewLine & _
	"	</tr>" & vbNewLine & _
	"</table><br />" & vbNewLine
WriteFooter

function checkSelected(chkval1, chkval2)
	if IsNumeric(chkval1) then chkval1 = cLng(chkval1)
	if (chkval1 = chkval2) then
		checkSelected = " selected"
	else
		checkSelected = ""
	end if
end function
%>



I then signed onto a regular member's account and when I clicked on my own poll post, I couldn't even vote. Instead, all that was there was the polling "results."


So, I'm going to just give up on this one.

Thank you guys so much!

I will have my sick grandbaby again today and there's just too much going on.

I've postponed my Grand Opening and I really need to get back to preparing for that.

I've got my backup files to go back to.

Again, thank you two SO MUCH! I'm really sorry I took up so much of your time with this!




"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 13 December 2013 :  10:24:56  Show Profile
quote:
Originally posted by MaGraham


Again, thank you two SO MUCH! I'm really sorry I took up so much of your time with this!

So you undid everything that was suggested in this topic?

Support Snitz Forums

Edited by - Davio on 13 December 2013 10:25:38
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 4.1 seconds. Powered By: Snitz Forums 2000 Version 3.4.07