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

📄 admin_forum_details.asp

📁 简单的asp论坛源码系统,很适用于初学者!界面简洁,功能齐全
💻 ASP
📖 第 1 页 / 共 3 页
字号:
		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("Display_post") = CBool(Request.Form("approve" & intUserGroupID))
			.Fields("Moderate") = CBool(Request.Form("moderator" & intUserGroupID))
			.Fields("Calendar_event") = CBool(Request.Form("calEvent" & intUserGroupID))
			.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


	'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"))
	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" -->
<meta name="generator" content="Web Wiz Forums" />
<title>Forum Details</title>
<%
'***** 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 ******
%>
<!-- 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("Please select a Main Forum for this Sub Forum is to be in");
		return false;
	}<%

'Else we need a category
Else
%>
	//Check for a category
	if (document.frmNewForum.cat.value==""){
		alert("Please select the Category this Forum is to be in");
		return false;
	}<%
End If

%>
	//Check for a forum name
	if (document.frmNewForum.forumName.value==""){
		alert("Please enter a Name for the Forum");
		document.frmNewForum.forumName.focus();
		return false;
	}

	//Check for a pforum description
	if (document.frmNewForum.description.value==""){
		alert("Please enter a Description for the Forum");
		document.frmNewForum.description.focus();
		return false;
	}

	return true
}
</script>
<!-- #include file="includes/admin_header_inc.asp" -->
   <div align="center"><h1>Forum Details</h1><br />
    <a href="admin_menu.asp<% = strQsSID1 %>">Control Panel Menu</a><br />
    <a href="admin_view_forums.asp<% = strQsSID1 %>">Return to the Forum Administration page</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
		%>
       You must first create a New Forum to place your new Sub Forum in.</span><br />
       <br />
       <a href="admin_forum_details.asp?mode=new<% = strQsSID2 %>">Create a New Forum</a>
       <%

	'Main forum mode
	Else
		%>
       You must first enter a Forum Category to place your new Forum in.</span><br />
       <br />
       <a href="admin_category_details.asp?mode=new<% = strQsSID2 %>">Enter a Forum Category</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">Select Main Forum </td>
     </tr>
     <tr>
      <td colspan="2" class="tableRow">Select the Main Forum from the drop down list below that you would like this Sub Forum to be in.<br />
       <select name="mainForum">
        <option value=""<% If intSubID = 0 Then Response.Write(" selected") %>>-- Select Main Forum --</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">Select Forum Category</td>
     </tr>
     <tr>
      <td colspan="2" class="tableRow">Select the Category from the drop down list below that you would like this Forum to be in.<br />
       <select name="cat">
        <option value=""<% If intCatID = 0 Then Response.Write(" selected") %>>-- Select Forum Category --</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

⌨️ 快捷键说明

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