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

📄 admin_view_forums.asp

📁 简单的asp论坛源码系统,很适用于初学者!界面简洁,功能齐全
💻 ASP
📖 第 1 页 / 共 2 页
字号:
			'Read in the row from the db using getrows for better performance
			sarryForums = rsCommon.GetRows()
			
			'Get the number of forums
			rsCommon.Close
			
			'Get the number of forums
			intNumOfForums = Ubound(sarryForums,2) + 1
			

			'Loop round to read in all the forums in the database
			Do While NOT intCurrentRecord > Ubound(sarryForums,2)
			
				'If this is a subforum jump to the next record, unless we have run out of forums
				Do While CInt(sarryForums(1,intCurrentRecord)) > 0 
					
					'Go to next record
					intCurrentRecord = intCurrentRecord + 1
					
					'If we have run out of records jump out of loop
					If intCurrentRecord > Ubound(sarryForums,2) Then Exit Do
				Loop
				
				'If we have run out of records jump out of loop
				If intCurrentRecord > Ubound(sarryForums,2) Then Exit Do

				'Read in forum details from the database
				intForumID = CInt(sarryForums(0,intCurrentRecord))
				strForumName = sarryForums(2,intCurrentRecord)
				strForumDiscription = sarryForums(3,intCurrentRecord)
				intForumOrder = CInt(sarryForums(4,intCurrentRecord))
				blnForumLocked = CBool(sarryForums(5,intCurrentRecord))

				'Write the HTML of the forum descriptions and hyperlinks to the forums
				
				%>
    <tr>
      <td class="tableRow"><a href="admin_forum_details.asp?mode=edit&amp;FID=<% = intForumID %><% = strQsSID2 %>"><% = strForumName %></a> <br />
        <span class="smText"><% = strForumDiscription %></span></td>
      <td align="center" class="tableRow"><a href="admin_change_to_subforum.asp?FID=<% = intForumID %><% = strQsSID2 %>"><img src="<% = strImagePath %>yes.png" border="0" title="Make this a Sub Forum" /></a> </td>
      <td width="6%" align="center" class="tableRow"><%

		            	'If the forum is locked and the user is admin let them unlock it
				If blnForumLocked = True Then
				  	Response.Write ("	<a href=""admin_lock_forum.asp?mode=UnLock&FID=" & intForumID & strQsSID2 & """ OnClick=""return confirm('Are you sure you want to Un-Lock this Forum?')""><img src=""" & strImagePath & "locked.png"" border=""0"" align=""baseline"" title=""Un-Lock Forum""></a>")
				'If the forum is not lovked and this is the admin then let them lock it
				ElseIf blnForumLocked = False Then
				  	Response.Write ("	<a href=""admin_lock_forum.asp?mode=Lock&FID=" & intForumID & strQsSID2 & """ OnClick=""return confirm('Are you sure you want to Lock this Forum?')""><img src=""" & strImagePath & "unlocked.png"" border=""0"" align=""baseline"" title=""Lock Forum""></a>")
				End If

               %>
      </td>
      <td width="6%" align="center" class="tableRow"><a href="admin_delete_forum.asp?FID=<% = intForumID %><% = strQsSID2 %>" onclick="return confirm('Are you sure you want to Delete this Forum?\n\nWARNING: Deleting this forum will permanently  remove all Posts in this Forum!')"><img src="<% = strImagePath %>delete.png" border="0" title="Delete Forum" /></a></td>
      <td width="5%" class="tableRow"  align="center"><select name="forumOrder<% = intForumID %>">
          <%

			    	'loop round to display the number of forums for the order select list
			 	For intLoop = 1 to intNumOfForums
			
					Response.Write("<option value=""" & intLoop & """ ")
			
						'If the loop number is the same as the order number make this one selected
						If intForumOrder = intLoop Then
							Response.Write("selected")
						End If
			
					Response.Write(">" & intLoop & "</option>")
			   	Next
           %>
        </select>
      </td>
    </tr>
    <%					
				
				'See if there are any subforums to this forum
				'*********************************************
				
				'Intilise record 2
				intCurrentRecord2 = 0
				
				'Loop round to read in any sub forums in the stored array recordset
				Do While NOT intCurrentRecord2 > Ubound(sarryForums,2)
				
					'If this is a subforum of the main forum show it
					If CInt(sarryForums(1,intCurrentRecord2)) = intForumID Then
						
						'Read in forum details from the database
						intSubForumID = CInt(sarryForums(0,intCurrentRecord2))
						strForumName = sarryForums(2,intCurrentRecord2)
						strForumDiscription = sarryForums(3,intCurrentRecord2)
						intForumOrder = CInt(sarryForums(4,intCurrentRecord2))
						blnForumLocked = CBool(sarryForums(5,intCurrentRecord2))

						'Write the HTML of the forum descriptions and hyperlinks to the forums
				
				%>
    <tr>
      <td class="tableRow">&nbsp;&nbsp;<img src="<% = strImagePath %>arrow.gif" />&nbsp;<a href="admin_forum_details.asp?mode=edit&amp;sub=true&amp;FID=<% = intSubForumID %><% = strQsSID2 %>"><% = strForumName %></a> <br />
        &nbsp;&nbsp;&nbsp;&nbsp;<span class="smText"><% = strForumDiscription %></span></td>
      <td align="center" class="tableRow"><a href="admin_remove_sub_forum.asp?FID=<% = intSubForumID %><% = strQsSID2 %>" onclick="return confirm('Are you sure you want to change this Sub Forum into a Main Forum?')"><img src="<% = strImagePath %>no.png" border="0" title="Change to Main Forum" /></a></td>
      <td width="6%" align="center" class="tableRow"><%

				            	'If the forum is locked and the user is admin let them unlock it
						If blnForumLocked = True Then
						  	Response.Write ("	<a href=""admin_lock_forum.asp?mode=UnLock&FID=" & intSubForumID & strQsSID2 & """ OnClick=""return confirm('Are you sure you want to Un-Lock this Forum?')""><img src=""" & strImagePath & "locked.png"" border=""0"" align=""baseline"" title=""Un-Lock Forum""></a>")
						'If the forum is not lovked and this is the admin then let them lock it
						ElseIf blnForumLocked = False Then
						  	Response.Write ("	<a href=""admin_lock_forum.asp?mode=Lock&FID=" & intSubForumID & strQsSID2 & """ OnClick=""return confirm('Are you sure you want to Lock this Forum?')""><img src=""" & strImagePath & "unlocked.png"" border=""0"" align=""baseline"" title=""Lock Forum""></a>")
						End If

               %>
      </td>
      <td width="6%" align="center" class="tableRow"><a href="admin_delete_forum.asp?FID=<% = intSubForumID %><% = strQsSID2 %>" onclick="return confirm('Are you sure you want to Delete this Forum?\n\nWARNING: Deleting this forum will permanently  remove all Posts in this Forum!')"><img src="<% = strImagePath %>delete.png" border="0" title="Delete Sub Forum" /></a></td>
      <td width="5%" class="tableRow"  align="center"><select name="forumOrder<% = intSubForumID %>">
          <%

					    	'loop round to display the number of forums for the order select list
					 	For intLoop = 1 to intNumOfForums
					
							Response.Write("<option value=""" & intLoop & """ ")
					
								'If the loop number is the same as the order number make this one selected
								If intForumOrder = intLoop Then
									Response.Write("selected")
								End If
					
							Response.Write(">" & intLoop & "</option>")
					   	Next
           %>
        </select>
      </td>
    </tr>
    <%		
						
					End If
					
				
					'Move to next record
					intCurrentRecord2 = intCurrentRecord2 + 1
				Loop
				
				
				'Move to next record
				intCurrentRecord = intCurrentRecord + 1
			
			'Loop back round for next forum
			Loop
		End If
		
		'Move to the next database record
		intCatCurrentRecord = intCatCurrentRecord + 1
		
		%>
  </table>
  <br />
  <%
		
	'Loop back round for next category
	Loop
	
	'Clean up
	Set rsCommon = Nothing
End If

'Clean up
Call closeDatabase()
%>
  <table width="98%" border="0" cellspacing="0" cellpadding="3" align="center">
    <tr align="right">
      <td width="100%"><input type="submit" name="Submit" value="Update Order"<% If blnDemoMode Then Response.Write(" disabled=""disabled""") %> /></td>
    </tr>
  </table>
  <br />
</form>
<table border="0" align="center" cellpadding="4" cellspacing="1" class="tableBorder">
  <tr>
    <td colspan="2" class="tableLedger">Create Options </td>
  </tr>
  <tr class="tableRow">
    <td colspan="2" align="center" class="text">Use the buttons below to create new, Categories, Forums, or Sub Forums <br />
      <table width="100%" border="0" cellspacing="0" cellpadding="1" align="center">
        <tr align="center">
          <td><form action="admin_category_details.asp?mode=new<% = strQsSID2 %>" method="post" name="form2" id="form2">
              <input type="submit" name="Submit2" value="Create New Category" />
            </form></td>
          <td><form action="admin_forum_details.asp?mode=new<% = strQsSID2 %>" method="post" name="form3" id="form3">
              <input type="submit" name="Submit2" value="Create New Forum" />
            </form></td>
          <td><form action="admin_forum_details.asp?mode=new&amp;sub=true<% = strQsSID2 %>" method="post" name="form3" id="form3">
              <input type="submit" name="Submit2" value="Create New Sub Forum" />
            </form></td>
        </tr>
      </table></td>
  </tr>
</table>
<br />
<!-- #include file="includes/admin_footer_inc.asp" -->

⌨️ 快捷键说明

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