<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="admin_common.asp" -->
<%
'****************************************************************************************
'**  Copyright Notice
'**
'**  Web Wiz Guide - Web Wiz Forums
'**  http://www.webwizforums.com
'**
'**  Copyright 2001-2006 Bruce Corkhill All Rights Reserved.
'**
'**  This program is free software; you can modify (at your own risk) any part of it
'**  under the terms of the License that accompanies this software and use it both
'**  privately and commercially.
'**
'**  All copyright notices must remain in tacked in the scripts and the
'**  outputted HTML.
'**
'**  You may use parts of this program in your own private work, but you may NOT
'**  redistribute, repackage, or sell the whole or any part of this program even
'**  if it is modified or reverse engineered in whole or in part without express
'**  permission from the author.
'**
'**  You may not pass the whole or any part of this application off as your own work.
'**
'**  You may not deactivate any adverts or links to Web Wiz Guide and it’s associates
'**  and must remain visible when the pages are viewed unless permission is first granted
'**  by the copyright holder.
'**
'**  This program is distributed in the hope that it will be useful,
'**  but WITHOUT ANY WARRANTY; without even the implied warranty of
'**  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER
'**  WARRANTIES WHETHER EXPRESSED OR IMPLIED.
'**
'**  You should have received a copy of the License along with this program;
'**  if not, write to:- Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom.
'**
'**
'**  Official support is available for this program through the free support forum at: -
'**  http://www.webwizguide.info/forum
'**
'**  Support questions are NOT answered by e-mail ever!
'**
'**  For correspondence or non support questions contact: -

'**
'** Web Wiz Guide, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, UK, BH15 4JD
'**
'****************************************************************************************



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







'Dimension variables
Dim rsCommon2		'Holds a secound recordset for the page
Dim strMode		'holds the mode of the page, set to true if changes are to be made to the database
Dim strMode2		'Holds if this is a sub forum
Dim strForumName	'Holds the name of the forum
Dim strForumDescription	'Holds the discription of the forum
Dim strForumPassword	'Holds the forum password
Dim intForumID		'Holds the forum ID number
Dim strForumCode	'Holds a security code for the forum if it is password protected
Dim strCatName		'Holds the name of the category
Dim intCatID		'Holds the ID number of the category
Dim intSelCatID		'Holds the selected cat id
Dim intSubID		'Holds the sub forum ID
Dim blnLocked
Dim blnHide
Dim intShowTopicsFrom	'Holds the amount of time to show topics in
Dim intUserGroupID	'Holds the group ID
Dim intMainForumID	'Holds the ID of the main forum is sub forum mode
Dim strUserCode		'Holds user code
Dim intForumOrderNum	'Holds the forum order number

Dim strForumLogo




'Initilise variables
intCatID = 0
intShowTopicsFrom = 0
intForumID = 0
blnLocked = False
blnHide = False
intForumOrderNum = 0


'Read in the details
intForumID = CInt(Request.QueryString("FID"))
strForumPassword = LCase(Request.Form("password"))


strMode = Request("mode")
strMode2 = Request("sub")



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




