📄 user.asp
字号:
if Pcount>currentpage+3 then
endpage=currentpage+3
else
endpage=Pcount
end if
for i=currentpage-3 to endpage
if not i<1 then
if i = clng(currentpage) then
response.write " <font color=red>["&i&"]</font>"
else
response.write " <a href="""&Searchstr&"&page="&i&""">["&i&"]</a>"
end if
end if
next
if currentpage+3 < Pcount then
response.write "... <a href="""&Searchstr&"&page="&Pcount&""">["&Pcount&"]</a>"
end if
%>
</td></tr>
<tr><td colspan=5 class=td1 align=center><B>请选择您需要进行的操作</B>:<input type="radio" class=radio name="useraction" value=1> 删除 <input type="radio" class=radio name="useraction" value=3> 删除用户所有帖子 <input type="radio" class=radio name="useraction" value=2 checked> 移动到用户组
<select size=1 name="selusergroup">
<%
set trs=Dvbbs.Execute("select usergroupid,UserTitle,ParentGID from dv_usergroups where not (usergroupid=1 or usergroupid=7) and (Not ParentGID=0) order by ParentGID,usergroupid")
do while not trs.eof
response.write "<option value="&trs(0)&">"&SysGroupName(tRs(2))&trs(1)&"</option>"
trs.movenext
loop
trs.close
set trs=nothing
%>
</select>
</td>
<td class=td1 colspan=8 align=center>全部选定<input type=checkbox class=checkbox value="on" name="chkall" onclick="CheckAll(this.form)">
</td>
</tr>
<tr><td colspan=8 class=td1 align=center>
<input type=submit class=button name=submit value="执行选定的操作" onclick="{if(confirm('确定执行选择的操作吗?')){return true;}return false;}">
</td></tr>
</FORM>
<%
end if
rs.close
set rs=nothing
End Sub
'操作用户,删除用户信息相关操作
Sub ToUser()
Dim SQL,rs
response.write "<tr><th colspan=8 style=""text-align:center;"">执行结果</th></tr>"
if request("useraction")="" then
response.write "<tr><td colspan=8 class=td1>请指定相关参数。</td></tr>"
founderr=true
end if
if request("userid")="" then
response.write "<tr><td colspan=8 class=td1>请选择相关用户。</td></tr>"
founderr=true
end if
if not founderr then
if request("useraction")=1 then
Dim AllUserName
AllUserName = ""
'------------------shinzeal加入删除用户的短信-------------------------
dim uid,i
for i=1 to request("userid").count
if request("userid").count=1 then
uID=request("userid")
else
uID=replace(request.form("userid")(i),"'","")
end if
set rs=Dvbbs.Execute("select username from [dv_User] where userid="&uid&"")
if not (rs.eof and rs.bof) then
AllUserName = AllUserName & Rs(0) & ","
Dvbbs.Execute("update dv_message set delR=1 where incept='"&trim(rs(0))&"' and delR=0")
Dvbbs.Execute("update dv_message set delS=1 where sender='"&trim(rs(0))&"' and delS=0 and issend=0")
Dvbbs.Execute("update dv_message set delS=1 where sender='"&trim(rs(0))&"' and delS=0 and issend=1")
Dvbbs.Execute("delete from dv_message where incept='"&rs(0)&"' and delR=1")
Dvbbs.Execute("update dv_message set delS=2 where sender='"&trim(rs(0))&"' and delS=1")
Dvbbs.Execute("delete from dv_friend where F_username='"&rs(0)&"'")
Dvbbs.Execute("delete from dv_bookmark where username='"&rs(0)&"'")
end if
rs.close
next
If Right(AllUserName,1) = "," Then AllUserName = Left(AllUserName,Len(AllUserName)-1)
'-------------------删除用户的短信------------------------
'删除用户的帖子和精华
Dvbbs.Execute("delete from dv_topic where PostUserID in ("&replace(request("userid"),"'","")&")")
for i=0 to ubound(allposttable)
Dvbbs.Execute("delete from "&allposttable(i)&" where PostUserID in ("&replace(request("userid"),"'","")&")")
next
Dvbbs.Execute("delete from dv_besttopic where PostUserID in ("&replace(request("userid"),"'","")&")")
'删除用户上传表
Dvbbs.Execute("delete from dv_upfile where F_UserID in ("&replace(request("userid"),"'","")&")")
Dvbbs.Execute("delete from [dv_user] where userid in ("&replace(request("userid"),"'","")&")")
Response.write "<tr><td colspan=8 class=td1>删除用户( "& AllUserName &" )操作成功。</td></tr>"
'-----------------------------------------------------------------
'系统整合
'-----------------------------------------------------------------
Dim DvApi_Obj,DvApi_SaveCookie,SysKey
If DvApi_Enable Then
'SysKey = Md5(DvApi_SysKey&AllUserName,16)
Set DvApi_Obj = New DvApi
DvApi_Obj.NodeValue "syskey",SysKey,0,False
DvApi_Obj.NodeValue "action","delete",0,False
DvApi_Obj.NodeValue "username",AllUserName,1,False
Md5OLD = 1
SysKey = Md5(DvApi_Obj.XmlNode("username")&DvApi_SysKey,16)
Md5OLD = 0
DvApi_Obj.NodeValue "syskey",SysKey,0,False
DvApi_Obj.SendHttpData
'If DvApi_Obj.Status = "1" Then
'Response.redirect "showerr.asp?ErrCodes="& DvApi_Obj.Message &"&action=OtherErr"
'End If
Set DvApi_Obj = Nothing
End If
'-----------------------------------------------------------------
elseif request("useraction")=2 then
dim userclass,usertitlepic
set rs=Dvbbs.Execute("select * from dv_usergroups where usergroupid="&request("selusergroup")&" order by minarticle")
if not (rs.eof and rs.bof) then
userclass=rs("usertitle")
usertitlepic=rs("grouppic")
end if
Dvbbs.Execute("update [dv_user] set UserGroupID="&replace(request("selusergroup"),"'","")&",userclass='"&userclass&"',titlepic='"&usertitlepic&"' where userid in ("&replace(request("userid"),"'","")&")")
response.write "<tr><td colspan=8 class=td1>操作成功。</td></tr>"
elseif request("useraction")=3 then
dim titlenum
if request("userid")="" then
response.write "<tr><td colspan=8 class=td1>请输入被删除帖子用户名。</td></tr>"
end if
titlenum=0
for i=0 to ubound(allposttable)
set rs=Dvbbs.Execute("Select Count(announceID) from "&allposttable(i)&" where postuserid in ("&replace(request("userid"),"'","")&")")
titlenum=titlenum+rs(0)
sql="update "&allposttable(i)&" set locktopic=boardid,boardid=444,isbest=0 where postuserid in ("&replace(request("userid"),"'","")&")"
Dvbbs.Execute(sql)
next
Dvbbs.Execute("delete from dv_besttopic where postuserid in ("&replace(request("userid"),"'","")&")")
set rs=Dvbbs.Execute("select topicid,posttable from dv_topic where postuserid in ("&replace(request("userid"),"'","")&")")
do while not rs.eof
Dvbbs.Execute("update "&rs(1)&" set locktopic=boardid,boardid=444,isbest=0 where rootid="&rs(0))
rs.movenext
loop
set rs=nothing
Dvbbs.Execute("update dv_topic set locktopic=boardid,boardid=444,isbest=0 where postuserid in ("&replace(request("userid"),"'","")&")")
if isnull(titlenum) then titlenum=0
sql="update [dv_user] set UserPost=UserPost-"&titlenum&",userWealth=userWealth-"&titlenum*Dvbbs.Forum_user(3)&",userEP=userEP-"&titlenum*Dvbbs.Forum_user(8)&",userCP=userCP-"&titlenum*Dvbbs.Forum_user(13)&" where userid in ("&replace(request("userid"),"'","")&")"
Dvbbs.Execute(sql)
response.write "<tr><td colspan=8 class=td1>删除成功,如果要完全删除帖子请到论坛回收站<BR>建议您到更新论坛数据中更新一下论坛数据,或者<a href=alldel.asp>返回</a></td></tr>"
else
response.write "<tr><td colspan=8 class=td1>错误的参数。</td></tr>"
end if
end if
End Sub
'修改用户资料表单
Sub UserModify()
dim realname,character,personal,country,province,city,shengxiao,blood,belief,occupation,marital, education,college,userphone,iaddress
Dim UserIM
Dim rs,sql
response.write "<tr><th colspan=8 style=""text-align:center;"">用户资料操作</th></tr>"
if not isnumeric(request("userid")) then
response.write "<tr><td colspan=8 class=td1>错误的用户参数。</td></tr>"
founderr=true
end if
if not founderr then
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from [dv_user] where userid="&request("userid")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<tr><td colspan=8 class=td1>没有找到相关用户。</td></tr>"
founderr=true
else
if rs("userinfo")<>"" then
userinfo=split(Server.HtmlEncode(rs("userinfo")),"|||")
if ubound(userinfo)=14 then
realname=userinfo(0)
character=userinfo(1)
personal=userinfo(2)
country=userinfo(3)
province=userinfo(4)
city=userinfo(5)
shengxiao=userinfo(6)
blood=userinfo(7)
belief=userinfo(8)
occupation=userinfo(9)
marital=userinfo(10)
education=userinfo(11)
college=userinfo(12)
userphone=userinfo(13)
iaddress=userinfo(14)
else
realname=""
character=""
personal=""
country=""
province=""
city=""
shengxiao=""
blood=""
belief=""
occupation=""
marital=""
education=""
college=""
userphone=""
iaddress=""
end if
else
realname=""
character=""
personal=""
country=""
province=""
city=""
shengxiao=""
blood=""
belief=""
occupation=""
marital=""
education=""
college=""
userphone=""
iaddress=""
end if
UserIM = Split(Rs("UserIM"),"|||")
%>
<FORM METHOD=POST ACTION="?action=saveuserinfo">
<tr>
<td width=100% class=td1 valign=top colspan=8>对 <%=rs("username")%> 用户操作快捷选项:<BR><BR>
<a href="mailto:<%=rs("useremail")%>">发邮件</a> | <a href="../messanger.asp?action=new&touser=<%=rs("username")%>" target=_blank>发短信</a> | <a href="../dispuser.asp?id=<%=rs("userid")%>" target=_blank>预览用户资料</a> | <a href="../Query.asp?stype=1&nSearch=3&keyword=<%=rs("username")%>&SearchDate=30" target=_blank>用户新贴</a> | <a href="../Query.asp?stype=6&nSearch=0&pSearch=0&keyword=<%=rs("username")%>" target=_blank>用户精华</a> | <a href="../Query.asp?stype=4&nSearch=0&pSearch=0&keyword=<%=rs("username")%>" target=_blank>用户热贴</a> | <a href="../show.asp?username=<%=rs("username")%>" target=_blank>用户展区</a> | <a href="?action=UserPermission&userid=<%=rs("userid")%>&username=<%=rs("username")%>">编辑权限</a> | <a href="../TopicOther.asp?action=lookip&ip=<%=Rs("UserLastIP")%>&t=1" target=_blank>最后来源</a> | <a href="?action=touser&useraction=1&userid=<%=rs("userid")%>" onclick="{if(confirm('删除将不可恢复,并且将删除该用户在论坛的所有信息,确定删除吗?')){return true;}return false;}">删除用户</a>
</td>
</tr>
<tr><th colspan=6 style="text-align:center;">用户基本资料修改--<%=rs("username")%></th></tr>
<tr><td class=td1 height=23 align=left colspan=6>
注意:新建管理员建议到管理员管理中进行,仅在此设置为管理员组的用户并无进入系统后台权限
</td></tr>
<tr>
<td width=20% class=td1>用户组</td>
<td width=80% class=td1 colspan=5>
<select size=1 name="usergroups">
<%
set trs=Dvbbs.Execute("select usergroupid,UserTitle,parentgid from dv_usergroups where Not ParentGID=0 order by ParentGID,usergroupid")
do while not trs.eof
response.write "<option value="&trs(0)
if rs("usergroupid")=trs(0) then response.write " selected "
response.write ">"&SysGroupName(tRs(2)) & trs(1)
'if trs(2)>0 then response.write "(自定义等级)"
response.write "</option>"
trs.movenext
loop
trs.close
set trs=nothing
%>
</select>
</td>
</tr>
<input name="userid" type=hidden value="<%=rs("userid")%>">
<tr>
<td width=20% class=td1>用户名</td>
<td width=80% class=td1 colspan=5><input size=45 name="username" type=text value="<%=Server.HtmlEncode(rs("username"))%>" disabled></td>
</tr>
<tr>
<td width=20% class=td1>密 码</td>
<td width=80% class=td1 colspan=5><input size=45 name="password" type=text> 如果不修改请留空</td>
</tr>
<tr>
<td width=20% class=td1>密码问题</td>
<td width=80% class=td1 colspan=5><input size=45 name="quesion" type=text value="<%If Trim(rs("userquesion"))<>"" Then Response.Write Server.HtmlEncode(rs("userquesion"))%>"></td>
</tr>
<tr>
<td width=20% class=td1>密码答案</td>
<td width=80% class=td1 colspan=5><input size=45 name="answer" type=text> 如果不修改请留空</td>
</tr><tr>
<td width=20% class=td1>用户性别</td>
<td width=80% class=td1 colspan=5>
女 <input type="radio" class=radio value="0" <%if rs("UserSex")=0 then%>checked<%end if%> name="sex">
男 <input type="radio" class=radio value="1" <%if rs("UserSex")=1 then%>checked<%end if%> name="sex">
</td>
</tr>
<tr>
<td width=20% class=td1>个人照片</td>
<td width=80% class=td1 colspan=5><input size=45 name="UserPhoto" type=text value="<%If Trim(rs("UserPhoto"))<>"" Then Response.Write Server.HtmlEncode(rs("UserPhoto"))%>"></td>
</tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -