%
HtmlTop
if CookieUserName=empty then error("您还未登录论坛")
ThreadID=RequestInt("ThreadID")
PostID=RequestInt("PostID")
Category=HTMLEncode(Request("Category"))
sql="Select * From [BBSXP_Threads] where ThreadID="&ThreadID&""
Rs.Open sql,Conn,1
if Rs.eof or Rs.bof then error"
系统不存在该帖子的资料"
ForumID=Rs("ForumID")
PostsTableName=Rs("PostsTableName")
Topic=Rs("Topic")
Category=Rs("Category")
Tags=Rs("Tags")
ThreadEmoticonID=Rs("ThreadEmoticonID")
Rs.close
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")
TotalCategorys=Rs("TotalCategorys")
Rs.close
%>
<%
if PermissionEdit=0 then error("您的权限不够")
sql="select * from [BBSXP_Posts"&PostsTableName&"] where PostID="&PostID&""
Set Rs=Conn.Execute(sql)
if Rs.eof or Rs.bof then error"系统不存在该帖子的资料"
if Rs("PostAuthor")<>CookieUserName and PermissionManage=0 then error("对不起,您的权限不够!")
if SiteConfig("PostEditBodyAgeInMinutes")>0 and DateDiff("n", Rs("PostDate"), now())> SiteConfig("PostEditBodyAgeInMinutes") then error"帖子发出 "&SiteConfig("PostEditBodyAgeInMinutes")&" 分钟之后不允许再次被编辑"
Subject=ReplaceText(""&Rs("Subject")&"","<[^>]*>","")
Body=Rs("Body")
PostParentID=Rs("ParentID")
Rs.close
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if Request.ServerVariables("Request_method") = "POST" then
color=HTMLEncode(Request.Form("color"))
Subject=HTMLEncode(Request.Form("PostSubject"))
Body=BodyEncode(Request.Form("Body"))
Category=HTMLEncode(Request.Form("Category"))
Tags=HTMLEncode(Request.Form("Tags"))
ThreadEmoticonID=RequestInt("ThreadEmoticonID")
if Request.Form("DisableYBBCode")<>1 then Body=YbbEncode(Body)
if PostParentID=0 then
if Len(Subject)<2 then Message=Message&"文章主题不能小于 2 字符"
end if
if Len(Body)<2 then Message=Message&"文章内容不能小于 2 字符"
if len(Tags)>255 then Message=Message&"标签不能大于255字符"
if SiteConfig("DisplayEditNotes")=1 then Body=""&Body&"[此帖子已被 "&CookieUserName&" 在 "&now()&" 编辑过]"
if Message<>"" then error(""&Message&"")
sql="select * from [BBSXP_Posts"&PostsTableName&"] where PostID="&PostID&""
Rs.Open sql,Conn,1,3
if Rs("ParentID")=0 then Conn.execute("update [BBSXP_Threads] set Topic='"&Subject&"',Category='"&Category&"',ThreadEmoticonID="&ThreadEmoticonID&",Tags='"&Tags&"' where ThreadID="&Rs("ThreadID")&"")
Rs("Subject")=Subject
Rs("Body")=Body
Rs.update
Rs.close
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
Log("修改帖子成功,标题:"&Subject&",主题ID:"&ThreadID&",帖子ID:"&PostID&"")
Message="
修改帖子成功返回主题返回论坛"
succeed Message,"ShowForum.asp?ForumID="&ForumID&""
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
%>
<%
HtmlBottom
%>