'If this is a post back update the database
If (strMode = "edit" OR strMode = "new") AND Request.Form("postBack") Then


	'If this is a sub forum do things a little different
	If strMode2 = "true" Then

		'Read in the sub ID
		intMainForumID = CInt(Request.Form("mainForum"))
		intSubID = intMainForumID

		'Get the Cat ID for this sub forum from the database
		strSQL = "SELECT " & strDbTable & "Forum.Cat_ID From " & strDbTable & "Forum WHERE " & strDbTable & "Forum.Forum_ID= " & intMainForumID & ";"

		'Query the database
		rsCommon.Open strSQL, adoCon

		'If there is a record get the Cat ID
		If NOT rsCommon.EOF Then intCatID = CInt(rsCommon("Cat_ID"))

		'Reset rsCommon
		rsCommon.Close

	'Else main forums
	Else
		
		'Set the sub ID to 0
		intSubID = 0

		'Read in the cat ID for main forums
		intCatID = CInt(Request.Form("cat"))
		
		'If this is an edit then update any sub forums
		If strMode = "edit" Then
			'If there are any sub forums we need to update the Cat ID for them
			strSQL = "UPDATE " & strDbTable & "Forum " & _
			"SET Cat_ID = " & intCatID & " " & _
			"WHERE (Sub_ID = "  & intForumID & ");"
				
			'Write to database
			adoCon.Execute(strSQL)
		End If
	End If



	'If this is new we need a different query and also need to get the number of forum in cat for forum order
	If strMode = "new" Then
		
		'SQL to colunt the number of forum in this cat
		strSQL = "SELECT Count(" & strDbTable & "Forum.Forum_ID) AS forumCount " & _
		"FROM " & strDbTable & "Forum " & _
		"WHERE " & strDbTable & "Forum.Cat_ID = " & intCatID & ";"
		
		'Query the database
		rsCommon.Open strSQL, adoCon
		
		'Get the number of forums in cat
		If NOT rsCommon.EOF Then intForumOrderNum = CInt(rsCommon("forumCount")) + 1
		
		'Close recordset
		rsCommon.Close
		
		'Initalise the strSQL variable with an SQL statement to query the database
		strSQL = "SELECT " & strDbTable & "Forum.* " & _
		"From " & strDbTable & "Forum " & _
		"ORDER BY " & strDbTable & "Forum.Forum_ID DESC;"
	
	'Else use a different query if we are updating
	Else
		strSQL = "SELECT " & strDbTable & "Forum.Cat_ID, " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Sub_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Forum.Forum_description, " & strDbTable & "Forum.Locked, " & strDbTable & "Forum.Hide, " & strDbTable & "Forum.Show_topics, " & strDbTable & "Forum.Password, " & strDbTable & "Forum.Forum_code, " & strDbTable & "Forum.Logoimg " & _
		"From " & strDbTable & "Forum " & _
		"WHERE " & strDbTable & "Forum.Forum_ID = " & intForumID & ";"
	End If

	'Set the cursor type property of the record set to Dynamic so we can navigate through the record set
	rsCommon.CursorType = 2

	'Set the Lock Type for the records so that the record set is only locked when it is updated
	rsCommon.LockType = 3

	'Query the database
	rsCommon.Open strSQL, adoCon
		

	With rsCommon
		'If this is a new one add new
		If strMode = "new" Then .AddNew

		'Update the recordset
		.Fields("Cat_ID") = intCatID
		.Fields("Sub_ID") = intSubID
		If strMode = "new" Then .Fields("Forum_Order") = intForumOrderNum
		If strMode = "new" Then .Fields("Last_post_author_ID") = 1
		If strMode = "new" Then .Fields("Last_post_date") = internationalDateTime("2001-01-01 00:00:00")
		.Fields("Forum_name") = Request.Form("forumName")
		.Fields("Forum_description") = Request.Form("description")
		.Fields("Locked") = CBool(Request.Form("locked"))
		.Fields("Hide") = CBool(Request.Form("hide"))
		.Fields("Show_topics") = CInt(Request.Form("showTopics"))
		'See if there is a password if not the filed must be null
		If Request.Form("remove") Then
			.Fields("Password") = null
			.Fields("Forum_code") = null
		'Add the new or updated password and usercode to the database
		ElseIf strForumPassword <> "" Then

			'Encrypt the forum password
			strForumPassword = HashEncode(strForumPassword)

			'Calculate a code for the forum
			strForumCode = userCode(strForumName)

			'Place in recordset
			.Fields("Password") = strForumPassword
			.Fields("Forum_code") = strForumCode
		End If
		
		.Fields("Logoimg") = Request.Form("ForumLogo")

		'Update the database with the new user's details
		.Update
	End With


	'Re-run the query to read in the updated recordset from the database
	'We need to do this to get the new forum ID
	rsCommon.Requery

	'Read in the new forum ID
	intForumID = CInt(rsCommon("Forum_ID"))


	'Close RS
	rsCommon.Close



	'Set the permissions for this forum

	'Read in the groups from db
	'Initalise the strSQL variable with an SQL statement to query the database
	strSQL = "SELECT " & strDbTable & "Group.Group_ID, " & strDbTable & "Group.Name, " & strDbTable & "Group.Starting_group FROM " & strDbTable & "Group ORDER BY " & strDbTable & "Group.Group_ID 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
		intUserGroupID = CInt(rsCommon("Group_ID"))
		
		
		'Due to some issues when updating from previous versions delete permission before reseting
		strSQL = "DELETE " & strDbTable & "Permissions FROM " & strDbTable & "Permissions WHERE " & strDbTable & "Permissions.Group_ID = " & intUserGroupID & " AND " & strDbTable & "Permissions.Forum_ID = " & intForumID & ";"

		'Write to database
		adoCon.Execute(strSQL)
			

		'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" & intUserGroupID))
			.Fields("Post") = CBool(Request.Form("topic" & intUserGroupID))
			.Fields("Priority_posts") = CBool(Request.Form("sticky" & intUserGroupID))
			.Fields("Reply_posts") = CBool(Request.Form("reply" & intUserGroupID))
			.Fields("Edit_posts") = CBool(Request.Form("edit" & intUserGroupID))
			.Fields("Delete_posts") = CBool(Request.Form("delete" & intUserGroupID))
			.Fields("Poll_create") = CBool(Request.Form("polls" & intUserGroupID))
			.Fields("Vote") = CBool(Request.Form("vote" & intUserGroupID))
			.Fields("Image_upload") = CBool(Request.Form("images" & intUserGroupID))
			.Fields("Attachments") = CBool(Request.Form("attach" & intUserGroupID))
			.Fields("Display_post") = CBool(Request.Form("approve" & intUserGroupID))
			.Fields("Moderate") = CBool(Request.Form("moderator" & intUserGroupID))
			.Fields("Calendar_event") = CBool(Request.Form("calEvent" & intUserGroupID))
			

			'Update the database
			.Update
		End With



		'Close rsCommon2
		rsCommon2.Close

		'Move to the next record in the recordset
		rsCommon.MoveNext
	Loop

	rsCommon.Close


	'If this is a new forum go back to the main forums page
	If strMode = "new" Then

		'Release server varaibles
		Set rsCommon2 = Nothing
		Call closeDatabase()

		Response.Redirect("admin_view_forums.asp" & strQsSID1)
	End If
End If




'If this is an edit read in the forum details
If strMode = "edit" Then

	'Initalise the strSQL variable with an SQL statement to query the database
	strSQL = "SELECT " & strDbTable & "Forum.* " & _
	"From " & strDbTable & "Forum " & _
	"WHERE " & strDbTable & "Forum.Forum_ID=" & intForumID & ";"

	'Query the database
	rsCommon.Open strSQL, adoCon

	If NOT rsCommon.EOF Then

		'Read in the forums from the recordset
		intCatID = CInt(rsCommon("Cat_ID"))
		intSubID = CInt(rsCommon("Sub_ID"))
		strForumName = rsCommon("Forum_name")
		strForumDescription = rsCommon("Forum_description")
		intForumID = CInt(rsCommon("Forum_ID"))
		strForumPassword = rsCommon("Password")
		blnLocked = CBool(rsCommon("Locked"))
		blnHide = CBool(rsCommon("Hide"))
		intShowTopicsFrom = CInt(rsCommon("Show_topics"))
		strForumLogo = rsCommon("Logoimg")
	End If

	'Close the rs
	rsCommon.Close
End If




'See if there is a main forum for this forum to be in or if there is a category to place a main forum within
If strMode2 = "true" Then
	'Read in the main forum name from the database
	'Initalise the strSQL variable with an SQL statement to query the database
	strSQL = "SELECT " & strDbTable & "Category.Cat_ID, " & 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 & "Forum.Forum_Order ASC;"
Else
	'Read in the category name from the database
	'Initalise the strSQL variable with an SQL statement to query the database
	strSQL = "SELECT " & strDbTable & "Category.Cat_name, " & strDbTable & "Category.Cat_ID " & _
	"FROM " & strDbTable & "Category " & _
	"ORDER BY " & strDbTable & "Category.Cat_order ASC;"
End If


'Query the database
rsCommon.Open strSQL, adoCon

%>
<!-- #include file="includes/browser_page_encoding_inc.asp" -->

<head>
<meta name="generator" content="Microsoft FrontPage 6.0" />
<title>Forum Detayları</title>
<%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Response.Write("<!--//" & _
vbCrLf & "/* *******************************************************" & _
vbCrLf & "Application: Web Wiz Forums ver. " & strVersion & "" & _
vbCrLf & "Author: Bruce Corkhill" & _
vbCrLf & "Info: http://www.webwizforums.com" & _
vbCrLf & "Available FREE: http://www.webwizforums.com" & _
vbCrLf & "Copyright: Bruce Corkhill ©2001-2006. All rights reserved" & _
vbCrLf & "******************************************************* */" & _
vbCrLf & "//-->")
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>
<!-- Check the from is filled in correctly before submitting -->
<script  language="JavaScript" type="text/javascript">

//Function to check form is filled in correctly before submitting
function CheckForm () {

<%

'If this is a sub forum check a forum is selected
If strMode2 = "true" Then
	%>
	//Check for a forum
	if (document.frmNewForum.mainForum.value==""){
		alert("Lütfen Alt Forumunuzun içinde olacağı Forumu seçin");
		return false;
	}<%

'Else we need a category
Else
%>
	//Check for a category
	if (document.frmNewForum.cat.value==""){
		alert("Lütfen Forumunuzun içinde olacağı Kategoriyi seçin");
		return false;
	}<%
End If

%>
	//Check for a forum name
	if (document.frmNewForum.forumName.value==""){
		alert("Lütfen forum için bir isim girin");
		document.frmNewForum.forumName.focus();
		return false;
	}

	//Check for a pforum description
	if (document.frmNewForum.description.value==""){
		alert("Lütfen forum için bir tanımlama girin");
		document.frmNewForum.description.focus();
		return false;
	}

	return true
}
</script>
<!-- #include file="includes/admin_header_inc.asp" -->
   </head>

   <div align="center"><span class="heading">Forum Detayları</span><br />
    <a href="admin_menu.asp<% = strQsSID1 %>">Kontrol Paneli Menüsü</a><br />
    <a href="admin_view_forums.asp<% = strQsSID1 %>">Forum Yönetimi Sayfasına Geri Dön</a><br />
    <br />
    <%

'If there is no main forum or cat then display a message
If rsCommon.EOF Then
 	%>
    <table width="98%" border="0" cellspacing="0" cellpadding="1" height="135">
     <tr>
      <td align="center" class="text"><span class="lgText">
       <%

	'Sub forum mode
	If strMode2 = "true" Then
		%>
       Önce Alt Forumunuzun içinde olacağı bir Forum oluşturmanız gerekmektedir.</span><br />
       <br />
       <a href="admin_forum_details.asp?mode=new<% = strQsSID2 %>">Yeni Forum Oluştur</a>
       <%

	'Main forum mode
	Else
		%>
       Önce Forumunuzun içinde olacağı bir Kategori oluşturmanız gerekmektedir.</span><br />
       <br />
       <a href="admin_category_details.asp?mode=new<% = strQsSID2 %>">Forum Kategorisi Oluştur</a>
       <%
	End If

%></td>
     </tr>
    </table>
    <%
