www.gusucode.com > 仿MOP对开式论坛程序 1.0源码程序 > user.asp

    <%@language="VBScript"%>
<!--#include file="title.asp"-->
<%
contents=contents &"<title>用户管理-"& caption &"</title>"&_
"</head>"&_
"<body>"&_
""&_
"<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" class=""tdc"">"
if bbsadmin>3 then
Dim setuser,show,order,rorder,page,i,sql,showname,showtype,showlist,ordertype,showdel,delfile,deluser,delfp
setuser=Trim(Request.QueryString("username"))
deluser=Trim(Request.QueryString("deluser"))
delfp=Trim(Request.QueryString("delfp"))
show=Request.QueryString("show")
order=Request.QueryString("order")
rorder=Request.QueryString("order")
delfile=Request.QueryString("delfile")
page=Request.QueryString("page")
if IsNumeric(page) then
page=Abs(Clng(page))
else
page=1
end if
if page=0 then page=1
if bbsadmin=5 and deluser<>"" then
rs.Open "gbmaduser Where gbmaduser='"& deluser &"'",conn,1,3
if Not rs.Eof then rs.Delete
rs.Close
rs.Open "Delete From message Where gbmaduser='"& deluser &"'",conn,1,3
rs.Open "Delete From oldmessage Where gbmaduser='"& deluser &"'",conn,1,3
rs.Open "Delete From market Where gbmaduser='"& deluser &"'",conn,1,3
rs.Open "Delete From tools Where gbmaduser='"& deluser &"'",conn,1,3
rs.Open "Delete From report Where gbmaduser='"& deluser &"'",conn,1,3
rs.Open "Delete From remark Where gbmaduser='"& deluser &"'",conn,1,3
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">删除用户</td></tr><tr><td><br>删除用户 "& deluser &" 成功。<br><br></td></tr>"
end if
if delfp<>"" then
rs.Open "remark Where gbmaduser='"& delfp &"' and toolname='凤之羽粉'",conn,1,3
if Not rs.Eof then rs.Delete
rs.Close
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">删除签名</td></tr><tr><td><br>删除用户 "& delfp &" 的签名成功。<br><br></td></tr>"
end if
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">用户管理</td></tr>"&_
"<form name=""user"" method=""get"" action=""user.asp"">"&_
"<tr class=""tds""><td>"&_
"请输入要设置用户:<input name=""username"" type=""text"" maxlength=""20"" size=""20"" class=""iptwin""> "&_
"<input type=""submit"" value=""提交"" class=""out"" onmouseover=""this.className='over'"" onmouseout=""this.className='out'"">"&_
"</td></tr>"&_
"</form>"&_
"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">高级查询</td></tr>"&_
"<form name=""showuser"" method=""get"" action=""user.asp"">"&_
"<tr class=""tds""><td>"&_
"快捷查询:<a href=""user.asp?show=all"">所有用户</a> <a href=""user.asp?show=reg"">3天内注册</a> <a href=""user.asp?show=login"">3天内登陆</a> <a href=""user.asp?show=topic"">发贴Top100</a> <a href=""user.asp?show=reply"">回复Top100</a> <a href=""user.asp?show=visitant"">贵宾</a> <a href=""user.asp?show=admin"">管理员</a><br>"&_
"</td></tr>"&_
"</form>"
if order="username" then
order="gbmaduser"
showlist="logintime"
showtype="登陆时间"
ordertype="用户名"
elseif order="gb" then
showlist="logintime"
showtype="登陆时间"
ordertype="gb"
elseif order="regtime" then
showlist="logintime"
showtype="登陆时间"
ordertype="注册时间"
elseif order="logintime" then
showlist="logintime"
showtype="登陆时间"
ordertype="登陆时间"
elseif order="loginip" then
showlist="loginip"
showtype="登陆IP"
ordertype="登陆IP"
elseif order="lasttime" then
showlist="lasttime"
showtype="最后登陆"
ordertype="最后登陆"
elseif order="lastip" then
showlist="lastip"
showtype="最后IP"
ordertype="最后IP"
elseif order="topic" then
order="topicpiece"
showlist="topicpiece"
showtype="帖子数"
ordertype="帖子数"
elseif order="reply" then
order="replypiece"
showlist="replypiece"
showtype="回复数"
ordertype="回复数"
else
order=""
showlist="logintime"
showtype="登陆时间"
ordertype="注册时间"
end if
if show="all" then
if order="" then order="regtime"
sql="Select id,gbmaduser,gb,regtime,logintime,loginip,lasttime,lastip,topicpiece,replypiece From gbmaduser Order by "& order &" Desc"
showname="所有注册用户:"
elseif show="reg" then
if order="" then order="regtime"
sql="Select id,gbmaduser,gb,regtime,logintime,loginip,lasttime,lastip,topicpiece,replypiece From gbmaduser Where regtime>#"& Date()-3 &"# Order by "& order &" Desc"
showname="3天内注册的用户:"
elseif show="login" then
if order="" then
order="logintime"
ordertype="登陆时间"
end if
sql="Select id,gbmaduser,gb,regtime,logintime,loginip,lasttime,lastip,topicpiece,replypiece From gbmaduser Where logintime>#"& Date()-3 &"# Order by "& order &" Desc"
showname="3天内登陆的用户:"
elseif show="topic" then
if order="" then
order="topicpiece"
showlist="topicpiece"
showtype="帖子数"
ordertype="帖子数"
end if
sql="Select id,gbmaduser,gb,regtime,logintime,loginip,lasttime,lastip,topicpiece,replypiece From gbmaduser Where (id In (Select Top 100 id From gbmaduser Order by topicpiece Desc)) Order by "& order &" Desc"
showname="发贴数最多的100用户:"
elseif show="reply" then
if order="" then
order="replypiece"
showlist="replypiece"
showtype="回复数"
ordertype="回复数"
end if
sql="Select id,gbmaduser,gb,regtime,logintime,loginip,lasttime,lastip,topicpiece,replypiece From gbmaduser Where (id In (Select Top 100 id From gbmaduser Order by replypiece Desc)) Order by "& order &" Desc"
showname="回复数最多的100用户:"
elseif show="visitant" then
if order="" then order="regtime"
sql="Select id,gbmaduser,gb,regtime,logintime,loginip,lasttime,lastip,topicpiece,replypiece From gbmaduser Where gbmadadmin=1 Order by "& order &" Desc"
showname="是贵宾的用户:"
elseif show="admin" then
if order="" then order="regtime"
sql="Select id,gbmaduser,gb,regtime,logintime,loginip,lasttime,lastip,topicpiece,replypiece From gbmaduser Where gbmadadmin>1 Order by "& order &" Desc"
showname="是管理员的用户:"
end if
if sql<>"" then
rs.Open sql,conn,1,1
contents=contents &"</table><table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" class=""tdc"">"&_
"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">查询结果</td></tr>"&_
"<tr class=""tds""><td>"& showname &"共" & rs.RecordCount &" 个。当前排序方式:"& ordertype &"。<br>"&_
"排序方式:<a href=""user.asp?show="& show &"&order=username"">用户名</a> <a href=""user.asp?show="& show &"&order=gb"">"& gbname &"</a> <a href=""user.asp?show="& show &"&order=regtime"">注册时间</a> <a href=""user.asp?show="& show &"&order=logintime"">登陆时间</a> <a href=""user.asp?show="& show &"&order=loginip"">登陆IP</a> <a href=""user.asp?show="& show &"&order=lasttime"">最后登陆</a> <a href=""user.asp?show="& show &"&order=lastip"">最后IP</a> <a href=""user.asp?show="& show &"&order=topic"">帖子数</a> <a href=""user.asp?show="& show &"&order=reply"">回复数</a><br>"
if Not rs.Eof then
rs.PageSize=50
if page>rs.PageCount then page=rs.PageCount
rs.AbsolutePage=page
contents=contents &"当前在第"& page &"页 转到第 "
For i=1 to rs.PageCount
contents=contents &"<a href=""user.asp?show="& show &"&order="& rorder &"&page="& i &""" target=""_self"">"& i &"</a> "
Next
contents=contents &"页 共有"& rs.PageCount &"页"&_
"<table border=""0"" cellpadding=""0"" cellspacing=""3"" width=""100%"">"&_
"<tr class=""toptr""><td width=""32"">ID</td><td>用户名</td><td width=""50"">"& gbname &"</td><td width=""120"">注册时间</td><td width=""120"">"& showtype &"</td></tr>"
For i=1 to rs.PageSize
contents=contents &"<tr class=""otr""><td>"& rs("id") &"</td><td><a href=""user.asp?username="& rs("gbmaduser") &""">"& rs("gbmaduser") &"</a></td><td>"& rs("gb") &"</td><td>"& rs("regtime") &"</td><td title=""帖子数:"& rs("topicpiece") & vbcrlf &"回复数:"& rs("replypiece") & vbcrlf &"登陆时间:"& rs("logintime") & vbcrlf &"登陆IP:"& rs("loginip") & vbcrlf &"最后登陆:"& rs("lasttime") & vbcrlf &"最后IP:"& rs("lastip") &""">"& rs(showlist) &"</td></tr>"
rs.MoveNext
if rs.Eof then Exit For
Next
end if
contents=contents &"</table></td></tr>"
rs.Close
end if
if setuser<>"" then
contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">用户管理</td></tr>"&_
"<tr class=""tds""><td>"&_
"<script language=""JavaScript"">"&_
"function ivalidinput()"&_
"{"&_
"if (document.setimprison.cause.value.length==0){"&_
"alert(""请填写状态异动原因。"");"&_
"document.setimprison.cause.focus();"&_
"return false;"&_
"}"&_
"return true;"&_
"}"&_
"function gvalidinput()"&_
"{"&_
"if (document.setgb.cause.value.length==0){"&_
"alert(""请填写"& gbname &"异动原因。"");"&_
"document.setgb.cause.focus();"&_
"return false;"&_
"}"&_
"return true;"&_
"}"&_
"function altergb()"&_
"{"&_
"if(document.setgb.minusgb.disabled==true)"&_
"{"&_
"document.setgb.minusgb.disabled=false;"&_
"document.setgb.addsgb.disabled=true;"&_
"document.setgb.addsgb.value="""";"&_
"}"&_
"else"&_
"{"&_
"document.setgb.minusgb.disabled=true;"&_
"document.setgb.addsgb.disabled=false;"&_
"document.setgb.minusgb.value="""";"&_
"}"&_
"}"&_
"function usertr(htmlurl)"&_
"{"&_
"var newwin=window.open(htmlurl,""_blank"",""top=70,left=5,width=400,height=450,scrollbars=yes,resizable=yes,status=yes"");"&_
"newwin.focus();"&_
"return false;"&_
"}"&_
"</script>"
rs.Open "gbmaduser Where gbmaduser='"& setuser &"'",conn,1,1
if bbsadmin=5 then showdel=" <a href=""javascript:if(confirm('确实要删除该用户吗?\n删除用户时不会删除该用户发布的帖子,\n以及用户的回复和上传的文件。'))location='user.asp?deluser="& setuser &"'"">删除该用户</a>"
contents=contents &"<table border=""0"" cellpadding=""0"" cellspacing=""3"" width=""100%"">"&_
"<tr><td width=""64"">用户名:</td><td class=""otr"">"& setuser &"</td><td width=""64"">ID:</td><td class=""otr"">"& rs("id") & showdel &"</td></tr>"&_
"<tr><td>"& gbname &":</td><td class=""otr"">"& rs("gb") &"</td><td>注册时间:</td><td class=""otr"">"& rs("regtime") &"</td></tr>"&_
"<tr><td>登陆时间:</td><td class=""otr"">"& rs("logintime") &"</td><td>登陆IP:</td><td class=""otr"">"& rs("loginip") &"</td></tr>"&_
"<tr><td>最后登陆:</td><td class=""otr"">"& rs("lasttime") &"</td><td>最后IP:</td><td class=""otr"">"& rs("lastip") &"</td></tr>"&_
"<tr><td>发贴数:</td><td class=""otr"">"& rs("topicpiece") &"</td><td>回复数:</td><td class=""otr"">"& rs("replypiece") &"</td></tr>"&_
"</table>"
rs.Close
contents=contents &"查看用户"& setuser &":<a href=""report.asp?username="& setuser &""" target=""_blank"">异动报告</a> <a href=""usertr.asp?topic="& setuser &""" onClick=""return usertr(this.href);"">发表的帖子</a> <a href=""usertr.asp?reply="& setuser &""" onClick=""return usertr(this.href);"">回复的帖子</a> <a href=""userinfo.asp?username="& setuser &""" onClick=""return showb(this.href);"">个人信息</a><br>"
rs.Open "imprison Where gbmaduser='"& setuser &"'",conn,1,1
if Not rs.EOF then
contents=contents &"用户当前状态:"
if rs("imprison")=1 then
contents=contents &"被禁止发贴回帖"
elseif rs("imprison")=2 then
contents=contents &"被禁止使用道具"
elseif rs("imprison")=3 then
contents=contents &"被禁止发送密信"
elseif rs("imprison")=4 then
contents=contents &"被禁止发贴回帖和使用道具"
elseif rs("imprison")=5 then
contents=contents &"被禁止发贴回帖和发送密信"
elseif rs("imprison")=6 then
contents=contents &"被禁止使用道具和发送密信"
elseif rs("imprison")=7 then
contents=contents &"被禁止发贴回帖、使用道具和发送密信"
else
contents=contents &"出错,未知状态 "& rs("imprison") &" "
end if
contents=contents &"至 "& rs("endtime") &",<a href=""setimprison.asp?username="& setuser &""">解除状态?</a>"
end if
rs.Close
contents=contents &"</td></tr>"&_
"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">状态异动设置</td></tr>"&_
"<form name=""setimprison"" onsubmit=""return ivalidinput();"" method=""post"" action=""setimprison.asp"">"&_
"<tr class=""tds""><td>"&_
"<input type=""hidden"" name=""username"" value="& setuser &">"&_
"异动原因:<input name=""cause"" type=""text"" maxlength=""255"" size=""40"" class=""iptwin""><br>"&_
"异动状态:<select name=""imprison"" size=""1""><option value=""1"">禁止发贴回帖</option><option value=""2"">禁止使用道具</option><option value=""3"">禁止发送密信</option><option value=""4"">禁止发贴回帖和使用道具</option><option value=""5"">禁止发贴回帖和发送密信</option><option value=""6"">禁止使用道具和发送密信</option><option value=""7"">禁止发贴回帖、使用道具和发送密信</option></select><br>"&_
"异动天数:<input type=""radio"" checked name=""endtime"" value=""1"">一天 <input type=""radio"" name=""endtime"" value=""2"">二天 <input type=""radio"" name=""endtime"" value=""3"">三天 <input type=""radio"" name=""endtime"" value=""5"">五天 <input type=""radio"" name=""endtime"" value=""7"">七天 <input type=""radio"" name=""endtime"" value=""30"">一月 <input type=""radio"" name=""endtime"" value=""365"">一年 "&_
"<input type=""submit"" value=""提交"" class=""out"" onmouseover=""this.className='over'"" onmouseout=""this.className='out'"">"&_
"</td></tr>"&_
"</form>"&_
"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">"& gbname &"异动设置</td></tr>"&_
"<form name=""setgb"" onsubmit=""return gvalidinput();"" method=""post"" action=""setgb.asp"">"&_
"<tr class=""tds""><td>"&_
"<input type=""hidden"" name=""username"" value="& setuser &">"&_
"<input type=""hidden"" name=""matter"" value=""管理设置"">"&_
"异动原因:<input name=""cause"" type=""text"" maxlength=""255"" size=""40"" class=""iptwin""><br>"&_
"<input type=""radio"" checked name=""choice"" onclick=""altergb()""> 扣除"& gbname &":<input name=""minusgb"" type=""text"" maxlength=""10"" size=""10"" class=""iptwin""> <input type=""radio"" name=""choice"" onclick=""altergb()""> 给予"& gbname &":<input name=""addsgb"" type=""text"" maxlength=""10"" size=""10"" class=""iptwin"" disabled> "&_
"<input type=""submit"" value=""提交"" class=""out"" onmouseover=""this.className='over'"" onmouseout=""this.className='out'"">"&_
"</td></tr>"&_
"</form>"&_
"</table><table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" class=""tdc"">"&_
"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">用户的签名(凤之羽粉效果)</td></tr>"&_
"<tr class=""tds""><td>"
rs.Open "remark Where gbmaduser='"& setuser &"' and toolname='凤之羽粉'",conn,1,1
if rs.Eof then
contents=contents &"该用户还没有设置签名。"
else
contents=contents &"该用户的签名还能使用 "& rs("amount") &" 次,<a href=""user.asp?username="& setuser &"&delfp="& setuser &""">删除其签名效果</a>,签名效果如下:<br>"& rs("content")
end if
rs.Close
contents=contents &"</td></tr>"&_
"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">用户的道具</td></tr>"&_
"<tr class=""tds""><td>"&_
"<table border=""0"" cellpadding=""0"" cellspacing=""3"" width=""100%"">"&_
"<tr class=""toptr""><td width=""40%"">可用道具(数量)</td><td width=""60%"">待售道具(价格/数量)</td></tr>"&_
"<tr class=""otr"" valign=""top""><td class=""tds"">"
rs.Open "tools Where gbmaduser='"& setuser &"' Order by toolname",conn,1,1
For i=1 to rs.RecordCount
contents=contents & rs("toolname") &"("& rs("amount") &")<br>"
rs.MoveNext
Next
rs.Close
contents=contents &"</td><td class=""tds"">"
rs.Open "market Where gbmaduser='"& setuser &"' Order by toolname",conn,1,1
For i=1 to rs.RecordCount
contents=contents & rs("toolname") &"("& rs("price") &"/"& rs("amount") &")<br>"
rs.MoveNext
Next
rs.Close
contents=contents &"</td></tr></table></td></tr>"&_
"</table><table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" class=""tdc"">"&_
"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">上载文件管理</td></tr>"
if delfile<>"" then contents=contents &"<tr><td><br>删除文件 "& delfile &" 成功。<br><br></td></tr>"
rs.Open "upfile Where gbmaduser='"& setuser &"'",conn,1,1
if rs.Eof then
contents=contents &"<tr><td><br>用户 "& setuser &" 还没有任何上载的文件。<br><br></td></tr>"
else
For i=1 to rs.RecordCount
contents=contents &"<tr><td class=""ftd"">&nbsp;<a href=""upload.asp?delfile="& rs("id") &""">删除</a> 查看:<a href="""& rs("filename") &""" target=""_blank"">"& rs("fileinfo") &"</a></td></tr>"
rs.MoveNext
Next
end if
rs.Close
end if
else
call connclose
Response.Redirect "login.asp"
end if
contents=contents &"</table>"&_
""
%>
<!--#include file="bottom.asp"-->