人性化小修改——更人性化编辑角色版块权限(适用于BBSXP 2008.0.5及之前之后版本)

By admin at 2008-07-20 • 0人收藏 • 1478人看过

今天刚把编辑角色版块权限的功能修改移植到我论坛

但是我发现其实许多权限应该是默认就该勾上的

你应该遇到过这种情况

所以我修改了一点

加了个全选/全不选的框,希望大家多上我论坛

1.打开Admin_User.asp

2.找到

 <input type="hidden" name="ForumID" value="<%=Rs("ForumID")%>" />
 <tr align="center" class="CommonListCell">
  <td><%=Rs("ForumName")%></td>
  <td><input type="checkbox" value="1" name="PermissionView<%=Rs("ForumID")%>"<%if PermissionView=1 then%> checked<%end if%> /></td>
  <td><input type="checkbox" value="1" name="PermissionRead<%=Rs("ForumID")%>"<%if PermissionRead=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionPost<%=Rs("ForumID")%>"<%if PermissionPost=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionReply<%=Rs("ForumID")%>"<%if PermissionReply=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionEdit<%=Rs("ForumID")%>"<%if PermissionEdit=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionDelete<%=Rs("ForumID")%>"<%if PermissionDelete=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionCreatePoll<%=Rs("ForumID")%>"<%if PermissionCreatePoll=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionVote<%=Rs("ForumID")%>"<%if PermissionVote=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionAttachment<%=Rs("ForumID")%>"<%if PermissionAttachment=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionManage<%=Rs("ForumID")%>"<%if PermissionManage=1 then%> checked /><%end if%></td>
 </tr>
<%
  Rs.movenext
 loop
%>
 <tr class="CommonListCell">
  <td colspan="11" align="right"><input type="submit" value=" 保存 " /></td>
 </tr>
</table></form>


<%
 Rs.close
End Sub

改为

 <input type="hidden" name="ForumID" value="<%=Rs("ForumID")%>" />
 <tr align="center" class="CommonListCell">
  <td><%=Rs("ForumName")%></td>
  <td><input type="checkbox" value="1" name="PermissionView<%=Rs("ForumID")%>"<%if PermissionView=1 then%> checked<%end if%> /></td>
  <td><input type="checkbox" value="1" name="PermissionRead<%=Rs("ForumID")%>"<%if PermissionRead=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionPost<%=Rs("ForumID")%>"<%if PermissionPost=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionReply<%=Rs("ForumID")%>"<%if PermissionReply=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionEdit<%=Rs("ForumID")%>"<%if PermissionEdit=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionDelete<%=Rs("ForumID")%>"<%if PermissionDelete=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionCreatePoll<%=Rs("ForumID")%>"<%if PermissionCreatePoll=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionVote<%=Rs("ForumID")%>"<%if PermissionVote=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionAttachment<%=Rs("ForumID")%>"<%if PermissionAttachment=1 then%> checked /><%end if%></td>
  <td><input type="checkbox" value="1" name="PermissionManage<%=Rs("ForumID")%>"<%if PermissionManage=1 then%> checked /><%end if%></td>
 </tr>
<%
  Rs.movenext
 loop
%>
 <tr class="CommonListCell">
  <td colspan="11" align="right">
<input type="checkbox" name="chkall" onclick="CheckAll(this.form)" value="ON" />全选/全不选
<input type="submit" value=" 保存 " /></td>
 </tr>
</table></form>


<%
 Rs.close
End Sub

完成

[此帖子已被 admin 在 2008-7-21 16:52:43 编辑过]

3 个回复 | 最后更新于 2008-09-18
2008-07-27   #1
应该在每个角色后加上全选就好了.
2008-08-25   #2

不知好用否

2008-09-18   #3
呵呵,不错啊

登录后方可回帖

登 录
信息栏

Carbon Forum是一个基于话题的高性能轻型PHP论坛

下载地址:Carbon Forum v5.9.0
QQ群:12607708(QQ我不常上)

donate

手机支付宝扫描上方二维码可向本项目捐款

粤公网安备 44030602003677号
粤ICP备17135490号

Loading...