⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_user.asp

📁 闻名一时的bbsxp超快论坛系统现在放出最新版2008版本给希望装论坛的朋友借鉴安装调试
💻 ASP
📖 第 1 页 / 共 3 页
字号:
	if CurrentAccountStatus <> "" then item=item&" and UserAccountStatus="&CurrentAccountStatus&""

	if item<>"" then item=" where "&mid(item,5)

	sql="["&TablePrefix&"Users]"&item&""

	TotalCount=Execute("Select count(UserID) From "&sql&"")(0) '获取数据数量
	PageSetup=20 '设定每页的显示数量
	TotalPage=Abs(Int(TotalCount/PageSetup*(-1))) '总页数
	PageCount = RequestInt("PageIndex") '获取当前页
	if PageCount <1 then PageCount = 1
	if PageCount > TotalPage then PageCount = TotalPage
	
	if Request("MemberSortDropDown")<>"" then item=item&" order by "&Request("MemberSortDropDown")&" "&Request("SortOrderDropDown")&""
	sql="["&TablePrefix&"Users]"&item&""
	if PageCount<11 then
		Set Rs=Execute(sql)
	else
		rs.Open sql,Conn,1
	end if
	if TotalPage>1 then RS.Move (PageCount-1) * pagesetup
	i=0
	Do While Not Rs.EOF and i<PageSetup
		i=i+1
%>
	<TR align=center class="CommonListCell">
		<TD><a href="Admin_User.asp?menu=UserEdit&UserName=<%=Rs("UserName")%>"><%=Rs("UserName")%></a></TD>
		<TD><a href="mailto:<%=Rs("UserEmail")%>"><%=Rs("UserEmail")%></a></TD>
		<TD><%=Rs("TotalPosts")%></TD>
		<TD><%=Rs("UserRegisterTime")%></TD>
		<TD><%=Rs("UserActivityTime")%></TD>
		<TD><a href="Admin_User.asp?menu=UserEdit&UserName=<%=Rs("UserName")%>">编辑</a> | <a onclick="return window.confirm('您确定要删除您所选用户的全部资料?');" href="Admin_User.asp?menu=UserDel&UserID=<%=Rs("UserID")%>">删除</a></TD>
	</TR>
<%
		Rs.MoveNext
	loop
	Rs.Close
%>
</TABLE>
<table border=0 width=100% align=center><tr><td><%ShowPage()%></tr></td></table>
<%
End Sub


Sub UserEdit
	sql="Select * from ["&TablePrefix&"Users] where UserName='"&HTMLEncode(UserName)&"'"
	Set Rs=Execute(sql)
	if Rs.eof then Alert(""&UserName&" 的用户资料不存在")
		
		UserSign=replace(""&Rs("UserSign")&"","<br>", vbCrlf)
		UserBio=replace(""&Rs("UserBio")&"","<br>",vbCrlf)
		UserNote=replace(""&Rs("UserNote")&"","<br>",vbCrlf)
%>
<form method="POST" name=form action="?menu=Userok">
<input type=hidden name=UserName value="<%=Rs("UserName")%>">
<table cellSpacing="1" cellpadding="5" border="0" width="70%" class=CommonListArea align=center>
	<tr class=CommonListTitle>
		<td width="600" colspan="4" align="center"><font color="000000"><a target="_blank" href="Profile.asp?UID=<%=Rs("UserID")%>">查看“<%=Rs("UserName")%>”的详细资料</a></font></td>
	</tr>
	<tr class="CommonListCell">
		<td colspan="2">用户名称:<%=Rs("UserName")%></td>
		<td width="600" colspan="2">用户密码:<a href="javascript:BBSXP_Modal.Open('?menu=ChangePassword&UserName=<%=Rs("UserName")%>',500,160);">修改密码</a></td>
	</tr>
	<tr class="CommonListCell">
		<td colspan="2">用户角色:<select name="UserRoleID">
<%
	RoleGetRow = FetchEmploymentStatusList("Select RoleID,Name from ["&TablePrefix&"Roles] where RoleID > 0 order by RoleID")
	For i=0 To Ubound(RoleGetRow,2)
	%><option value="<%=RoleGetRow(0,i)%>" <%if Rs("UserRoleID")=RoleGetRow(0,i) then%>selected<%end if%>><%=RoleGetRow(1,i)%></option><%
	Next
