home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
221.214.14.186
/
221.214.14.186.tar
/
221.214.14.186
/
zb
/
Notepad-1
/
admin_post_do.asp
< prev
next >
Wrap
Text File
|
2004-12-09
|
4KB
|
154 lines
<!--#include file="conn.asp"-->
<%
if not theUser.master then
connclose()
response.redirect ("index.asp")
end if
dim id,act
dim exec, rs
set id=request.form("id")
act=encodestr(request.form("act"))
main()
connclose()
response.redirect "admin_ok.asp"
sub main()
select case act
case "del" '╔╛┴⌠╤╘
for i=1 to id.count
delete(id(i))
next
case "best" '╔Φ╬¬╛½╗¬
for i=1 to id.count
best(id(i))
next
case "top" '╣╠╢Ñ
for i=1 to id.count
top(id(i))
next
case "lock" '╦°╢¿
for i=1 to id.count
lock(id(i))
next
end select
end sub
sub delete(xxid)
dim rs1
exec="select rt,jh,name,isPrivate from ly where id="& Cstr(xxid)
set rs=conn.execute(exec)
'▒╛┴⌠╤╘╖ó▒φ╙├╗º╖ó┴⌠╤╘╩²╝⌡
exec="update [user] set GBpostNum=GBpostNum-1 where username='"& rs("name") &"'"
conn.execute(exec)
'╩╟╕∙┴⌠╤╘╝╞╩²╝⌡
if rs(0)=0 then
'╟─╟─╗░╝╞╩²╝⌡
if rs("isPrivate") then
exec="update [user] set GBprivateNum=GBprivateNum-1 where username='"& rs("name") &"' "
conn.execute(exec)
exec="update GBconst set privateNum=privateNum-1"
conn.execute(exec)
end if
exec="update GBconst set topicNum=topicNum-1"
conn.execute(exec)
'╕·╠√╙├╗º╖ó▒φ╩²╝⌡
exec="select name from ly where bl=1 and rt="& Cstr(xxid)
set rs1=conn.execute(exec)
do until rs1.eof
exec="update [user] set GBpostNum=GBpostNum-1 where username='"& rs1("name") &"'"
conn.execute(exec)
rs1.movenext
loop
rs1.close
'╩╟╛½╗¬╡─╕·╠√╩²╝⌡
exec="select count(*) from ly where jh=1 and rt="& Cstr(xxid)
set rs1=conn.execute(exec)
if rs1(0)>0 then
exec="update GBconst set bestNum=bestNum-"& rs1(0)
conn.execute(exec)
end if
rs1.close
set rs1=nothing
'╔╛│²╕·╠√
exec="delete from ly where rt="& Cstr(xxid)
conn.execute(exec)
else
'╫ε║≤╗╪╕┤ID╕─▒Σ
exec="select top 1 id from ly where rt="& rs(0) &" and id<>"& Cstr(xxid) &" order by id desc"
set rs1=conn.execute(exec)
if not (rs1.eof and rs1.bof) then
exec="update ly set reid="& rs1(0) &" where id="& rs(0)
else
exec="update ly set reid=id where id="& rs(0)
end if
conn.execute(exec)
rs1.close
set rs1=nothing
exec="update ly set hf=hf-1 where id="& rs(0)
conn.execute(exec)
end if
'╩╟╛½╗¬╝╞╩²╝⌡
if rs(1)=1 then
exec="update GBconst set bestNum=bestNum-1"
conn.execute(exec)
end if
rsclose()
exec="delete from ly where id=" + CStr(xxid)
conn.execute(exec)
end sub
sub best(xxid)
exec="select jh,isPrivate from ly where id="& Cstr(xxid)
set rs=conn.execute(exec)
if rs(1) then
session("error")="╟─╟─╗░▓╗┐╔╥╘╔Φ╬¬╛½╗¬úí"
rsclose()
connclose()
response.redirect "error.asp"
end if
if rs(0)=1 then
exec="update ly set jh=0 where id=" + CStr(xxid)
conn.execute(exec)
exec="update GBconst set bestNum=bestNum-1"
conn.execute(exec)
else
exec="update ly set jh=1 where id=" + CStr(xxid)
conn.execute(exec)
exec="update GBconst set bestNum=bestNum+1"
conn.execute(exec)
end if
end sub
sub top(xxid)
exec="select istop from ly where id="& Cstr(xxid)
set rs=conn.execute(exec)
if rs(0)=1 then
exec="update ly set istop=0 where id=" + CStr(xxid)
conn.execute(exec)
else
exec="update ly set istop=1 where id=" + CStr(xxid)
conn.execute(exec)
end if
end sub
sub lock(xxid)
exec="select islock from ly where id="& Cstr(xxid)
set rs=conn.execute(exec)
if rs(0) then
exec="update ly set islock=0 where id=" + CStr(xxid)
conn.execute(exec)
else
exec="update ly set islock=1 where id=" + CStr(xxid)
conn.execute(exec)
end if
end sub
%>