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

📄 post_info.asp

📁 代码名称: Snitz Forums 2000 代码语言: 英文 代码类型: 国外代码 运行环境: ASP 授权方式: 免费代码 代码大小: 530kb 代码等级: 3 整
💻 ASP
📖 第 1 页 / 共 5 页
字号:
				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(strAuthor)
					end if
					doULastPost(strAuthor)
				end if
				'## Forum_SQL - Update count of replies to a topic in Forum table
				strSql = "UPDATE " & strTablePrefix & "FORUM SET "
				strSql = strSql & " F_COUNT = (F_COUNT + " & intResetCount & ")"
				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
		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")
		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 & ", '" & Request.ServerVariables("REMOTE_ADDR") & "'"
		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
		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")

		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

⌨️ 快捷键说明

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