Else
%>
   </div>
   <form action="admin_forum_details.asp?FID=<% = intForumID %><% = strQsSID2 %>" method="post" name="frmNewForum" id="frmNewForum" onsubmit="return CheckForm();">
    <%

	'If this is a sub forum check a forum is selected
	If strMode2 = "true" Then
	%>
    <table align="center" cellpadding="4" cellspacing="1" class="tableBorder">
     <tr>
      <td colspan="2" class="tableLedger">Forum Seçme </td>
     </tr>
     <tr>
      <td colspan="2" class="tableRow">Alt Forumunuzun içinde olmasını istediğiniz Forumu aşağıdaki listeden seçin.<br />
       <select name="mainForum">
        <option value=""<% If intSubID = 0 Then Response.Write(" selected") %>>-- Forum Seçin --</option>
        <%

		'Loop through all the main forums in the database
		Do while NOT rsCommon.EOF

			'Read in the deatils for the main forum
			strMainForumName = rsCommon("Forum_name")
			intMainForumID = CInt(rsCommon("Forum_ID"))

			'Display a link in the link list to the cat
			Response.Write (vbCrLf & "		<option value=""" & intMainForumID & """")
			If intMainForumID = intSubID Then Response.Write(" selected")
			Response.Write(">" & strMainForumName & "</option>")


			'Move to the next record in the recordset
			rsCommon.MoveNext
		Loop

		'Close Rs
		rsCommon.Close
%>
       </select>
      </td>
     </tr>
    </table>
    <%

	'Else this is a main forum so select a category
	Else

%>
    <table align="center" cellpadding="4" cellspacing="1" class="tableBorder">
     <tr>
      <td colspan="2" class="tableLedger">Forum Kategorisi Seçme</td>
     </tr>
     <tr>
      <td colspan="2" class="tableRow">Forumunuzun içinde olmasını istediğiniz kategoriyi aşağıdaki listeden seçin.<br />
       <select name="cat">
        <option value=""<% If intCatID = 0 Then Response.Write(" selected") %>>-- Kategori Seçin --</option>
        <%



		'Loop through all the categories in the database
		Do while NOT rsCommon.EOF

			'Read in the deatils for the category
			strCatName = rsCommon("Cat_name")
			intSelCatID = CInt(rsCommon("Cat_ID"))

			'Display a link in the link list to the cat
			Response.Write (vbCrLf & "		<option value=""" & intSelCatID & """")
			If intCatID = intSelCatID Then Response.Write(" selected")
			Response.Write(">" & strCatName & "</option>")


			'Move to the next record in the recordset
			rsCommon.MoveNext
		Loop

		'Close Rs
		rsCommon.Close
%>
       </select>
      </td>
     </tr>
    </table>
    <%
	End If

%>
    <br />
    <table align="center" cellpadding="4" cellspacing="1" class="tableBorder">
     <tr>
      <td colspan="2" class="tableLedger">Forum Detayları</td>
     </tr>
     <tr>
      <td width="50%" class="tableRow">Forum İsmi*:</td>
      <td width="50%" valign="top" class="tableRow"><input type="text" name="forumName" maxlength="60" size="30" value="<% = strForumName %>" />
      </td>
     </tr>
     <tr>
      <td class="tableRow">Forum Tanımı*:<br />
       <span class="smText">Foruma bir tanım girin.</span></td>
      <td valign="top" class="tableRow"><input type="text" name="description" maxlength="190" size="30" value="<% = strForumDescription %>" /></td>
     </tr>
     <tr>
      <td class="tableRow">Forum Logo:<br />
       <span class="smText">Foruma bir tanım resmi [isteye bagli]</span></td>
      <td valign="top" class="tableRow"><input type="text" name="ForumLogo" maxlength="190" size="30" value="<% = strForumLogo %>" />
      <%
      If strForumLogo="" OR Len(strForumLogo)=0 OR isNull(strForumLogo) Then
      Else
      Response.write "<img src=""" & strForumLogo & """>"
      End If
      %>
      </td>
     </tr>
     <tr>
      <td class="tableRow">En Son Konu Gösterimi:<br />
       </td>
      <td valign="top" class="tableRow"><select name="showTopics">
        <option value="0"<% If intShowTopicsFrom = 0 OR intShowTopicsFrom = "" Then Response.Write " selected" %>>Tümü</option>
        <option value="1"<% If intShowTopicsFrom = 1 Then Response.Write " selected" %>>Kullanıcının Son Girdiği Tarih</option>
        <option value="2"<% If intShowTopicsFrom = 2 Then Response.Write " selected" %>>Dün</option>
        <option value="3"<% If intShowTopicsFrom = 3 Then Response.Write " selected" %>>Son 2 Gün</option>
        <option value="4"<% If intShowTopicsFrom = 4 Then Response.Write " selected" %>>Son Hafta</option>
        <option value="5"<% If intShowTopicsFrom = 5 Then Response.Write " selected" %>>Son Ay</option>
        <option value="6"<% If intShowTopicsFrom = 6 Then Response.Write " selected" %>>Son İki Ay</option>
        <option value="7"<% If intShowTopicsFrom = 7 Then Response.Write " selected" %>>Son Altı Ay</option>
        <option value="8"<% If intShowTopicsFrom = 8 Then Response.Write " selected" %>>Son Bir Yıl</option>
       </select>
       </select></td>
     </tr>
     <tr>
      <td class="tableRow"><p>Forum Kilitli:<br />
      <span class="smText">Burada forumu kilitleyebilirsiniz.</span></p></td>
      <td valign="top" class="tableRow"><input name="locked" type="checkbox" id="locked2" value="true"<% If blnLocked Then Response.Write " checked" %> /></td>
     </tr>
     <tr>
      <td class="tableRow">Forumun Girişini Sakla:<br />
      <span class="smText">Forumu saklar.Yetkisiz kullanıcılar foruma göremez.</span></td>
      <td valign="top" class="tableRow"><input name="hide" type="checkbox" id="hide" value="true"<% If blnHide Then Response.Write " checked" %> /></td>
     </tr>
     <tr>
      <td  class="tableRow"><% If strForumPassword <> "" Then Response.Write("Change ")%>
       Parola:<br />
       <span class="smText">Eğer foruma parola vermek istiyorsanız bunu kullanın.</span><br />
       <br />
       </td>
      <td valign="top" class="tableRow"><input type="text" name="password" maxlength="20" size="20" />
       <%

      	'If there is a password ask if they want to remove it
      	If strForumPassword <> "" Then
      	%>
       <br />
       <input name="remove" type="checkbox" id="remove" value="true" />
       Forum Parolasını Kaldır
       <%

	End If

      	%></td>
     </tr>
    </table>
    <br />
    <br />
    <table width="100%" align="center" cellpadding="0" cellspacing="0">
     <tr>
      <td align="center" class="text"><span class="lgText">Forum İzinleri</span><br />
       Forumda Üye Gruplarına izin tanımlamak için aşağıdaki formu kullanın.<br />
       <a href="#per" class="smLink">Başlıkların anlamları?</a><br />
       <br />
       <table cellpadding="2" cellspacing="1" class="tableBorder">
        <tr>
         <td width="194" align="left" class="tableLedger">Üye Grubu</td>
         <td width="43" align="center" class="tableLedger">Giriş</td>
         <td width="38" align="center" class="tableLedger">Yeni Konu</td>
         <td width="38" align="center" class="tableLedger">Sabit Konu</td>
         <td width="31" align="center" class="tableLedger">Mesaj Cevaplama</td>
         <td width="33" align="center" class="tableLedger">Mesaj Düzenleme</td>
         <td width="39" align="center" class="tableLedger">Mesaj Silme</td>
         <td width="28" align="center" class="tableLedger">Anket Oluşturma</td>
         <td width="29" align="center" class="tableLedger">Oy Verme</td>
         <td width="29" align="center" class="tableLedger">Takvime Olay Girme</td>
         <td width="42" align="center" class="tableLedger">Resim Yükleme</td>
         <td width="40" align="center" class="tableLedger">Dosya Yükleme</td>
         <td width="50" align="center" class="tableLedger">Onay Gerekliliği</td>
         <td width="59" align="center" class="tableLedger">Forum Düzenleme</td>
        </tr>
        <%

	'Read in the groups from db
	'Initalise the strSQL variable with an SQL statement to query the database
	strSQL = "SELECT " & strDbTable & "Group.Group_ID, " & strDbTable & "Group.Name, " & strDbTable & "Group.Starting_group FROM " & strDbTable & "Group ORDER BY " & strDbTable & "Group.Group_ID 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
		intUserGroupID = CInt(rsCommon("Group_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 & ";"

		'Query the database
		rsCommon2.Open strSQL, adoCon

		'If no records are returned use default values
		If rsCommon2.EOF Then

%>
        <tr>
         <td align="left" class="tableRow"><% = rsCommon("Name") %>
          <% If CBool(rsCommon("Starting_group")) Then Response.Write("<br /><span class=""smText"">(Yeni Üye Grubu)</span>") %>
          <% If intUserGroupID = 2 Then Response.Write("<br /><span class=""smText"">(Kayıtlı Olmayan Kullanıcılar)</span>") %></td>
         <td align="center" class="tableRow"><input name="read<% = intUserGroupID %>" type="checkbox" id="read" value="true" checked /></td>
         <td align="center" class="tableRow"><input name="topic<% = intUserGroupID %>" type="checkbox" id="topic" value="true"<% If intUserGroupID <> 2 Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="sticky<% = intUserGroupID %>" type="checkbox" id="sticky" value="true"<% If intUserGroupID = 1 Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="reply<% = intUserGroupID %>" type="checkbox" id="reply" value="true"<% If intUserGroupID <> 2 Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="edit<% = intUserGroupID %>" type="checkbox" id="edit" value="true"<% If intUserGroupID = 2 Then Response.Write(" disabled=true") Else Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="delete<% = intUserGroupID %>" type="checkbox" id="delete" value="true"<% If intUserGroupID = 2 Then Response.Write(" disabled=true") Else Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="polls<% = intUserGroupID %>" type="checkbox" id="polls" value="true" /></td>
         <td align="center" class="tableRow"><input name="vote<% = intUserGroupID %>" type="checkbox" id="vote" value="true" /></td>
         <td align="center" class="tableRow"><input name="calEvent<% = intUserGroupID %>" type="checkbox" id="calEvent" value="true" /></td>
         <td align="center" class="tableRow"><input name="images<% = intUserGroupID %>" type="checkbox" id="images" value="true" /></td>
         <td align="center" class="tableRow"><input name="attach<% = intUserGroupID %>" type="checkbox" id="attach" value="true" /></td>
         <td align="center" class="tableRow"><input name="approve<% = intUserGroupID %>" type="checkbox" id="approve" value="true" /></td>
         <td align="center" class="tableRow"><input name="moderator<% = intUserGroupID %>" type="checkbox" id="moderator" value="true" /></td>
        </tr>
        <%

      		'Else display the values for this group
      		Else
%>
        <tr>
         <td align="left" class="tableRow"><% = rsCommon("Name") %>
          <% If CBool(rsCommon("Starting_group")) Then Response.Write("<br /><span class=""smText"">(Yeni Üye Grubu)</span>") %>
          <% If intUserGroupID = 2 Then Response.Write("<br /><span class=""smText"">(Kayıtlı Olmayan Kullanıcılar)</span>") %></td>
         <td align="center" class="tableRow"><input name="read<% = intUserGroupID %>" type="checkbox" id="read" value="true"<% If CBool(rsCommon2("View_Forum")) Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="topic<% = intUserGroupID %>" type="checkbox" id="topic" value="true"<% If CBool(rsCommon2("Post")) Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="sticky<% = intUserGroupID %>" type="checkbox" id="sticky" value="true"<% If CBool(rsCommon2("Priority_posts")) Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="reply<% = intUserGroupID %>" type="checkbox" id="reply" value="true"<% If CBool(rsCommon2("Reply_posts")) Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="edit<% = intUserGroupID %>" type="checkbox" id="edit"<% If intUserGroupID = 2 Then Response.Write(" disabled=true") %> value="true"<% If CBool(rsCommon2("Edit_posts")) Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="delete<% = intUserGroupID %>" type="checkbox" id="delete"<% If intUserGroupID = 2 Then Response.Write(" disabled=true") %> value="true"<% If CBool(rsCommon2("Delete_posts")) Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="polls<% = intUserGroupID %>" type="checkbox" id="polls" value="true"<% If CBool(rsCommon2("Poll_create")) Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="vote<% = intUserGroupID %>" type="checkbox" id="vote" value="true"<% If CBool(rsCommon2("Vote")) Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="calEvent<% = intUserGroupID %>" type="checkbox" id="calEvent" value="true"<% If CBool(rsCommon2("Calendar_event")) Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="images<% = intUserGroupID %>" type="checkbox" id="images" value="true"<% If CBool(rsCommon2("Image_upload")) Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="attach<% = intUserGroupID %>" type="checkbox" id="attach" value="true"<% If CBool(rsCommon2("Attachments")) Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="approve<% = intUserGroupID %>" type="checkbox" id="approve" value="true"<% If CBool(rsCommon2("Display_post")) Then Response.Write(" checked") %> /></td>
         <td align="center" class="tableRow"><input name="moderator<% = intUserGroupID %>" type="checkbox" id="moderator" value="true"<% If CBool(rsCommon2("Moderate")) Then Response.Write(" checked") %> /></td>
        </tr>
        <%

		End If

		'Close rsCommon2
		rsCommon2.Close

		'Move to the next record in the recordset
		rsCommon.MoveNext
	Loop

	'Close Rs
	rsCommon.Close

%>
       </table></td>
     </tr>
    </table>
    <div align="center"><br />
     <input type="hidden" name="postBack" value="true" />
     <input type="hidden" name="mode" value="<% = strMode %>" />
     <input type="hidden" name="sub" value="<% = strMode2 %>" />
     <input type="submit" name="Submit" value="Sun" />
     <input type="reset" name="Reset" value="Formu Temizle" />
     <br />
    </div>
   </form>
   <%
End If


'Reset Server Objects
Set rsCommon2 = Nothing
Call closeDatabase()
%>
   <br />
   <a name="per" id="per"></a> <br />
   <br />
   <table border="0" align="center" cellpadding="4" cellspacing="1" class="tableBorder">
    <tr>
     <td colspan="2" class="tableLedger">Forum İzinleri Tablosu </td>
  </tr>
  <tr >
    <td width="24%" align="right" valign="top"  class="tableRow"><strong>Giriş:</strong></td>
    <td width="76%" valign="top"  class="tableRow">İşaretlenen gruplar forumu 
    görüntüleyebilir </td>
  </tr>
  <tr >
    <td width="24%" align="right" valign="top"  class="tableRow"><strong>Yeni 
    Konu:</strong></td>
    <td width="76%" valign="top"  class="tableRow">İşaretlenen gruplar forumda 
    yeni konu açabilir</td>
  </tr>
  <tr >
    <td align="right" valign="top"  class="tableRow"><strong>Sabit Konu:</strong></td>
    <td valign="top"  class="tableRow">İşaretlenen gruplar forumda sabit konu 
    açabilir </td>
  </tr>
  <tr >
    <td width="24%" align="right" valign="top"  class="tableRow"><strong>Mesaj 
    Cevaplama:<br />    
    </strong></td>
    <td width="76%" valign="top"  class="tableRow">İşaretlenen gruplar forumlara 
    cevap yazabilir</td>
  </tr>
  <tr >
    <td align="right" valign="top"  class="tableRow"><strong>Mesaj Düzenleme:</strong></td>
    <td valign="top"  class="tableRow">İşaretlenen gruplardakiler yazdıkları 
    mesajları düzenleyebilirler</td>
  </tr>
  <tr >
    <td align="right" valign="top"  class="tableRow"><strong>Mesaj Silme:</strong></td>
    <td valign="top"  class="tableRow">İşaretlenen gruplardakiler yazdıkları 
    mesajları, eğer cevap yazılmamışsa silebilirler</td>
  </tr>
  <tr >
    <td align="right" valign="top"  class="tableRow"><strong>Anket Oluşturma:</strong></td>
    <td valign="top"  class="tableRow">İşaretlenen gruplar anket açabilirler</td>
  </tr>
  <tr >
    <td align="right" valign="top"  class="tableRow"><strong>Oy Verme:</strong></td>
    <td valign="top"  class="tableRow">İşaretlenen gruplar anketlere oy 
    verebilirler</td>
  </tr>
    <tr>
     <td align="right" valign="top"  class="tableRow"><strong>Takvime Olay Girme:</strong></td>
     <td valign="top"  class="tableRow">İşaretlenen gruplar takvime olay olarak 
     konu girebilirler..<br />
      <span class="smText">'<a href="admin_forum_configure.asp<% = strQsSID1 %>" class="smLink">Forum 
      Özellikleri</a>' sayfasından takvimi aktif duruma getirebilirsiniz. </span></td>
    </tr>
     <tr >
    <td align="right" valign="top"  class="tableRow"><strong>Resim Yükleme:<br />    
    </strong></td>
    <td valign="top" class="tableRow" >İşaretlenen gruplar mesajlarına web 
    alanınızı kullanarak resim yükleyebilirler<span class="text"><span class="smText"><br />
    Önce <a href="admin_upload_configure.asp<% = strQsSID1 %>" class="smLink">dosya-resim yükleme 
    ayarlarını yapmış olmanız</a>, gerekmektedir.</span></span></td>
  </tr>
  <tr >
    <td align="right" valign="top"  class="tableRow"><strong>Dosya Yükleme:<br />    
    </strong></td>
    <td valign="top" class="tableRow" >İşaretlenen gruplar mesajlarına web 
    alanınızı kullanarak dosya yükleyebilirler<span class="text"><span class="smText"><br />
    Önce <a href="admin_upload_configure.asp<% = strQsSID1 %>" class="smLink">dosya-resim yükleme 
    ayarlarını yapmış olmanız</a>, gerekmektedir.</span></span> </td>
  </tr>
  <tr >
    <td align="right" valign="top"  class="tableRow"><strong>Onay Gerekliliği:<br />    
    </strong></td>
    <td valign="top" class="tableRow" ><span class="text">İşaretlenen 
    gruptakilerin yazdığı mesajların onaylanmadan yayınlanmamasını istiyorsanız 
    bu seçeneği seçebilirsiniz</span></td>
  </tr>
  <tr >
    <td align="right" valign="top"  class="tableRow"><strong>Forum Düzenleme:<br />    
    </strong></td>
    <td valign="top" class="tableRow" ><span class="text">İşaretlenen 
    gruptakiler bu forumda görevli olurlar, forumu düzenleme yetkileri ve tüm 
    forumlarda üye bilgilerini değiştirme yetkileri olur<br />
    </span><span class="smText">Bu forumdaki tüm mesajları silebilir, 
    düzenleyebilir, taşıyabilir.Tüm forumlarda üyelerin bilgilerini değiştirebilirler, 
    herhangi bir forumda bu yetkiyi verdiğiniz grubun tüm forumlarda üye 
    bilgilerini değiştirebileceğini unutmayınız! ! ! </span></td>
  </tr>
   </table>
   <div align="center"><br />
    <br />
   </div>
   <!-- #include file="includes/admin_footer_inc.asp" -->