<% @ Language=VBScript %> <% Option Explicit %> <% 'Set the response buffer to true Response.Buffer = True '****************************************** '*** Create Usercode ***** '****************************************** Private Function userCode(ByVal strUsername) 'Randomise the system timer Randomize Timer 'Calculate a code for the user strUserCode = strUsername & hexValue(15) 'Make the usercode SQL safe strUserCode = formatSQLInput(strUserCode) 'Replace double quote with single in this intance strUserCode = Replace(strUserCode, "''", "'", 1, -1, 1) 'Return the function userCode = strUserCode End Function 'Dimension variables Dim strMode 'holds the mode of the page, set to true if changes are to be made to the database 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 intRead Dim intPost Dim intReply Dim intEdit Dim intDelete Dim intPriority Dim intPollCreate Dim intVote Dim intAttachments Dim intImageUpload Dim blnLocked Dim blnHide Dim intShowTopicsFrom 'Holds the amount of time to show topics in 'Initilise variables intCatID = 0 intShowTopicsFrom = 31 intRead = 1 intPost = 2 intReply = 2 intEdit = 2 intDelete = 2 intPriority = 4 intPollCreate = 0 intVote = 0 intAttachments = 0 intImageUpload = 0 blnLocked = False blnHide = False 'Read in the details intForumID = CInt(Request.QueryString("FID")) strForumPassword = LCase(Request.Form("password")) strMode = Request("mode") '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 & ";" '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 'If this is a post back update the database If (strMode = "edit" OR strMode = "new") AND Request.Form("postBack") Then With rsCommon 'If this is a new one add new If strMode = "new" Then .AddNew 'Update the recordset .Fields("Cat_ID") = CInt(Request.Form("cat")) .Fields("Forum_name") = Request.Form("forumName") .Fields("Forum_description") = Request.Form("description") .Fields("Read") = CInt(Request.Form("read")) .Fields("Post") = CInt(Request.Form("post")) .Fields("Reply_posts") = CInt(Request.Form("reply")) .Fields("Edit_posts") = CInt(Request.Form("edit")) .Fields("Delete_posts") = CInt(Request.Form("delete")) .Fields("Priority_posts") = CInt(Request.Form("priority")) .Fields("Poll_create") = CInt(Request.Form("polls")) .Fields("Vote") = CInt(Request.Form("vote")) .Fields("Attachments") = CInt(Request.Form("files")) .Fields("Image_upload") = CInt(Request.Form("images")) .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 'Update the database with the new user's details .Update End With 'If this is a new forum go back to the main forums page If strMode = "new" Then 'Release server varaibles rsCommon.Close Set rsCommon = Nothing adoCon.Close Set adoCon = Nothing Response.Redirect("view_forums.asp") End If 'Re-run the query to read in the updated recordset from the database rsCommon.Requery End If 'Read in the forum details from the recordset If NOT rsCommon.EOF Then 'Read in the forums from the recordset intCatID = CInt(rsCommon("Cat_ID")) strForumName = rsCommon("Forum_name") strForumDescription = rsCommon("Forum_description") intForumID = CInt(rsCommon("Forum_ID")) strForumPassword = rsCommon("Password") intRead = CInt(rsCommon("Read")) intPost = CInt(rsCommon("Post")) intReply = CInt(rsCommon("Reply_posts")) intEdit = CInt(rsCommon("Edit_posts")) intDelete = CInt(rsCommon("Delete_posts")) intPriority = CInt(rsCommon("Priority_posts")) intPollCreate = CInt(rsCommon("Poll_create")) intVote = CInt(rsCommon("Vote")) intAttachments = CInt(rsCommon("Attachments")) intImageUpload = CInt(rsCommon("Image_upload")) blnLocked = CBool(rsCommon("Locked")) blnHide = CBool(rsCommon("Hide")) intShowTopicsFrom = CInt(rsCommon("Show_topics")) End If 'Release server varaibles rsCommon.Close '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;" 'Query the database rsCommon.Open strSQL, adoCon %> FORUM DETAILS FORUM DETAILS

<% If rsCommon.EOF Then %>
YOU MUST FIRST ENTER A FORUM CATEGORY TO PLACE YOUR NEW FORUM IN.
ENTER A FORUM CATEGORY
<% Else %>
SELECT FORUM CATEGORY
SELECT THE CATEGORY FROM THE DROP DOWN LIST
THAT YOU WOULD LIKE THIS FORUM TO BE IN
FORUM DETAILS
FORUM NAME*
FORUM DESCRIPTION*
Give a brief description of the forum.
SHOW TOPIS IN THE LAST
This is the default time span in which topics containing new posts are shown in the topic list.
FORUM LOCKED
If the forum is locked posts can not be made in the forum. Useful for maintenance.
>
HIDE FORUM IF NO ACCESS
Hide this forum on the boards main page if the user can not access the forum.
>

GENERIC FORUM PERMISSIONS
Use the form below to set Generic Permissions on this forum.
Please be aware that the Generic Permissions can be over ridden by setting permissions on this forum by User Group.

KEY TO FORUM PERMISSIONS
  1. All Users
    This gives permission to all users including Guests.
  2. Registered Users
    This gives permission to all users except Guests.
  3. Private Groups
    This gives permissions to Groups that you have given permission to through the setting up of Group Permissions for this forum.
  4. Forum Admin's
    This gives permission to Forum Administers only.
FORUM ACCESS
POST NEW TOPICS
REPLY TO POSTS
EDIT POSTS
DELETE POSTS
STICKY TOPICS
CREATE POLL'S
VOTE IN POLL'S
<% If strForumPassword <> "" Then Response.Write("Change ") %> PASSWORD
If you want this forum password protected place the password here.
Otherwise leave it blank.
<% 'If there is a password ask if they want to remove it If strForumPassword <> "" Then %> REMOVE FORUM PASSWORD <% End If %>
<% End If 'Reset Server Objects rsCommon.Close Set rsCommon = Nothing adoCon.Close Set adoCon = Nothing %>