<!-- #include file="setup.asp" -->
<%
if adminpassword<>session("pass") then response.redirect "admin.asp?menu=login"
log(""&Request.ServerVariables("script_name")&"<br>"&Request.ServerVariables("Query_String")&"<br>"&Request.form&"")

select case Request("menu")

case "userset"
%>
<table cellspacing=1 cellpadding=2 width=<%=wid%> border=0 class=a2 align=center><tr class=a1>
<td align="center" width="20%" height="25">社区等级</td>
<td align="center" width="30%" height="25">等级图标</td>
<td align="center" width="10%" height="25">社区经验</td>
<td align="center" width="20%" height="25">所属组</td>
<td align="center" width="20%" height="25">操作</td></tr>
<%
sql="select * from [userop] order by arrange"
Set Rs=Conn.Execute(sql)
Do While Not RS.EOF
%>
<tr>
<td height="21" class=a4><%=rs("levelname")%></td>
<td height="21" class=a3><img src=<%=rs("levelimage")%>></td>
<td height="21" class=a4 align="right"><%=rs("experience")%></td>
<td height="21" class=a3 align="center"><%=rs("userset")%></td>
<td height="21" class=a4><a href=?menu=usersetedit&id=<%=rs("id")%>>编辑</a>|<a href=?menu=usersetop&id=<%=rs("id")%>>权限</a><%if rs("experience") > -1 then %>|<a href=?menu=usersetdel&id=<%=rs("id")%>>删除</a><%end if%></td>
</tr>
<%
RS.MoveNext
loop
RS.Close
%></table>

<%
case "usersetedit"
id=int(Request("id"))
sql="select * from [userop] where id="&id&""
Set Rs=Conn.Execute(sql)
experience=rs("experience")
%>
<table cellspacing=1 cellpadding=2 width=<%=wid%> border=0 class=a2 align=center><tr class=a1>
<td align="center" colspan="2" height="25">编辑社区等级</td></tr>
<form name="form" method="post" action="?menu=userseteditok&id=<%=id%>">
<tr class=a4>
<td height="21" align="center">排列序号：</td>
<td width=60%><input name="arrange" size="20" value="<%=rs("arrange")%>"></td></tr>
<tr class=a3>
<td width=40% height="21" align="center">等级名称：</td>
<td><input name="levelname" size="40" <%if experience=-1 then%> readOnly="true" <%end if%> value="<%=rs("levelname")%>"></td></tr>
<tr class=a4>
<td height="21" align="center">等级图标：</td>
<td><input name="levelimage" size="40" value="<%=rs("levelimage")%>"></td></tr>
<tr class=a3>
<td height="21" align="center">社区经验：</td>
<td><input name="experience" size="40" value="<%=rs("experience")%>"></td></tr>
<tr class=a4>
<td height="21" align="center">所 属 组：</td>
<td><input name="userset" size="40" readOnly="true" value="<%=rs("userset")%>"></td></tr>
</table><br><center><input type=submit value="确定"></form>
<%
rs.close

case "userseteditok"
arrange=HTMLEncode(Request.form("arrange"))
levelname=HTMLEncode(Request.form("levelname"))
levelimage=HTMLEncode(Request.form("levelimage"))
experience=Request.form("experience")
userset=HTMLEncode(Request.form("userset"))
id=int(Request("id"))
sql="select * from [userop] where id="&id&""
rs.Open sql,Conn,1,3
rs("arrange")=arrange
rs("levelname")=levelname
rs("levelimage")=levelimage
rs("experience")=experience
rs("userset")=userset
rs.update
rs.close
response.write "<center>编辑成功<br><br><a href=javascript:history.back()>返 回</a>"

case "usersetdel"
id=int(Request("id"))
conn.execute("delete from [userop] where experience > -1 and id="&id&"")
response.write "<center>已经将该组的数据删除了！<br><br><a href=javascript:history.back()>返 回</a>"

case "usersetadd"
%>
<table cellspacing=1 cellpadding=2 width=<%=wid%> border=0 class=a2 align=center><tr class=a1>
<td align="center" colspan="2" height="25">添加社区等级</td></tr>
<form name="form" method="post" action="?menu=usersetaddok">
<tr class=a4>
<td height="21" align="center">排列序号：</td>
<td width=60%><input name="arrange" size="20"></td></tr>
<tr class=a3>
<td width=40% height="21" align="center">等级名称：</td>
<td><input name="levelname" size="40"></td></tr>
<tr class=a4>
<td height="21" align="center">等级图标：</td>
<td><input name="levelimage" size="40"></td></tr>
<tr class=a3>
<td height="21" align="center">社区经验：</td>
<td><input name="experience" size="40"></td></tr>
<tr class=a4>
<td height="21" align="center">所 属 组：</td>
<td><input name="userset" size="40" readOnly="true" value="注册会员"></td></tr>
</table><br><center><input type=submit value="确定"></form>
<%
case "usersetaddok"
arrange=HTMLEncode(Request.form("arrange"))
levelname=HTMLEncode(Request.form("levelname"))
levelimage=HTMLEncode(Request.form("levelimage"))
experience=Request.form("experience")
userset=HTMLEncode(Request.form("userset"))
rs.Open "[userop]",Conn,1,3
rs.addnew
rs("arrange")=arrange
rs("levelname")=levelname
rs("levelimage")=levelimage
rs("experience")=experience
rs("userset")=userset
rs("opsetup")="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
rs.update
rs.close
response.write "<center>添加成功<br><br><a href=javascript:history.back()>返 回</a>"

case "usersetop"
id=int(Request("id"))
sql="select * from [userop] where id="&id&""
Set Rs=Conn.Execute(sql)
opsetup=split(rs("opsetup"),",")
examine=opsetup(0)               ''审核论坛直接发帖
editOneself=opsetup(1)           ''可编辑自己的帖子
goodtopic=opsetup(2)             ''可加精华主题
movetopic=opsetup(3)             ''可移动主题
FileNumber=opsetup(4)            ''单帖上传附件数
DayFileNumber=opsetup(5)         ''每天附件上传数
Download=opsetup(6)              ''可以下载附件
upface=opsetup(7)                ''可以上传头像
upphoto=opsetup(8)               ''可以上传照片
deltopic=opsetup(9)              ''可删除主题
movenew=opsetup(10)              ''可拉前主题
locktopic=opsetup(11)            ''可关闭主题
toptopic=opsetup(12)             ''可置顶主题
alltop=opsetup(13)               ''可总置顶主题
lockip=opsetup(14)               ''查看IP
edituser=opsetup(15)             ''编辑帖子时不显示编辑人
topiccolor=opsetup(16)           ''发帖颜色醒目
htmltopic=opsetup(17)            ''发支持HTML帖
%>
<table cellspacing=1 cellpadding=2 width=<%=wid%> border=0 class=a2 align=center><tr class=a1>
<td align="center" colspan="2" height="25">社区权限编辑</td></tr>
<form name="form" method="post" action="?menu=usersetopok&id=<%=id%>">
<tr class=a3>
<td width=30% height="21" align="center">社区等级：</td>
<td width=70%><input name="levelname" readOnly="true" value="<%=rs("levelname")%>" size="20"></td></tr>
<tr class=a4>
<td width=30% height="21" align="center">用户名显示样式：</td>
<td width=70%><input name="namehtm1" value="<%=rs("namehtm1")%>" size="10">&nbsp;&nbsp;<%=rs("namehtm1")%>会员名<%=rs("namehtm2")%>&nbsp;&nbsp;<input name="namehtm2" value="<%=rs("namehtm2")%>" size="10"></td></tr>
<tr class=a3>
<td width=30% height="21" align="center">审核论坛直接发帖：</td><td width=70%>
<input type=radio name="examine" value="0" <%if examine=0 then%>checked<%end if%> id=examine><label for=examine>禁止</label>
<input type=radio name="examine" value="1" <%if examine=1 then%>checked<%end if%> id=examine_1><label for=examine_1>允许</label></td></tr>
<tr class=a4>
<td width=30% height="21" align="center">单帖上传附件数：</td><td width=70%>
<input name="FileNumber" value="<%=FileNumber%>" size="20"></td></tr>
<tr class=a3>
<td width=30% height="21" align="center">每天附件上传数：</td><td width=70%>
<input name="DayFileNumber" value="<%=DayFileNumber%>" size="20"></td></tr>
<tr class=a4>
<td width=30% height="21" align="center">可以下载附件：</td><td width=70%>
<input type=radio name="Download" value="0" <%if Download=0 then%>checked<%end if%> id=Download><label for=Download>禁止</label>
<input type=radio name="Download" value="1" <%if Download=1 then%>checked<%end if%> id=Download_1><label for=Download_1>允许</label></td></tr>
<tr class=a3>
<td width=30% height="21" align="center">可以上传头像：</td><td width=70%>
<input type=radio name="upface" value="0" <%if upface=0 then%>checked<%end if%> id=upface><label for=upface>禁止</label>
<input type=radio name="upface" value="1" <%if upface=1 then%>checked<%end if%> id=upface_1><label for=upface_1>允许</label></td></tr>
<tr class=a4>
<td width=30% height="21" align="center">可以上传照片：</td><td width=70%>
<input type=radio name="upphoto" value="0" <%if upphoto=0 then%>checked<%end if%> id=upphoto><label for=upphoto>禁止</label>
<input type=radio name="upphoto" value="1" <%if upphoto=1 then%>checked<%end if%> id=upphoto_1><label for=upphoto_1>允许</label></td></tr>
<tr class=a3>
<td width=30% height="21" align="center">可编辑自己的帖子：</td><td width=70%>
<input type=radio name="editOneself" value="0" <%if editOneself=0 then%>checked<%end if%> id=editOneself><label for=editOneself>禁止</label>
<input type=radio name="editOneself" value="1" <%if editOneself=1 then%>checked<%end if%> id=editOneself_1><label for=editOneself_1>允许</label></td></tr>
<tr class=a4>
<td width=30% height="21" align="center">可删除主题：</td><td width=70%>
<input type=radio name="deltopic" value="0" <%if deltopic=0 then%>checked<%end if%> id=deltopic><label for=deltopic>禁止</label>
<input type=radio name="deltopic" value="1" <%if deltopic=1 then%>checked<%end if%> id=deltopic_1><label for=deltopic_1>允许</label></td></tr>
<tr class=a3>
<td width=30% height="21" align="center">可加精华主题：</td><td width=70%>
<input type=radio name="goodtopic" value="0" <%if goodtopic=0 then%>checked<%end if%> id=goodtopic><label for=goodtopic>禁止</label>
<input type=radio name="goodtopic" value="1" <%if goodtopic=1 then%>checked<%end if%> id=goodtopic_1><label for=goodtopic_1>允许</label></td></tr>
<tr class=a4>
<td width=30% height="21" align="center">可移动主题：</td><td width=70%>
<input type=radio name="movetopic" value="0" <%if movetopic=0 then%>checked<%end if%> id=movetopic><label for=movetopic>禁止</label>
<input type=radio name="movetopic" value="1" <%if movetopic=1 then%>checked<%end if%> id=movetopic_1><label for=movetopic_1>允许</label></td></tr>
<tr class=a3>
<td width=30% height="21" align="center">可拉前主题：</td><td width=70%>
<input type=radio name="movenew" value="0" <%if movenew=0 then%>checked<%end if%> id=movenew><label for=movenew>禁止</label>
<input type=radio name="movenew" value="1" <%if movenew=1 then%>checked<%end if%> id=movenew_1><label for=movenew_1>允许</label></td></tr>
<tr class=a4>
<td width=30% height="21" align="center">可关闭主题：</td><td width=70%>
<input type=radio name="locktopic" value="0" <%if locktopic=0 then%>checked<%end if%> id=locktopic><label for=locktopic>禁止</label>
<input type=radio name="locktopic" value="1" <%if locktopic=1 then%>checked<%end if%> id=locktopic_1><label for=locktopic_1>允许</label></td></tr>
<tr class=a3>
<td width=30% height="21" align="center">可置顶主题：</td><td width=70%>
<input type=radio name="toptopic" value="0" <%if toptopic=0 then%>checked<%end if%> id=toptopic><label for=toptopic>禁止</label>
<input type=radio name="toptopic" value="1" <%if toptopic=1 then%>checked<%end if%> id=toptopic_1><label for=toptopic_1>允许</label></td></tr>
<tr class=a4>
<td width=30% height="21" align="center">可总置顶主题：</td><td width=70%>
<input type=radio name="alltop" value="0" <%if alltop=0 then%>checked<%end if%> id=alltop><label for=alltop>禁止</label>
<input type=radio name="alltop" value="1" <%if alltop=1 then%>checked<%end if%> id=alltop_1><label for=alltop_1>允许</label></td></tr>
<tr class=a3>
<td width=30% height="21" align="center">查看IP：</td><td width=70%>
<input type=radio name="lockip" value="0" <%if lockip=0 then%>checked<%end if%> id=lockip><label for=lockip>禁止</label>
<input type=radio name="lockip" value="1" <%if lockip=1 then%>checked<%end if%> id=lockip_1><label for=lockip_1>允许</label></td></tr>
<tr class=a4>
<td width=30% height="21" align="center">编辑帖子时不显示编辑人：</td><td width=70%>
<input type=radio name="edituser" value="0" <%if edituser=0 then%>checked<%end if%> id=edituser><label for=edituser>禁止</label>
<input type=radio name="edituser" value="1" <%if edituser=1 then%>checked<%end if%> id=edituser_1><label for=edituser_1>允许</label></td></tr>
<tr class=a3>
<td width=30% height="21" align="center">发帖颜色醒目：</td><td width=70%>
<input type=radio name="topiccolor" value="0" <%if topiccolor=0 then%>checked<%end if%> id=topiccolor><label for=topiccolor>禁止</label>
<input type=radio name="topiccolor" value="1" <%if topiccolor=1 then%>checked<%end if%> id=topiccolor_1><label for=topiccolor_1>允许</label></td></tr>
<tr class=a4>
<td width=30% height="21" align="center">发支持HTML帖：</td><td width=70%>
<input type=radio name="htmltopic" value="0" <%if htmltopic=0 then%>checked<%end if%> id=htmltopic><label for=htmltopic>禁止</label>
<input type=radio name="htmltopic" value="1" <%if htmltopic=1 then%>checked<%end if%> id=htmltopic_1><label for=htmltopic_1>允许</label></td></tr>
</table><br><center><input type=submit value="确定"></form>


<%
rs.close


case "usersetopok"
id=int(Request("id"))
FileNumber=HTMLEncode(Request.form("FileNumber"))
DayFileNumber=HTMLEncode(Request.form("DayFileNumber"))
sql="select * from [userop] where id="&id&""
rs.Open sql,Conn,1,3
rs("namehtm1")=ContentEncode(Request.form("namehtm1"))
rs("namehtm2")=ContentEncode(Request.form("namehtm2"))
rs("opsetup")=""&Request.form("examine")&","&Request.form("editOneself")&","&Request.form("goodtopic")&","&Request.form("movetopic")&","&FileNumber&","&DayFileNumber&","&Request.form("Download")&","&Request.form("upface")&","&Request.form("upphoto")&","&Request.form("deltopic")&","&Request.form("movenew")&","&Request.form("locktopic")&","&Request.form("toptopic")&","&Request.form("alltop")&","&Request.form("lockip")&","&Request.form("edituser")&","&Request.form("topiccolor")&","&Request.form("htmltopic")&""
rs.update
rs.close
response.write "<center>编辑成功<br><br><a href=javascript:history.back()>返 回</a>"

end select

htmlend
%>