📄 adminrecycle.asp
字号:
<!--#INCLUDE FILE="Connections.asp" -->
<!--#include file="top.asp" -->
<%cpbtitle="管理回收站"
call toptitle(l_title,cpbtitle)
call head(0,"论坛信息",Request.ServerVariables("HTTP_REFERER"),cpbtitle)%>
<%'取出变量
if isuser=false then
errornum=1
errormsg=errormsg&"<li>请先登陆,然后才能操作</li>"
end if
if issupermaster=false then
errornum=1
errormsg=errormsg&"<li>很抱歉,您不是论坛管理员不能操作回收站</li>"
end if
if errornum=1 then
call error(errormsg)
call login()
call bq()
response.end
end if
dim h_delfen,h_delmoney,h_delbeauty
sql="select h_delfen,h_delmoney,h_delbeauty from home"
set rsconn1=conn.execute(sql)
if not rsconn1.eof then
h_delfen=rsconn1("h_delfen")'删除减分
h_delmoney=rsconn1("h_delmoney")
h_delbeauty=rsconn1("h_delbeauty")
end if
set rsconn1=nothing
rcount=request.form("t_id").count
if rcount<=0 and request("action")<>"清空回收站" then
errormsg=errormsg&"<li>请选择相关帖子后进行操作</li>"
call error(errormsg)
call bq()
response.end
end if
if request("action")="删除" then
call del()
elseif request("action")="还原" then
call come()
elseif request("action")="清空回收站" then
call delall()
else
errormsg="<li>参数错误</li>"
call error(errormsg)
call bq()
response.end
end if
e_content="操作回收站"
e_username="回收站"
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values (0,0,'"&o_ip&"','"&nowtime&"','"&e_content&"','"&e_username&"','"&cpbusername&"')"
conn.execute(sql)
succmsg="<li>帖子管理完毕</li>"
call succ(succmsg)
call bq()
response.end
'删除
sub del()
for i=1 to request.form("t_id").count
sql="select l_id,t_replynum,t_username,t_vote from topic where t_lock=2 and t_id="&Request.form("t_id")(i)&""
set rs=conn.execute(sql)
if not rs.eof then
r=rs("t_replynum")
t_username=rs("t_username")
t_vote=rs("t_vote")
l_id=rs("l_id")
end if
set rs=nothing
sqluser1="update user set u_deltopic=u_deltopic+1,fen=fen-"&h_delfen&",u_beauty=u_beauty-"&h_delbeauty&",u_money=u_money-"&h_delmoney&" where username='"&t_username&"'"
conn.Execute (sqluser1)
if t_vote<>0 then
sqlnum="delete * from vote where v_num="&Request.form("t_id")(i)&""
conn.Execute (sqlnum)
end if
sqlnum1="delete * from reply where t_id="&Request.form("t_id")(i)&""
conn.Execute (sqlnum1)
sqlnum="update total set t_num=t_num-1,r_num=r_num-"&r&""
conn.Execute (sqlnum)
sqllanmu="update lanmu set l_topiccount= l_topiccount-1,l_count= l_count-"&r&" where l_id="&l_id&""
conn.Execute (sqllanmu)
sqldel="DELETE * from topic where t_id="&Request.form("t_id")(i)&""
conn.Execute (sqldel)
next
end sub
'还原
sub come()
for i=1 to request.form("t_id").count
sqldel="update topic set t_lock=0 where t_id="&Request.form("t_id")(i)&""
conn.Execute (sqldel)
next
end sub
'清空
sub delall()
sql="select t_id,l_id,t_replynum,t_username,t_vote from topic where t_lock=2 "
set rs=conn.execute(sql)
do while not rs.eof
r=rs("t_replynum")
t_username=rs("t_username")
t_vote=rs("t_vote")
l_id=rs("l_id")
t_id=rs("t_id")
sqluser1="update user set u_deltopic=u_deltopic+1,fen=fen-"&h_delfen&",u_beauty=u_beauty-"&h_delbeauty&",u_money=u_money-"&h_delmoney&" where username='"&t_username&"'"
conn.Execute (sqluser1)
if t_vote<>0 then
sqlnum="delete * from vote where v_num="&t_id&""
conn.Execute (sqlnum)
end if
sqlnum1="delete * from reply where t_id="&t_id&""
conn.Execute (sqlnum1)
sqlnum="update total set t_num=t_num-1,r_num=r_num-"&r &""
conn.Execute (sqlnum)
sqllanmu="update lanmu set l_topiccount= l_topiccount-1,l_count= l_count-"&r &" where l_id="&l_id&""
conn.Execute (sqllanmu)
sqldel="DELETE * from topic where t_id="&t_id&""
conn.Execute (sqldel)
rs.movenext
loop
end sub
%><!--#include file="bq.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -