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

📄 post_info.asp

📁 此程序是一个个人主页创造程序,该程序无插件,无任何恶意程序.
💻 ASP
📖 第 1 页 / 共 4 页
字号:
	if Err_Msg = "" then
		'## Forum_SQL - Do DB Update
		strSql = "UPDATE " & strTablePrefix & "CATEGORY "
		strSql = strSql & " SET CAT_NAME = '" & ChkString(Request.Form("Subject"),"title") & "'"
		strSql = strSql & " WHERE CAT_ID = " & Request.Form("CAT_ID")

		my_Conn.Execute (strSql)

		 err_Msg= ""
		if Err.description <> "" then
			Go_Result "发生一个错误 →  " & Err.description, 0
%>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
		End If
			i = 1
			do until i > cint(Request.Form("NumberForums"))
				SelectName = "SortForum" & i
				SelectID   = "SortForumID" & i
		
				'## Forum_SQL - Do DB Update
				strSql = "UPDATE " & strTablePrefix & "FORUM "
				strSql = strSql & " SET FORUM_ORDER = " & Request.Form(SelectName)
				strSql = strSql & " WHERE FORUM_ID = " & Request.Form(SelectId)
				my_Conn.Execute (strSql)
	
				err_Msg= ""
				if Err.description <> "" then
					Go_Result "发生一个错误 →  " & Err.description, 0
				End if
				i = i + 1
			loop
		 	Go_Result "更新完成", 1
	else
		Go_Result Err_Msg, 0
	end if
end if

if Request.Form("Method_Type") = "SortCategory" then
	member = cint(ChkUser(STRdbntUserName, Request.Form("Password")))
	Select Case Member
		case 0 	'## Invalid Pword
			Go_Result "错误的密码或使用者名称", 0
		case 1 '## Author of Post
			Go_Result "只有管理员可以变更分类排序", 0
		case 2 '## Normal User - Not Authorised
			Go_Result "只有管理员可以变更分类排序", 0
		case 3 '## Moderator
			'## Do Nothing
			if chkForumModerator(Request.Form("FORUM_ID"), STRdbntUserName) = "0" then
				Go_Result "只有管理员可以修改分类排序", 0
			end if
		case 4 '## Admin
			'## Do Nothing
		case Else
			Go_Result cstr(Member), 0
	End Select

	i = 1
	do until i > cint(Request.Form("NumberCategories"))
		SelectName = "SortCategory" & i
		SelectID   = "SortCatID" & i
		
		'## Forum_SQL - Do DB Update
		strSql = "UPDATE " & strTablePrefix & "CATEGORY "
		strSql = strSql & " SET CAT_ORDER = " & Request.Form(SelectName)
		strSql = strSql & " WHERE CAT_ID = " & Request.Form(SelectId)
		my_Conn.Execute (strSql)

               		
		err_Msg= ""
		if Err.description <> "" then
			Go_Result "发生一个错误 →  " & Err.description, 0
		End if
		i = i + 1
	loop
 	Go_Result "更新完成", 1
End if

%>
<% set rs = nothing %>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
sub DoEmail(email, user_name)

    strsql = "Select m_message, m_subject from "&strTablePrefix&"email_config where m_type='newreply'"
    set EmailRS = my_conn.execute(strsql)
    	strEmailSubject = EmailRS("m_subject")
        strEmailMessage = EmailRS("m_message")
    set EmailRS = nothing

	if lcase(strEmail) = "1" then
		strRecipientsName = user_name
		strRecipients = email

        strSubject = strEmailSubject
        strSubject = Replace(strSubject, "[forum_title]", strForumTitle)

        strMessage = strEmailMessage
        strMessage = Replace(strMessage, "[user_name]", user_name)
        strMessage = Replace(strMessage, "[topic_title]", strTopicTitle)
        strMessage = Replace(strMessage, "[forum_title]", strForumTitle)
        strMessage = Replace(strMessage, "[link]", Request.form("Refer"))
        strMessage = Replace(strMessage, Chr(10), vbcrlf)
        strMessage = Replace(strMessage, "<br>", vbcrlf)
        strMessage = Replace(strMessage, "<p>", vbcrlf & vbcrlf)
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
	end if
end sub

