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

📄 admin_group.asp

📁 功能强大的一个b/s工作站
💻 ASP
📖 第 1 页 / 共 4 页
字号:
<!--#include file=conn.asp-->
<!-- #include file="inc/const.asp" -->
<title><%=Forum_info(0)%>--管理页面</title>
<link rel="stylesheet" href="forum_admin.css" type="text/css">
<meta NAME=GENERATOR Content="Microsoft FrontPage 3.0" CHARSET=GB2312>
<BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0">
<%
	dim admin_flag
	admin_flag="25"
	if not master or instr(session("flag"),admin_flag)=0 then
		Errmsg=Errmsg+"<br>"+"<li>本页面为管理员专用,请<a href=admin_index.asp target=_top>登陆</a>后进入。<br><li>您没有管理本页面的权限。"
		call dvbbs_error()
	else
		call main()
		conn.close
		set conn=nothing
	end if

	sub main()
if request("action")="save" then
call savegroup()
elseif request("action")="savedit" then
call savedit()
elseif request("action")="del" then
call del()
elseif request("action")="group" then
call gradeinfo()
elseif request("action")="addgroup" then
call addgroup()
elseif request("action")="editgroup" then
call editgroup()
elseif request("action")="delgroup" then
call delgroup()
else
call usergroup()
end if
end sub

sub usergroup()
%>
<table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder">
<tr> 
<th height="23" colspan="4" >用户组管理&nbsp;&nbsp;<a href="?action=addgroup"><font color=#FFFFFF>[添加用户组]</font></a></th>
</tr>
<tr align=center>
<td height="23" width="30%" class=forumHeaderBackgroundAlternate><B>用户组</B></td>
<td height="23" width="20%" class=forumHeaderBackgroundAlternate><B>用户数量</B></td>
<td height="23" width="20%" class=forumHeaderBackgroundAlternate><B>编辑</B></td>
<td height="23" width="30%" class=forumHeaderBackgroundAlternate><B>列出用户</B></td>
</tr>
<%
dim trs
set rs=conn.execute("select * from usergroups order by usergroupID")
do while not rs.eof
set trs=conn.execute("select count(*) from [user] where UserGroupID="&rs("UserGroupID"))
%>
<tr align=center>
<td height="23" width="30%" class="Forumrow"><%=rs("title")%></td>
<td height="23" width="20%" class="Forumrow"><%=trs(0)%></td>
<td height="23" width="20%" class="Forumrow"><a href="?action=editgroup&groupid=<%=rs("UserGroupID")%>">编辑</a><%if rs("UserGroupID")>8 then%> | <a href="?action=delgroup&groupid=<%=rs("UserGroupID")%>">删除</a><%end if%></td>
<td height="23" width="30%" class="Forumrow"><a href="admin_user.asp?action=userSearch&userSearch=10&usergroupid=<%=rs("usergroupid")%>">列出所有用户</td>
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
<tr><td colspan=4 height=25 class="Forumrow"><B>说明</B>:<BR>①在这里您可以设置各个用户组在论坛中的默认权限,论坛默认用户组不能删除和编辑用户组名<BR>②可以进行添加用户组操作并设置其权限,可以将其他组用户转移到该组,请到用户管理中进行相关操作,对某个组用户进行管理请点击该组用户列表<BR>③可以删除和编辑新添加的用户组<BR>④添加组后最好到等级中添加相关组的等级,具体说明请看添加等级页面,如果不添加相应等级,则该组用户的等级为用户组名,等级图象为论坛最低等级图象<BR>⑤<B>如果删除用户组,则该用户组所包含的用户将自动转到注册用户组,同时删除在等级中和该用户组关联的等级,并更新该用户组所包含的用户的等级为注册用户组按照文章计算的等级</B></td></tr>
</table>
<%
end sub

sub delgroup()
if not isnumeric(request("groupid")) then
response.write "错误的参数!"
exit sub
end if
'更新用户等级数据
Server.ScriptTimeout=999999
dim UserGrade
set rs=conn.execute("select userid,article from [user] where UserGroupID="&request("groupid"))
do while not rs.eof
	set UserGrade=conn.execute("select top 1 usertitle,titlepic,UserGroupID from usertitle where UserGroupID=4 and Minarticle<="&rs(1)&" and not MinArticle=-1 order by MinArticle desc,usertitleid")
	conn.execute("update [user] set userclass='"&rs(0)&"',titlepic='"&rs(1)&"' where userid="&rs(0))
rs.movenext
loop
set rs=nothing
'更新用户组数据
conn.execute("update [user] set UserGroupID=4 where UserGroupID="&request("groupid"))
'删除关联等级
conn.execute("delete from usertitle where UserGroupID="&request("groupid"))
'删除用户组
conn.execute("delete from usergroups where UserGroupID="&request("groupid"))
response.write "删除成功!"
end sub

sub editgroup()
if not isnumeric(request("groupid")) then
response.write "错误的参数!"
exit sub
end if
if request("groupaction")="yes" then
	dim GroupSetting
	if request.form("title")="" then
	response.write "请输入用户组名称!"
	exit sub
	end if
	GroupSetting=Request.Form("canview") & "," & Request.Form("canviewuserinfo") & "," & Request.Form("canviewpost") & "," & Request.Form("cannewpost") & "," & Request.Form("canreplymytopic") & "," & Request.Form("canreplytopic") & "," & Request.Form("canpostagree") & "," & Request.Form("canupload") & "," & Request.Form("canpostvote") & "," & Request.Form("canvote") & "," & Request.Form("caneditmytopic") & "," & Request.Form("candelmytopic") & "," & Request.Form("canmovemytopic") & "," & Request.Form("canclosemytopic") & "," & Request.Form("cansearch") & "," & Request.Form("canmailtopic") & "," & Request.Form("canmodify") & "," & Request.Form("cansmallpaper") & "," & Request.Form("candeltopic") & "," & Request.Form("canmovetopic") & "," & Request.Form("canclosetopic") & "," & Request.Form("cantoptopic") & "," & Request.Form("canawardtopic") & "," & Request.Form("canmodifytopic") & "," & Request.Form("canbesttopic") & "," & Request.Form("canAnnounce") & "," & Request.Form("canAdminAnnounce") & "," & Request.Form("canAdminPaper") & "," & Request.Form("canAdminUser") & "," & Request.Form("canDelUserTopic") & "," & Request.Form("canviewip") & "," & Request.Form("canadminip") & "," & Request.Form("cansendsms") & "," & Request.Form("Maxsendsms") & "," & Request.Form("Maxsmsbody") & "," & Request.Form("Maxsmsbox") & "," & Request.Form("canusetitle") & "," & Request.Form("canuseface") & "," & Request.Form("canusesign") & "," & Request.Form("canvieweven") & "," & Request.Form("canuploadnum") & "," & Request.Form("canviewbest") & "," & Request.Form("adminpermission") & "," & request.form("canaward") & "," & request.form("MaxUploadSize") & "," & request.form("canbatchtopic") & "," & request.form("smallpapermoney") & "," & request.form("postagreemoney") & "," & request.form("canadminfile") & "," & request.form("ba1") & "," & request.form("Maxcanuploadnum") & "," & request.form("ba3") & "," & request.form("ba4") & "," & request.form("ba5") & "," & request.form("ba6") & "," & request.form("ba7")
	Set rs= Server.CreateObject("ADODB.Recordset")
	sql="select * from usergroups where usergroupid="&request("groupid")
	rs.open sql,conn,1,3
	rs("title")=request.form("title")
	rs("GroupSetting")=GroupSetting
	rs.update
	rs.close
	set rs=nothing
	response.write "修改成功!"
else
Dim reGroupSetting
set rs=conn.execute("select * from usergroups where usergroupid="&request("groupid"))
if rs.eof and rs.bof then
response.write "未找到该用户组!"
exit sub
end if
reGroupSetting=split(rs("GroupSetting"),",")
%>
<FORM METHOD=POST ACTION="?action=editgroup">
<input type=hidden name="groupid" value="<%=request("groupid")%>">
<table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder">
<tr><td colspan=2 height=25 class="Forumrow"><B>说明</B>:<BR>①在这里您可以设置各个用户组在论坛中的默认权限,论坛默认用户组不能删除和编辑用户组名<BR>②可以删除和编辑新添加的用户组</td></tr>
<tr> 
<th height="23" colspan="2">编辑用户组:<%=rs("title")%></th>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>用户组名称</td>
<td height="23" width="40%" class=Forumrow><input size=35 name="title" type=text value="<%=rs("title")%>"  <%if Cint(request("GroupID"))<9 then%>disabled<%end if%>></td>
</tr>
<%if Cint(request("GroupID"))<9 then%>
<input name="title" type=hidden value="<%=rs("title")%>">
<%end if%>
<tr> 
<th height="23" colspan="2"  align=left>==查看权限</th>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>可以浏览论坛</td>
<td height="23" width="40%" class=Forumrow>是<input name="canview" type=radio value="1" <%if reGroupSetting(0)=1 then%>checked<%end if%>>&nbsp;否<input name="canview" type=radio value="0" <%if reGroupSetting(0)=0 then%>checked<%end if%>></td>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>可以查看会员信息(包括其他会员的资料和会员列表)
</td>
<td height="23" width="40%" class=Forumrow>是<input name="canviewuserinfo" type=radio value="1" <%if reGroupSetting(1)=1 then%>checked<%end if%>>&nbsp;否<input name="canviewuserinfo" type=radio value="0" <%if reGroupSetting(1)=0 then%>checked<%end if%>></td>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>可以查看其他人发布的主题
</td>
<td height="23" width="40%" class=Forumrow>是<input name="canviewpost" type=radio value="1" <%if reGroupSetting(2)=1 then%>checked<%end if%>>&nbsp;否<input name="canviewpost" type=radio value="0" <%if reGroupSetting(2)=0 then%>checked<%end if%>></td>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>可以浏览精华帖子
</td>
<td height="23" width="40%" class=Forumrow>是<input name="canviewbest" type=radio value="1" <%if reGroupSetting(41)=1 then%>checked<%end if%>>&nbsp;否<input name="canviewbest" type=radio value="0" <%if reGroupSetting(41)=0 then%>checked<%end if%>></td>
</tr>
<tr> 
<th height="23" colspan="2"  align=left>==发帖权限</th>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>可以发布新主题</td>
<td height="23" width="40%" class=Forumrow>是<input name="cannewpost" type=radio value="1" <%if reGroupSetting(3)=1 then%>checked<%end if%>>&nbsp;否<input name="cannewpost" type=radio value="0" <%if reGroupSetting(3)=0 then%>checked<%end if%>></td>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>可以回复自己的主题
</td>
<td height="23" width="40%" class=Forumrow>是<input name="canreplymytopic" type=radio value="1" <%if reGroupSetting(4)=1 then%>checked<%end if%>>&nbsp;否<input name="canreplymytopic" type=radio value="0" <%if reGroupSetting(4)=0 then%>checked<%end if%>></td>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>可以回复其他人的主题
</td>
<td height="23" width="40%" class=Forumrow>是<input name="canreplytopic" type=radio value="1" <%if reGroupSetting(5)=1 then%>checked<%end if%>>&nbsp;否<input name="canreplytopic" type=radio value="0" <%if reGroupSetting(5)=0 then%>checked<%end if%>></td>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>可以在论坛允许评分的时候参与评分(鲜花和鸡蛋)?
</td>
<td height="23" width="40%" class=Forumrow>是<input name="canpostagree" type=radio value="1" <%if reGroupSetting(6)=1 then%>checked<%end if%>>&nbsp;否<input name="canpostagree" type=radio value="0" <%if reGroupSetting(6)=0 then%>checked<%end if%>></td>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>参与评分所需金钱
</td>
<td height="23" width="40%" class=Forumrow><input name="postagreemoney" type=text size=4 value="<%=reGroupSetting(47)%>"></td>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>可以上传附件
</td>
<td height="23" width="40%" class=Forumrow>是<input name="canupload" type=radio value="1" <%if reGroupSetting(7)=1 then%>checked<%end if%>>&nbsp;否<input name="canupload" type=radio value="0" <%if reGroupSetting(7)=0 then%>checked<%end if%>>
&nbsp;发帖可以上传<input name="canupload" type=radio value="2" <%if reGroupSetting(7)=2 then%>checked<%end if%>>&nbsp;回复可以上传<input name="canupload" type=radio value="3" <%if reGroupSetting(7)=3 then%>checked<%end if%>>
</td>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>一次最多上传文件个数
</td>
<td height="23" width="40%" class=Forumrow><input name="canuploadnum" type=text size=4 value="<%=reGroupSetting(40)%>"></td>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>一天最多上传文件个数
</td>
<td height="23" width="40%" class=Forumrow><input name="Maxcanuploadnum" type=text size=4 value="<%=reGroupSetting(50)%>"></td>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>上传文件大小限制
</td>
<td height="23" width="40%" class=Forumrow><input name="MaxUploadSize" type=text size=4 value="<%=reGroupSetting(44)%>"> KB</td>
</tr>
<tr>
<td height="23" width="60%" class=Forumrow>可以发布新投票</td>

⌨️ 快捷键说明

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