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

📄 post_info.asp

📁 一个不错的ASP论坛源码
💻 ASP
📖 第 1 页 / 共 4 页
字号:
<%
'########## Snitz Forums 2000 Version 3.1 SR4 ####################
'#                                                               #
'#  汉化修改: 资源搜罗站                                         #
'#  电子邮件: cgier@21cn.com                                     #
'#  主页地址: http://www.sdsea.com                               #
'#            http://www.99ss.net                                #
'#            http://www.cdown.net                               #
'#	     http://www.wzdown.com                               #
'#	     http://www.13888.net                                #
'#  论坛地址:http://ubb.yesky.net                                #
'#  最后修改日期: 2001/03/12    中文版本:Version 3.1 SR4        #
'#################################################################
'# 原始来源                                                      #
'# Snitz Forums 2000 Version 3.1 SR4                             #
'# Copyright 2000 http://forum.snitz.com - All Rights Reserved   #
'#################################################################
'#【版权声明】                                                   #
'#                                                               #
'# 本软体为共享软体(shareware)提供个人网站免费使用,请勿非法修改,#
'# 转载,散播,或用于其他图利行为,并请勿删除版权声明。          #
'# 如果您的网站正式起用了这个脚本,请您通知我们,以便我们能够知晓#
'# 如果可能,请在您的网站做上我们的链接,希望能给予合作。谢谢!  #
'#################################################################
'# 请您尊重我们的劳动和版权,不要删除以上的版权声明部分,谢谢合作#
'# 如有任何问题请到我们的论坛告诉我们                            #
'#################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->
<% 
if strAuthType = "db" then
	strDBNTUserName = Request.Form("UserName")
end if

set rs = Server.CreateObject("ADODB.RecordSet")

err_Msg = ""
ok = "" 

if Request.Form("Method_Type") = "Edit" then
	member = cint(ChkUser(strDBNTUserName, Request.Form("Password")))
	Select Case Member 
		case 0 '## Invalid Pword
			Go_Result "错误的用户名跟密码", 0
%>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
			Response.End
		case 1 '## Author of Post so OK
			'## Do Nothing
		case 2 '## Normal User - Not Authorised
			Go_Result "只有管理员、版主或作者才能修改此文章", 0
%>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
			Response.End
		case 3 '## Moderator so OK - check the Moderator of this forum
			if chkForumModerator(Request.Form("FORUM_ID"), STRdbntUserName) = "0" then
				Go_Result "只有管理员、版主或作者才能修改此文章", 0
			end if
		case 4 '## Admin so OK
			'## Do Nothing
		case else 
			Go_Result cstr(Member), 0
