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

📄 post_info.asp

📁 一个不错的ASP论坛源码
💻 ASP
📖 第 1 页 / 共 4 页
字号:
			loop
		 	Go_Result "更新完成", 1
	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") = "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)
	'## Emails Topic Author if Requested.  
	'## This needs to be Edited to use your own email component
	'## if you don't have one, try the w3Jmail component from www.dimac.net it's free!
    '#-#-#-#-#-#-#-# Added by Me
    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
    '#-#-#-#-#-#-#-# Done adding
    
    '#-#-#-#-#-#-#-# Changed Code
	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]", Request.form("Topic_Title"))
        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)
    '#-#-#-#-#-#-#-# End of Changed Code
    '         newreply
    '<<forum_title>> = strForumTitle
    '<<user_name>> = user_name
    '<<topic_title>> = request.form("Topic_Title")
    '<<link>> = Request.form("Refer")
    '#-#-#-#-#-#-#-# Old Code
'	if lcase(strEmail) = "1" then
'		strRecipientsName = user_name
'		strRecipients = email
'		strSubject = strForumTitle & " - Reply to your posting"
'		strMessage = "Hello " & user_name & vbCrLf & vbCrLf
'		strMessage = strMessage & "You have received a reply to your posting on " & strForumTitle & "." & vbCrLf
'		strMessage = strMessage & "Regarding the subject - " & Request.Form("Topic_Title") & "." & vbCrLf & vbCrLf
'		strMessage = strMessage & "You can view the reply at " & Request.Form("Refer") & 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]", Request.form("Topic_Title"))
        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)
        '#-# End Changed Code
        
        '#-# Old Code
'		strSubject = strForumTitle & " - Reply to a posting"
'		strMessage = "Hello " & rsTopicAuthor("M_NAME") & vbCrLf & vbCrLf
'		strMessage = strMessage & PostedByName & " has replied to a topic on " & strForumTitle & " that you requested notification to. "
'		strMessage = strMessage & "Regarding the subject - " & Request.Form("Topic_Title") & "." & vbCrLf & vbCrLf
'		strMessage = strMessage & "You can view the reply at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & 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]", Request.form("Topic_Title"))
        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)
                '#-# End Changed Code
                '#-#-# Old Code
                
'				strSubject = strForumTitle & " - Reply to a posting"
'				strMessage = "Hello " & rsReply("M_NAME") & vbCrLf & vbCrLf
'				strMessage = strMessage & PostedByName & " has replied to a topic on " & strForumTitle & " that you requested notification to. "
'				strMessage = strMessage & "Regarding the subject - " & Request.Form("Topic_Title") & "." & vbCrLf & vbCrLf
'				strMessage = strMessage & "You can view the reply at " & Left(Request.Form("refer"), InstrRev(Request.Form("refer"), "/")) & "link.asp?TOPIC_ID=" & TopicNum & vbCrLf
'		'		strMessage = strMessage & "You can view the reply at " & Request.Form("refer") & vbCrLf
%>
<!--#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)
%>
<table border="0" width="100%">
  <tr>
	<td width="33%" align="left"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
	<img src="<%=strImageURL %>icon_folder_open.gif" border="0">&nbsp;<a href="default.asp">返回论坛首页</a><br>
<% 
	if Request.form("Method_Type") = "Topic" or _
		Request.form("Method_Type") = "Reply" or _
		Request.form("Method_Type") = "EditTopic" then 
%>
	<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") %>&Forum_Title=<% = ChkString(Request.Form("FORUM_Title"),"urlpath")%>"><% = Request.Form("FORUM_Title") %></a><br>
<% 
	end if 
	if Request.form("Method_Type") = "Reply" or _
		Request.form("Method_Type") = "EditTopic" then 
%>
	<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") %>"><% =Request.Form("Topic_Title")%></a>
<% 
	end if 
%>
    </font></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
				DoPCount
				DoUCount Request.Form("UserName")
				DoULastPost Request.Form("UserName")
				Response.Write("新主题发表完成!")
			case "Forum"
				Response.Write("新论坛建立完成!")
			case "URL"
				Response.Write("新连接建立完成!")
			case "Category"
				Response.Write("新分类建立完成!")
			case else
				Response.Write("完成!")
				DoPCount
				DoUCount Request.Form("UserName")
				DoULastPost Request.Form("UserName")
		end select
%>
</font></p>
<meta http-equiv="Refresh" content="0; URL=<% =Request.Form("refer")%>">

<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">
<%
		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>

<!--#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
%>

⌨️ 快捷键说明

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