%>
			</select>		</td>
		<td width="600" colspan="2">帐号状态:<select name="UserAccountStatus" size="1">
				<option value="0" <%if Rs("UserAccountStatus")=0 then%>selected<%end if%>>正等待审核</option>
				<option value="1" <%if Rs("UserAccountStatus")=1 then%>selected<%end if%>>已通过审核</option>
				<option value="2" <%if Rs("UserAccountStatus")=2 then%>selected<%end if%>>已禁用</option>
				<option value="3" <%if Rs("UserAccountStatus")=3 then%>selected<%end if%>>未通过审核</option>
			</select>		</td>
	</tr>
	<tr class="CommonListCell">
		<td colspan="2">用户头衔:<input size="10" name="UserTitle" value="<%=Rs("UserTitle")%>"></td>
		<td width="600" colspan="2">信任等级:<select name="ModerationLevel" size="1">
			<option value="1" <%if Rs("ModerationLevel")=True then%>selected<%end if%>>信任用户</option>
			<option value="0" <%if Rs("ModerationLevel")=False then%>selected<%end if%>>非信任用户</option>
		</select></td>
	</tr>
	<tr class="CommonListCell">
		<td width="600" colspan="2">发 帖 数:<input size="10" name="TotalPosts" value="<%=Rs("TotalPosts")%>"></td>
		<td colspan="2">用户声望:<input size="10" name="Reputation" value="<%=Rs("Reputation")%>"></td>
	</tr>
	
	<tr class="CommonListCell">
		<td width="600" colspan="2">活跃天数:<input size="10" name="UserActivityDay" value="<%=Rs("UserActivityDay")%>"></td>
		<td colspan="2">用户等级:<%=Rs("UserRank")%></td>
	</tr>
	
	<tr class="CommonListCell">
		<td colspan="2">金  钱:<input size="10" name="UserMoney" value="<%=Rs("UserMoney")%>" /></td>
		<td width="600" colspan="2">邀 请 人:<input size="20" name="ReferrerName" value="<%=Rs("ReferrerName")%>" /></td>
	</tr>
	<tr class="CommonListCell">
		<td colspan="2">经 验 值:<input size="10" name="experience" value="<%=Rs("experience")%>" /></td>
		<td colspan="2">用户头像:<input size="20" name="UserFaceUrl" value="<%=Rs("UserFaceUrl")%>"></td>
	</tr>
	<tr class="CommonListCell">
		<td width="1200" colspan="4">注册日期:<%=Rs("UserRegisterTime")%> (IP:<%=Rs("UserRegisterIP")%>)</td>
	</tr>
	<tr class="CommonListCell">
		<td width="1200" colspan="4">活动日期:<%=Rs("UserActivityTime")%> (IP:<%=Rs("UserActivityIP")%>)</td>
	</tr>
	<tr class=CommonListTitle>
		<td colspan="4" align="center">基本资料</td>
	</tr>
	<tr class="CommonListCell">
	  <td width="600" colspan="2">名字: <input type="text" name="RealName" size="20" value="<%=Rs("RealName")%>" /></td>
		<td width="600" height="3" colspan="2">性别: <select size=1 name=UserSex>
				<option value=0 selected>[请选择]</option>
				<option value=1 <%if Rs("UserSex")=1 then%>selected<%end if%>>男</option>
				<option value=2 <%if Rs("UserSex")=2 then%>selected<%end if%>>女</option>
	  </select></td>
	</tr>
	<tr class="CommonListCell">
		<td width="600" colspan="2">生日: <input type="text" name="birthday" size="20" value="<%=Rs("birthday")%>"></td>
		<td width="600" colspan="2">地址: <input type="text" name="Address" size="20" value="<%=Rs("Address")%>"></td>
	</tr>
	<tr class="CommonListCell">
	  <td colspan="2">职业: <input type="text" name="Occupation" size="20" value="<%=Rs("Occupation")%>"></td>
	  <td colspan="2">兴趣: <input type="text" name="Interests" size="20" value="<%=Rs("Interests")%>"></td>
    </tr>
	<tr class="CommonListCell">
	  <td colspan="2">邮箱: <input type="text" name="UserEmail" size="20" value="<%=Rs("UserEmail")%>"></td>
	  <td colspan="2">主页: <input type="text" name="WebAddress" size="20" value="<%=Rs("WebAddress")%>"></td>
    </tr>
	<tr class="CommonListCell">
	  <td colspan="2">博客: <input type="text" name="WebLog" size="20" value="<%=Rs("WebLog")%>"></td>
	  <td colspan="2">相册: <input type="text" name="WebGallery" size="20" value="<%=Rs("WebGallery")%>"></td>
    </tr>
    
	<tr class=CommonListTitle>
		<td colspan="4" align="center">即时通信</td>
	</tr>
    
	<tr class="CommonListCell">
	  <td colspan="2">QQ : <input type="text" name="QQ" size="20" value="<%=Rs("QQ")%>"></td>
	  <td colspan="2">ICQ: <input type="text" name="ICQ" size="20" onkeyup=if(isNaN(this.value))this.value='' value="<%=Rs("ICQ")%>"></td>
    </tr>
	<tr class="CommonListCell">
	  <td colspan="2">AIM: <input type="text" name="AIM" size="20" value="<%=Rs("AIM")%>"></td>
	  <td colspan="2">MSN: <input type="text" name="MSN" size="20" value="<%=Rs("MSN")%>"></b></td>
    </tr>
	<tr class="CommonListCell">
	  <td colspan="2">Yahoo:<input type="text" name="Yahoo" size="20" value="<%=Rs("Yahoo")%>"></td>
	  <td colspan="2">Skype:<input type="text" name="Skype" size="20" value="<%=Rs("Skype")%>"></b></td>
    </tr>
    
	<tr class=CommonListTitle>
		<td colspan="4" align="center">签名&简介&备注</td>
	</tr>
    
    
	<tr class="CommonListCell">
		<td width="600" colspan="4">签名:<textarea name="UserSign" rows="4" cols="60"><%=UserSign%></textarea></td>
	</tr>
	<tr class="CommonListCell">
		<td width="600" colspan="4">简介:<textarea name="UserBio" rows="4" cols="60"><%=UserBio%></textarea></td>
	</tr>
	
	<tr class="CommonListCell">
		<td width="600" colspan="4">备注:<textarea name="UserNote" rows="4" cols="60"><%=UserNote%></textarea></td>
	</tr>
	
	
	<tr class=CommonListTitle>
		<td width="600" align="center" ><a onclick="return window.confirm('您确定要删除该用户所有发表过的帖子?');" href="?menu=UserDelTopic&UserName=<%=Rs("UserName")%>">删除该用户的所有主题</a></td>
		<td width="600" colspan="2" align="center" ><input type="submit" value=" 更 新 "></td>
		<td width="600" align="center" ><a onclick="return window.confirm('您确定要删除该用户的所有资料?');" href="?menu=UserDel&UserID=<%=Rs("UserID")%>">删除该用户的所有资料</a></td>
	</tr>