sub DoReplyEmail(TopicNum, PostedBy, PostedByName)
	'## Emails all users who wish to receive a mail if topic
	'## has a reply but only send one per member.
	'## Forum_SQL
	strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
	strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "REPLY "
	strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "REPLY.R_AUTHOR "
	strSql = strSql & " AND   TOPIC_ID = " & TopicNum
	strSql = strSql & " AND   R_MAIL = 1 "
	strSql = strSql & " ORDER BY " & strMemberTablePrefix & "MEMBERS.MEMBER_ID"

	set rsReply = my_Conn.Execute (strSql)

	'## Forum_SQL
	strSql = " SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.M_EMAIL, " & strTablePrefix & "TOPICS.T_MAIL "
	strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS,  "
	strSql = strSql & strTablePrefix & "TOPICS "
	strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "TOPICS.T_AUTHOR "
	strSql = strSql & " AND " & strTablePrefix & "TOPICS.TOPIC_ID = " & TopicNum

	set rsTopicAuthor = my_Conn.Execute (strSql)
	
	MailSendToAuthor = false
	if (rsTopicAuthor("T_MAIL") = 1) and (PostedBy <> rsTopicAuthor("MEMBER_ID")) then
		strRecipientsName = rsTopicAuthor("M_NAME")
		strRecipients = rsTopicAuthor("M_EMAIL")
        '#-# Added Code
        'replynot
        strsql = "Select m_message, m_subject from "&strTablePrefix&"email_config where m_type='replynot'"
        set EmailRS = my_conn.execute(strsql)
        	strEmailMessage = EmailRS("m_message")
            strEmailSubject = EmailRS("m_subject")
        set EmailRS = nothing
       	'#-# End Added Code
        '#-# Changed Code
        strSubject = strEmailSubject
        strSubject = Replace(strSubject, "[forum_title]", strForumTitle)

        strEmailLink = Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & vbCrLf

        strMessage = strEmailMessage
        strMessage = Replace(strMessage, "[user_name]", user_name)
        strMessage = Replace(strMessage, "[topic_title]", strTopicTitle)
        strMessage = Replace(strMessage, "[forum_title]", strForumTitle)
        strMessage = Replace(strMessage, "[link]", strEmailLink)
        strMessage = Replace(strMessage, "[posted_by]", PostedByName)
        strMessage = Replace(strMessage, Chr(10), vbcrlf)
        strMessage = Replace(strMessage, "<br>", vbcrlf)
        strMessage = Replace(strMessage, "<p>", vbcrlf & vbcrlf)
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
		MailSendToAuthor = true
	end if
	
	prevMember = ""
	
	do while (not rsReply.EOF) and (not rsReply.BOF)
		if (prevMember <> rsReply("MEMBER_ID")) and (PostedBy <> rsReply("MEMBER_ID")) then
			if (rsTopicAuthor("MEMBER_ID") = rsReply("MEMBER_ID")) and (MailSendToAuthor) then
				'## Do Nothing
				'## The reply was done by the author, and he/she allready has got a mail
			else
				if (rsTopicAuthor("MEMBER_ID") = rsReply("MEMBER_ID")) then
					MailSendToAuthor = true
				end if
				strRecipientsName = rsReply("M_Name")
				strRecipients = rsReply("M_EMAIL")
                '#-# Added Code
        strsql = "Select m_message, m_subject from "&strTablePrefix&"email_config where m_type='replynot'"
        set EmailRS = my_conn.execute(strsql)
        	strEmailMessage = EmailRS("m_message")
            strEmailSubject = EmailRS("m_subject")
        set EmailRS = nothing
                '#-# End Added Code
                '#-# Changed Code
        strSubject = strEmailSubject
        strSubject = Replace(strSubject, "[forum_title]", strForumTitle)

        strEmailLink = Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & vbCrLf

        strMessage = strEmailMessage
        strMessage = Replace(strMessage, "[user_name]", user_name)
        strMessage = Replace(strMessage, "[topic_title]", strTopicTitle)
        strMessage = Replace(strMessage, "[forum_title]", strForumTitle)
        strMessage = Replace(strMessage, "[link]", strEmailLink)
        strMessage = Replace(strMessage, "[posted_by]", PostedByName)
        strMessage = Replace(strMessage, Chr(10), vbcrlf)
        strMessage = Replace(strMessage, "<br>", vbcrlf)
        strMessage = Replace(strMessage, "<p>", vbcrlf & vbcrlf)

		'rsReply("M_NAME")
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
			end if
		end if
		prevMember = rsReply("MEMBER_ID")
		rsReply.MoveNext
	loop

	rsReply.Close
	set rsReply = nothing

	rsTopicAuthor.Close
	set rsTopicAuthor = nothing
end sub

sub Go_Result(str_err_Msg, boolOk)
%>
	<TD width="70%" align="left" valign="top">
<TABLE border="0" width="85%" align=center>
  <TR>
    <TD width="33%" align="left" nowrap><font face="<% Response.Write strDefaultFontFace %>" size="<% Response.Write strDefaultFontSize %>"><a href="default.asp"><img src="<% =strImageURL %>icon_folder_open.gif" alt="返回论坛首页" border="0">&nbsp;<% =strForumTitle %></a>
<%
	if Request.form("Method_Type") = "Topic" or _
		Request.form("Method_Type") = "Reply" or _
		Request.form("Method_Type") = "EditTopic" then
%>
		<BR><img src="<%=strImageURL %>icon_bar.gif" border="0"><img src="<%=strImageURL %>icon_folder_open.gif" border="0">&nbsp;<a href="FORUM.asp?FORUM_ID=<% = Request.Form("FORUM_ID") %>&CAT_ID=<% = Request.Form("CAT_ID") %>"><% = strSubForumTitle %></a>
<%	end if %>
<%	if Request.form("Method_Type") = "Topic" then %>
		<BR><img src="<%=strImageURL %>icon_blank.gif" border="0"><img src="<%=strImageURL %>icon_bar.gif" border="0"><img src="<%=strImageURL %>icon_folder_open_topic.gif" border="0">&nbsp;新主题发表成功
<%	end if %>
<%
	if Request.form("Method_Type") = "Reply" or _
		Request.form("Method_Type") = "EditTopic" then
%>
		<BR><img src="<%=strImageURL %>icon_blank.gif" border="0"><img src="<%=strImageURL %>icon_bar.gif" border="0"><img src="<%=strImageURL %>icon_folder_open_topic.gif" border="0">&nbsp;<a href="<% =Request.Form("refer") %>"><% = TrueWord(strTopicTitle, 50, " ...") %></a>
<%	end if %>
</FONT></TD>
  </TR>
</TABLE>
</TD>
</TR>
</TABLE>

<%	if boolOk = 1 then %>
		<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">
<%
		select case Request.Form("Method_Type")
			case "Edit"
				Response.Write("你的回复修改成功!")
			case "EditCategory"
				Response.Write("分类名称修改成功!")
			case "EditForum"
				Response.Write("论坛属性更新成功!")
			case "EditTopic"
				Response.Write("主题修改成功!")
			case "EditURL"
				Response.Write("连接属性更新成功!")
			case "Reply"
				Response.Write("新回复发表完成!")
				DoPCount
				DoUCount Request.Form("UserName")
				DoULastPost Request.Form("UserName")
			case "ReplyQuote"
				Response.Write("新回复发表完成!")
				DoPCount
				DoUCount Request.Form("UserName")
				DoULastPost Request.Form("UserName")
			case "TopicQuote"
				Response.Write("新回复发表完成!")
				DoPCount
				DoUCount Request.Form("UserName")
				DoULastPost Request.Form("UserName")
			case "Topic"
				DoTCount
				DoUCount Request.Form("UserName")
				DoULastPost Request.Form("UserName")
				Response.Write("新主题发表完成!")
			case "Forum"
				Response.Write("新论坛建立完成!")
			case "URL"
				Response.Write("新连接建立完成!")
			case "Category"
				Response.Write("新分类建立完成!")
				If NOT IsNull(strTempCAT_ID) Then strReferBy_AUTHOR = "post.asp?method=Forum&CAT_ID=" & strTempCAT_ID & "&type=0"
			case else
				Response.Write("完成!")
				DoPCount
				DoUCount Request.Form("UserName")
				DoULastPost Request.Form("UserName")
		end select
%>
</font></p>
<meta http-equiv="Refresh" content="0; URL=<% =strReferBy_AUTHOR%>">
<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">
<%
		SET strReferBy_AUTHOR = Nothing
		If NOT IsNull(strTempCAT_ID) Then SET strTempCAT_ID = Nothing

		select case Request.Form("Method_Type")
			case "Category"
				Response.Write("记得在本分类建立至少一个讨论区。")
			case "EditCategory"
				Response.Write("感谢你的参与!")
			case "Forum"
				Response.Write("新论坛已经准备完成,可供会员发表文章!")
			case "EditForum"
				Response.Write("感谢你的参与!")
			case "URL"
				Response.Write("新连接已经建立!")
			case "EditURL"
				Response.Write("祝你有愉快的一天!")
			case "Topic"
				Response.Write("感谢你的参与!")
			case "TopicQuote"
				Response.Write("感谢你的参与!")
			case "EditTopic"
				Response.Write("感谢你的参与!")
			case "Reply"
				Response.Write("感谢你的参与!")
			case "ReplyQuote"
				Response.Write("感谢你的参与!")
			case "Edit"
				Response.Write("感谢你的参与!")
			case else
				Response.Write("祝你有愉快的一天!")
		end select
%>
</font></p>

<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="<% =Request.Form("refer")%>">返回论坛</font></a></p>

<!--#INCLUDE FILE="inc_footer.asp" -->
<%
		Response.End
	else
%>
<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">发生问题!</font></p>

<p align="center"><font color="red" size="<% =strHeaderFontSize %>"><% =str_err_Msg %></font></p>

<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript:history.go(-1)">返回修正问题。</a></font></p>
<!--
<table width="<% Response.Write strTableWidth  %>" bgcolor="<% =strTableBorderColor %>" cellpadding=0 cellspacing=0 border=0 align=center>
<tr>
<td>
<table width=100% cellpadding=6 cellspacing=1 border=0>
<tr>
<td bgcolor="<% =strHeadCellColor %>" align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>谢谢,您的新主题已经发表成功!</b></font></td></tr>
<tr>
<td bgcolor="<% =strForumCellColor %>"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">如果浏览器没有自动返回,请点击下面的链接!
<ul>
<li><a href="topic.cgi?forum=3&topic=349">返回新主题</a>
<li><a href="Link.asp?FORUM_ID=<% =Request.Form("FORUM_ID") %>">返回论坛</a>
<li><a href="default.asp">返回论坛首页</a>
</ul>
</td>
</tr>
</table>
</td>
</tr>
</table>
//-->
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
		Response.End
	end if
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)
		if Trim(Users(count)) <> "" then
			strSql = "INSERT INTO " & strTablePrefix & "ALLOWED_MEMBERS ("
			strSql = strSql & " MEMBER_ID, FORUM_ID) VALUES ( "& Users(count) & ", " & fForumID & ")"
	
			my_conn.execute (strSql)
			if err.number <> 0 then
				Go_REsult err.description, 0
			end if
		end if
	next

end sub

sub updateForumMembers(fForumID)
	my_Conn.execute ("DELETE FROM " & strTablePrefix & "ALLOWED_MEMBERS WHERE FORUM_ID = " & fForumId)
	newForumMembers(fForumID)
end sub

function CanUserPost(fTopicID, fMemberID)
	lastAllowedPost = DateToStr(DateAdd("n",-1,strForumTimeAdjust))
	strSql = "SELECT MAX(R_DATE) AS LASTPOST FROM " & strTablePrefix & "REPLY WHERE "
	strSql = strSql & "TOPIC_ID = " & fTopicID & " AND R_AUTHOR = " & fMemberID
	rsTmp = my_conn.execute(strSQL)
	if rsTmp("LASTPOST") > lastAllowedPost then
		CanUserPost = "no"
	else
		CanUserPost = "yes"
	end if
end function

Function ChkBadWords2(fString)

	ChkBadWords2 = false
	bwords = Split(strBadWords, "|")		' 建立不良词语数组
	for i = 0 to UBound(bwords)
		if InStr(fString, bwords(i)) then
			ChkBadWords2 = true
			exit for
		end if
	next

End Function
%>

⌨️ 快捷键说明

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