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: General / Classic ASP versions(v3.4.XX)
 line breaks do not show up in new posts
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Dave Goldman
New Member

USA
65 Posts

Posted - 31 August 2009 :  14:44:43  Show Profile
Hey guys, I am just curious if anyone else has had a problem with the latest version. I setup my forum and when you go to add a post you can type it up, however when you post it there are no line breaks at all. So basically all of the sentances just run together.

TIA

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 31 August 2009 :  15:29:00  Show Profile
Never seen it before. Have you got a site it is happening on and a test logon so we can see what is going on by testing?

As you see here, you get the line breaks.

Cheers,

David Greening
Go to Top of Page

Dave Goldman
New Member

USA
65 Posts

Posted - 31 August 2009 :  15:38:20  Show Profile
Hey David. The site is http://www.TheGunnersAcademy.com/Forum/Default.asp

I have created the following account: snitzUser and password is snitzUser1
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 01 September 2009 :  03:24:40  Show Profile
Dave,

I see what you are getting now and find it a bit wierd. Have you put a mod on recently and then this started happening. It is like it is not cleaning the code and putting in the line breaks. Can you please post a text version of your topic.asp, post_info.asp and post.asp?

Would like to see what is in them and make sure that something has not been removed by mistake.

Cheers,

David Greening
Go to Top of Page

Dave Goldman
New Member

USA
65 Posts

Posted - 01 September 2009 :  07:59:05  Show Profile
Hey Dave, here you go. I have added several mods, however was very careful not to remove anything. The only code I did modify was for SSL redirect, and that shouldn't affect the posting.

This is all 3 files. It wouldn't let me add 3 scroll codes to the post or all three pages in one scroll code because it failed here with the following error:

Request object error 'ASP 0104 : 80004005'
Operation not Allowed
/forum/inc_header.asp, line 162

I have to add them as three seperate posts. Here is topic.asp

topic.asp
<%
'#################################################################################
'## Snitz Forums 2000 v3.4.07
'#################################################################################
'## Copyright (C) 2000-09 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"-->
<%

if (Request.QueryString("TOPIC_ID") = "" or IsNumeric(Request.QueryString("TOPIC_ID")) = False) and Request.Form("Method_Type") <> "login" and Request.Form("Method_Type") <> "logout" then
Response.Redirect "default.asp"
Response.End
else
Topic_ID = cLng(Request.QueryString("TOPIC_ID"))
end if
Dim ArchiveView, ArchiveLink, CColor
if request("ARCHIVE") = "true" then
strActivePrefix = strTablePrefix & "A_"
ArchiveView = "true"
ArchiveLink = "ARCHIVE=true&"
elseif request("ARCHIVE") <> "" then
Response.Redirect "default.asp"
Response.End
else
strActivePrefix = strTablePrefix
ArchiveView = ""
ArchiveLink = ""
end if

%>
<!--#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_subscription.asp" -->
<!--#INCLUDE FILE="inc_moderation.asp" -->
<%
Response.Write " <script language=""JavaScript"" type=""text/javascript"">" & vbNewLine & _
" function ChangePage(fnum){" & vbNewLine & _
" if (fnum == 1) {" & vbNewLine & _
" document.PageNum1.submit();" & vbNewLine & _
" }" & vbNewLine & _
" else {" & vbNewLine & _
" document.PageNum2.submit();" & vbNewLine & _
" }" & vbNewLine & _
" }" & vbNewLine & _
" </script>" & vbNewLine

mypage = request("whichpage")
if ((Trim(mypage) = "") or (IsNumeric(mypage) = False)) then mypage = 1
mypage = cLng(mypage)

if Request("SearchTerms") <> "" then
SearchLink = "&SearchTerms=" & Request("SearchTerms")
else
SearchLink = ""
end if

if strSignatures = "1" and strDSignatures = "1" then
if ViewSig(MemberID) <> "0" then
CanShowSignature = 1
end if
end if

'## Forum_SQL - Get original topic and check for the Category, Forum or Topic Status and existence
strSql = "SELECT M.M_NAME, M.M_RECEIVE_EMAIL, M.M_AIM, M.M_ICQ, M.M_MSN, M.M_YAHOO" & _
", M.M_TITLE, M.M_HOMEPAGE, M.MEMBER_ID, M.M_LEVEL, M.M_POSTS, M.M_COUNTRY, M.M_AVATAR_URL" & _
", T.T_DATE, T.T_SUBJECT, T.T_AUTHOR, T.TOPIC_ID, T.T_STATUS, T.T_LAST_EDIT" & _
", T.T_LAST_EDITBY, T.T_LAST_POST, T.T_SIG, T.T_REPLIES" & _
", C.CAT_STATUS, C.CAT_ID, C.CAT_NAME, C.CAT_SUBSCRIPTION, C.CAT_MODERATION" & _
", F.F_STATUS, F.FORUM_ID, F.F_SUBSCRIPTION, F.F_SUBJECT, F.F_MODERATION, T.T_MESSAGE"
if CanShowSignature = 1 then
strSql = strSql & ", M.M_SIG"
end if
strSql = strSql & " FROM " & strActivePrefix & "TOPICS T, " & strTablePrefix & "FORUM F, " & _
strTablePrefix & "CATEGORY C, " & strMemberTablePrefix & "MEMBERS M " & _
" WHERE T.TOPIC_ID = " & Topic_ID & _
" AND F.FORUM_ID = T.FORUM_ID " & _
" AND C.CAT_ID = T.CAT_ID " & _
" AND M.MEMBER_ID = T.T_AUTHOR "

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

if rsTopic.EOF then
recTopicCount = ""
else
recTopicCount = 1
Member_Name = rsTopic("M_NAME")
Member_ReceiveMail = rsTopic("M_RECEIVE_EMAIL")
Member_AIM = rsTopic("M_AIM")
Member_ICQ = rsTopic("M_ICQ")
Member_MSN = rsTopic("M_MSN")
Member_YAHOO = rsTopic("M_YAHOO")
Member_Title = rsTopic("M_TITLE")
Member_Homepage = rsTopic("M_HOMEPAGE")
TMember_ID = rsTopic("MEMBER_ID")
Member_Level = rsTopic("M_LEVEL")
Member_Posts = rsTopic("M_POSTS")
Member_Country = rsTopic("M_COUNTRY")
Member_Avatar = rsTopic("M_AVATAR_URL")
Topic_Date = rsTopic("T_DATE")
Topic_Subject = rsTopic("T_SUBJECT")
Topic_Author = rsTopic("T_AUTHOR")
TopicID = rsTopic("TOPIC_ID")
Topic_Status = rsTopic("T_STATUS")
Topic_LastEdit = rsTopic("T_LAST_EDIT")
Topic_LastEditby = rsTopic("T_LAST_EDITBY")
Topic_LastPost = rsTopic("T_LAST_POST")
Topic_Sig = rsTopic("T_SIG")
Topic_Replies = rsTopic("T_REPLIES")
Cat_Status = rsTopic("CAT_STATUS")
Cat_ID = rsTopic("CAT_ID")
Cat_Name = rsTopic("CAT_NAME")
Cat_Subscription = rsTopic("CAT_SUBSCRIPTION")
Cat_Moderation = rsTopic("CAT_MODERATION")
Forum_Status = rsTopic("F_STATUS")
Forum_ID = rsTopic("FORUM_ID")
Forum_Subject = rsTopic("F_SUBJECT")
Forum_Subscription = rsTopic("F_SUBSCRIPTION")
Forum_Moderation = rsTopic("F_MODERATION")
Topic_Message = rsTopic("T_MESSAGE")
if CanShowSignature = 1 then
Topic_MemberSig = trim(rsTopic("M_SIG"))
end if
end if

rsTopic.close
set rsTopic = nothing

if recTopicCount = "" then
if ArchiveView <> "true" then
Response.Redirect("topic.asp?ARCHIVE=true&" & ChkString(Request.QueryString,"sqlstring"))
else
Response.Redirect("default.asp")
end if
end if

if mLev = 4 then
AdminAllowed = 1
ForumChkSkipAllowed = 1
elseif mLev = 3 then
if chkForumModerator(Forum_ID, chkString(strDBNTUserName,"decode")) = "1" then
AdminAllowed = 1
ForumChkSkipAllowed = 1
else
if lcase(strNoCookies) = "1" then
AdminAllowed = 1
ForumChkSkipAllowed = 0
else
AdminAllowed = 0
ForumChkSkipAllowed = 0
end if
end if
elseif lcase(strNoCookies) = "1" then
AdminAllowed = 1
ForumChkSkipAllowed = 0
else
AdminAllowed = 0
ForumChkSkipAllowed = 0
end if

if strPrivateForums = "1" and (Request.Form("Method_Type") <> "login") and (Request.Form("Method_Type") <> "logout") and ForumChkSkipAllowed = 0 then
result = ChkForumAccess(Forum_ID, MemberID, true)
end if

if strModeration > 0 and Cat_Moderation > 0 and Forum_Moderation > 0 and AdminAllowed = 0 then
Moderation = "Y"
else
Moderation = "N"
end if

if mypage = -1 then
strSql = "SELECT REPLY_ID FROM " & strActivePrefix & "REPLY WHERE TOPIC_ID = " & Topic_ID & " "
if AdminAllowed = 0 then
strSql = strSql & " AND (R_STATUS < "
if Moderation = "Y" then
strSql = strSql & "2 "
else
strSql = strSql & "3 "
end if
strSql = strSql & "OR R_AUTHOR = " & MemberID & ") "
end if
strSql = strSql & "ORDER BY R_DATE ASC "

set rsReplies = Server.CreateObject("ADODB.Recordset")
if strDBType = "mysql" then
rsReplies.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
else
rsReplies.open strSql, my_Conn, adOpenStatic, adLockReadOnly, adCmdText
end if

if not rsReplies.EOF then
arrReplyData = rsReplies.GetRows(adGetRowsRest)
iReplyCount = UBound(arrReplyData, 2)

if Request.Querystring("REPLY_ID") <> "" and IsNumeric(Request.Querystring("REPLY_ID")) then
LastPostReplyID = cLng(Request.Querystring("REPLY_ID"))
for iReply = 0 to iReplyCount
intReplyID = arrReplyData(0, iReply)
if LastPostReplyID = intReplyID then
intPageNumber = ((iReply+1)/strPageSize)
exit for
end if
next
else
LastPostReplyID = cLng(arrReplyData(0, iReplyCount))
intPageNumber = ((iReplyCount+1)/strPageSize)
end if
if intPageNumber > cLng(intPageNumber) then
intPageNumber = cLng(intPageNumber) + 1
end if
strwhichpage = "whichpage=" & intPageNumber & "&"
else
strwhichpage = ""
end if

rsReplies.close
set rsReplies = nothing
my_Conn.close
set my_Conn = nothing

Response.Redirect "topic.asp?" & ArchiveLink & strwhichpage & "TOPIC_ID=" & Topic_ID & SearchLink & "#" & LastPostReplyID
Response.End
end if

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

if (Moderation = "Y" and Topic_Status > 1 and Topic_Author <> MemberID) then
Response.write "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><br />Viewing of this Topic is not permitted until it has been moderated.<br />Please try again later</font></p>" & vbNewLine & _
"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back</a></font></p><br />" & vbNewLine
WriteFooter
Response.end
else
Response.Write " <script language=""JavaScript"" type=""text/javascript"">" & vbNewLine & _
" <!--" & vbNewLine & _
" function jumpTo(s) {if (s.selectedIndex != 0) location.href = s.options[s.selectedIndex].value;return 1;}" & vbNewLine & _
" // -->" & vbNewLine & _
" </script>" & vbNewLine

'## Forum_SQL
strSql = "SELECT M.M_NAME, M.M_RECEIVE_EMAIL, M.M_AIM, M.M_ICQ, M.M_MSN, M.M_YAHOO"
strSql = strSql & ", M.M_TITLE, M.MEMBER_ID, M.M_HOMEPAGE, M.M_LEVEL, M.M_POSTS, M.M_COUNTRY, M.M_AVATAR_URL"
strSql = strSql & ", R.REPLY_ID, R.FORUM_ID, R.R_AUTHOR, R.TOPIC_ID, R.R_MESSAGE, R.R_LAST_EDIT"
strSql = strSql & ", R.R_LAST_EDITBY, R.R_SIG, R.R_STATUS, R.R_DATE"
if CanShowSignature = 1 then
strSql = strSql & ", M.M_SIG"
end if
strSql2 = " FROM " & strMemberTablePrefix & "MEMBERS M, " & strActivePrefix & "REPLY R "
strSql3 = " WHERE M.MEMBER_ID = R.R_AUTHOR "
strSql3 = strSql3 & " AND R.TOPIC_ID = " & Topic_ID & " "
' DEM --> if not a Moderator, all unapproved posts should not be viewed.
if AdminAllowed = 0 then
strSql3 = strSql3 & " AND (R.R_STATUS < "
if Moderation = "Y" then
' Ignore unapproved/rejected posts
strSql3 = strSql3 & "2"
else
' Ignore any previously rejected topic
strSql3 = strSql3 & "3"
end if
strSql3 = strSql3 & " OR R.R_AUTHOR = " & MemberID & ")"
end if
strSql4 = " ORDER BY R.R_DATE ASC"

if strDBType = "mysql" then 'MySql specific code
if mypage > 1 then
intOffset = cLng((mypage-1) * strPageSize)
strSql5 = " LIMIT " & intOffset & ", " & strPageSize & " "
end if

'## Forum_SQL - Get the total pagecount
strSql1 = "SELECT COUNT(R.TOPIC_ID) AS REPLYCOUNT "

set rsCount = my_Conn.Execute(strSql1 & strSql2 & strSql3)
iPageTotal = rsCount(0).value
rsCount.close
set rsCount = nothing

if iPageTotal > 0 then
maxpages = (iPageTotal \ strPageSize )
if iPageTotal mod strPageSize <> 0 then
maxpages = maxpages + 1
end if
if iPageTotal < (strPageSize + 1) then
intGetRows = iPageTotal
elseif (mypage * strPageSize) > iPageTotal then
intGetRows = strPageSize - ((mypage * strPageSize) - iPageTotal)
else
intGetRows = strPageSize
end if
else
iPageTotal = 0
maxpages = 0
end if

if iPageTotal > 0 then
set rsReplies = Server.CreateObject("ADODB.Recordset")
rsReplies.Open strSql & strSql2 & strSql3 & strSql4 & strSql5, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
arrReplyData = rsReplies.GetRows(intGetRows)
iReplyCount = UBound(arrReplyData, 2)
rsReplies.Close
set rsReplies = nothing
else
iReplyCount = ""
end if

else 'end MySql specific code

set rsReplies = Server.CreateObject("ADODB.Recordset")
rsReplies.cachesize = strPageSize
rsReplies.open strSql & strSql2 & strSql3 & strSql4, my_Conn, adOpenStatic, adLockReadOnly, adCmdText

if not (rsReplies.EOF or rsReplies.BOF) then
rsReplies.pagesize = strPageSize
rsReplies.absolutepage = mypage '**
maxpages = cLng(rsReplies.pagecount)
if maxpages >= mypage then
arrReplyData = rsReplies.GetRows(strPageSize)
iReplyCount = UBound(arrReplyData, 2)
else
iReplyCount = ""
end if
else '## No replies found in DB
iReplyCount = ""
end if

rsReplies.Close
set rsReplies = nothing
end if

Response.Write " <table border=""0"" width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""50%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" " & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBar,"","align=""absmiddle""")
if Cat_Status <> 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(Cat_Name,"display") & "</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""")
if ArchiveView = "true" then
Response.Write getCurrentIcon(strIconFolderArchived,"","align=""absmiddle""")
else
if Forum_Status <> 0 and Cat_Status <> 0 then
Response.Write getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""")
else
Response.Write getCurrentIcon(strIconFolderClosed,"","align=""absmiddle""")
end if
end if
Response.Write " <a href=""forum.asp?" & ArchiveLink & "FORUM_ID=" & Forum_ID & """>" & ChkString(Forum_Subject,"display") & "</a><br />" & vbNewLine
if ArchiveView = "true" then
Response.Write " " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderArchived,"","align=""absmiddle""") & " "
elseif Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0 then
Response.Write " " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpenTopic,"","align=""absmiddle""") & " "
else
Response.Write " " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderClosedTopic,"","align=""absmiddle""") & " "
end if
if Request.QueryString("SearchTerms") <> "" then
Response.Write SearchHiLite(ChkString(Topic_Subject,"title"))
else
Response.Write ChkString(Topic_Subject,"title")
end if
Response.Write "</font></td>" & vbNewLine & _
" <td align=""center"" width=""50%"">" & vbNewLine
call PostingOptions()
Response.Write "</td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
if maxpages > 1 then
Response.Write "<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""1"" width=""95%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""right"" valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>"
if mypage > 1 then Response.Write("<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&whichpage=" & mypage-1 & SearchLink & """ title=""Goto the Previous page in this Topic""" & dWStatus("Goto the Previous page in this Topic") & ">Previous Page</a>")
'if mypage > 1 then Response.Write("<a href=""javascript: onclick=document.PageNum1.whichpage.value=" & mypage-1 & ";document.PageNum1.submit();"" title=""Goto the Previous page in this Topic""" & dWStatus("Goto the Previous page in this Topic") & ">Previous Page</a>")
if mypage > 1 and mypage < maxpages then Response.Write(" | ")
if mypage < maxpages then Response.Write("<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&whichpage=" & mypage+1 & SearchLink & """ title=""Goto the Next page in this Topic""" & dWStatus("Goto the Next page in this Topic") & ">Next Page</a>")
'if mypage < maxpages then Response.Write("<a href=""javascript: onclick=document.PageNum1.whichpage.value=" & mypage+1 & ";document.PageNum1.submit();"" title=""Goto the Next page in this Topic""" & dWStatus("Goto the Next page in this Topic") & ">Next Page</a>")
Response.Write "</td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
end if
Response.Write "<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""95%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""" & strTopicWidthLeft & """"
if lcase(strTopicNoWrapLeft) = "1" then Response.Write(" nowrap")
Response.Write "><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Author</font></b></td>" & vbNewLine & _
" <td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""" & strTopicWidthRight & """"
if lcase(strTopicNoWrapRight) = "1" then Response.Write(" nowrap")
Response.Write "><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>" & vbNewLine
if strShowTopicNav = "1" then
Call Topic_nav()
else
Response.Write("Topic")
end if
Response.Write "</font></b></td>" & vbNewLine
if (AdminAllowed = 1) then
if maxpages > 1 then
Call DropDownPaging(1)
Response.Write " <td align=""right"" bgcolor=""" & strHeadCellColor & """ nowrap>" & vbNewLine
call AdminOptions()
Response.Write " </td>" & vbNewLine
else
Response.Write " <td align=""right"" bgcolor=""" & strHeadCellColor & """ nowrap>" & vbNewLine
call AdminOptions()
Response.Write " </td>" & vbNewLine
end if
else
if maxpages > 1 then
Call DropDownPaging(1)
else
Response.Write " <td align=""right"" bgcolor=""" & strHeadCellColor & """ nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> </font></td>" & vbNewLine
end if
end if
Response.Write " </tr>" & vbNewLine

if mypage = 1 then
Call GetFirst()
end if

'## Forum_SQL
strSql = "UPDATE " & strActivePrefix & "TOPICS "
strSql = strSql & " SET T_VIEW_COUNT = (T_VIEW_COUNT + 1) "
strSql = strSql & " WHERE (TOPIC_ID = " & Topic_ID & ")"

my_conn.Execute (strSql),,adCmdText + adExecuteNoRecords

if iReplyCount = "" then '## No replies found in DB
' Nothing
else
intI = 0

rM_NAME = 0
rM_RECEIVE_EMAIL = 1
rM_AIM = 2
rM_ICQ = 3
rM_MSN = 4
rM_YAHOO = 5
rM_TITLE = 6
rMEMBER_ID = 7
rM_HOMEPAGE = 8
rM_LEVEL = 9
rM_POSTS = 10
rM_COUNTRY = 11
rM_Avatar = 12
rREPLY_ID = 13
rFORUM_ID = 14
rR_AUTHOR = 15
rTOPIC_ID = 16
rR_MESSAGE = 17
rR_LAST_EDIT = 18
rR_LAST_EDITBY = 19
rR_SIG = 20
rR_STATUS = 21
rR_DATE = 22
if CanShowSignature = 1 then
rM_SIG = 23
end if

for iForum = 0 to iReplyCount

Reply_MemberName = arrReplyData(rM_NAME, iForum)
Reply_MemberReceiveEmail = arrReplyData(rM_RECEIVE_EMAIL, iForum)
Reply_MemberAIM = arrReplyData(rM_AIM, iForum)
Reply_MemberICQ = arrReplyData(rM_ICQ, iForum)
Reply_MemberMSN = arrReplyData(rM_MSN, iForum)
Reply_MemberYAHOO = arrReplyData(rM_YAHOO, iForum)
Reply_MemberTitle = arrReplyData(rM_TITLE, iForum)
Reply_MemberID = arrReplyData(rMEMBER_ID, iForum)
Reply_MemberHomepage = arrReplyData(rM_HOMEPAGE, iForum)
Reply_MemberLevel = arrReplyData(rM_LEVEL, iForum)
Reply_MemberPosts = arrReplyData(rM_POSTS, iForum)
Reply_MemberCountry = arrReplyData(rM_COUNTRY, iForum)
Reply_MemberAvatar = arrReplyData(rM_Avatar, iForum)
Reply_ReplyID = arrReplyData(rREPLY_ID, iForum)
Reply_ForumID = arrReplyData(rFORUM_ID, iForum)
Reply_Author = arrReplyData(rR_AUTHOR, iForum)
Reply_TopicID = arrReplyData(rTOPIC_ID, iForum)
Reply_Content = arrReplyData(rR_MESSAGE, iForum)
Reply_LastEdit = arrReplyData(rR_LAST_EDIT, iForum)
Reply_LastEditBy = arrReplyData(rR_LAST_EDITBY, iForum)
Reply_Sig = arrReplyData(rR_SIG, iForum)
Reply_Status = arrReplyData(rR_STATUS, iForum)
Reply_Date = arrReplyData(rR_DATE, iForum)
if CanShowSignature = 1 then
Reply_MemberSig = trim(arrReplyData(rM_SIG, iForum))
end if

if intI = 0 then
CColor = strAltForumCellColor
else
CColor = strForumCellColor
end if

Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & CColor & """ valign=""top"" width=""" & strTopicWidthLeft & """"
if lcase(strTopicNoWrapLeft) = "1" then Response.Write(" nowrap")
Response.Write ">" & vbNewLine & _
" <p><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b><span class=""spnMessageText"">" & profileLink(ChkString(Reply_MemberName,"display"),Reply_Author) & "</span></b></font><br />" & vbNewLine
if strShowRank = 1 or strShowRank = 3 then
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>" & ChkString(getMember_Level(Reply_MemberTitle, Reply_MemberLevel, Reply_MemberPosts),"display") & "</small></font><br />" & vbNewLine
end if
if strShowRank = 2 or strShowRank = 3 then
Response.Write " " & getStar_Level(Reply_MemberLevel, Reply_MemberPosts) & "<br />" & vbNewLine
end if
Response.Write " </p>" & vbNewLine & _
" <p>" & vbNewLine
' ##### Avatar Mod #####
'if Reply_MemberAvatar="1" then Reply_MemberAvatar="noavatar.gif"
if Reply_MemberAvatar <> "noavatar.gif" then
Response.Write "<table width=""" & intAvatarWidth & """ height= """ & intAvatarHeight & """ cellspacing=""0"" cellpadding=""0"" border=""0"" style="" background-image: url('" & Reply_MemberAvatar & "');background-repeat: no-repeat; background-position: center;"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
end if
' ### Avatar Mod End ###
if strCountry = "1" and trim(Reply_MemberCountry) <> "" then
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>" & Reply_MemberCountry & "</small></font><br />" & vbNewLine
end if
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>" & Reply_MemberPosts & " Posts</small></font></p></td>" & vbNewLine & _
" <td bgcolor=""" & CColor & """ height=""100%"" width=""" & strTopicWidthRight & """"
if lcase(strTopicNoWrapRight) = "1" then Response.Write(" nowrap")
if (AdminAllowed = 1) and (maxpages > 1) then
Response.Write (" colspan=""3"" ")
else
Response.Write (" colspan=""2"" ")
end if
Response.Write "valign=""top""><a name=""" & Reply_ReplyID & """></a>" & vbNewLine & _
" <table width=""100%"" height=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td valign=""top"">" & vbNewLine
' DEM --> Start of Code altered for moderation
if Reply_Status < 2 then
Response.Write " " & getCurrentIcon(strIconPosticon,"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Posted - " & ChkDate(Reply_Date, " : " ,true) & "</font>" & vbNewline
elseif Reply_Status = 2 then
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>NOT MODERATED!!!</font>" & vbNewline
elseif Reply_Status = 3 then
Response.Write " " & getCurrentIcon(strIconPosticonHold,"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>ON HOLD</font>" & vbNewline
end if
' DEM --> End of Code added for moderation.
Response.Write " " & profileLink(getCurrentIcon(strIconProfile,"Show Profile","align=""absmiddle"" hspace=""6"""),Reply_MemberID) & vbNewLine
if mLev > 2 or Reply_MemberReceiveEmail = "1" then
if (mlev <> 0) or (mlev = 0 and strLogonForMail <> "1") then
Response.Write " <a href=""JavaScript:openWindow('pop_mail.asp?id=" & Reply_MemberID & "')"">" & getCurrentIcon(strIconEmail,"Email Poster","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if strHomepage = "1" then
if Reply_MemberHomepage <> " " then
Response.Write " <a href=""" & Reply_MemberHomepage & """ target=""_blank"">" & getCurrentIcon(strIconHomepage,"Visit " & ChkString(Reply_MemberName,"display") & "'s Homepage","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if (AdminAllowed = 1 or Reply_MemberID = MemberID) then
if (Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0) or (AdminAllowed = 1) then
Response.Write " <a href=""post.asp?" & ArchiveLink & "method=Edit&REPLY_ID=" & Reply_ReplyID & "&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconEditTopic,"Edit Reply","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if (strAIM = "1") then
if Trim(Reply_MemberAIM) <> "" then
Response.Write " <a href=""JavaScript:openWindow('pop_messengers.asp?mode=AIM&ID=" & Reply_MemberID & "')"">" & getCurrentIcon(strIconAIM,"Send " & ChkString(Reply_MemberName,"display") & " an AOL message","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if strICQ = "1" then
if Trim(Reply_MemberICQ) <> "" then
Response.Write " <a href=""JavaScript:openWindow6('pop_messengers.asp?mode=ICQ&ID=" & Reply_MemberID & "')"">" & getCurrentIcon(strIconICQ,"Send " & ChkString(Reply_MemberName,"display") & " an ICQ Message","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if (strMSN = "1") then
if Trim(Reply_MemberMSN) <> "" then
Response.Write " <a href=""JavaScript:openWindow('pop_messengers.asp?mode=MSN&ID=" & Reply_MemberID & "')"">" & getCurrentIcon(strIconMSNM,"Click to see " & ChkString(Reply_MemberName,"display") & "'s MSN Messenger address","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if strYAHOO = "1" then
if Trim(Reply_MemberYAHOO) <> "" then
Response.Write " <a href=""http://edit.yahoo.com/config/send_webmesg?.target=" & ChkString(Reply_MemberYAHOO, "urlpath") & "&.src=pg"" target=""_blank"">" & getCurrentIcon(strIconYahoo,"Send " & ChkString(Reply_MemberName,"display") & " a Yahoo! Message","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if ((Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status = 1) or (AdminAllowed = 1 and Topic_Status <= 1)) and ArchiveView = "" then
Response.Write " <a href=""post.asp?method=ReplyQuote&REPLY_ID=" & Reply_ReplyID & "&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconReplyTopic,"Reply with Quote","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
if (strIPLogging = "1") then
if (AdminAllowed = 1) then
Response.Write " <a href=""JavaScript:openWindow('pop_viewip.asp?" & ArchiveLink & "mode=getIP&REPLY_ID=" & Reply_ReplyID & "&FORUM_ID=" & Forum_ID & "')"">" & getCurrentIcon(strIconIP,"View user's IP address","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if (AdminAllowed = 1 or Reply_MemberID = MemberID) then
if (Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0) or (AdminAllowed = 1) then
Response.Write " <a href=""JavaScript:openWindow('pop_delete.asp?" & ArchiveLink & "mode=Reply&REPLY_ID=" & Reply_ReplyID & "&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & "')"">" & getCurrentIcon(strIconDeleteReply,"Delete Reply","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
' DEM --> Start of Code added for Full Moderation
if (AdminAllowed = 1 and Reply_Status > 1) then
ReplyString = "REPLY_ID=" & Reply_ReplyID & "&CAT_ID=" & Cat_ID & "&FORUM_ID=" & Forum_ID & "&TOPIC_ID=" & Topic_ID
Response.Write " <a href=""JavaScript:openWindow('pop_moderate.asp?" & ReplyString & "')"">" & getCurrentIcon(strIconFolderModerate,"Approve/Hold/Reject this Reply","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewline
end if
' DEM --> End of Code added for Full Moderation
end if
Response.Write " <hr noshade size=""" & strFooterFontSize & """></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td valign=""top"" height=""100%""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><span class=""spnMessageText"" id=""msg"">"
if Request.QueryString("SearchTerms") <> "" then
Response.Write SearchHiLite(formatStr(Reply_Content))
else
Response.Write formatStr(Reply_Content)
end if
Response.Write "</span id=""msg""></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
if CanShowSignature = 1 and Reply_Sig = 1 and Reply_MemberSig <> "" then
Response.Write " <tr>" & vbNewLine & _
" <td valign=""bottom""><hr noshade size=""" & strFooterFontSize & """><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><span class=""spnMessageText"">" & formatStr(Reply_MemberSig) & "</span></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
if strEditedByDate = "1" and Reply_LastEditBy <> "" then
if Reply_LastEditBy <> Reply_Author then
Reply_LastEditByName = getMemberName(Reply_LastEditBy)
else
Reply_LastEditByName = chkString(Reply_MemberName,"display")
end if
Response.Write " <tr>" & vbNewLine & _
" <td valign=""bottom""><hr noshade size=""" & strFooterFontSize & """ color=""" & CColor & """><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """>" & _
"Edited by - " & Reply_LastEditByName & " on " & chkDate(Reply_LastEdit, " " ,true) & "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
Response.Write " <tr>" & vbNewLine & _
" <td valign=""bottom"" align=""right"" height=""20""><a href=""#top"">" & getCurrentIcon(strIconGoUp,"Go to Top of Page","align=""right""") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
intI = intI + 1
if intI = 2 then
intI = 0
end if
next
end if
Response.Write " <tr>" & vbNewLine
if maxpages > 1 then
Call DropDownPaging(2)
else
Response.Write " <td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""" & strTopicWidthLeft & """"
if lcase(strTopicNoWrapLeft) = "1" then Response.Write(" nowrap")
Response.Write "><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """> </font></b></td>" & vbNewLine
end if
Response.Write " <td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""" & strTopicWidthRight & """"
if lcase(strTopicNoWrapRight) = "1" then Response.Write(" nowrap")
'if maxpages > 1 and (AdminAllowed = 1) then Response.Write(" colspan=""2""")
Response.Write "><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>" & vbNewLine
if strShowTopicNav = "1" then
Call Topic_nav()
else
Response.Write("Topic")
end if
Response.Write "</font></b></td>" & vbNewLine
if (AdminAllowed = 1) then
if maxpages > 1 then
Response.Write " <td align=""right"" bgcolor=""" & strHeadCellColor & """ nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> </font></td>" & vbNewLine
end if
Response.Write " <td align=""right"" bgcolor=""" & strHeadCellColor & """ nowrap>" & vbNewLine
call AdminOptions()
Response.Write "</td>" & vbNewLine
else
Response.Write " <td align=""right"" bgcolor=""" & strHeadCellColor & """ nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> </font></td>" & vbNewLine
end if
Response.Write " </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
if maxpages > 1 then
Response.Write "<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""1"" width=""95%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"" valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>"
if mypage > 1 then Response.Write("<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&whichpage=" & mypage-1 & SearchLink & """ title=""Goto the Previous page in this Topic""" & dWStatus("Goto the Previous page in this Topic") & ">Previous Page</a>")
'if mypage > 1 then Response.Write("<a href=""javascript: onclick=document.PageNum1.whichpage.value=" & mypage-1 & ";document.PageNum1.submit();"" title=""Goto the Previous page in this Topic""" & dWStatus("Goto the Previous page in this Topic") & ">Previous Page</a>")
if mypage > 1 and mypage < maxpages then Response.Write(" | ")
if mypage < maxpages then Response.Write("<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&whichpage=" & mypage+1 & SearchLink & """ title=""Goto the Next page in this Topic""" & dWStatus("Goto the Next page in this Topic") & ">Next Page</a>")
'if mypage < maxpages then Response.Write("<a href=""javascript: onclick=document.PageNum1.whichpage.value=" & mypage+1 & ";document.PageNum1.submit();"" title=""Goto the Next page in this Topic""" & dWStatus("Goto the Next page in this Topic") & ">Next Page</a>")
Response.Write "</td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
end if
Response.Write "<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""95%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td>" & vbNewLine & _
" <table width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center"" valign=""top"" width=""50%"">" & vbNewLine
Call PostingOptions()
Response.Write "</td>" & vbNewLine & _
" <td align=""right"" valign=""top"" width=""50%"" nowrap>" & vbNewLine
%>
<!--#INCLUDE FILE="inc_jump_to.asp" -->
<%
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine

if strShowQuickReply = "1" and strDBNTUserName <> "" and ((Cat_Status = 1) and (Forum_Status = 1) and (Topic_Status = 1)) and ArchiveView = "" then
call QuickReply()
end if

WriteFooter
end if

sub GetFirst()
CColor = strForumFirstCellColor
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumFirstCellColor & """ valign=""top"" width=""" & strTopicWidthLeft & """"
if lcase(strTopicNoWrapLeft) = "1" then Response.Write(" nowrap")
Response.Write ">" & vbNewLine & _
" <p><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b><span class=""spnMessageText"">" & profileLink(ChkString(Member_Name,"display"),TMember_ID) & "</span></b></font><br />" & vbNewLine
if strShowRank = 1 or strShowRank = 3 then
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>" & ChkString(getMember_Level(Member_Title, Member_Level, Member_Posts),"display") & "</small></font><br />" & vbNewLine
end if
if strShowRank = 2 or strShowRank = 3 then
Response.Write " " & getStar_Level(Member_Level, Member_Posts) & "<br />" & vbNewLine
end if
Response.Write " </p>" & vbNewLine & _
" <p>" & vbNewLine
' ##### Avatar Mod #####
if (Member_Avatar > " ") and (Member_Avatar <> "1") and (Member_Avatar <> "noavatar.gif") then
Response.Write "<table width=""" & intAvatarWidth & """ height= """ & intAvatarHeight & """ cellspacing=""0"" cellpadding=""0"" border=""0"" style="" background-image: url('" & Member_Avatar & "');background-repeat: no-repeat; background-position: center;"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
end if
' ### Avatar Mod End ###
if strCountry = "1" and trim(Member_Country) <> "" then
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>" & Member_Country & "</small></font><br />" & vbNewLine
end if
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>" & Member_Posts & " Posts</small></font></p></td>" & vbNewLine & _
" <td bgcolor=""" & strForumFirstCellColor & """ width=""" & strTopicWidthRight & """"
if lcase(strTopicNoWrapRight) = "1" then Response.Write(" nowrap")
if (AdminAllowed = 1) and (maxpages > 1) then
Response.Write (" colspan=""3"" ")
else
Response.Write (" colspan=""2"" ")
end if
Response.Write "valign=""top"">" & vbNewLine & _
" <table width=""100%"" height=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td valign=""top"">" & vbNewLine
if Topic_Status < 2 then
Response.Write " " & getCurrentIcon(strIconPosticon,"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Posted - " & ChkDate(Topic_Date, " : " ,true) & "</font>" & vbNewline
elseif Topic_Status = 2 then
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>NOT MODERATED!!!</font>" & vbNewline
elseif Topic_Status = 3 then
Response.Write " " & getCurrentIcon(strIconPosticonHold,"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>ON HOLD</font>" & vbNewline
end if
Response.Write " " & profileLink(getCurrentIcon(strIconProfile,"Show Profile","align=""absmiddle"" hspace=""6"""),TMember_ID) & vbNewLine
if mLev > 2 or Member_ReceiveMail = "1" then
if (mlev <> 0) or (mlev = 0 and strLogonForMail <> "1") then
Response.Write " <a href=""JavaScript:openWindow('pop_mail.asp?id=" & TMember_ID & "')"">" & getCurrentIcon(strIconEmail,"Email Poster","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if (strHomepage = "1") then
if Member_Homepage <> " " then
Response.Write " <a href=""" & Member_Homepage & """ target=""_blank"">" & getCurrentIcon(strIconHomepage,"Visit " & ChkString(Member_Name,"display") & "'s Homepage","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if (AdminAllowed = 1 or TMember_ID = MemberID) then
if ((Cat_Status <> 0) and (Forum_Status <> 0) and (Topic_Status <> 0)) or (AdminAllowed = 1) then
Response.Write " <a href=""post.asp?" & ArchiveLink & "method=EditTopic&REPLY_ID=" & Topic_ID & "&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconEditTopic,"Edit Topic","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if (strAIM = "1") then
if Trim(Member_AIM) <> "" then
Response.Write " <a href=""JavaScript:openWindow('pop_messengers.asp?mode=AIM&ID=" & TMember_ID & "')"">" & getCurrentIcon(strIconAIM,"Send " & ChkString(Member_Name,"display") & " an AOL message","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if (strICQ = "1") then
if Trim(Member_ICQ) <> "" then
Response.Write " <a href=""JavaScript:openWindow6('pop_messengers.asp?mode=ICQ&ID=" & TMember_ID & "')"">" & getCurrentIcon(strIconICQ,"Send " & ChkString(Member_Name,"display") & " an ICQ Message","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if (strMSN = "1") then
if Trim(Member_MSN) <> "" then
Response.Write " <a href=""JavaScript:openWindow('pop_messengers.asp?mode=MSN&ID=" & TMember_ID & "')"">" & getCurrentIcon(strIconMSNM,"Click to see " & ChkString(Member_Name,"display") & "'s MSN Messenger address","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if (strYAHOO = "1") then
if Trim(Member_YAHOO) <> "" then
Response.Write " <a href=""http://edit.yahoo.com/config/send_webmesg?.target=" & ChkString(Member_YAHOO, "urlpath") & "&.src=pg"" target=""_blank"">" & getCurrentIcon(strIconYahoo,"Send " & ChkString(Member_Name,"display") & " a Yahoo! Message","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if ((Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status = 1) or (AdminAllowed = 1 and Topic_Status <= 1) and ArchiveView = "" ) then
Response.Write " <a href=""post.asp?method=TopicQuote&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconReplyTopic,"Reply with Quote","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
if (strIPLogging = "1") then
if (AdminAllowed = 1) then
Response.Write " <a href=""JavaScript:openWindow('pop_viewip.asp?" & ArchiveLink & "mode=getIP&TOPIC_ID=" & TopicID & "&FORUM_ID=" & Forum_ID & "')"">" & getCurrentIcon(strIconIP,"View user's IP address","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if (AdminAllowed = 1) or (TMember_ID = MemberID and Topic_Replies < 1) then
Response.Write " <a href=""JavaScript:openWindow('pop_delete.asp?" & ArchiveLink & "mode=Topic&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & "&CAT_ID=" & Cat_ID & "')"">" & getCurrentIcon(strIconDeleteReply,"Delete Topic","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
' DEM --> Start of Code added for Full Moderation
if (AdminAllowed = 1 and Topic_Status > 1) then
TopicString = "TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & "&CAT_ID=" & Cat_ID
Response.Write " <a href=""JavaScript:openWindow('pop_moderate.asp?" & TopicString & "')"">" & getCurrentIcon(strIconFolderModerate,"Approve/Hold/Reject this Topic","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewline
End if
' End of Code added for Full Moderation
Response.Write " <hr noshade size=""" & strFooterFontSize & """></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td valign=""top"" height=""100%""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><span class=""spnMessageText"" id=""msg"">"
if Request.QueryString("SearchTerms") <> "" then
Response.Write SearchHiLite(formatStr(Topic_Message))
else
Response.Write formatStr(Topic_Message)
end if
Response.Write "</span id=""msg""></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
if CanShowSignature = 1 and Topic_Sig = 1 and Topic_MemberSig <> "" then
Response.Write " <tr>" & vbNewLine & _
" <td valign=""bottom""><hr noshade size=""" & strFooterFontSize & """><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><span class=""spnMessageText"">" & formatStr(Topic_MemberSig) & "</span></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
if strEditedByDate = "1" and Topic_LastEditBy <> "" then
if Topic_LastEditBy <> Topic_Author then
Topic_LastEditByName = getMemberName(Topic_LastEditBy)
else
Topic_LastEditByName = chkString(Member_Name,"display")
end if
Response.Write " <tr>" & vbNewLine & _
" <td valign=""bottom""><hr noshade size=""" & strFooterFontSize & """ color=""" & strForumFirstCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """>" &_
"Edited by - " & Topic_LastEditByName & " on " & chkDate(Topic_LastEdit, " ", true) & "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
Response.Write " </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
End Sub


sub PostingOptions()
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
if (mlev = 4 or mlev = 3 or mlev = 2 or mlev = 1) or (lcase(strNoCookies) = "1") or (strDBNTUserName = "") then
if ((Cat_Status = 1) and (Forum_Status = 1)) then
Response.Write " <a href=""post.asp?method=Topic&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolderNewTopic,"","align=""absmiddle""") & "</a> <a href=""post.asp?method=Topic&FORUM_ID=" & Forum_ID & """>New Topic</a>" & vbNewLine
else
if (AdminAllowed = 1) then
Response.Write " <a href=""post.asp?method=Topic&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolderLocked,"","align=""absmiddle""") & "</a> <a href=""post.asp?method=Topic&FORUM_ID=" & Forum_ID & """>New Topic</a>" & vbNewLine
else
Response.Write " " & getCurrentIcon(strIconFolderLocked,"","align=""absmiddle""") & " Forum Locked" & vbNewLine
end if
end if
if ((Cat_Status = 1) and (Forum_Status = 1) and (Topic_Status = 1)) and ArchiveView = "" then
Response.Write " <a href=""post.asp?method=Reply&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconReplyTopic,"","align=""absmiddle""") & "</a> <a href=""post.asp?method=Reply&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & """>Reply to Topic</a>" & vbNewLine
else
if ((AdminAllowed = 1 and Topic_Status <= 1) and ArchiveView = "") then
Response.Write " <a href=""post.asp?method=Reply&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & """>"
' DEM --> Added if statement to show normal icon for unmoderated posts.
if Topic_Status = 1 and Cat_Status <> 0 and Forum_Status <> 0 then
Response.Write getCurrentIcon(strIconReplyTopic,"","align=""absmiddle""") & "</a> "
else
Response.Write getCurrentIcon(strIconClosedTopic,"","align=""absmiddle""") & "</a> "
end if
Response.Write "<a href=""post.asp?" & ArchiveLink & "method=Reply&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & """>Reply to Topic</a>" & vbNewLine
else
if Topic_Status = 0 then
Response.Write getCurrentIcon(strIconClosedTopic,"","align=""absmiddle""") & " Topic Locked" & vbNewline
end if
end if
end if
if lcase(strEmail) = "1" and Topic_Status < 2 then
if Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0 and mLev > 0 then
if strSubscription > 0 and Cat_Subscription > 0 and Forum_Subscription > 0 then
if InArray(strTopicSubs, Topic_ID) then
Response.Write " <br />" & ShowSubLink ("U", Cat_ID, Forum_ID, Topic_ID, "Y") & vbNewLine
elseif strBoardSubs <> "Y" and not(InArray(strForumSubs,Forum_ID) or InArray(strCatSubs,Cat_ID)) then
Response.Write " <br />" & ShowSubLink ("S", Cat_ID, Forum_ID, Topic_ID, "Y") & vbNewLine
end if
end if
end if
if ((mlev <> 0) or (mlev = 0 and strLogonForMail <> "1")) and lcase(strShowSendToFriend) = "1" then
Response.Write " <br /><a href=""JavaScript:openWindow('pop_send_to_friend.asp?url=" & strForumURL & "topic.asp?TOPIC_ID=" & Topic_ID & "')"">" & getCurrentIcon(strIconSendTopic,"","align=""absmiddle""") & "</a> <a href=""JavaScript:openWindow('pop_send_to_friend.asp?url=" & strForumURL & "topic.asp?TOPIC_ID=" & Topic_ID & "')"">Send Topic to a Friend</a>" & vbNewLine
end if
end if
if lcase(strShowPrinterFriendly) = "1" and Topic_Status < 2 then
Response.Write " <br /><a href=""JavaScript:openWindow5('pop_printer_friendly.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "')"">" & getCurrentIcon(strIconPrint,"","align=""absmiddle""") & "</a> <a href=""JavaScript:openWindow5('pop_printer_friendly.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "')"">Printer Friendly</a>" & vbNewLine
end if
end if
Response.Write " </font>"
end sub

