%@ LANGUAGE="VBSCRIPT" %>
<%
stats="批量删除"
dim rsactiveusers,activeuser
dim sql,rs
dim sql1,rs1
dim id,boardid,rootid
if founduser=false then
founderr=true
Errmsg=Errmsg+"
"+"
请登陆后进行操作。"
end if
if request("boardid")="" then
founderr=true
Errmsg=Errmsg+"
"+"请指定论坛版面。"
elseif not isInteger(request("boardid")) then
founderr=true
Errmsg=Errmsg+"
"+"非法的版面参数。"
else
boardid=request("boardid")
if chkboardmaster(boardid)=false then
founderr=true
Errmsg=Errmsg+"
"+"您不是该版面斑竹或者系统管理员。"
end if
end if
call nav()
call headline(1)
if founderr=true then
call error()
else
if request("action")="del" then
call del()
if founderr then
call error()
else
call success()
end if
else
call main()
end if
end if
call endline()
sub main()
%>
<%
end sub
sub del()
dim titlenum
dim NewAnnounceNum,NewTopicNum
if request("username")="" then
founderr=true
errmsg=errmsg+"
"+"请输入被帖子删除用户名。"
exit sub
end if
rs=conn.execute("Select Count(announceID) from bbs1 where boardid="&boardid&" and username='"&trim(request("username"))&"'")
titlenum=rs(0)
if isnull(titlenum) then titlenum=0
sql="delete from bbs1 where boardid="&boardid&" and username='"&trim(request("username"))&"'"
conn.Execute(sql)
sql="update [user] set article=article-"&titlenum&",userWealth=userWealth-"&titlenum*wealthDel&",userEP=userEP-"&titlenum*epDel&",userCP=userCP-"&titlenum*cpDel&" where username='"&trim(request("username"))&"'"
conn.Execute(sql)
sql="select count(announceid) from bbs1 where boardid="&boardid
set rs=conn.Execute(sql)
NewAnnounceNum=rs(0)
sql="select count(announceid) from bbs1 where ParentID=0 and boardid="&boardid
set rs=conn.Execute(sql)
NewTopicNum=rs(0)
sql="update board set lastbbsnum="&NewAnnounceNum&",lasttopicnum="&NewTopicNum&" where boardid="&boardid
conn.execute(sql)
end sub
sub success()
%>
<%
end sub
%>