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

📄 post_info.asp

📁 代码名称: Snitz Forums 2000 代码语言: 英文 代码类型: 国外代码 运行环境: ASP 授权方式: 免费代码 代码大小: 530kb 代码等级: 3 整
💻 ASP
📖 第 1 页 / 共 5 页
字号:
	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
			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 & _
				"  

⌨️ 快捷键说明

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