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

📄 admin_group_permissions.asp

📁 简单的asp论坛源码系统,很适用于初学者!界面简洁,功能齐全
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="admin_common.asp" -->
<%
'****************************************************************************************
'**  Copyright Notice    
'**
'**  Web Wiz Forums(TM)
'**  http://www.webwizforums.com
'**                            
'**  Copyright (C)2001-2008 Web Wiz(TM). All Rights Reserved.
'**  
'**  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'.
'**  
'**  IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE 
'**  THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE
'**  AND DERIVATIVE WORKS IMMEDIATELY.
'**  
'**  If you have not received a copy of the license with this work then a copy of the latest
'**  license contract can be found at:-
'**
'**  http://www.webwizguide.com/license
'**
'**  For more information about this software and for licensing information please contact
'**  'Web Wiz' at the address and website below:-
'**
'**  Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England
'**  http://www.webwizguide.com
'**
'**  Removal or modification of this copyright notice will violate the license contract.
'**
'****************************************************************************************



'*************************** SOFTWARE AND CODE MODIFICATIONS **************************** 
'**
'** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE  
'** AGREEMENT AND IS STRICTLY PROHIBITED
'**
'** If you wish to modify any part of this software a license must be purchased
'**
'****************************************************************************************




'Set the response buffer to true
Response.Buffer = True



'Dimension variables
Dim rsCommon2		'Holds a secound recordset for the page
Dim intUserGroupID	'Holds the group ID
Dim strGroupName	'Holds the name of the group
Dim intCatID
Dim sarryForums
Dim intCurrentRecord
Dim sarrySubForums
Dim intCurrentRecord2
Dim intSubForumID



'Initlise variables
intCatID = 0


'Read in the details
intUserGroupID = CInt(Request.QueryString("GID"))





'Intialise the ADO recordset object
Set rsCommon2 = Server.CreateObject("ADODB.Recordset")


'If this is a post back update the database
If Request.Form("postBack") AND blnDemoMode = False Then
	
	
	'Read in the groups from db
	'Initalise the strSQL variable with an SQL statement to query the database
	strSQL = "SELECT " & strDbTable & "Forum.Forum_ID FROM " & strDbTable & "Forum ORDER BY " & strDbTable & "Forum.Forum_Order ASC;"
	
	'Query the database
	rsCommon.Open strSQL, adoCon
	
	'Loop through all the categories in the database
	Do while NOT rsCommon.EOF
	
	
		'Get the group ID
		intForumID = CInt(rsCommon("Forum_ID"))
	
		'Read in the permssions from the db for this group (not very efficient doing it this way, but this page won't be run often)
		'Initalise the strSQL variable with an SQL statement to query the database
		strSQL = "SELECT " & strDbTable & "Permissions.* FROM " & strDbTable & "Permissions WHERE " & strDbTable & "Permissions.Group_ID = " & intUserGroupID & " AND " & strDbTable & "Permissions.Forum_ID = " & intForumID & ";"
		
		'Set the cursor type property of the record set to Dynamic so we can navigate through the record set
		rsCommon2.CursorType = 2
		
		'Set the Lock Type for the records so that the record set is only locked when it is updated
		rsCommon2.LockType = 3
		
		'Query the database
		rsCommon2.Open strSQL, adoCon
		
		With rsCommon2
			'If no records are returned then add a new record to the database
			If .EOF Then .AddNew
			
			'Update the recordset
			.Fields("Group_ID") = intUserGroupID
			.Fields("Forum_ID") = intForumID
			.Fields("View_Forum") = CBool(Request.Form("read" & intForumID))
			.Fields("Post") = CBool(Request.Form("topic" & intForumID))
			.Fields("Priority_posts") = CBool(Request.Form("sticky" & intForumID))
			.Fields("Reply_posts") = CBool(Request.Form("reply" & intForumID))
			.Fields("Edit_posts") = CBool(Request.Form("edit" & intForumID))
			.Fields("Delete_posts") = CBool(Request.Form("delete" & intForumID))
			.Fields("Poll_create") = CBool(Request.Form("polls" & intForumID))
			.Fields("Vote") = CBool(Request.Form("vote" & intForumID))
			.Fields("Display_post") = CBool(Request.Form("approve" & intForumID))
			.Fields("Moderate") = CBool(Request.Form("moderator" & intForumID))
			.Fields("Calendar_event") = CBool(Request.Form("calEvent" & intForumID))
			.Fields("Attachments") = False
			.Fields("Image_upload") = False
	
			'Update the database
			.Update
		End With
		
		
		
		'Close rsCommon2
		rsCommon2.Close
	            
		'Move to the next record in the recordset
		rsCommon.MoveNext
	Loop
	
	rsCommon.Close
	
End If 





	
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT " & strDbTable & "Group.* FROM " & strDbTable & "Group WHERE " & strDbTable & "Group.Group_ID = " & intUserGroupID & ";"
	
'Query the database
rsCommon.Open strSQL, adoCon

If NOT rsCommon.EOF Then

	'Get the category name from the database
	strGroupName = rsCommon("Name")
End If
	
'Close the rs
rsCommon.Close


%>
<!-- #include file="includes/browser_page_encoding_inc.asp" -->
<title>Group Permissions</title>
<meta name="generator" content="Web Wiz Forums" />
<%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Response.Write("<!--//" & _
vbCrLf & "/* *******************************************************" & _
vbCrLf & "Software: Web Wiz Forums(TM) ver. " & strVersion & "" & _
vbCrLf & "Info: http://www.webwizforums.com" & _
vbCrLf & "Copyright: (C)2001-2008 Web Wiz(TM). All rights reserved" & _
vbCrLf & "******************************************************* */" & _
vbCrLf & "//-->")
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>
<!-- #include file="includes/admin_header_inc.asp" -->
<div align="center"><h1> <% = strGroupName %> Group Permissions</h1><br />
  <a href="admin_menu.asp<% = strQsSID1 %>">Control Panel Menu</a><br />
  <a href="admin_group_permissions_form.asp<% = strQsSID1 %>">Select an alternate Member Group </a></div>
<form action="admin_group_permissions.asp?GID=<% = intUserGroupID %><% = strQsSID2 %>" method="post" name="frmGroup" id="frmGroup">
  <table width="100%" height="58" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td align="center" class="text"><span class="lgText"><br />
        <% = strGroupName %>
        Group Permissions</span><br />
        Use the grid below to set Permissions for the this Member Group on various forums.<br />
        <a href="#per" class="smLink">What do the different permissions mean?</a><br />
        <br />
        <table border="0" cellpadding="2" cellspacing="1" class="tableBorder">
          <tr>
            <td width="194" align="left" class="tableLedger">Member Group</td>
            <td width="43" align="center" class="tableLedger">Access</td>
            <td width="43" align="center" class="tableLedger"> New Topics</td>
            <td width="43" align="center" class="tableLedger">Sticky Topics</td>
            <td width="43" align="center" class="tableLedger">Post Reply</td>
            <td width="43" align="center" class="tableLedger">Edit Posts</td>
            <td width="43" align="center" class="tableLedger">Delete Posts</td>
            <td width="43" align="center" class="tableLedger">New Polls </td>
            <td width="43" align="center" class="tableLedger">Poll Vote </td>
            <td width="43" align="center" class="tableLedger">Calendar Event</td>
            <td width="43" align="center" class="tableLedger">Post Approval </td>
            <td width="43" align="center" class="tableLedger">Forum Moderator</td>
          </tr>
          <tr class="tableSubLedger">
           <td align="left">Check All</td>
           <td align="center"><input type="checkbox" name="chkAllread" id="chkAllread" onclick="checkAll('read');" /></td>
           <td align="center"><input type="checkbox" name="chkAlltopic" id="chkAlltopic" onclick="checkAll('topic');" /></td>
           <td align="center"><input type="checkbox" name="chkAllsticky" id="chkAllsticky" onclick="checkAll('sticky');" /></td>
           <td align="center"><input type="checkbox" name="chkAllreply" id="chkAllreply" onclick="checkAll('reply');" /></td>
           <td align="center"><input type="checkbox" name="chkAlledit" id="chkAlledit" onclick="checkAll('edit');" /></td>
           <td align="center"><input type="checkbox" name="chkAlldelete" id="chkAlldelete" onclick="checkAll('delete');" /></td>
           <td align="center"><input type="checkbox" name="chkAllpolls" id="chkAllpolls" onclick="checkAll('polls');" /></td>
           <td align="center"><input type="checkbox" name="chkAllvote" id="chkAllvote" onclick="checkAll('vote');" /></td>
           <td align="center"><input type="checkbox" name="chkAllcalEvent" id="chkAllcalEvent" onclick="checkAll('calEvent');" /></td>
           <td align="center"><input type="checkbox" name="chkAllapprove" id="chkAllapprove" onclick="checkAll('approve');" /></td>
           <td align="center">&nbsp;</td>
          </tr>
          <%

'Read in the groups from db
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT " & strDbTable & "Category.Cat_ID, " & strDbTable & "Category.Cat_name, " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Forum_name " & _
"FROM " & strDbTable & "Category, " & strDbTable & "Forum " & _
"WHERE " & strDbTable & "Category.Cat_ID=" & strDbTable & "Forum.Cat_ID AND " & strDbTable & "Forum.Sub_ID=0 " & _
"ORDER BY " & strDbTable & "Category.Cat_order ASC, " & strDbTable & "Category.Cat_ID ASC, " & strDbTable & "Forum.Forum_Order ASC;"

'Query the database
rsCommon.Open strSQL, adoCon

'Read in the row from the db using getrows for better performance
If NOT rsCommon.EOF Then 
	sarryForums = rsCommon.GetRows()
End If

'close
rsCommon.Close

'If no record returned display so
If NOT isArray(sarryForums) Then
	%>
	  <tr>
            <td align="left" class="tableRow" colspan="14">There are presently no Forums created to set permissions on</td>
          </tr><%

'If records returned
Else
    
	'Loop round to read in all the forums in the database
	Do While intCurrentRecord =< Ubound(sarryForums,2)
  
		'Get the forum ID
		intForumID = CInt(sarryForums(2,intCurrentRecord))

⌨️ 快捷键说明

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