sub AdminOptions()
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
if (AdminAllowed = 1) or (lcase(strNoCookies) = "1") then
if (Cat_Status = 0) then
if (mlev = 4) then
Response.Write " <a href=""JavaScript:openWindow('pop_open.asp?mode=Category&CAT_ID=" & Cat_ID & "')"">" & getCurrentIcon(strIconFolderUnlocked,"Un-Lock Category","") & "</a>" & vbNewLine
else
Response.Write " " & getCurrentIcon(strIconFolderUnlocked,"Category Locked","") & vbNewLine
end if
else
if (Forum_Status = 0) then
Response.Write " <a href=""JavaScript:openWindow('pop_open.asp?mode=Forum&FORUM_ID=" & Forum_ID & "&CAT_ID=" & Cat_ID & "')"">" & getCurrentIcon(strIconFolderUnlocked,"Un-Lock Forum","") & "</a>" & vbNewLine
else
if (Topic_Status <> 0) then
Response.Write " <a href=""JavaScript:openWindow('pop_lock.asp?mode=Topic&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & "&CAT_ID=" & Cat_ID & "')"">" & getCurrentIcon(strIconFolderLocked,"Lock Topic","") & "</a>" & vbNewLine
else
Response.Write " <a href=""JavaScript:openWindow('pop_open.asp?mode=Topic&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & "&CAT_ID=" & Cat_ID & "')"">" & getCurrentIcon(strIconFolderUnlocked,"Un-Lock Topic","") & "</a>" & vbNewLine
end if
end if
end if
if ((Cat_Status <> 0) and (Forum_Status <> 0) and (Topic_Status <> 0)) or (AdminAllowed = 1) then
Response.Write " <a href=""post.asp?" & ArchiveLink & "method=EditTopic&REPLY_ID=" & Topic_ID & "&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolderPencil,"Edit Topic","hspace=""0""") & "</a>" & vbNewLine
end if
Response.Write " <a href=""JavaScript:openWindow('pop_delete.asp?" & ArchiveLink & "mode=Topic&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & "&CAT_ID=" & Cat_ID & "')"">" & getCurrentIcon(strIconFolderDelete,"Delete Topic","") & "</a>" & vbNewLine & _
" <a href=""post.asp?method=Topic&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolderNewTopic,"New Topic","") & "</a>" & vbNewLine
if Topic_Status <= 1 and ArchiveView = "" then
Response.Write " <a href=""post.asp?method=Reply&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconReplyTopic,"Reply to Topic","") & "</a>" & vbNewLine
end if
end if
' DEM --> Start of Code added for Full Moderation
if (AdminAllowed = 1 and CheckForUnModeratedPosts("TOPIC", Cat_ID, Forum_ID, Topic_ID) > 0) then
TopicString = "TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & "&CAT_ID=" & Cat_ID & "&REPLY_ID=X"
Response.Write " <a href=""JavaScript:openWindow('pop_moderate.asp?" & TopicString & "')"">" & getCurrentIcon(strIconFolderModerate,"Approve/Hold/Reject all posts for this Topic","") & "</a>" & vbNewline
end if
' DEM --> End of Code added for Full Moderation
Response.Write " </font>"
end sub

sub DropDownPaging(fnum)
if maxpages > 1 then
if mypage = "" then
pge = 1
else
pge = mypage
end if
scriptname = request.servervariables("script_name")
Response.Write(" <form name=""PageNum" & fnum & """ action=""topic.asp"">" & vbNewLine)
Response.Write(" <td bgcolor=""" & strHeadCellColor & """ nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>" & vbNewLine)
if Archiveview = "true" then Response.Write(" <input type=""hidden"" name=""ARCHIVE"" value=""" & ArchiveView & """>" & vbNewLine)
Response.Write(" <input type=""hidden"" name=""TOPIC_ID"" value=""" & Request("TOPIC_ID") & """>" & vbNewLine)
Response.Write(" <b>Page: </b><select name=""whichpage"" size=""1"" onchange=""ChangePage(" & fnum & ");"">" & vbNewLine)
for counter = 1 to maxpages
if counter <> cLng(pge) then
Response.Write " <option value=""" & counter & """>" & counter & "</option>" & vbNewLine
else
Response.Write " <option selected value=""" & counter & """>" & counter & "</option>" & vbNewLine
end if
next
Response.Write(" </select><b> of " & maxpages & "</b>" & vbNewLine)
if Request.QueryString("SearchTerms") <> "" then Response.Write(" <input type=""hidden"" name=""SearchTerms"" value=""" & Server.HTMLEncode(Request.QueryString("SearchTerms")) & """>" & vbNewLine)
Response.Write(" </font></td>" & vbNewLine)
Response.Write(" </form>" & vbNewLine)
end if
top = "0"
end sub

Sub Topic_nav()

if prevTopic = "" then
strSQL = "SELECT T_SUBJECT, TOPIC_ID "
strSql = strSql & "FROM " & strActivePrefix & "TOPICS "
strSql = strSql & "WHERE T_LAST_POST > '" & Topic_LastPost
strSql = strSql & "' AND FORUM_ID = " & Forum_ID
strSql = strSql & " AND T_STATUS < 2" ' Ignore unapproved/held posts
strSql = strSql & " ORDER BY T_LAST_POST;"

set rsPrevTopic = my_conn.Execute(TopSQL(strSql,1))

if rsPrevTopic.EOF then
prevTopic = getCurrentIcon(strIconBlank,"","align=""top"" hspace=""6""")
else
prevTopic = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & rsPrevTopic("TOPIC_ID") & """>" & getCurrentIcon(strIconGoLeft,"Previous Topic","align=""top"" hspace=""6""") & "</a>"
end if

rsPrevTopic.close
set rsPrevTopic = nothing
else
prevTopic = prevTopic
end if

if NextTopic = "" then
strSQL = "SELECT T_SUBJECT, TOPIC_ID "
strSql = strSql & "FROM " & strActivePrefix & "TOPICS "
strSql = strSql & "WHERE T_LAST_POST < '" & Topic_LastPost
strSql = strSql & "' AND FORUM_ID = " & Forum_ID
strSql = strSql & " AND T_STATUS < 2" ' Ignore unapproved/held posts
strSql = strSql & " ORDER BY T_LAST_POST DESC;"

set rsNextTopic = my_conn.Execute(TopSQL(strSql,1))

if rsNextTopic.EOF then
nextTopic = getCurrentIcon(strIconBlank,"","align=""top"" hspace=""6""")
else
nextTopic = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & rsNextTopic("TOPIC_ID") & """>" & getCurrentIcon(strIconGoRight,"Next Topic","align=""top"" hspace=""6""") & "</a>"
end if

rsNextTopic.close
set rsNextTopic = nothing
else
nextTopic = nextTopic
end if

Response.Write (" " & prevTopic & "<b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """> Topic </font></b>" & nextTopic)

end sub

function SearchHiLite(fStrMessage)
'function derived from HiLiTeR by 2eNetWorX
fArr = split(replace(Request.QueryString("SearchTerms"),";",""), ",")
strBuffer = ""
for iPos = 1 to len(fStrMessage)
bChange = False
'Looks for html tags
if mid(fStrMessage, iPos, 1) = "<" then
bInHTML = True
end if
'Looks for End of html tags
if bInHTML = True then
if mid(fStrMessage, iPos, 1) = ">" then
bInHTML = False
end if
end if
if bInHTML <> True then
for i = 0 to UBound(fArr)
if fArr(i) <> "" then
if lcase(mid(fStrMessage, iPos, len(fArr(i)))) = lcase(fArr(i)) then
bChange = True
strBuffer = strBuffer & "<span class=""spnSearchHighlight"" id=""hilite"">" & _
mid(fStrMessage, iPos, len(fArr(i))) & "</span id=""hilite"">"
iPos = iPos + len(fArr(i)) - 1
end if
end if
next
end if
if Not bChange then
strBuffer = strBuffer & mid(fStrMessage, iPos, 1)
end if
next
SearchHiLite = strBuffer
end function

Sub QuickReply()
intSigDefault = getSigDefault(MemberID)
Response.Write " <script language=""JavaScript"" type=""text/javascript"" src=""inc_code.js""></script>" & vbNewLine & _
" <table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
" <table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine & _
" <form name=""PostTopic"" method=""post"" action=""post_info.asp"" onSubmit=""return validate();"">" & vbNewLine & _
" <input name=""ARCHIVE"" type=""hidden"" value=""" & ArchiveView & """>" & vbNewLine & _
" <input name=""Method_Type"" type=""hidden"" value=""Reply"">" & vbNewLine & _
" <input name=""TOPIC_ID"" type=""hidden"" value=""" & Topic_ID & """>" & vbNewLine & _
" <input name=""FORUM_ID"" type=""hidden"" value=""" & Forum_ID & """> " & vbNewLine & _
" <input name=""CAT_ID"" type=""hidden"" value=""" & Cat_ID & """>" & vbNewLine & _
" <input name=""Refer"" type=""hidden"" value=""" & request.servervariables("SCRIPT_NAME") & "?" & chkString(Request.QueryString,"refer") & """>" & vbNewLine & _
" <input name=""UserName"" type=""hidden"" value=""" & strDBNTUserName & """>" & vbNewLine & _
" <input name=""Password"" type=""hidden"" value=""" & Request.Cookies(strUniqueID & "User")("Pword") & """>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strHeadCellColor & """ noWrap vAlign=""top"" colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b>Quick Reply</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strForumCellColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><span class=""spnMessageText""><b>Message: </b><br />" & vbNewLine & _
" <br />" & vbNewLine & _
" <table border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine
if strAllowHTML = "1" then
Response.Write " * HTML is ON<br />" & vbNewLine
else
Response.Write " * HTML is OFF<br />" & vbNewLine
end if
if strAllowForumCode = "1" then
Response.Write " * <a href=""JavaScript:openWindow6('pop_forum_code.asp')"">Forum Code</a> is ON<br />" & vbNewLine
else
Response.Write " * Forum Code is OFF<br />" & vbNewLine
end if
if strSignatures = "1" then
Response.Write " <br /><input name=""Sig"" id=""Sig"" type=""checkbox"" value=""yes""" & chkCheckbox(intSigDefault,1,true) & "><label for=""Sig"">Include Signature</label><br />" & vbNewLine
end if
Response.Write " </font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </span></font></td>" & vbNewLine & _
" <td width=""" & strTopicWidthRight & """ bgColor=""" & strForumCellColor & """><textarea name=""Message"" cols=""50"" rows=""6"" wrap=""VIRTUAL"" style=""width:100%""></textarea><br /></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strForumCellColor & """ noWrap align=""center"" colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><input name=""Submit"" type=""submit"" value=""Submit Reply""> <input name=""Preview"" type=""button"" value=""Preview Reply"" onclick=""OpenPreview()"">"
'Response.Write " <input name=""Reset"" type=""reset"" value=""Reset Form""></font></td>" & vbNewLine & _
Response.Write "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </form>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <br />" & vbNewLine
end sub
%>

Edited by - Dave Goldman on 01 September 2009 08:06:36
Go to Top of Page

Dave Goldman
New Member

USA
65 Posts

Posted - 01 September 2009 :  08:07:14  Show Profile
Here is post_info.asp


<%
'#################################################################################
'## Snitz Forums 2000 v3.4.07
'#################################################################################
'## Copyright (C) 2000-09 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" -->
<%
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")

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
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

' If Creating a new topic or reply, the subscription and moderation capabilities will need to be checked.
Moderation = "No"
if MethodType = "Topic" or _
MethodType = "Edit" or _
MethodType = "Reply" or _
MethodType = "ReplyQuote" or _
MethodType = "TopicQuote" or _
MethodType = "Forum" or _
MethodType = "EditForum" then

if strModeration > 0 or strSubscription > 0 then
'## Forum_SQL - Get the Cat_Subscription, Cat_Moderation, Forum_Subscription, Forum_Moderation
strSql = "SELECT C.CAT_MODERATION, C.CAT_SUBSCRIPTION, C.CAT_NAME "
if MethodType <> "Forum" then
strSql = strSql & ", F.F_MODERATION, F.F_SUBSCRIPTION "
end if
strsql = strsql & " FROM " & strTablePrefix & "CATEGORY C"
if MethodType <> "Forum" then
strSql = strSql & ", " & strTablePrefix & "FORUM F"
end if
strSql = strSql & " WHERE C.CAT_ID = " & Cat_ID
if MethodType <> "Forum" then
strSql = strSql & " AND F.FORUM_ID = " & Forum_ID
end if
set rsCheck = my_Conn.Execute (strSql)

CatName = rsCheck("CAT_NAME")
CatSubscription = rsCheck("CAT_SUBSCRIPTION")
CatModeration = rsCheck("CAT_MODERATION")
if MethodType <> "Forum" then
ForumSubscription = rsCheck("F_SUBSCRIPTION")
ForumModeration = rsCheck("F_MODERATION")
end if
rsCheck.Close
set rsCheck = nothing
if MethodType <> "Forum" then
'## Moderators and Admins are not subject to Moderation
if strModeration = 0 or mlev = 4 or chkForumModerator(Forum_ID, strDBNTUserName) = "1" then
Moderation = "No"
'## Is Moderation allowed on the category?
elseif CatModeration = 1 then
'## if this is a topic, is forum moderation set to all posts or topic?
if (ForumModeration = 1 or ForumModeration = 2) and (MethodType = "Topic") then
Moderation = "Yes"
'## if this is a reply, is forum moderation set to all posts or reply?
elseif (ForumModeration = 1 or ForumModeration = 3) and (MethodType <> "Topic") then
Moderation = "Yes"
end if
end if
end if
end if
end if

if MethodType = "Edit" then
member = 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 Forum Admin can change this post", 0
end if
case 4 '## Admin so OK
if strReplyAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
Go_Result "Only the Forum Admin 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 & "'"
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 Forum Admin can change this post", 0
end if
case 4 '## Admin so OK
if strTopicAuthor = intAdminMemberID and MemberID <> intAdminMemberID then
Go_Result "Only the Forum Admin 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 " & strActivePrefix & "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

if ArchiveView = "true" then
'## Prevent moving of topics in archives
Dim aryForum(1)
aryForum(1) = 0
Forum_ID = 0
else
'## Set array to pull out CAT_ID and FORUM_ID from dropdown values in post.asp
aryForum = split(Request.Form("Forum"), "|")
end if

'## 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
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 & "'"
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
if Request.Form("sig") = "yes" and strDSignatures = "1" then
strSql = strSql & ", T_SIG = 1"
else
strSql = strSql & ", T_SIG = 0"
end if
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

'# 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
doUCount(strT_Last_Post_Author)
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 = "" or left(UserIPAddress, 7) = "unknown" then
UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
elseif InStr(UserIPAddress, ",") > 0 then
UserIPAddress = Left(UserIPAddress, InStr(UserIPAddress, ",")-1)
elseif InStr(UserIPAddress, ";") > 0 then
UserIPAddress= Left(UserIPAddress, InStr(UserIPAddress, ";")-1)
end if
if InStr(UserIPAddress, ":") > 0 then
UserIPAddress = Left(UserIPAddress, InStr(UserIPAddress, ":")-1)
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
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 - Add new post to Topics Table
strSql = "INSERT INTO " & strTablePrefix & "TOPICS (FORUM_ID"
strSql = strSql & ", CAT_ID"
strSql = strSql & ", T_SUBJECT"
strSql = strSql & ", T_MESSAGE"
strSql = strSql & ", T_AUTHOR"
strSql = strSql & ", T_LAST_POST"
strSql = strSql & ", T_LAST_POST_AUTHOR"
strSql = strSql & ", T_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"
strSql = strSql & ") VALUES ("
strSql = strSql & Forum_ID
strSql = strSql & ", " & Cat_ID
strSql = strSql & ", '" & txtSubject & "'"
strSql = strSql & ", '" & txtMessage & "'"
strSql = strSql & ", " & rs("MEMBER_ID")
strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", " & rs("MEMBER_ID")
strSql = strSql & ", 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 "
strSql = strSql & ")"

my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

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

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 = "" or left(UserIPAddress, 7) = "unknown" then
UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
elseif InStr(UserIPAddress, ",") > 0 then
UserIPAddress = Left(UserIPAddress, InStr(UserIPAddress, ",")-1)
elseif InStr(UserIPAddress, ";") > 0 then
UserIPAddress= Left(UserIPAddress, InStr(UserIPAddress, ";")-1)
end if
if InStr(UserIPAddress, ":") > 0 then
UserIPAddress = Left(UserIPAddress, InStr(UserIPAddress, ":")-1)
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 & ") 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 & ")"

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_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

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"
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 "
strSql = strSql & ", F_DEFAULTDAYS "
strSql = strSql & ", F_COUNT_M_POSTS "
strSql = strSql & ") VALUES ("
strSql = strSql & Cat_ID
strSql = strSql & ", 1 "
if strPrivateForums = "1" then
strSql = strSql & ", " & chkString(Request.Form("AuthType"), "SQLString") & ""
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 "
strSql = strSql & ", " & ChkString(Request.Form("DefaultDays"), "SQLString")
strSql = strSql & ", " & ChkString(Request.Form("ForumCntMPosts"), "SQLString")
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")
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"
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 & Cat_ID
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")
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
'## Forum_SQL - Check if CAT_ID changed
strSql = "SELECT " & strTablePrefix & "FORUM.CAT_ID "
strSql = strSql & " FROM " & strTablePrefix & "FORUM "
strSql = strSql & " WHERE FORUM_ID = " & Forum_ID

