📄 adminuser.asp
字号:
dd2=chktopic(request("dd2"))
if dd2="1" then
sql5="select t_id,t_replynum,l_id from topic where t_username='"&username&"' and t_time>#"&dateadd("d", -dd1, nowtime) & "#"
set rs5=conn.execute(sql5)
do while not rs5.eof
ii=ii+1'主题数
i=i+rs5("t_replynum")'回复数
conn.execute("update total set t_num=t_num-1, r_num=r_num-"&rs5("t_replynum")&"")
conn.execute("update lanmu set l_topiccount=l_topiccount-1,l_count=l_count-"&rs5("t_replynum")&" where l_id="&rs5("l_id")&"")
conn.execute("delete from reply where t_id="&rs5("t_id"))
conn.execute("delete from vote where v_num="&rs5("t_id"))
rs5.movenext
loop
set rs5=nothing
conn.execute("delete from topic where t_username='"&username&"' and t_time>#"&dateadd("d", -dd1, nowtime) & "#")
succmsg=succmsg&"<li>共删除主题数 "&ii&" 篇,回复数 "&i&" 篇</li>"
elseif dd2="2" then
sql5="select r_id,t_id,l_id from reply where r_username='"&username&"' and r_time>#"&dateadd("d", -dd1, nowtime) & "#"
set rs5=conn.execute(sql5)
do while not rs5.eof
ii=ii+1'回复数
conn.execute("update total set r_num=r_num-1")
conn.execute("update lanmu set l_count=l_count-1 where l_id="&rs5("l_id")&"")
conn.execute("update topic set t_replynum=t_replynum-1 where t_id="&rs5("t_id")&"")
rs5.movenext
loop
set rs5=nothing
succmsg=succmsg&"<li>共删除回复数 "&ii&" 篇</li>"
end if
elseif delete="deletetopic" then
sql5="select t_id,t_replynum,l_id from topic where t_username='"&username&"'"
set rs5=conn.execute(sql5)
do while not rs5.eof
ii=ii+1'主题数
i=i+rs5("t_replynum")'回复数
conn.execute("update total set t_num=t_num-1, r_num=r_num-"&rs5("t_replynum")&"")
conn.execute("update lanmu set l_topiccount=l_topiccount-1,l_count=l_count-"&rs5("t_replynum")&" where l_id="&rs5("l_id")&"")
conn.execute("delete from reply where t_id="&rs5("t_id"))
conn.execute("delete from vote where v_num="&rs5("t_id"))
rs5.movenext
loop
set rs5=nothing
sql="delete from topic where t_username='"&username&"'"
conn.execute(sql)
iii=0
sql5="select r_id,t_id,l_id from reply where r_username='"&username&"'"
set rs5=conn.execute(sql5)
do while not rs5.eof
iii=iii+1'回复数
conn.execute("update total set r_num=r_num-1")
conn.execute("update lanmu set l_count=l_count-1 where l_id="&rs5("l_id")&"")
conn.execute("update topic set t_replynum=t_replynum-1 where t_id="&rs5("t_id")&"")
rs5.movenext
loop
sql="delete from reply where r_username='"&username&"'"
conn.execute(sql)
sql="update user set lastsend='已经删除' where username='"&username&"'"
conn.execute(sql)
succmsg=succmsg&"<li>共删除主题数 "&ii&" 篇,回复数 "&i+iii&" 篇</li>"
ii=ii+iii
elseif delete="deleteuser" then
sql5="select t_id,t_replynum,l_id from topic where t_username='"&username&"'"
set rs5=conn.execute(sql5)
do while not rs5.eof
ii=ii+1'主题数
i=i+rs5("t_replynum")'回复数
conn.execute("update total set t_num=t_num-1, r_num=r_num-"&rs5("t_replynum")&"")
conn.execute("update lanmu set l_topiccount=l_topiccount-1,l_count=l_count-"&rs5("t_replynum")&" where l_id="&rs5("l_id")&"")
conn.execute("delete from reply where t_id="&rs5("t_id"))
conn.execute("delete from vote where v_num="&rs5("t_id"))
rs5.movenext
loop
set rs5=nothing
sql="delete from topic where t_username='"&username&"'"
conn.execute(sql)
iii=0
sql5="select r_id,t_id,l_id from reply where r_username='"&username&"'"
set rs5=conn.execute(sql5)
do while not rs5.eof
iii=iii+1'回复数
conn.execute("update total set r_num=r_num-1")
conn.execute("update lanmu set l_count=l_count-1 where l_id="&rs5("l_id")&"")
conn.execute("update topic set t_replynum=t_replynum-1 where t_id="&rs5("t_id")&"")
rs5.movenext
loop
sql="delete from reply where r_username='"&username&"'"
conn.execute(sql)
sql="update user set lastsend='已经删除' where username='"&username&"'"
conn.execute(sql)
succmsg=succmsg&"<li>共删除主题数 "&ii&" 篇,回复数 "&i+iii&" 篇</li>"
ii=ii+iii
sql="delete from user where username='"&username&"'"
conn.execute(sql)
sql="update topic set t_lastusername='已经删除' where t_lastusername='"&username&"'"
conn.execute(sql)
sql="delete from pm where q_receive='"&username&"'"
conn.execute(sql)
sql="update total set n_num=n_num-1"
conn.execute(sql)
succmsg=succmsg&"<li>用户已经删除</li>"
call succ(succmsg)
response.end
end if
errornum=0
if password<>"" then
if len(password)>18 or len(password)<6 then
errornum=1
errormsg=errormsg&"<li>密码不能超过18位或者少于6位</li>"
end if
end if
if email="" then
errornum=1
errormsg=errormsg&"<li>email不能为空</li>"
end if
email1=Split(email, "@")
if UBound(email1) <>1 then
errornum=1
errormsg=errormsg&"<li>email格式不对</li>"
else
email1=Split(email, ".")
if UBound(email1) <1 then
errornum=1
errormsg=errormsg&"<li>email格式不对</li>"
end if
end if
if instr(imghead,"script:")>0 then
errornum=1
errormsg=errormsg&"<li>请不要在自定义头像输入非法字符:script:</li>"
end if
if imgwidth >"" then
if not IsNumeric(imgwidth) then
errornum=1
errormsg=errormsg&"<li>头像宽度必须为数字</li>"
elseif cint(imgwidth)>120 then
errornum=1
errormsg=errormsg&"<li>头像宽度必须小于120</li>"
end if
end if
if imgheight>"" then
if not IsNumeric(imgheight) then
errornum=1
errormsg=errormsg&"<li>头像高度必须为数字</li>"
elseif cint(imgheight)>120 then
errornum=1
errormsg=errormsg&"<li>头像高度必须小于120</li>"
end if
end if
if cday="" or cmonth="" or cyear="" then
h_birder=""
else
h_birder=cyear&"-"&cmonth&"-"&cday
if not isdate(h_birder) then
errornum=1
errormsg=errormsg&"<li>出生日期出现非法日期</li>"
end if
end if
if len(question)>100 then
errornum=1
errormsg=errormsg&"<li>问题不能超过100个字符</li>"
end if
if len(answer)>200 then
errornum=1
errormsg=errormsg&"<li>答案不能超过200个字符</li>"
end if
if len(sign)>250 then
errornum=1
errormsg=errormsg&"<li>签名不能超过250个字符</li>"
end if
if errornum=1 then
call error(errormsg)
response.end
end if
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
ufen=0
umoney=0
ubeauty=0
if ii<>"" then
ubeauty=ii*h_delbeauty
umoney=ii*h_delmoney
ufen=ii*h_delfen
else
ii=0
end if
'判别更新会员发帖
if trim(rsedit("username"))<>trim(username) then
sql="update topic set t_username='"&username&"' where t_username='"&rsedit("username")&"'"
conn.execute(sql)
sql="update topic set t_lastusername='"&username&"' where t_lastusername='"&rsedit("username")&"'"
conn.execute(sql)
sql="update reply set r_username='"&username&"' where r_username='"&rsedit("username")&"'"
conn.execute(sql)
sql="update admin set a_username='"&username&"' where a_username='"&rsedit("username")&"'"
conn.execute(sql)
end if
rsedit("grade")=grade
rsedit("lock")=lock
rsedit("locktopic")=locktopic
rsedit("fen")=fen-ufen
rsedit("username")=username
rsedit("question")=question
if answer<>"" then
rsedit("answer")=md5(answer)
end if
if password<>"" then
rsedit("Password")=md5(password)
end if
rsedit("email")=email
rsedit("u_todaytime")=openemail
rsedit("sex")=sex
rsedit("qq")=qq
rsedit("home")=home
rsedit("face")=face
rsedit("msn")=msn
rsedit("address")=address
rsedit("imghead")=imghead
rsedit("u_beauty")=u_beauty-ubeauty
rsedit("u_money")=u_money-umoney
rsedit("u_deltopic")=u_deltopic+ii
rsedit("u_toptopic")=u_toptopic
rsedit("u_logintimes")=u_logintimes
rsedit("send")=send
rsedit("u_yzreg")=u_yzreg
rsedit("u_locksendpm")=u_locksendpm
if u_name<>"" then
rsedit("u_name")=u_name
end if
if u_weiwang<>"" then
rsedit("u_weiwang")=u_weiwang
end if
if imgwidth<>"" then
rsedit("imgwidth")=imgwidth
end if
if imgheight<>"" then
rsedit("imgheight")=imgheight
end if
rsedit("sign")=sign
if h_birder<>"" then
rsedit("h_birder")=h_birder
end if
rsedit.update
succmsg=succmsg&"<li>成功更新</li>"
call succ(succmsg)
response.end
end if
end sub
sub adduser() %>
<table border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >
<form ACTION="?action=adduser1" METHOD="POST" NAME=form1>
<tr>
<td colspan="2" <%=tColor%> class=tdc1 height="22" align=center>添加新用户</td>
</tr>
<tr>
<td width="18%" bgcolor=<%=tColor2%> class=tdc align="right" height="22">用户名<font color="#FF00FF">:*</font></td>
<td width="82%" bgcolor=<%=tColor2%> class=tdc height="23">
<input TYPE=TEXT NAME=UserName SIZE=25 MAXLENGTH=15 class="bdtj3">
(最少2位,最多12位)
</td>
</tr>
<tr>
<td width="18%" bgcolor=<%=tColor2%> class="tdc" align="right" height="22">密码<font color="#FF00FF">:*</font></td>
<td width="82%" bgcolor=<%=tColor2%> class="tdc" height="23">
<input type=password name=password size=20 maxlength=13 class="bdtj3">(最少6位,最多18位)
</td>
</tr>
<tr>
<td width="18%" bgcolor=<%=tColor2%> class=tdc align="right" height="22">确认密码<font color="#FF00FF">:*</font></td>
<td width="82%" bgcolor=<%=tColor2%> class=tdc height="23">
<input type=password name=password1 size=20 maxlength=13 class="bdtj3">
</td>
</tr>
<tr>
<td width="18%" bgcolor=<%=tColor2%> class=tdc align="right" height="22" >
Email<font color="#FF00FF">:*</font></td>
<td width="82%" bgcolor=<%=tColor2%> class=tdc height="23">
<input TYPE=TEXT NAME=Email SIZE=30 MAXLENGTH=50 class="bdtj3"><% if h_reg=1 then response.write("请认真填写,密码将通过此信箱发送给您")%>
</td>
</tr>
<tr >
<td valign=top width="18%" bgcolor=<%=tColor2%> class=tdc height="26"> </td>
<td width="82%" bgcolor=<%=tColor2%> class=tdc height="26">
<input type=SUBMIT name=Submit value=提交 class=bdtj >
<input type=RESET name=Reset value=重置 class=bdtj>
</td>
</tr></form>
</table>
<%end sub
sub adduser1
username=chktopic(trim(Request.Form("username")))
password=chktopic(trim(Request.Form("password")))
password1=chktopic(trim(Request.Form("password1")))
email=chktopic(trim(Request.Form("email")))
if username="" then
errornum=1
errormsg="<li>用户名不能为空</li>"
end if
if Instr(username,"=")>0 or Instr(username,"%")>0 or Instr(username,chr(32))>0 or Instr(username,"?")>0 or Instr(username,"&")>0 or Instr(username,";")>0 or Instr(username,",")>0 or Instr(username,"'")>0 or Instr(username,",")>0 or Instr(username,chr(34))>0 or Instr(username,chr(9))>0 or Instr(username,"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -