<!--#include file="Connections.asp" -->
<!--#include file="top.asp" -->
<!--#include file="fyerror.asp" -->
<!--#include file="online.asp" -->
<%cpbtitle="管理主题"
call toptitle(l_title,cpbtitle)
call head(4,"论坛信息",Request.ServerVariables("HTTP_REFERER"),cpbtitle)
if request.querystring("l_id")="" then 
errornum=1
errormsg="<li>很抱歉，您没有选择论坛,请从论坛首页正确登陆</li>"
 end if
 
  if errornum<> 1 then
  
 if isuser then

isbanzhu=false
'如果是管理员或者总斑竹就跳过此检查
 if issupermaster=false and ismaster=false then
 sql="select l_id  from topic where t_id="&chktopic(request("t_id"))&""
 set rs=conn.execute(sql)
 if rs.eof then
errormsg="<li>很抱歉，此主题不存在</li>"
call error(errormsg)
call bq
response.end 
else
l_idd=rs("l_id")
 end if

sqlchecadmin="select l_banzhu from lanmu where l_id="&l_idd&""
set rschecadmin=conn.execute(sqlchecadmin)
if not (rschecadmin.eof or rschecadmin.bof) then
l_banzhu=rschecadmin("l_banzhu")
if not isnull(l_banzhu) and l_banzhu<>"" and isuser then
  if instr(l_banzhu,cpbusername)=0 then
  errornum=1
errormsg="<li>很抱歉，您不是管理员或者总版主或者该论坛版主</li>"
  end if
  else
errornum=1
errormsg="<li>很抱歉，您不是管理员或者总版主或者该论坛版主</li>"
  end if
   else
errornum=1
errormsg="<li>很抱歉，您不是管理员或者总版主或者该论坛版主</li>"

  end if

  end if
else
errornum=1
errormsg="<li>很抱歉，您还没有登陆</li>"
end if
end if 
 if errornum=1 then
call error(errormsg)
call bq
response.end 
end if

'取出变量
dim top_fen,h_topmoney,h_topbeauty
 sql="select top_fen,h_topmoney,h_topbeauty from home"
 set rsconn1=conn.execute(sql)
 if not rsconn1.eof then
top_fen=rsconn1("top_fen")
h_topmoney=rsconn1("h_topmoney")
h_topbeauty=rsconn1("h_topbeauty")
end if
set rsconn1=nothing%>

<%if request.querystring("action")="top" then
sql="select t_title,t_top from topic where t_id="&chktopic(request("t_id"))&""
 set rs=conn.execute(sql)
 if rs("t_top")=0 and issupermaster=false and ismaster=false then
errormsg="<li>此主题已经总固定，只有管理员和总版主才可以操作</li>"
call error(errormsg)
call bq()
response.end
end if
 if rs("t_top")=1 then
 if request.querystring("mode")="" then%>
 <div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=top&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="3" <%=tColor%> height=22> 
<p align="center">取消置顶主题"<%=htmlencode(rs("t_title"))%>"
　</td>

 </tr>
 <%call even()%>
 <td align="left" class=tdc bgcolor=<%=tcolor2%>>
       &nbsp;<input type="submit" name="Submit" value="确认"   class=bdtj >　</td>
 </tr>
 
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> << 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>

 </table>
  </center>
</div>

<%
else
e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
if e_content="" and  e_title="" then
errormsg="<li>请填写操作理由</li>"
call error(errormsg)
call bq()
response.end
end if
e_content="取消置顶主题："&htmlencode(rs("t_title"))&"<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
 sql="select t_username,t_title from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
if not rs.eof then
 e_username=rs("t_username")
 e_title=rs("t_title")
 end if
set rs=nothing
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)

   sqlnum="update topic set t_top=4 where t_id="&chktopic(request("t_id"))&""
    conn.Execute (sqlnum)
    
    sqluser1="update user set fen=fen+"&e_fen&",u_beauty=u_beauty+"&e_beauty&",u_money=u_money+"&e_money&" where username='"&e_username&"'"
conn.Execute (sqluser1)

    if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您发表的的主题《"&e_title&"》被取消置顶,[url=topic.asp?l_id="&chktopic(request("l_id"))&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
       conn.Execute(sqlpm)
 end if

  succmsg="<LI>主题取消置顶完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg) 
    end if
    else
     if request.querystring("mode")="" then%>
 <div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=top&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="3" <%=tColor%> height=22> 
<p align="center">置顶主题"<%=htmlencode(rs("t_title"))%>"
　</td>

 </tr>
<%call even()%>
<td align="left" class=tdc bgcolor=<%=tcolor2%>>
       &nbsp;<input type="submit" name="Submit" value="确认"   class=bdtj >　</td>
 </tr>
 
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> << 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>

 </table>
  </center>
</div>

<%
else
e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
if e_content="" and  e_title="" then
errormsg="<li>请填写操作理由</li>"
call error(errormsg)
call bq()
response.end
end if
e_content="置顶主题："&htmlencode(rs("t_title"))&"<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
sql="select t_username,t_title from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
if not rs.eof then
 e_username=rs("t_username")
 e_title=rs("t_title")
 end if

set rs=nothing
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)

    sqlnum="update topic set t_top=1 where t_id="&chktopic(request("t_id"))&""
    conn.Execute (sqlnum)
    
       if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您发表的的主题《"&e_title&"》被置顶,[url=topic.asp?l_id="&chktopic(request("l_id"))&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
        conn.Execute(sqlpm)
        end if
      
        sqluser1="update user set fen=fen+"&e_fen&",u_beauty=u_beauty+"&e_beauty&",u_money=u_money+"&e_money&" where username='"&e_username&"'"
conn.Execute (sqluser1)
    succmsg="<LI>主题置顶完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg)
end if
    end if

'总固定
elseif request.querystring("action")="toptop" then
if issupermaster=false and ismaster=false then
    errormsg="<li>很抱歉，您无权限操作，只有总斑竹或者管理员才可以操作</li>"
call error(errormsg)
call bq()
response.end
end if

sql="select t_title,t_top from topic where t_id="&chktopic(request("t_id"))&""
 set rs=conn.execute(sql)
 if rs("t_top")=0 then
 if request.querystring("mode")="" then%>
 <div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=toptop&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="3" <%=tColor%> height=22> 
<p align="center">取消总固顶主题"<%=htmlencode(rs("t_title"))%>"
　</td>

 </tr>
 <%call even()%>
 <td align="left" class=tdc bgcolor=<%=tcolor2%>>
       &nbsp;<input type="submit" name="Submit" value="确认"   class=bdtj >　</td>
 </tr>
 
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> << 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>

 </table>
  </center>
</div>

<%
else
e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
if e_content="" and  e_title="" then
errormsg="<li>请填写操作理由</li>"
call error(errormsg)
call bq()
response.end
end if
e_content="取消总固顶主题："&htmlencode(rs("t_title"))&"<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
 sql="select t_username,t_title from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
if not rs.eof then 
e_username=rs("t_username")
e_title=rs("t_title")
end if
set rs=nothing
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)

   sqlnum="update topic set t_top=4 where t_id="&chktopic(request("t_id"))&""
    conn.Execute (sqlnum)
    
    if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您发表的的主题《"&e_title&"》被取消总固顶,[url=topic.asp?l_id="&chktopic(request("l_id"))&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
        conn.Execute(sqlpm)
        end if
      
        sqluser1="update user set fen=fen+"&e_fen&",u_beauty=u_beauty+"&e_beauty&",u_money=u_money+"&e_money&" where username='"&e_username&"'"
conn.Execute (sqluser1)
 succmsg="<LI>主题取消总固顶完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg)

       end if
    else
     if request.querystring("mode")="" then%>
 <div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=toptop&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="3" <%=tColor%> height=22> 
<p align="center">总固顶主题"<%=htmlencode(rs("t_title"))%>"
　</td>

 </tr>
<%call even()%>
<td align="left" class=tdc bgcolor=<%=tcolor2%>>
       &nbsp;<input type="submit" name="Submit" value="确认"   class=bdtj >　</td>
 </tr>
 
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> << 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>

 </table>
  </center>
</div>

<%
else
e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
if e_content="" and  e_title="" then
errormsg="<li>请填写操作理由</li>"
call error(errormsg)
call bq()
response.end
end if
e_content="总固顶主题："&htmlencode(rs("t_title"))&"<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
 sql="select t_username,t_title from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
if not rs.eof then 
e_username=rs("t_username")
e_title=rs("t_title")
end if
set rs=nothing
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)

    sqlnum="update topic set t_top=0 where t_id="&chktopic(request("t_id"))&""
    conn.Execute (sqlnum)
    
     if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您发表的的主题《"&e_title&"》被总固顶,[url=topic.asp?l_id="&chktopic(request("l_id"))&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
        conn.Execute(sqlpm)
        end if
      
        sqluser1="update user set fen=fen+"&e_fen&",u_beauty=u_beauty+"&e_beauty&",u_money=u_money+"&e_money&" where username='"&e_username&"'"
conn.Execute (sqluser1)

 succmsg="<LI>主题总固顶完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg)

      
     end if
    end if

    
    elseif request.querystring("action")="del" then
sql="select t_top,t_title,t_username from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
 if not rs.eof then
 if rs("t_top")=0 and issupermaster=false and ismaster=false then
errormsg="<li>此主题已经总固定，只有管理员和总版主才可以操作</li>"
call error(errormsg)
call bq()
response.end
end if
if request.querystring("mode")="" then 

%>

<div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=del&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="3" <%=tColor%> height=22> 
<p align="center">删除主题"<%=htmlencode(rs("t_title"))%>"
　</td>

 </tr>
  <%call even()%>
 <td align="left" class=tdc bgcolor=<%=tcolor2%>>
       &nbsp;<input type="submit" name="Submit" value="确认"   class=bdtj >　</td>
 </tr>
 
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> << 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>

 </table>
  </center>
</div>

<%
else
e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
if e_content="" and  e_title="" then
errormsg="<li>请填写操作理由</li>"
call error(errormsg)
call bq()
response.end
end if
e_content="删除主题："&htmlencode(rs("t_title"))&"<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
 sql="select t_username,t_title from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
if not rs.eof then 
e_username=rs("t_username")
e_title=rs("t_title")
end if
set rs=nothing
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)


 sqluser1="update topic set t_lock=2 where t_id="&chktopic(request("t_id"))&""
 conn.Execute (sqluser1)
 
  if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您发表的的主题《"&e_title&"》被删除,[url=topic.asp?l_id="&chktopic(request("l_id"))&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
        conn.Execute(sqlpm)
        end if
      
        sqluser1="update user set fen=fen+"&e_fen&",u_beauty=u_beauty+"&e_beauty&",u_money=u_money+"&e_money&" where username='"&e_username&"'"
conn.Execute (sqluser1)


 succmsg="<LI>主题删除完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg)
     end if
      set rs=nothing
     end if
    
 %>
 
 <%elseif request.querystring("action")="ts" then
sql="select t_top,t_title,t_username from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
 if not rs.eof then
 if rs("t_top")=0 and issupermaster=false and ismaster=false then
errormsg="<li>此主题已经总固定，只有管理员和总版主才可以操作</li>"
call error(errormsg)
call bq()
response.end
end if
if request.querystring("mode")="" then 

%>

<div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=ts&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="3" <%=tColor%> height=22> 
<p align="center">拉升主题"<%=htmlencode(rs("t_title"))%>"
　</td>

 </tr>
  <%call even()%>
 <td align="left" class=tdc bgcolor=<%=tcolor2%>>
       &nbsp;<input type="submit" name="Submit" value="确认"   class=bdtj >　</td>
 </tr>
 
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> << 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>

 </table>
  </center>
</div>

<%
else
e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
if e_content="" and  e_title="" then
errormsg="<li>请填写操作理由</li>"
call error(errormsg)
call bq()
response.end
end if
e_content="拉升主题："&htmlencode(rs("t_title"))&"<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
 sql="select t_username,t_title from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
if not rs.eof then 
e_username=rs("t_username")
e_title=rs("t_title")
end if
set rs=nothing
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)


 sqluser1="update topic set t_lasttime='"&nowtime&"' where t_id="&chktopic(request("t_id"))&""
 conn.Execute (sqluser1)
 
  if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您发表的的主题《"&e_title&"》被拉升,[url=topic.asp?l_id="&chktopic(request("l_id"))&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
        conn.Execute(sqlpm)
        end if
      
        sqluser1="update user set fen=fen+"&e_fen&",u_beauty=u_beauty+"&e_beauty&",u_money=u_money+"&e_money&" where username='"&e_username&"'"
conn.Execute (sqluser1)

 succmsg="<LI>主题拉升完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg)

     end if
      set rs=nothing
     end if
    
 '----------关闭
 elseif request.querystring("action")="lock" then
     sql="select t_top,t_title,t_lock from topic where t_id="&chktopic(request("t_id"))&""
 set rs=conn.execute(sql)
 if not rs.eof then
 if rs("t_top")=0 and issupermaster=false and ismaster=false then
errormsg="<li>此主题已经总固定，只有管理员和总版主才可以操作</li>"
call error(errormsg)
call bq()
response.end
end if
 if rs("t_lock")=1 then
 if request.querystring("mode")="" then%>
 <div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=lock&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="3" <%=tColor%> height=22> 
<p align="center">取消关闭主题"<%=htmlencode(rs("t_title"))%>"
　</td>

 </tr>
  <%call even()%>
 <td align="left" class=tdc bgcolor=<%=tcolor2%>>
       &nbsp;<input type="submit" name="Submit" value="确认"   class=bdtj >　</td>
 </tr>  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> << 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>

 </table>
  </center>
</div>

<%
else
e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
if e_content="" and  e_title="" then
errormsg="<li>请填写操作理由</li>"
call error(errormsg)
call bq()
response.end
end if
e_content="取消关闭主题："&htmlencode(rs("t_title"))&"<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
 sql="select t_username,t_title from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
if not rs.eof then 
e_username=rs("t_username")
e_title=rs("t_title")
end if
set rs=nothing
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)


sqlnum="update topic set t_lock=0 where t_id="&chktopic(request("t_id"))&""
    conn.Execute (sqlnum)
    
      if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您发表的的主题《"&e_title&"》被取消关闭,[url=topic.asp?l_id="&chktopic(request("l_id"))&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
        conn.Execute(sqlpm)
        end if
      
        sqluser1="update user set fen=fen+"&e_fen&",u_beauty=u_beauty+"&e_beauty&",u_money=u_money+"&e_money&" where username='"&e_username&"'"
conn.Execute (sqluser1)
    
   succmsg="<LI>主题取消关闭完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg)
end if
    else
    if request.querystring("mode")="" then%>
 <div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=lock&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="3" <%=tColor%> height=22> 
<p align="center">关闭主题"<%=htmlencode(rs("t_title"))%>"
　</td>

 </tr>
   <%call even()%>
 <td align="left" class=tdc bgcolor=<%=tcolor2%>>
       &nbsp;<input type="submit" name="Submit" value="确认"   class=bdtj >　</td>
 </tr> 
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> << 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>

 </table>
  </center>
</div>

<%
else
e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
if e_content="" and  e_title="" then
errormsg="<li>请填写操作理由</li>"
call error(errormsg)
call bq()
response.end
end if
e_content="关闭主题："&htmlencode(rs("t_title"))&"<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
 sql="select t_username,t_title from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
if not rs.eof then 
e_username=rs("t_username")
e_title=rs("t_title")
end if
set rs=nothing
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)


    sqlnum="update topic set t_lock=1 where t_id="&chktopic(request("t_id"))&""
    conn.Execute (sqlnum)   
    
          if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您发表的的主题《"&e_title&"》被关闭,[url=topic.asp?l_id="&chktopic(request("l_id"))&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
        conn.Execute(sqlpm)
        end if
      
        sqluser1="update user set fen=fen+"&e_fen&",u_beauty=u_beauty+"&e_beauty&",u_money=u_money+"&e_money&" where username='"&e_username&"'"
conn.Execute (sqluser1)

 succmsg="<LI>主题关闭完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg)
    end if
    end if
    else
    errormsg="<li>参数错误，无此主题</lI>"
call error(errormsg)
call bq()
response.end
    end if
    '_--------------------------精华----------------------------
    elseif request.querystring("action")="jinhua" then
     sql="select t_jinhua,t_username,t_title from topic where t_id="&chktopic(request("t_id"))&""
 set rs=conn.execute(sql)

 if rs("t_jinhua")<>0 then
 if request.querystring("mode")="" then%>
 <div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=jinhua&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="3" <%=tColor%> height=22> 
<p align="center">取消精华主题"<%=htmlencode(rs("t_title"))%>"
　</td>

 </tr>
   <%call even()%>
 <td align="left" class=tdc bgcolor=<%=tcolor2%>>
       &nbsp;<input type="submit" name="Submit" value="确认"   class=bdtj >　</td>
 </tr> 
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> << 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>

 </table>
  </center>
</div>

<%
else
e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
if e_content="" and  e_title="" then
errormsg="<li>请填写操作理由</li>"
call error(errormsg)
call bq()
response.end
end if
e_content="取消精华主题："&htmlencode(rs("t_title"))&"<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
 sql="select t_username,t_title from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
if not rs.eof then 
e_username=rs("t_username")
e_title=rs("t_title")
end if
set rs=nothing
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)

   sqlnum="update topic set t_jinhua=0 where t_id="&chktopic(request("t_id"))&""
    conn.Execute (sqlnum)
sqluser1="update user set fen=fen-"&top_fen&",u_beauty=u_beauty-"&h_topbeauty&",u_money=u_money-"&h_topmoney&" ,u_toptopic=u_toptopic-1 where username='"&e_username&"'"
 conn.Execute (sqluser1)
 
 
          if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您发表的的主题《"&e_title&"》被取消精华,[url=topic.asp?l_id="&chktopic(request("l_id"))&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
        conn.Execute(sqlpm)
        end if
      
        sqluser1="update user set fen=fen+"&e_fen&",u_beauty=u_beauty+"&e_beauty&",u_money=u_money+"&e_money&" where username='"&e_username&"'"
conn.Execute (sqluser1)
 succmsg="<LI>主题取消精华完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg)
end if
    else
 if request.querystring("mode")="" then 
sql="select t_title from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
if not rs.eof then%>
    
<div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=4 cellSpacing=1 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=jinhua&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="3" <%=tColor%> height=22> 
<p align="center">添加主题"<%=htmlencode(rs("t_title"))%>" 到精华
　</td>

 </tr>
   <%call even()%>
 <td align="left" class=tdc bgcolor=<%=tcolor2%>>
      　</td>
 </tr>

  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right"> 

操作   </td><td class=tdc bgcolor=<%=tcolor2%> align="left"> 
	  <select name="e_title1" size=1 class=bdtj3>
<option value="2" selected>允许回复</option>
<option value="1">不允许回复</option>

	  </select>&nbsp;

 </td>



<td align="left" class=tdc bgcolor=<%=tcolor2%>>
       &nbsp;<input type="submit" name="Submit" value="确认"   class=bdtj >　</td>
 </tr>
 
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> << 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>

 </table>
  </center>
</div>


    <%end if
set rs=nothing
else
e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
e_title1=chktopic(trim(request("e_title1")))
if e_content="" and  e_title="" then
errormsg="<li>请填写操作理由</li>"
call error(errormsg)
call bq()
response.end
end if
e_content="添加精华主题："&htmlencode(rs("t_title"))&"<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
 sql="select t_username,t_title from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
if not rs.eof then 
e_username=rs("t_username")
e_title=rs("t_title")
end if
set rs=nothing
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)


    sqlnum="update topic set t_jinhua="&e_title1&" where t_id="&chktopic(request("t_id"))&""
    conn.Execute (sqlnum)
 sqluser1="update user set fen=fen+"&top_fen&",u_beauty=u_beauty+"&h_topbeauty&",u_money=u_money+"&h_topmoney&" ,u_toptopic=u_toptopic+1 where username='"&e_username&"'"
 conn.Execute (sqluser1)
 
    if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您发表的的主题《"&e_title&"》被加入精华,[url=topic.asp?l_id="&chktopic(request("l_id"))&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
        conn.Execute(sqlpm)
        end if
      
        sqluser1="update user set fen=fen+"&e_fen&",u_beauty=u_beauty+"&e_beauty&",u_money=u_money+"&e_money&" where username='"&e_username&"'"
conn.Execute (sqluser1)

 succmsg="<LI>主题加入精华完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg)
    end if
    end if
    
    '-------------------------禁止用户--------------
    elseif request.querystring("action")="user" then    
 if request.querystring("mode")="" then 
  sql="select l_lockuser,l_pbuser,l_title from lanmu where l_id="&request.querystring("l_id")&""
 set rs=conn.execute(sql)%>

<div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=user&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="4" <%=tColor%> height=25> 
<p align="center">屏蔽和禁止用户"<%=chktopic(request("username"))%>"在"<%=l_title%>"版块的发言
　</td>

 </tr>
  <tr height=90>
<td class=tdc bgcolor=<%=tcolor2%> align="right" width=20%> 

屏蔽用户：&nbsp;

 </td>

<td align="left" class=tdc bgcolor=<%=tcolor2%> height=70 colspan="2">
&nbsp;<textarea name=l_lockuser rows=5 cols=60 wrap=VIRTUAL class="bdtj3" ><%response.write(rs("l_lockuser"))%></textarea><br>（屏蔽用户在该版块的发言,多用户请用“|”分开）
       </td>

 </tr>
  <tr height=90>
<td class=tdc bgcolor=<%=tcolor2%> align="right" width=20%> 

禁止用户：&nbsp;

 </td>

<td align="left" class=tdc bgcolor=<%=tcolor2%> height=70 colspan="2">
&nbsp;<textarea name=l_pbuser rows=5 cols=60 wrap=VIRTUAL class="bdtj3" ><%response.write(rs("l_pbuser"))%></textarea><BR>（禁止用户在该版块的发言权,多用户请用“|”分开）
       </td>

 </tr>
<%call even%>
            <td valign=top bgcolor=<%=tcolor2%>     
 class=tdc>   
              &nbsp;<input type="submit" name="Submit" value="确认提交"  class=bdtj >
             </td>
          </tr>

 
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>

 </table>
  </center>
</div>

  <% else
  e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
  l_lockuser=chktopic(request("l_lockuser"))
  l_pbuser=chktopic(request("l_pbuser"))
if e_content="" and  e_title="" then
errormsg="<li>请填写操作理由</li>"
call error(errormsg)
call bq()
response.end
end if

sql="select t_username,t_title from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
if not rs.eof then 
e_username=rs("t_username")
e_title=rs("t_title")
end if

e_content="管理用户："&e_title&"<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
 
set rs=nothing
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)


 sqluser1="update user set fen=fen+"&top_fen&",u_beauty=u_beauty+"&h_topbeauty&",u_money=u_money+"&h_topmoney&" ,u_toptopic=u_toptopic+1 where username='"&e_username&"'"
 conn.Execute (sqluser1)
 
    if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您因为发表的的主题《"&e_title&"》被屏蔽或者禁止发言或者被取消,[url=topic.asp?l_id="&chktopic(request("l_id"))&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
        conn.Execute(sqlpm)
        end if
        
        

  sql="update lanmu set l_pbuser='"&l_pbuser&"',l_lockuser='"&l_lockuser&"' where l_id="&request.querystring("l_id")&""
conn.execute(sql)  

  succmsg="<LI>屏蔽或者禁止发言完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg)
end if

'-----------------移动------------------------------------------
 elseif request.querystring("action")="move" then
     sql="select * from topic where t_id="&chktopic(request("t_id"))&""
 set rs=conn.execute(sql)
 if rs("t_top")=0 and issupermaster=false and ismaster=false then
errormsg="<li>此主题已经总固定，只有管理员和总版主才可以操作</li>"
call error(errormsg)
call bq()
response.end
end if

 if request.querystring("mode")="" then 
  %>
<body  <%=background%> topmargin="30" leftmargin="0" >
<div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=move&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="3" <%=tColor%> height=22> 
<p align="center">移动当前主题"<%=htmlencode(rs("t_title"))%>"
　</td>

 </tr>
    <%call even()%>
 <td align="left" class=tdc bgcolor=<%=tcolor2%>>
      　</td>
 </tr>  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right"> 

移动到：&nbsp;

 </td>

<td align="left" class=tdc bgcolor=<%=tcolor2%> height=30>
<%sqllanmu="select  * from lanmu where l_id="&request.querystring("l_id")&""
set rslanmu=conn.execute(sqllanmu)%>
       &nbsp;
       <select name="l_id" class=bdtj3>
            <option value="<%=rslanmu("l_id")%>" selected >&nbsp;&nbsp;├<%=rslanmu("l_title")%></option>
<% sqlfen="select f_id,f_title from fenlei order by f_num asc"
set rsfen=conn.execute(sqlfen)
do while not rsfen.eof%>
           <option value="<%=rslanmu("l_id")%>"> ++<%=rsfen("f_title")%>++</option>
            <%sql_lanmu1="select * from lanmu where f_id="&rsfen("f_id")&""
set rs_lanmu1=conn.execute(sql_lanmu1)
%>
               <% do while not rs_lanmu1.Eof %>
      
      <option value="<%=rs_lanmu1("l_id")%>">&nbsp;&nbsp;├<%=rs_lanmu1("l_title")%></option>
      
      <%rs_lanmu1.MoveNext 
        Loop
        set rs_lanmu1=nothing
       
        rsfen.movenext
			loop
			set rsfen=nothing
			 set rslanmu=nothing%>  </select>  
       
 </td>

<td align="left" class=tdc bgcolor=<%=tcolor2%>>
       &nbsp;<input type="submit" name="Submit" value="确认"   class=bdtj >　</td>
 </tr>
 
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> << 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>

 </table>
  </center>
</div>

  <% else
  e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
  l_id1=chktopic(request.form("l_id"))
  if l_id1=chktopic(request.querystring("l_id")) then
  errnum=1
   errormsg="<li>请不要在相同论坛间移动</li>"
   end if 
if e_content="" and  e_title="" then
errnum=1
errormsg=errormsg&"<li>请填写操作理由</li>"
end if
if errnum=1 then
call error(errormsg)
call bq()
response.end
end if


e_content="移动主题："&htmlencode(rs("t_title"))&"<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
 sql="select * from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
e_username=rs("t_username")
e_title=rs("t_title")


sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)


sql1="select l_title from lanmu where l_id="&chktopic(request.querystring("l_id"))&""
set rs1=conn.execute(sql1)
l_title=rs1("l_title")
set rs1=nothing
t_id=rs("t_id")
t_replynum=rs("t_replynum")
l_id2=rs("l_id")
t_title=htmlencode(rs("t_title"))&"-"&cpbusername&"移-"
t_lastedit1="<br><i>本主题由 "& cpbusername & "于 " & nowtime &"从"&l_title&"论坛转移到此</i>"
set rs=nothing
 
  sqlnum="update topic set l_id="&l_id1&" ,t_title='"&t_title&"',t_lastedit='"&t_lastedit1&"' where t_id="&chktopic(request("t_id"))&""
    conn.Execute (sqlnum)
   t_lastedit1="<br><i>本回复由 "& cpbusername & "于 " & nowtime &"从"&l_title&"论坛转移到此</i>"
sqlnum="update reply set t_lastedit='"&t_lastedit1&"' where t_id="&chktopic(request("t_id"))&""
   conn.Execute (sqlnum)
   sql1="update lanmu set l_topiccount=l_topiccount-1,l_count=l_count-"&t_replynum&" where l_id="&l_id2&""
   conn.execute(sql1)
   sql1="update lanmu  set l_topiccount=l_topiccount+1,l_count=l_count+"&t_replynum&" where l_id="&l_id1&""
   conn.execute(sql1)
   
    if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您发表的的主题《"&e_title&"》被移动,[url=topic.asp?l_id="&l_id1&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
        conn.Execute(sqlpm)
        end if
      
        sqluser1="update user set fen=fen+"&e_fen&",u_beauty=u_beauty+"&e_beauty&",u_money=u_money+"&e_money&" where username='"&e_username&"'"
conn.Execute (sqluser1)

succmsg="<LI>主题移动完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg)
         end if

'复制---------------------------------------------
elseif request.querystring("action")="copy" then
     sql="select * from topic where t_id="&chktopic(request("t_id"))&""
 set rs=conn.execute(sql)
 if request.querystring("mode")="" then %>
<body  <%=background%> topmargin="30" leftmargin="0" >
<div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=0 cellSpacing=0 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=copy&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="3" <%=tColor%> height=22> 
<p align="center">复制当前主题"<%=htmlencode(rs("t_title"))%>"
　</td>

 </tr>
  <%call even()%>
 <td align="left" class=tdc bgcolor=<%=tcolor2%>>
  </td>
 </tr>
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align=right> 

复制到：&nbsp;

 </td>

<td align="left" class=tdc bgcolor=<%=tcolor2%> height=30>
      <%sqllanmu="select  * from lanmu where l_id="&request.querystring("l_id")&""
set rslanmu=conn.execute(sqllanmu)%>
       &nbsp;<select name="l_id" class=bdtj3>
            <option value="<%=rslanmu("l_id")%>" selected >&nbsp;&nbsp;├<%=rslanmu("l_title")%></option>
<% sqlfen="select f_id,f_title from fenlei order by f_num asc"
set rsfen=conn.execute(sqlfen)
do while not rsfen.eof%>
           <option value="<%=rslanmu("l_id")%>"> ++<%=rsfen("f_title")%>++</option>
            <%sql_lanmu1="select * from lanmu where f_id="&rsfen("f_id")&""
set rs_lanmu1=conn.execute(sql_lanmu1)
%>
               <% do while not rs_lanmu1.Eof %>
      
      <option value="<%=rs_lanmu1("l_id")%>">&nbsp;&nbsp;├<%=rs_lanmu1("l_title")%></option>
      
      <%rs_lanmu1.MoveNext 
        Loop
        set rs_lanmu1=nothing
       
        rsfen.movenext
			loop
			set rsfen=nothing
			 set rslanmu=nothing%>  </select>  
 
       
 </td>

<td align="left" class=tdc bgcolor=<%=tcolor2%>>
       &nbsp;<input type="submit" name="Submit" value="确认"   class=bdtj >　</td>
 </tr>
   <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> << 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>
 </table>
  </center>
</div>

  <% else
    e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
  l_id1=chktopic(request.form("l_id"))
  if l_id1=chktopic(request.querystring("l_id")) then
  errnum=1
   errormsg="<li>请不要在相同论坛间复制</li>"
   end if 
if e_content="" and  e_title="" then
errnum=1
errormsg=errormsg&"<li>请填写操作理由</li>"
end if
if errnum=1 then
call error(errormsg)
call bq()
response.end
end if


e_content="移动主题："&htmlencode(rs("t_title"))&"<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
 sql="select * from topic where  t_id="&chktopic(request("t_id"))&""
set rs=conn.execute(sql)
e_username=rs("t_username")
e_title=rs("t_title")
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)


sql1="select l_title from lanmu where l_id="&rs("l_id")&""
set rs1=conn.execute(sql1)
l_title=rs1("l_title")
set rs1=nothing
t_title=replace(trim(rs("t_title")),"'"," ")&"-"&cpbusername&"复-"
t_content=replace(rs("t_content"),"'"," ")
t_id=rs("t_id")
t_ip=rs("t_ip")
t_lasttime=rs("t_lasttime")
t_username=rs("t_username")
t_lastusername=rs("t_lastusername")
t_face=rs("t_face")
l_id=request.form("l_id")
t_time=rs("t_time")
t_replynum=rs("t_replynum")
t_top=rs("t_top")
t_count=rs("t_count")
t_lock=rs("t_lock")
t_jinhua=rs("t_jinhua")
t_vote=rs("t_vote")
t_lasttitle=replace(trim(rs("t_lasttitle")),"'","’")&"-"&cpbusername&"复-"
t_lastedit1="<br><i>本主题由 "& cpbusername & "于 " & nowtime &"从"&l_title&"论坛复制到此</i>"
set rs=nothing
  strSql = "insert into topic (t_username,t_lasttitle,t_lastedit,t_ip, t_title,t_content, t_lasttime, t_lastusername,t_face,t_time,t_replynum,t_count,t_top,t_jinhua,t_lock,t_vote,l_id) Values ('"
 strSql = StrSQl & t_username & "', '"
   strSql = StrSQl & t_lasttitle & "', '"
  strSql = StrSQl & t_lastedit1 & "', '"
 strSql = StrSQl & t_ip & "', '"
 strSql = StrSQl & t_title& "', '"
 strSql = StrSQl & t_content & "', '"
 strSql = StrSQl & t_lasttime & "', '"
 strSql = StrSQl & t_lastusername & "', '"
 strSql = StrSQl & t_face & "', '"
   strSql = StrSQl & t_time & "',"
     strSql = StrSQl & t_replynum & ","
      strSql = StrSQl & t_count & ","
      strSql = StrSQl & t_top & ","
    strSql = StrSQl & t_jinhua & ", "
     strSql = StrSQl & t_lock & ", "
      strSql = StrSQl & t_vote & ", "
 strSql = StrSQl & l_id & ")"
  conn.Execute (strsql)
  sql4="update total set t_num=t_num+1,r_num=r_num+"&t_replynum&""
  conn.execute(sql4)
  sql5="update lanmu set l_topiccount=l_topiccount+1,l_count=l_count+"&t_replynum&" where l_id="&l_id&""
  conn.execute(sql5)
    sql2="select t_id,l_id from topic order by t_id desc"
  set rs2=conn.execute(sql2)
  l_id1=rs2("l_id")
  t_id1=rs2("t_id")
  set rs2=nothing
  sql3="select * from reply where t_id="&t_id&""
  set rs3=conn.execute(sql3)
  do while not rs3.eof
  r_username=replace(rs3("r_username"),"'"," ")
  r_title=replace(rs3("r_title"),"'"," ")
   r_ip=rs3("r_ip")
    r_content=replace(rs3("r_content"),"'"," ")
     r_face=rs3("r_face")
     t_id=t_id1
     l_id=l_id1
     r_time=rs3("r_time")
      t_lastedit1="<br><i>本回复由 "& cpbusername & "于 " & nowtime &"从"&l_title&"论坛复制到此</i>"
   strSql = "insert into reply (r_username, r_title,r_ip,r_time,t_lastedit, r_content, r_face,t_id,l_id) Values ('"
 strSql = StrSQl & r_username & "', '"
 strSql = StrSQl & r_title & "', '"
  strSql = StrSQl & r_ip & "', '"
  strSql = StrSQl & r_time & "', '"
    strSql = StrSQl & t_lastedit1 & "', '"
 strSql = StrSQl & r_content & "', '"
 strSql = StrSQl & r_face & "', "
 strSql = StrSQl & t_id & ", "
 strSql = StrSQl & l_id & ")"
 conn.Execute (strsql)
  rs3.movenext
  loop
  set rs3=nothing
  if t_vote<>0 then
   sql6="select * from vote where  v_num="&t_id&""
set rs6=conn.execute(sql6)
do while not rs6.eof
v_title=rs6("v_title")
v_count=rs6("v_count")
v_user=rs6("v_user")
v_time=rs6("v_time")
v_type=rs6("v_type")
v_num=t_id1
   strSql = "insert into vote (v_num, v_title,v_time,v_user,v_count,v_type) Values( "
 strSql = StrSQl & v_num & ", '"
 strSql = StrSQl & v_title & "', '"
  strSql = StrSQl & v_time & "','"
    strSql = StrSQl & v_user & "', "
    strSql = StrSQl & v_count & ", "
 strSql = StrSQl & v_type & ")"
 conn.Execute (strsql)
  rs6.movenext
  loop
  set rs6=nothing
end if


 if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您发表的的主题《"&e_title&"》被复制,[url=topic.asp?l_id="&chktopic(request("l_id"))&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
        conn.Execute(sqlpm)
        end if
      
        sqluser1="update user set fen=fen+"&e_fen&",u_beauty=u_beauty+"&e_beauty&",u_money=u_money+"&e_money&" where username='"&e_username&"'"
conn.Execute (sqluser1)

   succmsg="<LI>主题复制完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg)
end if

'奖励----------------------
elseif request.querystring("action")="gooduser" then

     sql="select t_title,t_username from topic where t_id="&chktopic(request("t_id"))&""
 set rs=conn.execute(sql)
 if request.querystring("mode")="" then%>
 <div align="center">
  <center> 
 <table border=1 borderColor=<%=tdc2%> cellPadding=2 cellSpacing=1 width=<%=tdc3%> style="border-collapse: collapse">
<form action=up.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=chktopic(request("t_id"))%>&action=gooduser&mode=do METHOD="POST" name="form1"><tr>
<td class=tdc1 colspan="3" <%=tColor%> height=22> 
<p align="center">奖励/惩罚该主题"<%=htmlencode(rs("t_title"))%>"的作者
　</td>

 </tr>
<%call even()%>
 
<td align="left" class=tdc bgcolor=<%=tcolor2%>>
       &nbsp;<input type="submit" name="Submit" value="确认"   class=bdtj >　</td>
 </tr>
 
 
 
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right" colspan="3"> 

<p align="center">
<br><br>
    <a href=javascript:history.go(-1)> << 返回上一页</a>
<br><br>
<a href=list.asp?l_id=<%=request.querystring("l_id")%>>返回前论坛</a>

    <br>
</td>

 </tr>

 </table>
  </center>
</div>

<%
else
  e_money=chktopic(trim(request("e_money")))
e_beauty=chktopic(trim(request("e_beauty")))
e_fen=chktopic(trim(request("e_fen")))
e_title=chktopic(trim(request("e_title")))
e_content=chktopic(trim(request("e_content")))
if e_content="" and  e_title="" then
errormsg="<li>请填写操作理由</li>"
call error(errormsg)
call bq()
response.end
end if
e_content="奖励/惩罚该主题："""&htmlencode(rs("t_title"))&"""的作者<BR>结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;<BR>理由:"&e_title&"："&e_content
if not rs.eof then e_username=rs("t_username")
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&chktopic(request("l_id"))&","&chktopic(request("t_id"))&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)

if request("p_send")="1" then
    p_content=chktopic(request("p_content"))
    admina=cpbusername
q_content="您发表的的主题《"&htmlencode(rs("t_title"))&"》被奖励/惩罚,[url=topic.asp?l_id="&chktopic(request("l_id"))&"&t_id="&chktopic(request("t_id"))&"]地址[/url]"&chr(10)&"结果：经验："&e_fen&";;;魅力："&e_beauty&";;;金钱："&e_money&";;;"&chr(10)&"以下为操作者对你的留言:"&p_content&""
q_title="系统信息"
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&e_username&"','"&q_title&"','"&q_content&"','"&admina&"')"
        conn.Execute(sqlpm)
        end if
      
        sqluser1="update user set fen=fen+"&e_fen&",u_beauty=u_beauty+"&e_beauty&",u_money=u_money+"&e_money&" where username='"&e_username&"'"
conn.Execute (sqluser1)

  succmsg="<LI>奖励/惩罚完成</LI><li><a href=list.asp?l_id="&request.querystring("l_id")&">返回前论坛</a></li>"
call succ(succmsg)
end if
end if%>
    <%sub even()%>
     <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="left" colspan=3><BR>
<B>&nbsp;管理说明</B>：<BR>&nbsp;①请慎重使用管理，所有操作将被记录<BR>&nbsp;②如果选择短信通知，则会将操作原因用短信发送给用户<br>
 </td>

 </tr>
   <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right"> 

短信通知</b>：  
	 &nbsp;

 </td>

<td align="left" class=tdc bgcolor=<%=tcolor2%> height=30>&nbsp;<input type="text" name="p_content" size=50 class=bdtj3>
       
 </td>
 <td align="left" class=tdc bgcolor=<%=tcolor2%> height=30>&nbsp;
 <INPUT type=checkbox value=1 name=p_send>使用
  </td>
 </tr>
 <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right"> 

操作用户   </td><td class=tdc bgcolor=<%=tcolor2%> align="left">&nbsp;金钱: 
	  <select name="e_money" size=1 class=bdtj3>
	  <%for i=-50 to 50
	  if i=0 then
	   ii="selected"
	   else
	   ii=""
	   end if
	  response.write("<option value="&i&" "&ii&">"&i&"</option>")
	  next%>


	  </select>&nbsp;
	  &nbsp;魅力: 
	  <select name="e_beauty" size=1 class=bdtj3>
	  <%for i=-50 to 50
	  if i=0 then
	   ii="selected"
	   else
	   ii=""
	   end if
	  response.write("<option value="&i&" "&ii&">"&i&"</option>")
	  next%>


	  </select>&nbsp;
	  </select>&nbsp;
	  &nbsp;经验: 
	  <select name="e_fen" size=1 class=bdtj3>
	  <%for i=-50 to 50
	  if i=0 then
	   ii="selected"
	   else
	   ii=""
	   end if
	  response.write("<option value="&i&" "&ii&">"&i&"</option>")
	  next%>


	  </select>&nbsp;
 </td>
 <td class=tdc bgcolor=<%=tcolor2%>></td>
 </tr>
  <tr height=20>
<td class=tdc bgcolor=<%=tcolor2%> align="right"> 

操作理由</b>：  
	  <select name="e_title" size=1 class=bdtj3>
<option value="">自定义</option>
<option value="灌水">灌水</option>
<option value="广告">广告</option>
<option value="内容不符">内容不符</option>
<option value="好文章">好文章</option>
<option value="重复发贴">重复发帖</option>
<option value="有必要">有必要</option>
<option value="无必要">无必要</option>
<option value="文不对版">文不对版</option>
	  </select>&nbsp;

 </td>

<td align="left" class=tdc bgcolor=<%=tcolor2%> height=30>&nbsp;<input type="text" name="e_content" size=50 class=bdtj3>
       
 </td>


<%
 end sub%><!--#include file="bq.asp" -->