<!-- #include file="setup.asp" -->
<%
if CookieUserName=empty then error2("请登录后再进行操作！")

if Request.ServerVariables("request_method") <> "POST" then
response.write "<form name=BBSXPPost method=Post action=Manage1.asp?"&Request.ServerVariables("Query_String")&"></form><SCRIPT>if(confirm('您确定要执行该操作?')){returnValue=BBSXPPost.submit()}else{returnValue=history.back()}</SCRIPT>"
htmlend
end if

top

if Request.Cookies("flowers11")=empty then Response.Cookies("flowers11")="1110012222"

If not Conn.Execute("Select UserName From [BBSXP_Prison] where UserName='"&CookieUserName&"'" ).eof Then error("<li>您被关进<a href=Prison.asp>监狱</a>")

sql="select * from [BBSXP_Users] where UserName='"&CookieUserName&"'"
Rs.Open sql,Conn,1
money=Rs("UserMoney")
experience=Rs("experience")
Postrevert=Rs("Postrevert")
Rs.Close

if experience<200 then error("<li>您的经验少于200")
if money<50 then error("<li>您的忧郁钞票少于50")
if Postrevert<100 then error("<li>您的回贴数少于100")


PostID=int(Request("PostID"))
ThreadID=int(Request("ThreadID"))
sql="Select * From [BBSXP_Threads] where ID="&ThreadID&""
Rs.Open sql,Conn,1
ForumID=Rs("ForumID")
Topic=Rs("Topic")
PostsTableName=Rs("PostsTableName")
UserName=Rs("UserName")
ThreadID=Rs("id")
Replies=Rs("Replies")
Rs.close
ForumName=Conn.Execute("Select ForumName From [BBSXP_Forums] where ID="&ForumID&"")(0)

select case Request("menu")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "flower"
if Conn.Execute("Select IsDel From [BBSXP_Threads] where id="&ThreadID&" ")(0)=1 then error("<li>此帖子已经在回收站了")
sql="select * from [BBSXP_Posts"&PostsTableName&"] where id="&PostID&""
Rs.Open sql,Conn,1,3
if Rs("IsTopic")=1 then
meme="您在["&ForumName&"]版块内发表的[<a href=ShowPost.asp?ThreadID="&ThreadID&" target=main>"&Topic&"</a>]被奖励"
else
meme="您在["&ForumName&"]版块[<a href=ShowPost.asp?ThreadID="&ThreadID&" target=main>"&Topic&"</a>]内的回复被奖励"
end if

if Rs("UserName")=CookieUserName then error("<li>不能自己奖励自己")
if int(Request.Cookies("flowers11"))=int(Request("PostID")) then  error("<li>请勿对同一个帖子进行操作！")

Conn.execute("update [BBSXP_Users] set Postrevert=Postrevert+1,UserMoney=UserMoney+"&SiteSettings("IntegralAddPost")&",experience=experience+"&SiteSettings("IntegralAddPost")&" where UserName='"&Rs("UserName")&"'")

conn.execute("update [BBSXP_Users] set [UserMoney]=[UserMoney]-50 where username='"&CookieUserName&"'")

content=""&Rs("content")&"<p>［ "&CookieUserName&" 于 "&now()&" 时奖励］"
Rs("content")=content

sql="insert into [BBSXP_Messages](UserName,incept,content) values ('"&CookieUserName&"','"&Rs("UserName")&"','"&meme&"')"
Conn.Execute(SQL)
Conn.execute("update [BBSXP_Users] set NewMessage=NewMessage+1 where UserName='"&Rs("UserName")&"'")

Rs.update
Rs.close

Response.Cookies("flowers11") = int(Request("PostID"))

succtitle="奖励成功"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "pig"
if Conn.Execute("Select IsDel From [BBSXP_Threads] where id="&ThreadID&" ")(0)=1 then error("<li>此帖子已经在回收站了")
sql="select * from [BBSXP_Posts"&PostsTableName&"] where id="&PostID&""
Rs.Open sql,Conn,1,3
if Rs("IsTopic")=1 then
meme="您在["&ForumName&"]版块内发表的[<a href=ShowPost.asp?ThreadID="&ThreadID&" target=main>"&Topic&"</a>]被惩罚"
else
meme="您在["&ForumName&"]版块[<a href=ShowPost.asp?ThreadID="&ThreadID&" target=main>"&Topic&"</a>]内的回复被惩罚"
end if

if Rs("UserName")=CookieUserName then error("<li>不能自己奖励自己")
if int(Request.Cookies("flowers11"))=int(Request("PostID")) then  error("<li>请勿对同一个帖子进行操作！")

Conn.execute("update [BBSXP_Users] set Postrevert=Postrevert-1,UserMoney=UserMoney+"&SiteSettings("IntegralDeletePost")&",experience=experience+"&SiteSettings("IntegralDeletePost")&" where UserName='"&Rs("UserName")&"'")

conn.execute("update [BBSXP_Users] set [UserMoney]=[UserMoney]-50 where username='"&CookieUserName&"'")

content=""&Rs("content")&"<p>［ "&CookieUserName&" 于 "&now()&" 时惩罚］"
Rs("content")=content

sql="insert into [BBSXP_Messages](UserName,incept,content) values ('"&CookieUserName&"','"&Rs("UserName")&"','"&meme&"')"
Conn.Execute(SQL)
Conn.execute("update [BBSXP_Users] set NewMessage=NewMessage+1 where UserName='"&Rs("UserName")&"'")

Rs.update
Rs.close

Response.Cookies("flowers11") = int(Request("PostID"))

succtitle="惩罚成功"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
end select
if succtitle="" then error("<li>无效命令")

log(""&succtitle&"，主题ID："&ThreadID&"，PostID："&PostID&"")

Message="<li>"&succtitle&"<li><a href=ShowPost.asp?ThreadID="&ThreadID&">返回主题</a><li><a href=ShowForum.asp?ForumID="&ForumID&">返回论坛</a><li><a href=Default.asp>返回社区首页</a>"
succeed(""&Message&"<meta http-equiv=refresh content=3;url=ShowForum.asp?ForumID="&ForumID&">")
%>