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

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


top


id=int(Request("id"))
sql="Select * From [forum] where ID="&ID&""
rs.Open sql,Conn,1
forumid=rs("forumid")
ReList=rs("ReList")
rs.close

if membercode > 3 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>您的权限不够")


username=Conn.Execute("Select username From [forum] where id="&id&"")(0)
topic=Conn.Execute("Select topic From [forum] where id="&id&"")(0)
select case Request("menu")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "top"
if membercode > 4 then
conn.execute("update [forum] set toptopic=2 where id="&id&"")
succtitle="总置顶主题成功"
sql="insert into message(author,incept,content) values ('"&Request.Cookies("username")&"','"&username&"','【系统消息】：管理员或版主<b>"&Request.Cookies("username")&"</b>已经把您的帖子：<b><font color=red>"&topic&"</font></b>总置顶，感谢您的好贴,感谢您对网站一如既往的支持和热爱，请继续支持我们哦，让我们为共同建设好这个网上家园而努力！')"
conn.Execute(SQL)
conn.execute("update [user] set newmessage=newmessage+1 where username='"&username&"'")
else
error("<li>您的权限不够")
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "untop"
if membercode > 4 then
conn.execute("update [forum] set toptopic=0 where id="&id&"")
succtitle="取消总置顶主题成功"
else
error("<li>您的权限不够")
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "movenew"
conn.execute("update [forum] set lasttime='"&now()&"' where id="&id&"")
succtitle="拉前主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "move"
if Request("moveid")="" then error("<li>您没有选择要将主题移动哪个论坛")
if Conn.Execute("Select pass From [bbsconfig] where id="&Request("moveid")&"")(0)=4 then error("<li>目标论坛为授权发帖状态")

conn.execute("update [bbsconfig] set lasttopic='该主题已被转移',lastname='"&Request.Cookies("Username")&"',lasttime='"&now()&"',today=today-1,tolrestore=tolrestore-1 where id="&forumid&"")
conn.execute("update [forum] set forumid="&Request("moveid")&",toptopic=0,goodtopic=0,locktopic=0,lastname='"&Request.Cookies("username")&"',lasttime='"&now()&"' where id="&id&" and forumid="&forumid&"")
bbsname=Conn.Execute("Select bbsname From bbsconfig where id="&Request("moveid"))(0)
sql="insert into message(author,incept,content) values ('"&Request.Cookies("username")&"','"&username&"','【系统消息】：管理员或版主<b>"&Request.Cookies("username")&"</b>已经把您的帖子：<b><font color=red>"&topic&"</font></b>移动到<b><font color=#0300ff>"&bbsname&"</b></font>，可能您的主题不符合原版块的要求或更适合新版块或其它问题而被转移，如有异议，请直接通过站内短消息的方式联系管理员 ，不好意思，给您添麻烦了。感谢您对网站的一如既往的支持和热爱，请继续支持我们哦，让我们为共同建设好这个网上家园而努力！')"
conn.Execute(SQL)
conn.execute("update [user] set newmessage=newmessage+1 where username='"&username&"'")
succtitle="移动主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "deltopic"
if isnumeric(""&Request("retopicid")&"") then
conn.execute("delete from [reforum"&ReList&"] where topicid="&id&" and id="&Request("retopicid")&"")
conn.execute("update [forum] set replies=replies-1 where id="&id&"")
succtitle="删除回贴成功"
else
conn.execute("update [user] set deltopic=deltopic+1 where username='"&username&"'")
conn.execute("update [forum] set toptopic=0,deltopic=1,lastname='"&Request.Cookies("username")&"',lasttime='"&now()&"' where id="&id&" and deltopic=0")
sql="select * from bbsconfig where id="&forumid&""
rs.Open sql,Conn,1
if not rs.eof then
lastpic=""&rs("lasttopic")&""
else
lastpic="no"
end if
rs.close
if instr(lastpic,"?id="&id&"")>0 then
sql="select * from forum where deltopic<>1 and forumid="&forumid&" order by id Desc"
rs.Open sql,Conn,1
lastid=rs("id")
lasttopic=""&rs("topic")&""
lastname=""&rs("lastname")&""
lasttime=rs("lasttime")
if rs("replies")>0 then
lasttopic="Re:"&lasttopic&""
end if
rs.close
conn.execute("update [bbsconfig] set lasttopic='<a onclick=min_yuzi() target=message href=ShowPost.asp?id="&lastid&">"&left(lasttopic,10)&"</a>',lastname='"&lastname&"',lasttime='"&lasttime&"',toltopic=toltopic-1,tolrestore=tolrestore-1  where id="&forumid&"")
else
conn.execute("update [bbsconfig] set toltopic=toltopic-1,tolrestore=tolrestore-1 where id="&forumid&"")
end if
succtitle="删除主题成功"
conn.execute("update [user] set [money]=[money]-15 where username='"&username&"'")
conn.execute("update [user] set [experience]=[experience]-10 where username='"&username&"'")
sql="insert into message(author,incept,content) values ('"&Request.Cookies("username")&"','"&username&"','【系统消息】：管理员或版主<b>"&Request.Cookies("username")&"</b>已经把您的帖子：<b><font color=red>"&topic&"</font></b>删除，<b><font color=#ff9600>您减少了15金钱及10经验，</font></b>可能您的主题已经过期或重复或涉嫌未经过同意的广告或有违反本论坛规章制度或其它问题，如有异议，请直接通过站内短消息的方式联系删除斑竹，也可以提出意见给管理员而不要再次发贴讯问，不好意思，给您添麻烦了。感谢您对网站的一如既往的支持和热爱，请继续支持我们哦，让我们为共同建设好这个网上家园而努力！')"
conn.Execute(SQL)
conn.execute("update [user] set newmessage=newmessage+1 where username='"&username&"'")
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "lockpage"
if isnumeric(""&Request("retopicid")&"") then
conn.execute("update [reforum] set lock=1 where topicid="&id&" and id="&Request("retopicid")&"")
succtitle="锁定回贴成功"
else
conn.execute("update [forum] set lock=1 where id="&id&"")
succtitle="锁定主题成功"
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "unlockpage"
if isnumeric(""&Request("retopicid")&"") then
conn.execute("update [reforum] set lock=0 where topicid="&id&" and id="&Request("retopicid")&"")
succtitle="解除锁定回贴成功"
else
conn.execute("update [forum] set lock=0 where id="&id&"")
succtitle="解除锁定主题成功"
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "goodtopic"
if Conn.Execute("Select goodtopic From [forum] where id="&id&" ")(0)=1 then error("<li>此帖子已经加入精华区了，无需重复添加")
conn.execute("update [forum] set goodtopic=1 where id="&id&"")
conn.execute("update [user] set goodtopic=goodtopic+1 where username='"&username&"'")
conn.execute("update [user] set [money]=[money]+25 where username='"&username&"'")
conn.execute("update [user] set [experience]=[experience]+50 where username='"&username&"'")
sql="insert into message(author,incept,content) values ('"&Request.Cookies("username")&"','"&username&"','【系统消息】：管理员或版主<b>"&Request.Cookies("username")&"</b>已经把您的帖子：<b><font color=red>"&topic&"</font></b>加为精华，<b><font color=#ff9600>您增加了25金钱值及50经验！</font></b>感谢您对网站一如既往的支持和热爱，请继续支持我们哦，让我们共同为网站的明天而努力！期待您更精彩的精华贴！')"
conn.Execute(SQL)
conn.execute("update [user] set newmessage=newmessage+1 where username='"&username&"'")
succtitle="加入精华区成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "delgoodtopic"
if Conn.Execute("Select goodtopic From [forum] where id="&id&" ")(0)=0 then error("<li>此帖子已经移出精华区了")
conn.execute("update [forum] set goodtopic=0 where id="&id&"")
conn.execute("update [user] set goodtopic=goodtopic-1 where username='"&username&"'")
succtitle="移出精华区成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "toptopic"
conn.execute("update [forum] set toptopic=1 where id="&id&"")
sql="insert into message(author,incept,content) values ('"&Request.Cookies("username")&"','"&username&"','【系统消息】：管理员或版主<b>"&Request.Cookies("username")&"</b>已经把您的帖子：<b><font color=red>"&topic&"</font></b>置顶，感谢您的好贴，感谢您对网站一如既往的支持和热爱，请继续支持我们哦，让我们共同为建设这个网上家园而努力！')"
conn.Execute(SQL)
conn.execute("update [user] set newmessage=newmessage+1 where username='"&username&"'")
succtitle="置顶主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "deltoptopic"
conn.execute("update [forum] set toptopic=0 where id="&id&"")
succtitle="取消置顶主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "locktopic"
conn.execute("update [forum] set locktopic=1 where id="&id&"")
succtitle="关闭主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "dellocktopic"
conn.execute("update [forum] set locktopic=0 where id="&id&"")
succtitle="开放主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "lookip"
if isnumeric(""&Request("retopicid")&"") then
sql="Select * From [reforum"&ReList&"] where id="&Request("retopicid")&""
else
sql="Select * From [forum] where id="&id&""
end if

rs.Open sql,Conn,1
username=rs("username")
posttime=rs("posttime")
postip=rs("postip")
rs.close
%>


<table border=0 width=97% align=center cellspacing=1 cellpadding=4 class=a2>
<tr class=a3>
<td height=25>&nbsp;<img src=images/Forum_nav.gif>&nbsp; <%ClubTree%> → 查看IP</td>
</tr>
</table>
<br>
<table width="333" border="0" cellspacing="1" cellpadding="2" align="center" class=a2>
<tr>
<td width="328" height="25" align="center" class=a1 colspan="2">
查看IP
</td></tr><tr>
<td height="7" width="164" valign="top" align="center" class=a3>
用户名</td>
<td height="7" width="164" valign="top" align="center" class=a3>
<%=username%></td></tr><tr>
<td height="6" width="164" valign="top" align="center" class=a3>
时间</td>
<td height="6" width="164" valign="top" align="center" class=a3>
<%=posttime%></td></tr><tr>
<td height="6" width="164" valign="top" align="center" class=a3>
IP地址</td>
<td height="6" width="164" valign="top" align="center" class=a3>
<%=postip%></td></tr></table>

<br>
<center>
<a href=ShowPost.asp?id=<%=id%>>BACK</a><br>
<%
htmlend

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "color"
color=request.QueryString("color")
title=conn.execute("select topic from [forum] where id="&id&" and forumid="&forumid&"")(0)

Set re = New RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="(<font)(.*)(>)(.*)(</font>)"
title=re.replace(title,"$4")
set re=Nothing
if color<>"buddhi" then
title="<font color="&color&">"&title&"</font>" 
end if
title=replace(title,"'","''")

conn.execute("update [forum] set topic='"&title&"' where id="&id&" and forumid="&forumid&"")
succtitle="标色操作成功"

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

log(""&succtitle&"，主题ID："&id&"")

message="<li>"&succtitle&"<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&">")
%>