%
HtmlTop
if CookieUserName=empty then error("您还未登录论坛")
Rs.Open "select * from [BBSXP_Users] where UserID="&CookieUserID&"",Conn,1,3
UserAccountStatus=Rs("UserAccountStatus")
UserRegisterTime=Rs("UserRegisterTime")
UserPostTime=Rs("UserPostTime")
Rs.close
if UserAccountStatus<>1 then error("您的帐号未通过审核!")
if SiteConfig("RegUserTimePost") > 0 then
StopPostTime=int(DateDiff("n",UserRegisterTime,Now()))
if StopPostTime < SiteConfig("RegUserTimePost") then error("
新注册用户必须等待 "&SiteConfig("RegUserTimePost")&" 分钟后才能发帖!您必须再等待 "&SiteConfig("RegUserTimePost")-StopPostTime&" 分钟!")
end if
if SiteConfig("PostInterval") > 0 then
StopPostTime=int(DateDiff("s",UserPostTime,Now()))
if StopPostTime < SiteConfig("PostInterval") then error("论坛限制一个人两次发帖间隔必须大于 "&SiteConfig("PostInterval")&" 秒!您必须再等待 "&SiteConfig("PostInterval")-StopPostTime&" 秒!")
end if
ThreadID=RequestInt("ThreadID")
PostID=RequestInt("PostID")
sql="Select * From [BBSXP_Threads] where ThreadID="&ThreadID&""
Rs.Open sql,Conn,1
if Rs.Eof then error("系统不存在此主题的资料")
if Rs("IsDel")=1 then error("此主题已经删除,不接受新的回复")
if Rs("IsLocked")=1 then error("此主题已经关闭,不接受新的回复")
ForumID=Rs("ForumID")
PostsTableName=Rs("PostsTableName")
Topic=Rs("Topic")
Tags=Rs("Tags")
PostAuthor=Rs("PostAuthor")
Rs.close
if Conn.Execute("select PostID from [BBSXP_Posts"&PostsTableName&"] where ThreadID="&ThreadID&" and PostID="&PostID&"").Eof then error("系统没有找到回复帖ID")
sql="select * from [BBSXP_Forums] where ForumID="&ForumID&""
Set Rs=Conn.Execute(sql)
ForumName=Rs("ForumName")
Moderated=Rs("Moderated")
ParentID=Rs("ParentID")
GroupID=Rs("GroupID")
ForumUrl=Rs("ForumUrl")
IsActive=Rs("IsActive")
Rs.close
%>
<%
if ForumUrl<>"" then response.redirect ForumUrl
if IsActive=0 and PermissionManage=0 then error"该版块已经关闭!"
if PermissionReply=0 then error("您的权限不够")
if Request.ServerVariables("Request_method") = "POST" then
if Request.Form=Application("LastPost") and SiteConfig("AllowDuplicatePosts")=0 then error("请不要提交重复数据")
Subject=HTMLEncode(Request.Form("PostSubject"))
Body=BodyEncode(Request.Form("Body"))
TagsPost=HTMLEncode(Request.Form("Tags"))
if Tags="" then
Tags=TagsPost
else
TagArray=split(TagsPost,",")
for i=0 to ubound(TagArray)
if instr(","&Tags&",",","&TagArray(i)&",")<1 then Tags=Tags&","&TagArray(i)
next
end if
Tags=Left(Tags,255)
if Request.Form("DisableYBBCode")<>1 then Body=YbbEncode(Body)
if Len(Body)<2 then Message=Message&"文章内容不能小于 2 字符"
if Message<>"" then error(""&Message&"")
Conn.Execute("update [BBSXP_Users] set TotalPosts=TotalPosts+1,UserMoney=UserMoney+"&SiteConfig("IntegralAddPost")&",experience=experience+"&SiteConfig("IntegralAddPost")&",UserPostTime="&SqlNowString&" where UserID="&CookieUserID&"")
if Request.Form("UpFileID")<>"" then
UpFileID=split(Request.Form("UpFileID"),",")
for i = 0 to ubound(UpFileID)-1
Conn.execute("update [BBSXP_PostAttachments] set Description='"&Subject&"' where UpFileID="&int(UpFileID(i))&" and UserName='"&CookieUserName&"'")
next
end if
UpdateStatistics 0,0,1
Conn.Execute("insert into [BBSXP_Posts"&PostsTableName&"] (ThreadID,ParentID,PostAuthor,Subject,Body,IPAddress) values ('"&ThreadID&"','"&PostID&"','"&CookieUserName&"','"&Subject&"','"&Body&"','"&Request.ServerVariables("REMOTE_ADDR")&"')")
Conn.execute("update [BBSXP_Threads] set lastname='"&CookieUserName&"',Tags='"&Tags&"',TotalReplies=TotalReplies+1,lasttime="&SqlNowString&" where ThreadID="&ThreadID&"")
Conn.execute("update [BBSXP_Forums] set MostRecentPostSubject='"&Topic&"',MostRecentPostAuthor='"&CookieUserName&"',MostRecentPostDate="&SqlNowString&",TodayPosts=TodayPosts+1,TotalPosts=TotalPosts+1,MostRecentThreadID="&ThreadID&" where ForumID="&ForumID&" or ForumID="&ParentID&"")
Application("LastPost")=Request.Form
if SiteConfig("SelectMailMode")<>"" then
MailSubject="("&SiteConfig("SiteName")&")您订阅的主题有新回复"
MailBody=MailBody&"主题:"&Topic&"
"
MailBody=MailBody&""&SiteURL&"ShowPost.asp?ThreadID="&ThreadID&"
"
MailBody=MailBody&""&CookieUserName&" 发表于 "&now()&"
"
MailBody=MailBody&"--------------------------------------------------------
"
MailBody=MailBody&""&Subject&"
"&Body&"
--------------------------------------------------------
"
MailBody=MailBody&"您已通过邮件订阅了该主题,因此当主题有新帖子您都将收到邮件通知。
"
MailBody=MailBody&"如果您要取消邮件订阅,点击以上链接,选择“取消订阅”即可。
"
set Rs=Conn.Execute("select top 100 * from [BBSXP_Subscriptions] where ThreadID="&ThreadID&" order by SubscriptionID")
do while not Rs.eof
MailAddRecipient=""&Rs("UserName")&"<"&Rs("Email")&">;"&MailAddRecipient
Rs.movenext
loop
Rs.close
SendMail MailAddRecipient,MailSubject,MailBody
end if
Message=Message&"回复主题成功返回主题返回论坛"
succeed Message,"ShowForum.asp?ForumID="&ForumID&""
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sql="select * from [BBSXP_Posts"&PostsTableName&"] where PostID="&PostID&""
Set Rs=Conn.Execute(sql)
ReBody=""
ReBody=ReBody&""&Rs("PostAuthor")&" 发表于:"&Rs("PostDate")&" |
"
ReBody=ReBody&""&Rs("Body")&"
"
ReBody=ReBody&" 引用"
ReBody=ReBody&" |
"
Rs.close
%>
<%=ReBody%>
<%
HtmlBottom
%>