</table>
</form>
<%
End Sub

Sub UserDelTopic
	ThreadGetRow=FetchEmploymentStatusList("select ThreadID from ["&TablePrefix&"Threads] where PostAuthor='"&UserName&"'")
	if IsArray(ThreadGetRow) then
		for i=0 to ubound(ThreadGetRow,2)
			sql="select PostID from ["&TablePrefix&"Posts] where ThreadID="&ThreadGetRow(0,i)&""
			Rs.open sql,Conn,1,1
				do while not Rs.eof
					DelAttachments"Select * from ["&TablePrefix&"PostAttachments] where PostID="&Rs("PostID")&""
					Rs.movenext
				loop
			Rs.Close
		next
	end if
	ThreadGetRow=null
			
	Execute("Delete from ["&TablePrefix&"Threads] where PostAuthor='"&UserName&"'")
	Response.Write("已经将 "&UserName&" 所有发表过的主题全部删除")
End Sub

Sub UserDel
	for each ho in Request("UserID")
		ho=int(ho)
		if ho=CookieUserID then Alert("不能自己删除自己")
		Rs.open "select UserName from ["&TablePrefix&"Users] where UserID="&ho&"",Conn,1,3
		if not Rs.Eof Then
			UserName=Rs("UserName")
			'--------------------  API Start  --------------------
			Message=""
			If SiteConfig("APIEnable")=1 and UserName<>"" Then APIDeleteUser()
			if Message<>"" then Alert(""&Message&"")
			'--------------------  API End  ----------------------
		
			DelAttachments"Select * from ["&TablePrefix&"PostAttachments] where UserName='"&UserName&"'"
			
			Rs.Delete
			Rs.Update
		end if
		Rs.Close
	next
	Response.Write("已经成功删除用户ID为("&Request("UserID")&")的所有资料")
End Sub

Sub Userok
	birthday=HTMLEncode(Request.Form("birthday"))
	if Not IsDate(birthday) then birthday=null
	
	
	sql="Select * from ["&TablePrefix&"Users] where UserName='"&UserName&"'"
	Rs.Open sql,Conn,1,3
		Rs("UserFaceUrl")=Request("UserFaceUrl")
		Rs("UserRoleID")=Request("UserRoleID")
		Rs("UserEmail")=Request("UserEmail")
		Rs("TotalPosts")=Request("TotalPosts")
		Rs("UserActivityDay")=Request("UserActivityDay")
		Rs("UserRank")=Request("UserRank")
		Rs("experience")=Request("experience")
		Rs("UserMoney")=Request("UserMoney")
		Rs("ReferrerName")=Request("ReferrerName")
		Rs("TotalPosts")=Request("TotalPosts")
		Rs("UserTitle")=Request("UserTitle")
		Rs("Reputation")=RequestInt("Reputation")
		Rs("UserSign")=HTMLEncode(Request.Form("UserSign"))
		Rs("Interests")=HTMLEncode(Request.Form("Interests"))
		Rs("UserBio")=HTMLEncode(Request.Form("UserBio"))
		Rs("UserNote")=HTMLEncode(Request.Form("UserNote"))
		
		Rs("UserSex")=RequestInt("UserSex")
		Rs("UserAccountStatus")=Request("UserAccountStatus")
		Rs("ModerationLevel")=Request("ModerationLevel")
		Rs("birthday")=birthday
		
		Rs("QQ")=HTMLEncode(Request("QQ"))
		Rs("ICQ")=HTMLEncode(Request("ICQ"))
		Rs("AIM")=Request("AIM")
		Rs("MSN")=Request("MSN")
		Rs("Yahoo")=Request("Yahoo")
		Rs("Skype")=Request("Skype")
		

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -