%
HtmlTop
if CookieUserName=empty then error("您还未登录论坛")
Rs.Open "select * from [BBSXP_Users] where UserID="&CookieUserID&"",Conn,1,3
UserAccountStatus=Rs("UserAccountStatus")
ModerationLevel=Rs("ModerationLevel")
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
ForumID=RequestInt("ForumID")
sql="select * from [BBSXP_Forums] where ForumID="&ForumID&""
Set Rs=Conn.Execute(sql)
if Rs.Eof then error("系统不存在此论坛的资料")
ForumName=Rs("ForumName")
Moderated=Rs("Moderated")
ParentID=Rs("ParentID")
GroupID=Rs("GroupID")
TotalCategorys=Rs("TotalCategorys")
IsModerated=Rs("IsModerated")
ForumUrl=Rs("ForumUrl")
IsActive=Rs("IsActive")
Rs.close
%>
<%
if ForumUrl<>"" then response.redirect ForumUrl
if IsActive=0 and PermissionManage=0 then error"该版块已经关闭!"
if PermissionPost=0 then error("您的权限不够")
if Request.ServerVariables("Request_method") = "POST" then
if Request.Form=Application("LastPost") and SiteConfig("AllowDuplicatePosts")=0 then error("请不要提交重复数据")
if SiteConfig("EnableAntiSpamTextGenerateForPost")=1 then
if Request.Form("VerifyCode")<>Session("VerifyCode") or Session("VerifyCode")="" then Message=Message&"验证码错误!"
end if
Subject=HTMLEncode(Request.Form("Subject"))
Category=HTMLEncode(Request.Form("Category"))
Body=BodyEncode(Request.Form("Body"))
Tags=HTMLEncode(Request.Form("Tags"))
ThreadEmoticonID=RequestInt("ThreadEmoticonID")
if Request.Form("DisableYBBCode")<>1 then Body=YbbEncode(Body)
if Len(Subject)<2 then Message=Message&"文章主题不能小于 2 字符"
if Len(Body)<2 then Message=Message&"文章内容不能小于 2 字符"
if len(Tags)>255 then Message=Message&"标签不能大于255字符"
Vote=Request.Form("Vote")
if Vote<>"" then
if instr(Vote,"|") > 0 then error("投票选项中不能含有“|”字符")
pollTopic=split(Vote,chr(13)&chr(10))
j=0
for i = 0 to ubound(pollTopic)
if not (pollTopic(i)="" or pollTopic(i)=" ") then
allpollTopic=""&allpollTopic&""&pollTopic(i)&"|"
j=j+1
end if
next
if j投票选项不能少于 "&SiteConfig("MinVoteOptions")&" 个")
if j>SiteConfig("MaxVoteOptions") then error("投票选项超过 "&SiteConfig("MaxVoteOptions")&" 个")
for y = 1 to j
Votenum=""&Votenum&"0|"
next
end if
IsMultiplePoll=RequestInt("IsMultiplePoll")
VoteItems=HTMLEncode(allpollTopic)
VoteExpiry=now()+RequestInt("VoteExpiry")
if Not Isdate(VoteExpiry) then error("投票过期时间错误")
if Message<>"" then error(""&Message&"")
Conn.Execute("update [BBSXP_Users] set TotalPosts=TotalPosts+1,UserMoney=UserMoney+"&SiteConfig("IntegralAddThread")&",experience=experience+"&SiteConfig("IntegralAddThread")&",UserPostTime="&SqlNowString&" where UserID="&CookieUserID&"")
Rs.Open "select * from [BBSXP_Threads]",Conn,1,3
Rs.addNew
Rs("PostAuthor")=CookieUserName
Rs("PostTime")=now()
Rs("lastname")=CookieUserName
Rs("lasttime")=now()
Rs("Topic")=Subject
Rs("ForumID")=ForumID
Rs("Category")=Category
Rs("Tags")=Tags
Rs("ThreadEmoticonID")=ThreadEmoticonID
if Request("Vote")<>"" then Rs("IsVote")=1
if Request("IsLocked")=1 then Rs("IsLocked")=1
if IsModerated=1 and ModerationLevel=0 then Rs("IsApproved")=0
Rs.update
ThreadID=Rs("ThreadID")
PostsTableName=Rs("PostsTableName")
Rs.close
if Request.Form("Vote")<>"" then
Conn.Execute("insert into [BBSXP_Votes] (ThreadID,IsMultiplePoll,Items,Result,Expiry) values ('"&ThreadID&"',"&IsMultiplePoll&",'"&VoteItems&"','"&Votenum&"','"&VoteExpiry&"')")
end if
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&"',ThreadID='"&ThreadID&"' where UpFileID="&int(UpFileID(i))&" and UserName='"&CookieUserName&"'")
next
end if
UpdateStatistics 0,1,1
Conn.Execute("insert into [BBSXP_Posts"&PostsTableName&"] (ThreadID,PostAuthor,Subject,Body,IPAddress) values ('"&ThreadID&"','"&CookieUserName&"','"&Subject&"','"&Body&"','"&Request.ServerVariables("REMOTE_ADDR")&"')")
Conn.execute("update [BBSXP_Forums] set MostRecentPostSubject='"&Subject&"',MostRecentPostAuthor='"&CookieUserName&"',MostRecentPostDate="&SqlNowString&",TodayPosts=TodayPosts+1,TotalThreads=TotalThreads+1,TotalPosts=TotalPosts+1,MostRecentThreadID="&ThreadID&" where ForumID="&ForumID&" or ForumID="&ParentID&"")
Session("VerifyCode")=""
Application("LastPost")=Request.Form
if IsModerated=1 and ModerationLevel=0 then
EnableCensorship="由于论坛设有审核制度,您发表的帖子需要等待激活才能显示。"
else
EnableCensorship="返回主题"
end if
Message="新主题发表成功"&EnableCensorship&"返回论坛"
succeed Message,"ShowForum.asp?ForumID="&ForumID&""
end if
%>
<%ClubTree%> → <%ForumTree(ParentID)%><%=ForumTreeList%>
><%=ForumName%> → 发表帖子
<%
HtmlBottom
%>