%>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
			Response.End
	end select

	txtMessage = ChkString(Request.Form("Message"),"message")
	Err_Msg = ""

	if txtMessage = " " then 
		Err_Msg = Err_Msg & "<li>不是吧你?内容都不写?</li>"
	end if
	if Err_Msg = "" then
		if strEditedByDate = "1" and mlev < 4 then
			txtMessage = txtMessage & vbCrLf & vbCrLf & "<font size=""" & strFooterFontSize & """ color=""" & strLinkColor & """>Edited by - "
			txtMessage = txtMessage & ChkString(STRdbntUserName, "display") & " 重新编辑於 " & ChkDate(DateToStr(strForumTimeAdjust)) & " " & ChkTime(DateToStr(strForumTimeAdjust)) & "</font>"
		end if

		'## Forum_SQL - Do DB Update
		strSql = "UPDATE " & strTablePrefix & "REPLY "
		strSql = strSql & " SET R_MESSAGE = '" & txtMessage & "'"
		if lcase(strEmail) = "1" then '**
			if Request.Form("rmail") <> "1" then
				TF = "0"
			else 
				TF = "1"
			end if
			strSql = strSql & ", R_MAIL = " & TF
		end if
		strSql = strSql & " WHERE REPLY_ID=" & Request.Form("REPLY_ID")

		my_Conn.Execute (strSql)

		if mLev <> 4 then
			'## Forum_SQL - Update Last Post
			strSql = " UPDATE " & strTablePrefix & "FORUM"
			strSql = strSql & " SET F_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
			strSql = strSql & ",    F_LAST_POST_AUTHOR = " & getMemberID(STRdbntUserName)
			strSql = strSql & " WHERE FORUM_ID = " & Request.Form("FORUM_ID")

			my_Conn.Execute (strSql)
			
			'## Forum_SQL - Update Last Post
			strSql = " UPDATE " & strTablePrefix & "TOPICS"
			strSql = strSql & " SET T_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
			strSql = strSql & ",    T_LAST_POST_AUTHOR = " & getMemberID(STRdbntUserName)
			strSql = strSql & " WHERE TOPIC_ID = " & Request.Form("TOPIC_ID")

			my_Conn.Execute (strSql)
		
		end if

		err_Msg = ""
		if Err.description <> "" then 
			Go_Result "发生一个错误 →  " & Err.description, 0
%>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
			Response.End
		else
			Go_Result "更新完成", 1
		end if

		'## Forum_SQL
		strSql = "UPDATE " & strTablePrefix & "TOPICS "
		strSql = strSql & " SET T_LAST_POST = '" & DateToStr(strForumTimeAdjust) & "'"
		strSql = strSql & ",    T_LAST_POST_AUTHOR = " & getMemberID(STRdbntUserName)
		strSql = strSql & " WHERE TOPIC_ID = " & Request.Form("TOPIC_ID")

		my_Conn.Execute (strSql)

		err_Msg = ""
		if Err.description <> "" then 
			Go_Result "发生一个错误 →  " & Err.description, 0
%>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
			Response.End
		else
			Go_Result  "更新完成", 1
%>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
			Response.End
		end if
	else 
%>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
	<p align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">你输入的资料有问题或没有填写完整</font></p>

	<table align=center border=0>
	  <tr>
	    <td><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
		<ul>
		<% =Err_Msg %>
		</ul>
	    </font></td>
	  </tr>
	</table>

	<p align=center><font face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>><a href="JavaScript:history.go(-1)">请返回重新输入</a></font></p>
<%
	end if
end if

if Request.Form("Method_Type") = "EditTopic" then
	member = cint(ChkUser(STRdbntUserName, Request.Form("Password")))
	select case Member 
		case 0 '## Invalid Pword
			Go_Result "错误的用户名跟密码", 0
%>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
			Response.End
		case 1 '## Author of Post so OK
			'## Do Nothing
		case 2 '## Normal User - Not Authorised
			Go_Result "只有管理员、版主或作者才能修改此文章", 0
%>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
			Response.End
		case 3 '## Moderator so 
			if chkForumModerator(Request.Form("FORUM_ID"), STRdbntUserName) = "0" then
				Go_Result "只有管理员、版主或作者才能修改此文章", 0
			end if
		case 4 '## Admin so OK
			'## Do Nothing
		case else 
			Go_Result cstr(Member), 0
%>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
			Response.End
	end select

	txtMessage = ChkString(Request.Form("Message"),"message")
	txtSubject = ChkString(Request.Form("Subject"),"title")
	Err_Msg = ""

	if txtSubject = " " then 
		Err_Msg = Err_Msg & "<li>你必须输入文章标题</li>"
	end if
	if txtMessage = " " then 
		Err_Msg = Err_Msg & "<li>你必须输入文章内容</li>"
	end if
	if Err_Msg = "" then
		if strEditedByDate = "1" and mlev < 4 then
			txtMessage = txtMessage & vbCrLf & vbCrLf & "<font size=""" & strFooterFontSize & """ color=""" & strLinkColor & """>Edited by - "
			txtMessage = txtMessage & Chkstring(STRdbntUserName, "display") & " on " & ChkDate(DateToStr(strForumTimeAdjust)) & " " & ChkTime(DateToStr(strForumTimeAdjust)) & "</font>"
		end if

		'## Set array to pull out CAT_ID and FORUM_ID from dropdown values in post.asp
		aryForum = split(Request.Form("Forum"), "|")

		'## Forum_SQL
		strSql = "UPDATE " & strTablePrefix & "TOPICS "
		strSql = strSql & " SET T_MESSAGE = '" & txtMessage & "'"
		strSql = strSql & ",     T_SUBJECT = '" & txtSubject & "'"
		if Request.Form("FORUM_ID") <> "" and Request.Form("FORUM_ID") <> aryForum(1) then
			strSql = strSql & ",     CAT_ID = " & aryForum(0)
			strSql = strSql & ",     FORUM_ID = " & aryForum(1)
		end if
		if lcase(strEmail) = "1" then '**
			if Request.Form("rmail") <> "1" then
				TF = "0"
			else 
				TF = "1"
			end if
			strSql = strSql & ",     T_MAIL = " & TF
		end if
		strSql = strSql & " WHERE TOPIC_ID = " & Request.Form("TOPIC_ID")

		my_Conn.Execute(strSql)

		if Request.Form("FORUM_ID") <> aryForum(1) then
			'## Forum_SQL
			strSql = "UPDATE " & strTablePrefix & "REPLY "
			strSql = strSql & " SET CAT_ID = " & aryForum(0)
			strSql = strSql & ",     FORUM_ID = " & aryForum(1)
			strSql = strSql & " WHERE TOPIC_ID = " & Request.Form("TOPIC_ID")

			my_Conn.Execute(strSql)
			
			set rs = Server.CreateObject("ADODB.Recordset")
			
			'## Forum_SQL - count total number of replies in Topics table
			strSql = "SELECT T_REPLIES, T_LAST_POST, T_LAST_POST_AUTHOR "
			strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
			strSql = strSql & " WHERE TOPIC_ID = " & Request.Form("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 T_LAST_POST, T_LAST_POST_AUTHOR "
			strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
			strSql = strSql & " WHERE FORUM_ID = " & Request.Form("FORUM_ID") & " "
			strSql = strSql & " ORDER BY T_LAST_POST DESC;"

			set rs = my_Conn.Execute (strSql)
			
			if not rs.eof then
				strLast_Post = rs("T_LAST_POST")
				strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
			else
				strLast_Post = ""
				strLast_Post_Author = ""
			end if
			
			rs.Close
			set rs = nothing

			'## Forum_SQL - Update count of replies to a topic in Forum table



			strSql = "UPDATE " & strTablePrefix & "FORUM SET "
			strSql = strSql & " F_COUNT = F_COUNT - " & intResetCount
			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 = " & Request.Form("FORUM_ID")
			my_Conn.Execute(strSql)

			'## Forum_SQL
			strSql =  "UPDATE " & strTablePrefix & "FORUM SET "
			strSql = strSql & " F_TOPICS = F_TOPICS - 1 "
			strSql = strSql & " WHERE FORUM_ID = " & Request.Form("FORUM_ID")
			my_Conn.Execute(strSql)

			'## Forum_SQL - Get last_post and last_post_author for Forum
			strSql = "SELECT T_LAST_POST, T_LAST_POST_AUTHOR "
			strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
			strSql = strSql & " WHERE FORUM_ID = " & aryForum(1) & " "
			strSql = strSql & " ORDER BY T_LAST_POST DESC;"

			set rs = my_Conn.Execute (strSql)
			
			if not rs.eof then
				strLast_Post = rs("T_LAST_POST")
				strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
			else
				strLast_Post = ""
				strLast_Post_Author = ""
			end if
			
			rs.Close
			set rs = nothing

			'## Forum_SQL - Update count of replies to a topic in Forum table
			strSql = "UPDATE " & strTablePrefix & "FORUM SET "
			strSql = strSql & " F_COUNT = (F_COUNT + " & intResetCount & ")"
			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 = " & aryForum(1)
			my_Conn.Execute(strSql)

			'## Forum_SQL
			strSql =  "UPDATE " & strTablePrefix & "FORUM SET "
			strSql = strSql & " F_TOPICS = F_TOPICS + 1 "
			strSql = strSql & " WHERE FORUM_ID = " & aryForum(1)
			my_Conn.Execute(strSql)

		end if
		err_Msg = ""
		aryForum = ""
		if Err.description <> "" then 
			Go_Result "发生一个错误 →  " & Err.description, 0
%>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
			Response.End
		else
			Go_Result  "更新完成", 1
		end if
	else 
%>
	<p align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">你输入的资料有问题或没有填写完整</font></p>

	<table align=center border=0>
	  <tr>
	    <td><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
		<ul>
		<% =Err_Msg %>
		</ul>
	    </font></td>
	  </tr>
	</table>

	<p align=center><font face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>><a href="JavaScript:history.go(-1)">请返回重新输入</a></font></p>
<%
	end if
end if

if Request.Form("Method_Type") = "Topic" then
	'## Forum_SQL
	strSql = "SELECT MEMBER_ID, M_LEVEL, M_EMAIL, "&Strdbntsqlname
	if strAuthType = "db" then
		strSql = strSql & ", M_PASSWORD "
	end if
	strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
	strSql = strSql & " WHERE "&Strdbntsqlname&" = '" & STRdbntUserName & "'"
	strSql = strSql & " AND " & strMemberTablePrefix & "MEMBERS.M_STATUS = " & 1
	if strAuthType = "db" then
		strSql = strSql & " AND   M_PASSWORD = '" & Request.Form("Password") &"'"
		QuoteOk = (ChkQuoteOk(STRdbntUserName) and ChkQuoteOk(Request.Form("Password")))
	else
		QuoteOk = ChkQuoteOk(Session(strCookieURL & "userid"))
	end if

	set rs = my_Conn.Execute (strSql)

	if rs.BOF or rs.EOF or not(QuoteOk) then '##  Invalid Password
		Go_Result "Invalid UserName or Password", 0
%>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
		Response.End
	else

			if not(chkForumAccess(Request.Form("FORUM_ID"))) then			
				Go_Result "你不能在本论坛发表文章" & strDBNTUserName, 0		
			end if
		txtMessage = ChkString(Request.Form("Message"),"message")
		txtSubject = ChkString(Request.Form("Subject"),"title")

⌨️ 快捷键说明

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