set rsCatIDCheck = my_Conn.execute(strSql)
bolCatIDChanged = (cSTr(rsCatIDCheck("CAT_ID")) <> ChkString(Request.Form("Category"), "SQLString"))
rsCatIDCheck.Close
set rsCatIDCheck = Nothing

'## Forum_SQL - Do DB Update
strSql = "UPDATE " & strTablePrefix & "FORUM "
strSql = strSql & " SET CAT_ID = " & cLng("0" & Request.Form("Category"))
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
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"))
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" & Request.Form("Category"))
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" & Request.Form("Category"))
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" & Request.Form("Category"))
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" & Request.Form("Category"))
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
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

'## Forum_SQL - Do DB Update
strSql = "UPDATE " & strTablePrefix & "FORUM "
strSql = strSql & " SET CAT_ID = " & cLng("0" & Request.Form("Category"))
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
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"">All Forums</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!")
DoPCount
if ForumCountMPosts <> 0 then
DoUCount MemberID
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!")
DoTCount
DoPCount
if ForumCountMPosts <> 0 then
DoUCount MemberID
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!")
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!")
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 ( "& CLng(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

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 ( "& CLng(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
strSql = strSql & " AND " & strMemberTablePrefix & "MEMBERS.M_STATUS <> 0"

set rs2 = my_Conn.Execute (strSql)

If Not rs2.EOF Then
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
Else
rs2.Close
Set rs2 = nothing
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 ##
%>

Edited by - Dave Goldman on 01 September 2009 08:08:24
Go to Top of Page

Dave Goldman
New Member

USA
65 Posts

Posted - 01 September 2009 :  08:08:52  Show Profile


Post.asp

<%
'#################################################################################
'## Snitz Forums 2000 v3.4.07
'#################################################################################
'## Copyright (C) 2000-09 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"-->
<%
'#################################################################################
'## Variable declaration
'#################################################################################
dim strSelectSize
dim intCols, intRows
'#################################################################################
'## Initialise variables
'#################################################################################
if Request.QueryString("method") <> "" then
strRqMethod = chkString(Request.QueryString("method"), "SQLString")
elseif Request.Form("Method_Type") = "logout" then
'Do Nothing
else
Response.Redirect("default.asp")
end if
if Request.QueryString("TOPIC_ID") <> "" then
if IsNumeric(Request.QueryString("TOPIC_ID")) = True then
strRqTopicID = cLng(Request.QueryString("TOPIC_ID"))
else
Response.Redirect("default.asp")
end if
end if
if Request.QueryString("FORUM_ID") <> "" then
if IsNumeric(Request.QueryString("FORUM_ID")) = True then
strRqForumID = cLng(Request.QueryString("FORUM_ID"))
else
Response.Redirect("default.asp")
end if
end if
if Request.QueryString("CAT_ID") <> "" then
if IsNumeric(Request.QueryString("CAT_ID")) = True then
strRqCatID = cLng(Request.QueryString("CAT_ID"))
else
Response.Redirect("default.asp")
end if
end if
if Request.QueryString("REPLY_ID") <> "" then
if IsNumeric(Request.QueryString("REPLY_ID")) = True then
strRqReplyID = cLng(Request.QueryString("REPLY_ID"))
else
Response.Redirect("default.asp")
end if
end if
strCkPassWord = Request.Cookies(strUniqueID & "User")("Pword")

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
%>
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_subscription.asp"-->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<!--#INCLUDE FILE="inc_func_posting.asp"-->
<%
'#################################################################################
'## Page-code start
'#################################################################################

if request("ARCHIVE") = "true" then
strActivePrefix = strTablePrefix & "A_"
ArchiveView = "true"
else
strActivePrefix = strTablePrefix
ArchiveView = ""
end if

if strRqMethod = "Edit" or _
strRqMethod = "EditTopic" or _
strRqMethod = "Reply" or _
strRqMethod = "ReplyQuote" or _
strRqMethod = "TopicQuote" then
'## check if topic exists in TOPICS table
set rsTCheck = my_Conn.Execute ("SELECT TOPIC_ID FROM " & strActivePrefix & "TOPICS WHERE TOPIC_ID = " & strRqTopicID)
if rsTCheck.EOF or rsTCheck.BOF then
rsTCheck.Close
set rsTCheck = nothing
Go_Result "Sorry, that Topic no longer exists in the Database"
end if
set rsTCheck = nothing
end if

if ArchiveView <> "" then
if MethodType = "Reply" or _
MethodType = "ReplyQuote" or _
MethodType = "TopicQuote" then
Go_Result "This is not allowed in the Archives."
end if
end if

if strRqMethod = "Edit" or _
strRqMethod = "EditTopic" or _
strRqMethod = "Reply" or _
strRqMethod = "ReplyQuote" or _
strRqMethod = "Topic" or _
strRqMethod = "TopicQuote" then

if strRqMethod <> "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_ID, C.CAT_NAME, C.CAT_STATUS, C.CAT_SUBSCRIPTION, " &_
"F.FORUM_ID, F.F_STATUS, F.F_TYPE, F.F_SUBJECT, F.F_SUBSCRIPTION, "&_
"T.T_STATUS, 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 = " & strRqTopicID & ""
else
'## Forum_SQL - Find out if the Category or Forum is Locked or Un-Locked and if it Exists
strSql = "SELECT C.CAT_ID, C.CAT_NAME, C.CAT_STATUS, C.CAT_SUBSCRIPTION, " &_
"F.FORUM_ID, F.F_STATUS, F.F_TYPE, F.F_SUBJECT, F.F_SUBSCRIPTION "&_
" FROM " & strTablePrefix & "CATEGORY C, " &_
strTablePrefix & "FORUM F" &_
" WHERE C.CAT_ID = F.CAT_ID " &_
" AND F.FORUM_ID = " & strRqForumID & ""
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."
else
'## Subscribe checkbox start ##
PostCat_subscription = rsStatus("CAT_SUBSCRIPTION")
PostForum_subscription = rsStatus("F_SUBSCRIPTION")
'## Subscribe checkbox end ##
blnCStatus = rsStatus("CAT_STATUS")
blnFStatus = rsStatus("F_STATUS")
strRqForumID = rsStatus("FORUM_ID")
strRqCatID = rsStatus("CAT_ID")
Cat_Name = rsStatus("CAT_NAME")
Forum_Type = rsStatus("F_TYPE")
Forum_Subject = rsStatus("F_SUBJECT")
if strRqMethod <> "Topic" then
blnTStatus = rsStatus("T_STATUS")
Topic_Title = 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(strRqForumID, 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 strRqMethod
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"
end if
if (blnCStatus = 0) and (AdminAllowed = 0) then
Go_Result "You have attempted to post a New Topic to a Locked Category"
end if
if (blnFStatus = 0) and (AdminAllowed = 0) then
Go_Result "You have attempted to post a New Topic to a Locked Forum"
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"
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"
end if
if (blnTStatus = 2) then
Go_Result "You have attempted to Reply to a Moderated Topic"
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"
end if
end select
if strPrivateForums = "1" and ForumChkSkipAllowed = 0 then
if not(chkForumAccess(strRqForumID,MemberID,false)) then
Go_Result "You do not have access to this forum"
end if
end if
end if

select case strSelectSize
case "1"
intCols = 45
intRows = 11
case "2"
intCols = 70
intRows = 12
case "3"
intCols = 90
intRows = 12
case "4"
intCols = 130
intRows = 15
case else
intCols = 70
intRows = 12
end select

Response.Write " <script language=""JavaScript"" type=""text/javascript"" src=""inc_code.js""></script>" & vbNewLine & _
" <script language=""JavaScript"" type=""text/javascript"" src=""selectbox.js""></script>" & vbNewLine

if strRqMethod = "EditForum" then
if (mLev = 4) or (chkForumModerator(strRqForumId, strDBNTUserName) = "1") then
'## Do Nothing
else
Go_Result "Only moderators and administrators can edit forums"
end if
end if

Msg = ""

select case strRqMethod
case "Reply", "ReplyQuote", "TopicQuote"
if (strNoCookies = 1) or (strDBNTUserName = "") then
Msg = Msg & "<b>Note:</b> You must be registered in order to post a reply.<br />"
if strProhibitNewMembers <> "1" then
Msg = Msg & "To register, <a href=""https://www.TheGunnersAcademy.com/Forum/register.asp"">click here</a>. Registration is FREE!<br />"
end if
end if
case "Topic"
if (strNoCookies = 1) or (strDBNTUserName = "") then
Msg = Msg & "<b>Note:</b> You must be registered in order to post a Topic.<br />"
if strProhibitNewMembers <> "1" then
Msg = Msg & "To register, <a href=""https://www.TheGunnersAcademy.com/Forum/register.asp"">click here</a>. Registration is FREE!<br />"
end if
end if
case "Category"
Msg = Msg & "<b>Note:</b> You must be an Administrator to create a new Category.<br />"
case "Forum"
Msg = Msg & "<b>Note:</b> You must be an Administrator to create a new Forum.<br />"
case "URL"
Msg = Msg & "<b>Note:</b> You must be an Administrator to create a new Web Link.<br />"
case "Edit", "EditTopic"
Msg = Msg & "<b>Note:</b> Only the poster of this message, and the Moderator can edit the message."
case "EditForum"
Msg = Msg & "<b>Note:</b> Only the Moderator or an Administrator can edit a Forum."
case "EditURL"
Msg = Msg & "<b>Note:</b> Only the Moderator or an Administrator can edit a Web Link."
case "EditCategory"
Msg = Msg & "<b>Note:</b> Only an Administrator can edit a Category."
case else
Response.Redirect "http://www.TheGunnersAcademy.com/Forum/default.asp"
end select

if strRqMethod = "Edit" or _
strRqMethod = "ReplyQuote" then
'## Forum_SQL
strSql = "SELECT M.M_NAME, R.R_AUTHOR, R.R_SIG, R.R_MESSAGE "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS M, " & strActivePrefix & "REPLY R "
strSql = strSql & " WHERE M.MEMBER_ID = R.R_AUTHOR AND R.REPLY_ID = " & strRqReplyID

set rs = my_Conn.Execute (strSql)

strAuthor = rs("R_AUTHOR")
strReplySig = rs("R_SIG")
if strRqMethod = "Edit" then
TxtMsg = rs("R_MESSAGE")
else
if strRqMethod = "ReplyQuote" then
TxtMsg = "
quote:
Originally posted by " & chkString(rs("M_NAME"),"display") & "" & vbNewline
TxtMsg = TxtMsg & "
" & rs("R_MESSAGE") & vbNewline
TxtMsg = TxtMsg & "
"
end if
end if
set rs = nothing
end if

if strRqMethod = "EditTopic" or strRqMethod = "TopicQuote" then
'## Forum_SQL
strSql = "SELECT M.M_NAME, T.T_SUBJECT, T.T_AUTHOR, T.T_STICKY, T.T_SIG, T.T_MESSAGE "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS M, " & strActivePrefix & "TOPICS T "
strSql = strSql & " WHERE M.MEMBER_ID = T.T_AUTHOR AND T.TOPIC_ID = " & strRqTopicID

set rs = my_Conn.Execute (strSql)

TxtSub = rs("T_SUBJECT")
strAuthor = rs("T_AUTHOR")
strTopicSig = rs("T_SIG")
if strStickyTopic = "1" then
strTopicSticky = rs("T_STICKY")
end if

if strRqMethod = "EditTopic" then
TxtMsg = rs("T_MESSAGE")
else
if strRqMethod = "TopicQuote" then
TxtMsg = "
quote:
Originally posted by " & chkString(rs("M_NAME"),"display") & "" & vbNewline
TxtMsg = TxtMsg & "
" & rs("T_MESSAGE") & vbNewline
TxtMsg = TxtMsg & "
"
end if
end if
set rs = nothing
end if

if strRqMethod = "EditForum" or _
strRqMethod = "EditURL" then
'## Forum_SQL
' DEM --> Added F_SUBSCRIPTION, F_MODERATION to the end of this select
strSql = "SELECT F_SUBJECT, F_URL, F_PRIVATEFORUMS, F_PASSWORD_NEW, " & _
"F_DEFAULTDAYS, F_COUNT_M_POSTS, F_SUBSCRIPTION, F_MODERATION, F_DESCRIPTION " & _
" FROM " & strTablePrefix & "FORUM " & _
" WHERE FORUM_ID = " & strRqForumId

set rs = my_Conn.Execute (strSql)

if strRqMethod = "EditURL" then
TxtUrl = rs("F_URL")
end if

if strRqMethod = "EditForum" then
fDefaultDays = rs("F_DEFAULTDAYS")
fForumCntMPosts = rs("F_COUNT_M_POSTS")
fPasswordNew = rs("F_PASSWORD_NEW")
end if

if strRqMethod = "EditForum" or _
strRqMethod = "EditURL" then
TxtSub = rs("F_SUBJECT")
' DEM --> Added fields to get them into local variables which is a faster run
fPrivateForums = rs("F_PRIVATEFORUMS")
ForumSubscription = rs("F_SUBSCRIPTION")
ForumModeration = rs("F_MODERATION")
TxtMsg = rs("F_DESCRIPTION")
end if
set rs = nothing
end if

' DEM --> Added editforum and forum to get the cat_subscription and cat_moderation for later use.
if strRqMethod = "EditCategory" or strRqMethod = "EditForum" or strRqMethod = "EditURL" or strRqMethod = "Forum" then
'## Forum_SQL
' DEM --> Added CAT_SUBSCRIPTION for subscription services
' DEM --> Added CAT_MODERATION for moderation processing
strSql = "SELECT CAT_NAME, CAT_SUBSCRIPTION, CAT_MODERATION "
strSql = strSql & " FROM " & strTablePrefix & "CATEGORY "
strSql = strSql & " WHERE CAT_ID = " & strRqCatID

' DEM --> Added if statement to use a different connection and to move the database fields to local variables
if strRqMethod = "EditForum" or strRqMethod = "EditURL" or strRqMethod = "Forum" then
set rs1 = my_Conn.Execute (strSql)
CatSubscription = rs1("CAT_SUBSCRIPTION")
CatModeration = rs1("CAT_MODERATION")
strCatName = rs1("CAT_NAME")
set rs1 = nothing
else
set rs = my_Conn.Execute (strSql)
CatSubscription = rs("CAT_SUBSCRIPTION")
CatModeration = rs("CAT_MODERATION")
TxtSub = rs("CAT_NAME")
set rs = nothing
end if

'if strRqMethod = "EditCategory" then
' TxtSub = rs("CAT_NAME")
'end if
end if

select case strRqMethod
case "Category"
btn = "Post New Category"
case "Edit", "EditCategory", "EditForum", "EditTopic", "EditURL"
btn = "Post Changes"
case "Forum"
btn = "Post New Forum"
case "Reply", "ReplyQuote", "TopicQuote"
btn = "Post New Reply"
case "Topic"
btn = "Post New Topic"
case "URL"
btn = "Post New URL"
case else
btn = "Post"
end select

Response.Write " <table border=""0"" width=""100%"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""33%"" align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" " & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp"" tabindex=""-1"">All Forums</a><br />" & vbNewLine
if strRqMethod = "EditCategory" then
Response.Write " " & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " " & ChkString(TxtSub,"display") & "<br />" & vbNewLine
elseif strRqMethod = "EditForum" or strRqMethod = "EditURL" then
Response.Write " " & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp?CAT_ID=" & strRqCatID & """ tabindex=""-1"">" & ChkString(strCatName,"display") & "</a><br />" & vbNewLine
Response.Write " " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " " & ChkString(TxtSub,"display") & "<br />" & vbNewLine
else
if strRqMethod = "Edit" or strRqMethod = "EditTopic" or _
strRqMethod = "Reply" or strRqMethod = "ReplyQuote" or _
strRqMethod = "Topic" or strRqMethod = "TopicQuote" 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=" & strRqCatId & """ tabindex=""-1"">" & ChkString(Cat_Name,"display") & "</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
if strRqMethod <> "Topic" then
Response.Write getCurrentIcon(strIconFolderClosed,"","align=""absmiddle""")
else
Response.Write getCurrentIcon(strIconFolderClosedTopic,"","align=""absmiddle""")
end if
end if
Response.Write " <a href=""forum.asp?FORUM_ID=" & strRqForumId & """ tabindex=""-1"">" & ChkString(Forum_Subject,"display") & "</a><br />" & vbNewLine
end if
end if

if strRqMethod = "Edit" or strRqMethod = "EditTopic" or _
strRqMethod = "Reply" or strRqMethod = "ReplyQuote" or _
strRqMethod = "TopicQuote" 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=""topic.asp?TOPIC_ID=" & strRqTopicID & """ tabindex=""-1"">" & ChkString(Topic_Title,"title") & "</a>" & vbNewLine
end if
Response.Write " </font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & Msg & "</font></p>" & vbNewLine & _
" <table border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
" <table border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine & _
" <form name=""PostTopic"" method=""post"" action=""post_info.asp"""
select case strRqMethod
case "Topic", "EditTopic", "Reply", "ReplyQuote", "TopicQuote", "Edit"
Response.Write(" onSubmit=""return validate();""")
case else
Response.Write ""
end select
'strRefer = Request.ServerVariables("HTTP_REFERER")
if strReferer = "" then strReferer = chkString(Request.Form("Refer"),"refer")
if strReferer = "" then strReferer = "default.asp"
Response.Write ">" & vbNewLine & _
" <input name=""ARCHIVE"" type=""hidden"" value=""" & ArchiveView & """>" & vbNewLine & _
" <input name=""Method_Type"" type=""hidden"" value=""" & strRqMethod & """>" & vbNewLine & _
" <input name=""REPLY_ID"" type=""hidden"" value=""" & strRqReplyID & """>" & vbNewLine & _
" <input name=""TOPIC_ID"" type=""hidden"" value=""" & strRqTopicID & """>" & vbNewLine & _
" <input name=""FORUM_ID"" type=""hidden"" value=""" & strRqForumId & """> " & vbNewLine & _
" <input name=""CAT_ID"" type=""hidden"" value=""" & strRqCatID & """>" & vbNewLine
if strRqMethod = "Edit" or strRqMethod = "EditTopic" then Response.Write(" <input name=""Author"" type=""hidden"" value=""" & strAuthor & """>" & vbNewLine)
Response.Write " <input name=""Refer"" type=""hidden"" value=""" & strReferer & """>" & vbNewLine & _
" <input name=""cookies"" type=""hidden"" value=""yes"">" & vbNewLine

if strRqMethod = "Edit" or strRqMethod = "EditTopic" or strRqMethod = "Forum" or strRqMethod = "EditForum" or _
strRqMethod = "Reply" or strRqMethod = "ReplyQuote" or _
strRqMethod = "Topic" or strRqMethod = "TopicQuote" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Screensize:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" <select name=""SelectSize"" size=""1"" tabindex=""-1"" onchange=""resizeTextarea('" & strUniqueID & "')"">" & vbNewLine & _
" <option value=""1"""
if strSelectSize = "1" then Response.Write(" selected")
Response.Write ">640 x 480</option>" & vbNewLine & _
" <option value=""2"""
if strSelectSize = "2" or strSelectSize = "" then Response.Write(" selected")
Response.Write ">800 x 600</option>" & vbNewLine & _
" <option value=""3"""
if strSelectSize = "3" then Response.Write(" selected")
Response.Write ">1024 x 768</option>" & vbNewLine & _
" <option value=""4"""
if strSelectSize = "4" then Response.Write(" selected")
Response.Write ">1280 x 1024</option>" & vbNewLine & _
" </select>" & vbNewLine & _
" </font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if

if mlev = 4 or _
mlev = 3 or _
mlev = 2 or _
mlev = 1 then
Response.Write " <input name=""UserName"" type=""hidden"" value=""" & strDBNTUserName & """>" & vbNewLine & _
" <input name=""Password"" type=""hidden"" value=""" & strCkPassWord & """>" & vbNewLine
else
if (lcase(strNoCookies) = "1") or _
(strDBNTUserName = "" or _
strCkPassWord = "") then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>UserName:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input name=""UserName"" maxLength=""25"" size=""25"" type=""text"" value=""" & Request.Form("UserName") & """></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Password:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ valign=""top""><input name=""Password"" maxLength=""25"" size=""25"" type=""password"" value=""" & Request.Form("password") & """></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
end if

if strAllowForumCode = "1" and strShowFormatButtons = "1" then
if strRqMethod = "Edit" or strRqMethod = "EditTopic" or _
strRqMethod = "Reply" or strRqMethod = "ReplyQuote" or _
strRqMethod = "Topic" or strRqMethod = "TopicQuote" then
%>
<!--#INCLUDE FILE="inc_post_buttons.asp" -->
<%
end if
end if
if strRqMethod = "Forum" or _
strRqMethod = "URL" or _
strRqMethod = "EditURL" or _
strRqMethod = "EditForum" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Category:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """>" & vbNewLine & _
" <select name=""Category"" size=""1"">" & vbNewLine
'## Forum_SQL
strSql = "SELECT CAT_ID, CAT_NAME "
strSql = strSql & " FROM " & strTablePrefix & "CATEGORY "
if mlev = 3 then
strSql = strSql & " WHERE CAT_ID = " & strRqCatID
end if
strSql = strSql & " ORDER BY CAT_ORDER, CAT_NAME ASC;"

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

if rsCat.EOF then
recCatCount = ""
else
allCatData = rsCat.GetRows(adGetRowsRest)
recCatCount = UBound(allCatData,2)
end if

rsCat.close
set rsCat = nothing

if recCatCount <> "" then
cCAT_ID = 0
cCAT_NAME = 1

for iCat = 0 to recCatCount
CatID = allCatData(cCAT_ID,iCat)
CatName = allCatData(cCAT_NAME,iCat)

Response.Write " <option value=""" & CatID & """"
if cLng(strRqCatID) = CatID then
Response.Write " selected"
end if
Response.Write ">" & ChkString(CatName,"display") & "</option>" & vbNewline
next
end if
Response.Write " </select>" & vbNewLine & _
" <a href=""Javascript:openWindow3('pop_help.asp?mode=options#category')"" tabindex=""-1"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if

if (strRqMethod = "EditTopic") then
Dim MoveTopicAllowed
if (mLev = 4) or (mLev = 3 and strMoveTopicMode = "0") or ((mLev = 3) and (strMoveTopicMode = "1") and (strAuthor = MemberID)) then
MoveTopicAllowed = "1"
else
MoveTopicAllowed = "0"
end if

Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Forum:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """>" & vbNewLine
if (mlev = 3 or mlev = 4) and ArchiveView <> "true" then
Response.Write " <select name=""Forum"" size=""1"">" & vbNewLine
end if
'## Forum_SQL
strSql = "SELECT C.CAT_NAME, F.CAT_ID, F.FORUM_ID, F.F_SUBJECT, F_PRIVATEFORUMS, F_PASSWORD_NEW " &_
" FROM " & strTablePrefix & "CATEGORY C, " & strTablePrefix & "FORUM F" &_
" WHERE F.F_TYPE = 0 " & _
" AND C.CAT_ID = F.CAT_ID "
if mLev = 4 and ArchiveView = "true" then
strSql = strSql & " AND F.FORUM_ID = " & strRqForumID
else
if MoveTopicAllowed = "1" then
else
strSql = strSql & " AND F.FORUM_ID = " & strRqForumID
end if
end if
strSql = strSql & " ORDER BY C.CAT_ORDER, C.CAT_NAME, F.F_ORDER, F.F_SUBJECT ASC;"

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

if rsForum.EOF then
recForumCount = ""
else
allForumData = rsForum.GetRows(adGetRowsRest)
recForumCount = UBound(allForumData,2)
end if

rsForum.close
set rsForum = nothing

if (mlev = 3 or mlev = 4) and ArchiveView <> "true" then
if recForumCount <> "" then
cCAT_NAME = 0
fCAT_ID = 1
fFORUM_ID = 2
fF_SUBJECT = 3
fF_PRIVATEFORUMS = 4
fF_PASSWORD_NEW = 5

for iForum = 0 to recForumCount
ForumCat_Name = allForumData(cCAT_NAME, iForum)
ForumCatID = allForumData(fCAT_ID, iForum)
ForumID = allForumData(fFORUM_ID, iForum)
ForumSubject = allForumData(fF_SUBJECT, iForum)
ForumPrivateForums = allForumData(fF_PRIVATEFORUMS,iForum)
ForumFPasswordNew = allForumData(fF_PASSWORD_NEW,iForum)
if ChkDisplayForum(ForumPrivateForums,ForumFPasswordNew,ForumID,MemberID) then
Response.Write " <option value=""" & ForumCatID & "|" & ForumID & """"
if cLng(strRqForumId) = ForumID then
Response.Write " selected"
end if
Response.Write ">" & ChkString(ForumSubject,"display") & "</option>" & vbNewline
end if
next
end if
else
fCAT_ID = 1
fFORUM_ID = 2
fF_SUBJECT = 3
ForumCatID = allForumData(fCAT_ID, 0)
ForumID = allForumData(fFORUM_ID, 0)
ForumSubject = allForumData(fF_SUBJECT, 0)

Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & ChkString(ForumSubject,"display") & "</font>" & vbNewLine & _
" <input type=""hidden"" name=""Forum"" value=""" & ForumCatID & "|" & ForumID & """>" & vbNewLine
end if

'set rsForum = nothing

if (mlev = 3 or mlev = 4) and ArchiveView <> "true" then
Response.Write " </select>" & vbNewline
end if
Response.Write " </td>" & vbNewline & _
" </tr>" & vbNewLine
end if

if strRqMethod = "Forum" or _
strRqMethod = "EditForum" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Default Days:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><select name=""DefaultDays"" size=""1"">" & vbNewLine & _
" <option value=""0"""
if fDefaultDays = "0" then Response.Write(" SELECTED")
Response.Write ">Show all topics</option>" & vbNewLine & _
" <option value=""-1"""
if fDefaultDays = "-1" then Response.Write(" SELECTED")
Response.Write ">Show all open topics</option>" & vbNewLine & _
" <option value=""1"""
if fDefaultDays = "1" then Response.Write(" SELECTED")
Response.Write ">Show topics from last day</option>" & vbNewLine & _
" <option value=""2"""
if fDefaultDays = "2" then Response.Write(" SELECTED")
Response.Write ">Show topics from last 2 days</option>" & vbNewLine & _
" <option value=""5"""
if fDefaultDays = "5" then Response.Write(" SELECTED")
Response.Write ">Show topics from last 5 days</option>" & vbNewLine & _
" <option value=""7"""
if fDefaultDays = "7" then Response.Write(" SELECTED")
Response.Write ">Show topics from last 7 days</option>" & vbNewLine & _
" <option value=""14"""
if fDefaultDays = "14" then Response.Write(" SELECTED")
Response.Write ">Show topics from last 14 days</option>" & vbNewLine & _
" <option value=""30"""
if fDefaultDays = "30" then Response.Write(" SELECTED")
Response.Write ">Show topics from last 30 days</option>" & vbNewLine & _
" <option value=""60"""
if fDefaultDays = "60" then Response.Write(" SELECTED")
Response.Write ">Show topics from last 60 days</option>" & vbNewLine & _
" <option value=""120"""
if fDefaultDays = "120" then Response.Write(" SELECTED")
Response.Write ">Show topics from last 120 days</option>" & vbNewLine & _
" <option value=""365"""
if fDefaultDays = "365" then Response.Write(" SELECTED")
Response.Write ">Show topics from the last year</option>" & vbNewLine & _
" </select>" & vbNewLine & _
" <a href=""Javascript:openWindow3('pop_help.asp?mode=options#defaultdays')"" tabindex=""-1"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if

if strRqMethod = "Forum" or _
strRqMethod = "EditForum" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Increase Post Count:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><select name=""ForumCntMPosts"" size=""1"">" & vbNewLine & _
" <option value=""0"""
if fForumCntMPosts = "0" then Response.Write(" selected")
Response.Write ">No</option>" & vbNewLine & _
" <option value=""1"""
if fForumCntMPosts = "1" or fForumCntMPosts = "" then Response.Write(" selected")
Response.Write ">Yes</option>" & vbNewLine & _
" </select>" & vbNewLine & _
" <a href=""Javascript:openWindow3('pop_help.asp?mode=options#forumcntmposts')"" tabindex=""-1"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if

if strRqMethod = "Category" or _
strRqMethod = "EditCategory" or _
strRqMethod = "URL" or _
strRqMethod = "EditURL" or _
strRqMethod = "Forum" or _
strRqMethod = "EditForum" or _
strRqMethod = "EditTopic" or _
strRqMethod = "Topic" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Subject:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input maxLength=""50"" name=""Subject"" value=""" & Trim(ChkString(TxtSub,"edit")) & """ size=""40""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <script language=""JavaScript"" type=""text/javascript"">document.PostTopic.Subject.focus();</script>" & vbNewLine
end if

if strRqMethod = "URL" or _
strRqMethod = "EditURL" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Address:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input maxLength=""150"" name=""Address"" value="""
if (TxtURL <> "") then Response.Write(TxtURL) else Response.Write("http://")
Response.Write """ size=""40""><a href=""Javascript:openWindow3('pop_help.asp?mode=options#address')"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if

if strRqMethod = "Edit" or strRqMethod = "URL" or strRqMethod = "EditURL" or _
strRqMethod = "Forum" or strRqMethod = "EditForum" or _
strRqMethod = "Reply" or strRqMethod = "ReplyQuote" or _
strRqMethod = "EditTopic" or strRqMethod = "Topic" or strRqMethod = "TopicQuote" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Message:</b><br />" & vbNewLine & _
" <br />" & vbNewLine & _
" <table border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
if strAllowHTML = "1" then
Response.Write " * HTML is ON<br />" & vbNewLine
else
Response.Write " * HTML is OFF<br />" & vbNewLine
end if
if strAllowForumCode = "1" then
Response.Write " * <a href=""JavaScript:openWindow6('pop_forum_code.asp')"" tabindex=""-1"">Forum Code</a> is ON<br />" & vbNewLine
else
Response.Write " * Forum Code is OFF<br />" & vbNewLine
end if
if strIcons = "1" and strShowSmiliesTable = "1" then
if strRqMethod = "Edit" or strRqMethod = "EditTopic" or _
strRqMethod = "Reply" or strRqMethod = "ReplyQuote" or _
strRqMethod = "Topic" or strRqMethod = "TopicQuote" then
%>
<!--#INCLUDE FILE="inc_smilies.asp" -->
<%
end if
end if
Response.Write " </font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><textarea cols=""" & intCols & """ name=""Message"" rows=""" & intRows & """ wrap=""VIRTUAL"" onselect=""storeCaret(this);"" onclick=""storeCaret(this);"" onkeyup=""storeCaret(this);"" onchange=""storeCaret(this);"">" & Trim(CleanCode(TxtMsg)) & "</textarea><br /></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
select case strRqMethod
case "Reply", "ReplyQuote", "TopicQuote"
Response.Write " <script language=""JavaScript"" type=""text/javascript"">document.PostTopic.Message.focus();</script>" & vbNewLine
end select

'#################################################################################
'## Forum Moderators - listbox Code
'#################################################################################
if (strRqMethod = "Forum" or _
strRqMethod = "URL" or _
strRqMethod = "EditURL" or _
strRqMethod = "EditForum") and (mLev > 3 or lcase(strNoCookies) = "1") then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Moderators:</b></font></td>" & vbNewLine
strSql = "SELECT MEMBER_ID, M_NAME "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_LEVEL > 1 "
strSql = strSql & " AND M_STATUS = " & 1
strSql = strSql & " ORDER BY M_NAME ASC "

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

if rsModerators.EOF then
recModeratorsCount = ""
else
allModeratorsData = rsModerators.GetRows(adGetRowsRest)
recModeratorsCount = UBound(allModeratorsData,2)
meMEMBER_ID = 0
meM_NAME = 1
end if

rsModerators.close
set rsModerators = nothing

tmpStrUserList = ""

if strRqMethod = "EditForum" or strRqMethod = "EditURL" then
strSql = "SELECT MO.MEMBER_ID, M.M_NAME "
strSql = strSql & " FROM " & strTablePrefix & "MODERATOR MO, " & strMemberTablePrefix & "MEMBERS M"
strSql = strSql & " WHERE MO.FORUM_ID = " & strRqForumID & " AND M.MEMBER_ID = MO.MEMBER_ID"

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

if rsForumModerator.EOF then
recForumModeratorCount = ""
else
allForumModeratorData = rsForumModerator.GetRows(adGetRowsRest)
recForumModeratorCount = UBound(allForumModeratorData,2)
moMEMBER_ID = 0
moM_NAME = 1
end if

rsForumModerator.close
set rsForumModerator = nothing

if recForumModeratorCount <> "" then
for iForumModerator = 0 to recForumModeratorCount
ForumModeratorMemberID = allForumModeratorData(moMEMBER_ID, iForumModerator)
if tmpStrUserList = "" then
tmpStrUserList = ForumModeratorMemberID
else
tmpStrUserList = tmpStrUserList & "," & ForumModeratorMemberID
end if
next
end if
end if
SelectSize = 6
Response.Write " <td bgColor=""" & strPopUpTableColor & """>" & vbNewLine & _
" <table>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Available</b></font><br />" & vbNewLine & _
" <select name=""ForumModCombo"" size=""" & SelectSize & """ multiple onDblClick=""moveSelectedOptions(document.PostTopic.ForumModCombo, document.PostTopic.ForumMod, true, '')"">" & vbNewLine
'## Pick from list
if recModeratorsCount <> "" then
for iModerators = 0 to recModeratorsCount
MembersMemberID = allModeratorsData(meMEMBER_ID, iModerators)
MembersMemberName = allModeratorsData(meM_NAME, iModerators)

if not(Instr("," & tmpStrUserList & "," , "," & MembersMemberID & ",") > 0) then
Response.Write " <option value=""" & MembersMemberID & """>" & ChkString(MembersMemberName,"display") & "</option>" & vbNewline
end if
next
end if
Response.Write " </select>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td width=""15"" align=""center"" valign=""middle""><br />" & vbNewLine & _
" <a href=""javascript:moveAllOptions(document.PostTopic.ForumMod, document.PostTopic.ForumModCombo, true, '')"" tabindex=""-1"">" & getCurrentIcon(strIconPrivateRemAll,"","") & "</a>" & vbNewLine & _
" <a href=""javascript:moveSelectedOptions(document.PostTopic.ForumMod, document.PostTopic.ForumModCombo, true, '')"" tabindex=""-1"">" & getCurrentIcon(strIconPrivateRemove,"","") & "</a>" & vbNewLine & _
" <a href=""javascript:moveSelectedOptions(document.PostTopic.ForumModCombo, document.PostTopic.ForumMod, true, '')"" tabindex=""-1"">" & getCurrentIcon(strIconPrivateAdd,"","") & "</a>" & vbNewLine & _
" <a href=""javascript:moveAllOptions(document.PostTopic.ForumModCombo, document.PostTopic.ForumMod, true, '')"" tabindex=""-1"">" & getCurrentIcon(strIconPrivateAddAll,"","") & "</a>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Selected</b></font><br />" & vbNewLine & _
" <select name=""ForumMod"" size=""" & SelectSize & """ tabindex=""-1"" multiple onDblClick=""moveSelectedOptions(document.PostTopic.ForumMod, document.PostTopic.ForumModCombo, true, '')"">" & vbNewLine
'## Selected List
if strRqMethod = "EditForum" or strRqMethod = "EditURL" then
if recForumModeratorCount <> "" then
for iForumModerator = 0 to recForumModeratorCount
ForumModeratorMemberID = allForumModeratorData(moMEMBER_ID, iForumModerator)
ForumModeratorMemberName = chkString(allForumModeratorData(moM_NAME, iForumModerator), "display")
if ForumModeratorMemberID <> "" then
Response.Write " <option value=""" & ForumModeratorMemberID & """>" & ForumModeratorMemberName & "</option>" & vbNewline
end if
next
end if
end if
Response.Write " </select>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td valign=""top""> <a href=""Javascript:openWindow3('pop_help.asp?mode=options#moderators')"" tabindex=""-1"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
'#################################################################################
'## Forum Moderators - End of listbox code
'#################################################################################

' DEM --> Start of Code added for full moderation and subscription services
if strRqMethod = "Forum" or strRqMethod = "EditForum" or _
strRqMethod = "Category" or strRqMethod = "EditCategory" then
if strSubscription > 0 and strEmail = "1" and _
((strRqMethod = "Category" or strRqMethod = "EditCategory") or _
((strRqMethod = "Forum" or strRqMethod = "EditForum") and (CatSubscription > 0))) then
' Subscription service first.....
Response.Write " <tr>" & vbNewline
Response.Write " <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Subscription:</b></font></td>" & vbNewLine
Response.Write " <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
Response.Write " <select name=""Subscription"">" & vbNewLine
if strRqMethod = "Category" or strRqMethod = "EditCategory" then
Response.Write " <option"
if CatSubscription = 0 then
Response.Write " selected "
end if
Response.Write " value=""0"">No Subscriptions Allowed</option>" & vbNewLine
' If Whole Board or Category Level Subscriptions Allowed, show option
if strSubscription < 3 then
Response.Write " <option"
if CatSubscription = 1 then
Response.Write " selected "
end if
Response.Write " value=""1"">Category Subscriptions Allowed</option>" & vbNewLine
end if
' If Whole Board, Category Level or Forum Level Subscriptions Allowed, show option
if strSubscription < 4 then
Response.Write " <option"
if CatSubscription = 2 then
Response.Write " selected "
end if
Response.Write " value=""2"">Forum Subscriptions Allowed</option>" & vbNewLine
end if
Response.Write " <option"
if CatSubscription = 3 then
Response.Write " selected "
end if
Response.Write " value=""3"">Topic Subscriptions Allowed</option>" & vbNewLine
else
Response.Write " <option"
if ForumSubscription = 0 then
Response.Write " selected "
end if
Response.Write " value=""0"">No Subscriptions Allowed</option>" & vbNewLine
' If Whole Board, Category Level or Forum Level Subscriptions Allowed, show option
if strSubscription < 4 and CatSubscription < 3 then
Response.Write " <option"
if ForumSubscription = 1 then
Response.Write " selected "
end if
Response.Write " value=""1"">Forum Subscriptions Allowed</option>" & vbNewLine
end if
Response.Write " <option"
if ForumSubscription = 2 then
Response.Write " selected "
end if
Response.Write " value=""2"">Topic Subscriptions Allowed</option>" & vbNewLine
end if
Response.Write " </select>" & vbNewline
Response.Write " <a href=""Javascript:openWindow3('pop_help.asp?mode=options#subscription')"" tabindex=""-1"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a></font></td>" & vbNewline
Response.Write " </tr>" & vbNewLine
end if

' Topic Moderation Code - Check if Moderation is allowed over the entire board, then
' check if Moderation is allowed for the next level up.
if strModeration > 0 and _
((strRqMethod = "Category" or strRqMethod = "EditCategory") or _
((strRqMethod = "Forum" or strRqMethod = "EditForum") and CatModeration > 0)) then
Response.Write " <tr>" & vbNewline
Response.Write " <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Moderation:</b></font></td>" & vbNewLine
Response.Write " <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
Response.Write " <select name=""Moderation"">" & vbNewLine
if strRqMethod = "Category" or strRqMethod = "EditCategory" then
Response.Write " <option"
if CatModeration = 0 then
Response.Write " selected "
end if
Response.Write " value=""0"">Moderation Not Allowed in this Category</option>" & vbNewLine
Response.Write " <option"
if CatModeration = 1 then
Response.Write " selected "
end if
Response.Write " value=""1"">Moderation Allowed in this Category</option>" & vbNewLine
else
Response.Write " <option"
if ForumModeration = 0 then
Response.Write " selected "
end if
Response.Write " value=""0"">No Moderation for this forum</option>" & vbNewLine
Response.Write " <option"
if ForumModeration = 1 then
Response.Write " selected "
end if
Response.Write " value=""1"">All Posts Moderated</option>" & vbNewLine
Response.Write " <option"
if ForumModeration = 2 then
Response.Write " selected "
end if
Response.Write " value=""2"">Original Posts Only Moderated</option>" & vbNewLine
Response.Write " <option"
if ForumModeration = 3 then
Response.Write " selected "
end if
Response.Write " value=""3"">Replies Only Moderated</option>" & vbNewLine
end if
Response.Write " </select>" & vbNewline
Response.Write " <a href=""Javascript:openWindow3('pop_help.asp?mode=options#moderation')"" tabindex=""-1"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a> </font></td>" & vbNewline
Response.Write " </tr>" & vbNewline
end if
end if
' DEM --> End of Code Added for Moderation and Subscription

if strRqMethod = "Edit" or _
strRqMethod = "URL" or strRqMethod = "EditURL" or _
strRqMethod = "Reply" or strRqMethod = "ReplyQuote" or _
strRqMethod = "EditTopic" or strRqMethod = "Topic" or strRqMethod = "TopicQuote" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """> </td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """>" & vbNewLine
if strRqMethod = "Edit" or strRqMethod = "Reply" or strRqMethod = "ReplyQuote" or _
strRqMethod = "Topic" or strRqMethod = "EditTopic" or strRqMethod = "TopicQuote" then
if (strRqMethod = "Reply" or strRqMethod = "ReplyQuote" or _
strRqMethod = "Topic" or strRqMethod = "TopicQuote") and strSignatures = "1" and strDSignatures <> "1" then
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
intSigDefault = getSigDefault(MemberID)
Response.Write " <input name=""Sig"" id=""Sig"" type=""checkbox"" value=""yes""" & chkCheckbox(intSigDefault,1,true) & "><label for=""Sig"">Check here to include your profile signature.</label><br /></font>" & vbNewLine
end if
if strSignatures = "1" and strDSignatures = "1" then
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>"
if strRqMethod = "Edit" then
Response.Write "<input name=""Sig"" id=""Sig"" type=""checkbox"" value=""yes""" & chkCheckbox(strReplySig,1,true) & "><label for=""Sig"">Check here to include your profile signature.</label><br /></font>" & vbNewLine
elseif strRqMethod = "EditTopic" then
Response.Write "<input name=""Sig"" id=""Sig"" type=""checkbox"" value=""yes""" & chkCheckbox(strTopicSig,1,true) & "><label for=""Sig"">Check here to include your profile signature.</label><br /></font>" & vbNewLine
else
intSigDefault = getSigDefault(MemberID)
Response.Write "<input name=""Sig"" id=""Sig"" type=""checkbox"" value=""yes""" & chkCheckbox(intSigDefault,1,true) & "><label for=""Sig"">Check here to include your profile signature.</label><br /></font>" & vbNewLine
end if
end if
'## Subscribe checkbox start ##
if strSubscription > 0 and postCat_Subscription > 0 and postForum_Subscription > 0 and strEmail = 1 then
' -- Check for a topic subscription held by the user
Dim strSubString, strSubArray, strBoardSubs, strCatSubs, strForumSubs, strTopicSubs
if MySubCount > 0 then
strSubString = PullSubscriptions(0, 0, 0)
strSubArray = Split(strSubString,";")
if uBound(strSubArray) < 0 then
strBoardSubs = ""
strCatSubs = ""
strForumSubs = ""
strTopicSubs = ""
else
strBoardSubs = strSubArray(0)
strCatSubs = strSubArray(1)
strForumSubs = strSubArray(2)
strTopicSubs = strSubArray(3)
end If
end if
SubLinkFontStart = " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>"
SubLinkFontEnd = "<br /></font>" & vbNewLine
if InArray(strTopicSubs, strRqTopicID) and strRqMethod <> "Topic" then
Response.Write SubLinkFontStart & ShowSubLink ("U", strRqCatID, strRqForumID, strRqTopicID, "Y") & SubLinkFontEnd
elseif strBoardSubs <> "Y" and not(InArray(strForumSubs,strRqForumID) or InArray(strCatSubs,strRqCatID)) then
Response.Write SubLinkFontStart & ShowSubLink ("S", strRqCatID, strRqForumID, strRqTopicID, "Y") & SubLinkFontEnd
end if
end if
'# Subscribe checkbox end ##
if ((mLev = 4) or (chkForumModerator(strRqForumId, strDBNTUserName) = "1")) _
and (strRqMethod = "Topic" or strRqMethod = "EditTopic" or strRqMethod = "Reply" or _
strRqMethod = "ReplyQuote" or strRqMethod = "TopicQuote") then
if strStickyTopic = "1" then
if strRqMethod = "Topic" then
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""sticky"" id=""sticky"" type=""checkbox"" value=""1""><label for=""sticky"">Check here to make this topic sticky.</label><br /></font>" & vbNewLine
elseif strRqMethod = "EditTopic" then
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""sticky"" id=""sticky"" type=""checkbox"" value=""1""" & chkCheckbox(strTopicSticky,1,true) & "><label for=""sticky"">Check here to make this topic sticky.</label><br /></font>" & vbNewLine
end if
end if
if blnTStatus = 1 then
if strRqMethod <> "EditTopic" then
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""lock"" id=""lock"" type=""checkbox"" value=""1""><label for=""lock"">Check here to lock the topic after this post.</label><br /></font>" & vbNewLine
end if
end if
end if
if (strDBNTUserName = "" and strSignatures <> "1") or (strRqMethod = "EditTopic" and strDSignatures <> "1") then
Response.Write "  " & vbNewLine
end if
end if
Response.Write " </td>" & vbNewline
Response.Write " </tr>" & vbNewline
end if

if strPrivateForums <> "0" then
if strRqMethod = "Forum" or _
strRqMethod = "URL" or _
strRqMethod = "EditURL" or _
strRqMethod = "EditForum" then
if strRqMethod = "EditForum" or _
strRqMethod = "EditURL" then
ForumAuthType = fPrivateForums
else
ForumAuthType = 0
end if
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Auth Type:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """>" & vbNewLine & _
" <select readonly name=""AuthType"">" & vbNewLine & _
" <option value=""0"""
if ForumAuthType = 0 then Response.Write(" selected")
Response.Write ">All Visitors</option>" & vbNewLine
if strRqMethod = "Forum" or strRqMethod = "EditForum" then
Response.Write " <option value=""4"""
if ForumAuthType = 4 then Response.Write(" selected")
Response.Write ">Members Only</option>" & vbNewLine
end if
Response.Write " <option value=""5"""
if ForumAuthType = 5 then Response.Write(" selected")
Response.Write ">Members Only (Hidden)</option>" & vbNewLine
if strRqMethod = "Forum" or _
strRqMethod = "EditForum" then
Response.Write " <option value=""2"""
if ForumAuthType = 2 then Response.Write(" selected")
Response.Write ">Password Protected</option>" & vbNewLine & _
" <option value=""7"""
if ForumAuthType = 7 then Response.Write(" selected")
Response.Write ">Members Only & Password Protected</option>" & vbNewLine & _
" <option value=""3"""
if ForumAuthType = 3 then Response.Write(" selected")
Response.Write ">Allowed Member List & Password Protected</option>" & vbNewLine & _
" <option value=""1"""
if ForumAuthType = 1 then Response.Write(" selected")
Response.Write ">Allowed Member List</option>" & vbNewLine
end if
Response.Write " <option value=""6"""
if ForumAuthType = 6 then Response.Write(" selected")
Response.Write ">Allowed Member List (Hidden)</option>" & vbNewLine
if strNTGroups = "1" then
Response.Write " <option value=""9"""
if ForumAuthType = 9 then Response.Write(" selected")
Response.Write ">NT Global Group</option>" & vbNewLine & _
" <option value=""8"""
if ForumAuthType = 8 then Response.Write(" selected")
Response.Write ">NT Global Group (Hidden)</option>" & vbNewLine
end if
Response.Write " </select> <a href=""Javascript:openWindow3('pop_help.asp?mode=options#authtype')"" tabindex=""-1"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a>" & vbNewLine
if strRqMethod = "Forum" or _
strRqMethod = "EditForum" then
if strRqMethod = "EditForum" then
If fPasswordNew <> " " Then
strPassword = fPasswordNew
else
strPassword = " "
end if
else
strPassword = " "
end if
Response.Write " <br /><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Password"
if strNTGroups = "1" then Response.Write(" or Global Groups")
Response.Write ":</b><br /></font>" & vbNewLine & _
" <input maxLength=""255"" type=""text"" name=""AuthPassword"" size=""50"" value=""" & strPassword & """>"
end if
Response.Write "</td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Allowed Member List:</b></font></td>" & vbNewLine
'#################################################################################
'## Allowed User - listbox Code
'#################################################################################
strSql = "SELECT MEMBER_ID, M_NAME "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_STATUS = " & 1
strSql = strSql & " ORDER BY M_NAME ASC "

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

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

rsMember.close
set rsMember = nothing

tmpStrUserList = ""

if strRqMethod = "EditForum" or strRqMethod = "EditURL" then
strSql = "SELECT AM.MEMBER_ID, M.M_NAME"
strSql = strSql & " FROM " & strTablePrefix & "ALLOWED_MEMBERS AM, " & strMemberTablePrefix & "MEMBERS M"
strSql = strSql & " WHERE AM.FORUM_ID = " & strRqForumID & " AND M.MEMBER_ID = AM.MEMBER_ID"

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

if rsAllowedMember.EOF then
recAllowedMemberCount = ""
else
allAllowedMemberData = rsAllowedMember.GetRows(adGetRowsRest)
recAllowedMemberCount = UBound(allAllowedMemberData,2)
amMEMBER_ID = 0
amM_NAME = 1
end if

rsAllowedMember.close
set rsAllowedMember = nothing

if recAllowedMemberCount <> "" then
for iAllowedMember = 0 to recAllowedMemberCount
AllowedMembersMemberID = allAllowedMemberData(amMEMBER_ID, iAllowedMember)
if tmpStrUserList = "" then
tmpStrUserList = AllowedMembersMemberID
else
tmpStrUserList = tmpStrUserList & "," & AllowedMembersMemberID
end if
next
end if
end if
SelectSize = 6
Response.Write " <td bgColor=""" & strPopUpTableColor & """>" & vbNewLine & _
" <table>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Available</b></font><br />" & vbNewLine & _
" <select name=""AuthUsersCombo"" size=""" & SelectSize & """ multiple onDblClick=""moveSelectedOptions(document.PostTopic.AuthUsersCombo, document.PostTopic.AuthUsers, false, '')"">" & vbNewLine
'## Pick from list
if recMemberCount <> "" then
for iMembers = 0 to recMemberCount
MembersMemberID = allMemberData(meMEMBER_ID, iMembers)
MembersMemberName = allMemberData(meM_NAME, iMembers)
if not(Instr("," & tmpStrUserList & "," , "," & MembersMemberID & ",") > 0) then
Response.Write " <option value=""" & MembersMemberID & """>" & ChkString(MembersMemberName,"display") & "</option>" & vbNewline
end if
next
end if
Response.Write " </select>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td width=""15"" align=""center"" valign=""middle""><br />" & vbNewLine & _
" <a href=""javascript:moveAllOptions(document.PostTopic.AuthUsers, document.PostTopic.AuthUsersCombo, false, '')"" tabindex=""-1"">" & getCurrentIcon(strIconPrivateRemAll,"","") & "</a>" & vbNewLine & _
" <a href=""javascript:moveSelectedOptions(document.PostTopic.AuthUsers, document.PostTopic.AuthUsersCombo, false, '')"" tabindex=""-1"">" & getCurrentIcon(strIconPrivateRemove,"","") & "</a>" & vbNewLine & _
" <a href=""javascript:moveSelectedOptions(document.PostTopic.AuthUsersCombo, document.PostTopic.AuthUsers, false, '')"" tabindex=""-1"">" & getCurrentIcon(strIconPrivateAdd,"","") & "</a>" & vbNewLine & _
" <a href=""javascript:moveAllOptions(document.PostTopic.AuthUsersCombo, document.PostTopic.AuthUsers, false, '')"" tabindex=""-1"">" & getCurrentIcon(strIconPrivateAddAll,"","") & "</a>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Selected</b></font><br />" & vbNewLine & _
" <select name=""AuthUsers"" size=""" & SelectSize & """ tabindex=""-1"" multiple onDblClick=""moveSelectedOptions(document.PostTopic.AuthUsers, document.PostTopic.AuthUsersCombo, false, '')"">" & vbNewLine
'## Selected List
if strRqMethod = "EditForum" or strRqMethod = "EditURL" then
if recAllowedMemberCount <> "" then
for iAllowedMember = 0 to recAllowedMemberCount
AllowedMembersMemberID = allAllowedMemberData(amMEMBER_ID, iAllowedMember)
AllowedMembersMemberName = chkString(allAllowedMemberData(amM_NAME, iAllowedMember), "display")
if AllowedMembersMemberID <> "" then
Response.Write " <option value=""" & AllowedMembersMemberID & """>" & AllowedMembersMemberName & "</option>" & vbNewline
end if
next
end if
end if
Response.Write " </select>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td valign=""top""> <a href=""Javascript:openWindow3('pop_help.asp?mode=options#memberlist')"" tabindex=""-1"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
'#################################################################################
'## Allowed User - End of listbox code
'#################################################################################
end if
end if

Response.Write " <tr>" & vbNewline & _
" <td bgColor=""" & strPopUpTableColor & """> </td>" & vbNewline & _
" <td bgColor=""" & strPopUpTableColor & """><input name=""Submit"" type=""submit"" value=""" & btn & """"
if strRqMethod = "Forum" or _
strRqMethod = "URL" or _
strRqMethod = "EditURL" or _
strRqMethod = "EditForum" then
if strPrivateForums <> "0" then
if mLev = 3 then
Response.Write " onclick=""selectAllOptions(document.PostTopic.AuthUsers);"""
else
Response.Write " onclick=""selectAllOptions(document.PostTopic.AuthUsers);selectAllOptions(document.PostTopic.ForumMod);"""
end if
else
if mLev > 3 then Response.Write " onclick=""selectAllOptions(document.PostTopic.ForumMod);"""
end if
end if
Response.Write ">"

if strAllowForumCode = "1" or strAllowHTML = "1" then
if strRqMethod = "Reply" or _
strRqMethod = "ReplyQuote" or _
strRqMethod = "Edit" or _
strRqMethod = "EditTopic" or _
strRqMethod = "Topic" or _
strRqMethod = "TopicQuote" then
Response.Write " <input name=""Preview"" type=""button"" value="" Preview "" onclick=""OpenPreview()"">"
end if
end if
'Response.Write " <input name=""Reset"" type=""reset"" value=""Reset Fields"" tabindex=""-1""></td>" & vbNewline & _
Response.Write "</td>" & vbNewline & _
" </tr>" & vbNewline & _
" </form>" & vbNewLine & _
" </table>" & vbNewline & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
" </table>" & vbNewline & _
" <br />" & vbNewline

if strRqMethod = "Reply" or _
strRqMethod = "TopicQuote" or _
strRqMethod = "ReplyQuote" then
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine & _
"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""95%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strHeadCellColor & """ colspan=""2"" align=""center""><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>T O P I C    R E V I E W</font></b></td>" & vbNewLine & _
" </tr>" & vbNewLine
if (mLev = 4) or (chkForumModerator(strRqForumId, strDBNTUserName) = "1") then
Moderation = "N"
else
' DEM --> Added Select of Moderation Fields
strSQL = "SELECT C.CAT_MODERATION, F.F_MODERATION "
strSQL = strSQL & "FROM " & strTablePrefix & "CATEGORY C, " & strTablePrefix & "FORUM F "
strSQL = strSQL & " WHERE C.CAT_ID = " & strRqCatID
strSQL = strSQL & " AND F.FORUM_ID = " & strRqForumID
set rsa = my_Conn.Execute (strSql)
' ## Moderators and Admins can see unmoderated posts.
if strModeration = 1 and rsa("CAT_MODERATION") = 1 and (rsa("F_MODERATION") = 1 or rsa("F_MODERATION") = 3) then
Moderation = "Y"
else
Moderation = "N"
end if
set rsa = nothing
end if
' DEM --> End of Moderation Code

'## Forum_SQL
strSql = "SELECT M.M_NAME, T.T_DATE, T.T_MESSAGE "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS M, " & strActivePrefix & "TOPICS T "
strSql = strSql & " WHERE M.MEMBER_ID = T.T_AUTHOR AND T.TOPIC_ID = " & strRqTopicID

set rs = my_Conn.Execute (strSql)

Response.Write " <tr>" & vbNewline
Response.Write " <td bgcolor=""" & strForumFirstCellColor & """ valign=""top"" width=""" & strTopicWidthLeft & """"
if lcase(strTopicNoWrapLeft) = "1" then
Response.Write " nowrap"
end if
Response.Write "><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & ChkString(rs("M_NAME"),"display") & "</b></font></td>" & vbNewline
Response.Write " <td bgcolor=""" & strForumFirstCellColor & """ valign=""top"" width=""" & strTopicWidthRight & """"
if lcase(strTopicNoWrapRight) = "1" then
Response.Write " nowrap"
end if
Response.Write "><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><small>Posted - " & ChkDate(rs("T_DATE"), " :" ,true) & "</small><hr size=""" & strFooterFontSize & """><span class=""spnMessageText"">" & formatStr(rs("T_MESSAGE")) & "</span></font></td>" & vbNewline
Response.Write " </tr>" & vbNewline

rs.close
set rs = nothing
'## Forum_SQL - Get all replies to Topic from the DB
strSql ="SELECT M.M_NAME, R.R_DATE, R.R_MESSAGE "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS M, " & strActivePrefix & "REPLY R "
strSql = strSql & " WHERE M.MEMBER_ID = R.R_AUTHOR AND R.TOPIC_ID = " & strRqTopicID
' DEM --> Added check for moderation so that only admins and moderators can see the unapproved posts.
if Moderation = "Y" then
strSql = strSql & " AND R.R_STATUS < 2 " ' Ignore unapproved and rejected posts...
else
strSql = strSql & " AND R.R_STATUS < 3 " ' Ignore all rejected posts....
end if
strSql = strSql & " ORDER BY R.R_DATE DESC;"

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

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

rs.close
set rs = nothing

strI = 0
if recReplyCount = "" then
Response.Write ""
else
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strHeadCellColor & """ colspan=""2"" align=""center""><b><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>" & recReplyCount+1 & "   L A T E S T    R E P L I E S    (Newest First)</font></b></td>" & vbNewLine & _
" </tr>" & vbNewLine

mM_NAME = 0
rR_DATE = 1
rR_MESSAGE = 2

for iReply = 0 to recReplyCount

ReplyMemberName = allReplyData(mM_NAME, iReply)
ReplyDate = allReplyData(rR_DATE, iReply)
ReplyMessage = allReplyData(rR_MESSAGE, iReply)

if strI = 0 then
CColor = strAltForumCellColor
else
CColor = strForumCellColor
end if
Response.Write " <tr>" & vbNewline & _
" <td bgcolor=""" & CColor & """ valign=""top""" & vbNewline
if lcase(strTopicNoWrapLeft) = "1" then
Response.Write " nowrap"
end if
Response.Write "><b><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & ChkString(ReplyMemberName,"display") & "</font></b></td>" & vbNewline & _
" <td bgcolor=""" & CColor & """ valign=""top"""
if lcase(strTopicNoWrapRight) = "1" then
Response.Write " nowrap"
end if
Response.Write "><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><small>Posted - " & ChkDate(ReplyDate, " :" ,true) & "</small><hr size=""" & strFooterFontSize & """><span class=""spnMessageText"">" & formatStr(ReplyMessage) & "</span></font></td>" & vbNewline & _
" </tr>" & vbNewline
strI = strI + 1
if strI = 2 then
strI = 0
end if
next
end if

Response.Write " </table>" & vbNewline & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
" </table>" & vbNewline & _
" <br />" & vbNewline
end if
WriteFooter

function Go_Result(message)
Response.write " <br /><div align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiliteFontColor & """>" & message & "</font></div>" &_
" <br />" &_
" <meta http-equiv=""Refresh"" content=""2; URL=default.asp"">"
WriteFooter
Response.end
end function
%>
Go to Top of Page

Dave Goldman
New Member

USA
65 Posts

Posted - 01 September 2009 :  14:59:49  Show Profile
Hey Dave, just to let you know I actually backed up those three files and put the default files in and restarted the forum and no change.
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 01 September 2009 :  18:19:36  Show Profile
Post a link to your "inc_func_common.asp" in .txt format for us to look at.
Go to Top of Page

Dave Goldman
New Member

USA
65 Posts

Posted - 07 September 2009 :  07:07:06  Show Profile
I fixed the problem. I did a windiff on the files and it turned out there were a few lines that were different in the topic.asp. Thanks for your help guys!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 1.83 seconds. Powered By: Snitz Forums 2000 Version 3.4.07