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

📄 admin_view_forums.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

%>
<!-- #include file="includes/browser_page_encoding_inc.asp" -->
<title>Administer Forums</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>Administer Forums</h1><br />
  <a href="admin_menu.asp<% = strQsSID1 %>">Control Panel Menu</a></div>
<form action="admin_update_forum_order.asp<% = strQsSID1 %>" method="post" name="form1" id="form1">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="center" class="text">From here you can add, delete, edit, or lock Categories and Forums.<br />
        <br />
        Click on Forum name or Category to Amend Details.<br />
        <br />
        Select the order you would like the forums to be in from the Order drop down list and click on the Update Order button.<br />
        <span class="smText">If forums are not correctly set in an order you may find stability issues within your forums. </span> </td>
    </tr>
  </table>
  <br />
  <%

'Dimension variables
Dim strCategory			'Holds the categories
Dim intCatID			'Holds the category ID number
Dim strForumName		'Holds the forum name
Dim strForumDiscription		'Holds the forum description
Dim blnForumLocked		'Set to true if the forum is locked
Dim intLoop			'Holds the number of times round in the Loop Counter
Dim intNumOfForums		'Holds the number of forums
Dim intForumOrder		'Holds the order number of the forum
Dim intNumOfCategories		'Holds the number of categories
Dim intCatOrder			'Holds the order number of the category
Dim intSubForumID
Dim sarryForums			'Holds the getrows db call for forums
Dim intCurrentRecord		'Holds the current record
Dim intCurrentRecord2		'holds the second current record
Dim saryCategories		'Holds the categories
Dim intCatCurrentRecord		'Holds the currnet record for the cats


'Read the various categories 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, " & strDbTable & "Category.Cat_order FROM " & strDbTable & "Category ORDER BY " & strDbTable & "Category.Cat_order ASC, " & strDbTable & "Category.Cat_ID ASC;"


'Query the database
rsCommon.Open strSQL, adoCon

'Place the rs into an array
If NOT rsCommon.EOF Then
	saryCategories = rsCommon.GetRows()
End If

'Close rs
rsCommon.close

'Check there are categories to display
If isArray(saryCategories) = false Then


	'If there are no categories to display then display the appropriate error message
	Response.Write vbCrLf & "<br /><br /><br /><span class=""text""><strong>There are no Categories to display. <a href=""admin_category_details.asp?mode=new" & strQsSID2 & """>Click here to create a Forum Category</a></strong></span><br /><br /><br />"

'Else there the are categories so write the HTML to display categories and the forum names and a discription
Else

	'Get the number of categories
	intNumOfCategories = Ubound(saryCategories,2) + 1

	'Loop round to read in all the categories in the database
	Do While NOT intCatCurrentRecord > Ubound(saryCategories,2)


		'Get the category name from the database
		strCategory = saryCategories(0,intCatCurrentRecord)
		intCatID = CInt(saryCategories(1,intCatCurrentRecord))
		intCatOrder = CInt(saryCategories(2,intCatCurrentRecord))


		'Display the category name
		
		%>
  <table border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
    <tr>
      <td width="77%" height="26" class="tableLedger">Forums</td>
      <td width="6%" align="center" class="tableLedger">Sub&nbsp;Forum</td>
      <td width="6%" height="26" align="center" class="tableLedger">Lock</td>
      <td width="6%" height="26" align="center" class="tableLedger">Delete</td>
      <td width="5%" height="26" align="center" class="tableLedger">Order</td>
    </tr>
    <tr>
      <td colspan="3" class="tableSubLedger"><a href="admin_category_details.asp?mode=edit&amp;CatID=<% = intCatID %><% = strQsSID2 %>"><b><% = strCategory %></b></a></td>
      <td align="center" class="tableSubLedger"><a href="admin_delete_category.asp?CatID=<% = intCatID %><% = strQsSID2 %>" onclick="return confirm('Are you sure you want to Delete this Category?\n\nWARNING: Deleting this category will permanently  remove all Forum(s) in this Category and all the Posts!')"><img src="<% = strImagePath %>delete.png" border="0" title="Delete Category" /></a></td>
      <td align="center" class="tableSubLedger"><select name="catOrder<% = intCatID %>">
          <%
          Response.Write(intNumOfCategories)
           'loop round to display the number of forums for the order select list
           For intLoop = 1 to intNumOfCategories
		Response.Write("<option value=""" & intLoop & """ ")

			'If the loop number is the same as the order number make this one selected
			If intCatOrder = intLoop Then
				Response.Write("selected")
			End If

		Response.Write(">" & intLoop & "</option>")
           Next
           %>
        </select>
      </td>
    </tr>
    <%
		'Read the various forums from the database
		'******************************************
		'Initalise the strSQL variable with an SQL statement to query the database
		strSQL = "SELECT " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Sub_ID," & strDbTable & "Forum.Forum_name," & strDbTable & "Forum.Forum_description," & strDbTable & "Forum.Forum_Order," & strDbTable & "Forum.Locked FROM " & strDbTable & "Forum WHERE " & strDbTable & "Forum.Cat_ID = " & intCatID  & " ORDER BY " & strDbTable & "Forum.Forum_Order ASC;"

		'Query the database
		rsCommon.Open strSQL, adoCon

		'Check there are forum's to display
		If rsCommon.EOF Then

			'If there are no forum's to display then display the appropriate error message
			Response.Write vbCrLf & "<td bgcolor=""#FFFFFF"" colspan=""5"" class=""tableBottomRow"">There are no Forum's to display. <a href=""admin_forum_details.asp?mode=new" & strQsSID2 & """>Click here to create a Forum</a></td>"
			
			'Close the recordset as it is no longer needed
			rsCommon.Close
			
		'Else there the are forum's to write the HTML to display it the forum names and a discription
		Else

			'Initilise current record
			intCurrentRecord = 0
			

⌨️ 快捷键说明

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