⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 post_info.asp

📁 代码名称: Snitz Forums 2000 代码语言: 英文 代码类型: 国外代码 运行环境: ASP 授权方式: 免费代码 代码大小: 530kb 代码等级: 3 整
💻 ASP
📖 第 1 页 / 共 5 页
字号:
			strSql = strSql & ", " & "'" & Request.ServerVariables("REMOTE_ADDR") & "'"
		end if
	        ' DEM --> Added R_STATUS to allow for moderation of posts
	        ' Used R_STATUS = 1 to match the topic status code.
	        if Moderation = "Yes" then
			strSql = strSql & ", 2"
	        else
			strSql = strSql & ", 1"
	        end if
	        ' DEM --> End of Code added
		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 & ", " & Request.Form("AuthType") & ""
			if Request.Form("AuthPassword") <> " " then
				strSql = strSql & ", '" & ChkString(Request.Form("AuthPassword"),"SQLString") & "'"
			end if
		end if
		'strSql = strSql & ", " & "'" & DateToStr(strForumTimeAdjust) & "'"
		strSql = strSql & ", '" & txtSubject & "'"
		strSql = strSql & ", '" & txtMessage & "'"
		strSql = strSql & ", " & ChkString(Request.Form("Type"), "SQLString")
		strSql = strSql & ", '' "
		strSql = strSql & ", 30 "
		strSql = strSql & ", '' "
		strSql = strSql & ", 365 "
	        ' DEM --> Start of Code added for moderation and subscription
	        if strSubscription > 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 & ", " & Request.Form("Type")
	        strSql = strSql & ", ''"
	        strSql = strSql & ", 30"
	        strSql = strSql & ", ''"
	        strSql = strSql & ", 365"
	        ' DEM --> Added 0's for the subscription and moderation fields since they are ignored for URLS
	        strSql = strSql & ", 0, 0"
	        strSql = strSql & ", 1"
		strSql = strSql & ", 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")

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -