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

id=int(Request("id"))
sql="Select * From [forum] where ID="&ID&""
rs.Open sql,Conn,1
forumid=rs("forumid")
'ReList=rs("ReList")
rs.close
retopicid=request("retopicid")
forumid=int(request.Form("forumid"))
if forumid=0 then
forumid=Conn.Execute("Select forumid From forum where id="&id)(0)
end if

if membercode > 4 then
pass=1
elseif instr("|"&Conn.Execute("Select moderated From [bbsconfig] where id="&forumid&" ")(0)&"|","|"&Request.Cookies("username")&"|")>0 then
pass=1
end if

if pass<>1 then error("<li>您的权限不够")

if request("menu")="Uedit" then
   
   userop=HTMLEncode(request.Form("userop"))
    'if (not isnumeric(retopicid)) and request.Form("color")<>empty then
	'conn.execute("update [forum] set color='"&HTMLEncode(request.Form("color"))&"' where id="&id&" and forumid="&forumid)
	'end if

   	if int(request.Form("douser"))=0 then
   	if userop=Request.Cookies("username") then error("你不能对自己进行操作!")  	

	if int(request.Form("domoney"))<>0 then
	conn.execute("update [user] set [money]=[money]+int("&request.Form("domoney")&") where username='"&userop&"'")
	if Request("domoney")<>"0" then
if Request("domoney")>"0" then
domoney="+"&Request("domoney")&"金钱 "
else
domoney=Request("domoney")&"金钱 "
end if
end if
	end if

	if int(request.Form("doexperience"))<>0 then
	conn.execute("update [user] set [experience]=[experience]+int("&request.Form("doexperience")&") where username='"&userop&"'")
	if Request("doexperience")<>"0" then
if Request("doexperience")>"0" then
doexperience="+"&Request("doexperience")&"经验 "
else
doexperience=Request("doexperience")&"经验 "
end if
end if
	end if
 
	if int(request.Form("domagicpower"))<>0 then
       conn.execute("update [user] set [magicpower]=[magicpower]+int("&request.Form("domagicpower")&") where username='"&userop&"'")
	temp=temp&"魅力"&request.Form("domagicpower")&"&nbsp;"
	if Request("domagicpower")<>"0" then
if Request("domagicpower")>"0" then
domagicpower="+"&Request("domagicpower")&"魅力 "
else
domagicpower=Request("domagicpower")&"魅力 "
end if
end if
       end if
	if int(request.Form("dopower"))<>0 then
       	conn.execute("update [user] set [power]=[power]+int("&request.Form("dopower")&") where username='"&userop&"'")
	if Request("dopower")<>"0" then
if Request("dopower")>"0" then
dopower="+"&Request("dopower")&"威望 "
else
dopower=Request("dopower")&"威望 "
end if
end if
	end if

  end if


	if  int(request.Form("ismsg"))=1 or  int(request.Form("iscon"))=1 then
   		reason=request.Form("content")
   		if reason="" then 
   		error2("原因未填写")
   		else
   		reason="<font color=red>[系统提示]:<br>&nbsp;&nbsp;.::帖子因为<b>"&HTMLEncode(reason)&"</b>被论坛管理者<b>"&Request.cookies("username")&"</b>实行了：<b>"&domoney&doexperience&domagicpower&dopower&"</b>的奖惩::."
		
       
	if  int(request.Form("ismsg"))=1 then
conn.execute("insert into [message] (author,incept,content) values ('"&request.Cookies("username")&"','"&userop&"','"&reason&"')")
conn.execute("update [user] set newmessage=newmessage+1 where username='"&userop&"'")
        end if
	   
	if  int(request.Form("iscon"))=1 then
	      if isnumeric(retopicid) then
		  conn.execute("update [reforum] set content=content&'<br>'&'"&reason&"' where id="&int(retopicid)&" and topicid="&id)
		    else
		  conn.execute("update [forum] set content=content&'<br>'&'"&reason&"' where id="&id&" and forumid="&forumid)
		  end if

        end if
   end if
  end if


  
message="<li>操作成功</li><li><a href=Showpost.asp?id="&id&">返回主题</a></li><li><a href=ShowForum.asp?forumid="&forumid&">返回论坛</a></li><li><a href=default.asp>返回社区首页</a></li>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=ShowForum.asp?forumid="&forumid&">")
end if
%>

	<table border="0" width="<%=dkuan%>" align="center" cellspacing="1" cellpadding="4" class=a2>
		<tr class=a3>
			<td height="25">&nbsp;<img src=images/Forum_nav.gif>&nbsp; <%ClubTree%> → <%=ForumTreeList%> <a href="ShowForum.asp?forumid=<%=forumid%>">返回论坛</a> → 管理论坛</td>
		</tr>
	</table><br>

<form method="post" action="?menu=Uedit">
<table border=0 width="<%=dkuan%>" align=center cellspacing=1 cellpadding=4 class=a2  style="table-layput:fixed">
<tr class=a1>
<td align=center>－＝论坛帖子管理中心＝－</td>
</tr>
<tr class="a3"><td>
<%

if not isnumeric(retopicid) then      
userop=conn.execute("select username from [forum] where  id="&id&" and forumid="&forumid)(0)
%>
  <b> 主题作者</b>：<input readonly="true" value="<%=userop%>" name="userop"> <b>主题</b>：<INPUT maxLength=50 size=50 name=topic value="<%=request.QueryString("topic")%>">
<% 
  else
   userop=conn.execute("select username from [reforum] where topicid="&id&" and id="&int(retopicid)&"")(0)
   %>
    <b> 回复作者</b>：<input readonly="true" value="<%=userop%>" name="userop">
   <%
   end if
%>
</td></tr>
<tr>
<td class=a4 height=24><b>
操作理由</b>：
<select name="title" size=1 onChange="javascript:content.value+=this.options[this.selectedIndex].value">
<option value="">自定义</option>
<option value="[灌水]">灌水</option>
<option value="[广告]">广告</option>
<option value="[奖励]" >奖励</option>
<option value="[好文章]">好文章</option>
<option value="[内容不符]">内容不符</option>
<option value="[重复发贴]">重复发帖</option>
</select>
<input type="text" name="content" size=60>  *</td>
</tr>
<tr>
<td class=a4 height=24>
<SCRIPT>
var domoney=0;
var doexperience=0;
var domagicpower=0;
var dopower=0;
function Utimes(which){

for (i=-50;i<51 ;i++ )
{
	document.write ("<option value="+i);
	if (i==eval("do"+which)){document.write(" selected ");}
	document.write (">"+i+"</option>");
}

}
</SCRIPT>
<B>用户操作</B>：  金钱  <select name="domoney"  size=1 ><script>Utimes("money");</script></select>&nbsp;
  经验  <select name="doexperience"  size=1 ><script>Utimes("experience");</script></select>&nbsp;
  魅力  <select name="domagicpower"  size=1 ><script>Utimes("magicpower");</script></select>&nbsp;
  威望  <select name="dopower"  size=1 ><script>Utimes("power");</script></select>&nbsp;
&nbsp;<input type="checkbox" name="douser" value="1" >不对用户进行分值操作;

</td>
</tr>
<input type=hIDden value="<%=id%>" name="id">
<input type=hIDden value="<%=retopicid%>" name="retopicid">
<input type=hIDden value="<%=forumid%>" name="forumid">
<tr>
<td height=24 class=a4>
<B>短信通知</B>：<input type="checkbox" name="ismsg" value="1">使用&nbsp;&nbsp;<B>内容提示</B>：<input type="checkbox" name="iscon" value="1">使用</td>
</tr>
<tr>
<td height=24 class=a4>
<B>管理说明</B>：<BR>
①请慎重使用版主的管理职能，版主所有操作将被记录<BR>
②如果选择了短信通知，则会将删贴原因发送给用户，您也可以在短信中附上简短说明
</td>
</tr>
<tr>
<td height=24 class=a4 align=center>
<input type="submit" name=submit value="确认操作"></td>
</tr></form>
<%
htmlend
%>
