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

📄 displaycategory.asp

📁 简介:一个程序小巧而功能强大
💻 ASP
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--#include file="Includes/site-dataconn.asp" -->
<!--#include file="Includes/func-common.asp" -->
<!--#include file="Includes/site-config.asp" -->
<!--#include file="Includes/inc-common.asp" -->
<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<html>

<head>
<title>// <%=Site_Name%> //</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK REL=stylesheet TYPE="text/css" HREF="Includes/site-style.css">
</head>

<body>
<!--#include file="Includes/inc-header.asp" -->
<%
if isnumeric(request.querystring("C")) <> true then
	strHeader = "Error"	
	strMessage = "The Category that you have selected does not exist. If you have followed a valid link please contact the board administrator. Click <a href=""default.asp"">here</a> if you are not redirected within 5 seconds."
	strRedirectURL = "default.asp"
else
	'Retrieve thespecified category and the forums that it contains.
	set rsCategories = server.createobject("adodb.recordset")
	sqlCategories = "SELECT FC.Category_ID, FC.Category_Title, FF.Forum_ID, FF.Forum_Name, FF.Forum_Description, FF.Forum_Posts, FF.Forum_Topics, FF.Forum_Topic_ID, FF.Forum_Post_Date, FF.Forum_User_ID, FF.Forum_User_Name, FF.Forum_Order FROM Forum_Categories FC LEFT OUTER JOIN Forum_Forums FF ON FC.Category_ID = FF.Forum_Category_ID WHERE FC.Category_ID = "& int(request.querystring("C")) &" ORDER BY FC.Category_Order ASC, FF.Forum_Order ASC, FF.Forum_Name ASC;"				
	rsCategories.Open sqlcategories, adoConn, CMDText
	
	'If the Recordset is not emtpy then load it up into a getrows set and close and destroy the recordset.	
	if rsCategories.eof or rsCategories.bof then
		CaegoryCnt = 0
	else
		CategoryCnt = rsCategories.recordCount
		CategoryData = rsCategories.GetRows()
	end if
	rsCategories.close
	set rsCategories = nothing
	
	if CategoryCnt = 0 then
		strHeader = "Error"
		strMessage = "The Category that you have selected does not exist. If you have followed a valid link please contact the board administrator. Click <a href=""default.asp"">here</a> if you are not redirected within 5 seconds."
		strRedirectURL = "default.asp"
	end if
end if

if strMessage <> "" then
%>
	<table border="0" cellspacing="1" cellpadding="2" align="center" class="main">
		<tr valign="middle" class="title">
		<td align="center"><%=Site_Name%> // <%=strHeader%></td>
		</tr>
		<tr valign="top" class="body">
		<td align="center"><%=strMessage%></td>
		</tr>
	</table>
	<META HTTP-EQUIV="Refresh" CONTENT="5; URL=<%=strRedirectURL%>">
<%
else
	'Display Navigation trail
	response.write("<table border='0' cellspacing='0' cellpadding='2' align='center' class='plain'><tr><td>")
	response.write("<a href='default.asp'>"& Site_Name &"</a><br>"& Site_Description &"</td></tr></table>")

	tempCnt = 0
	tempCategory = ""

	'Build category header
	response.write("<table width='100%' border='0' cellspacing='1' cellpadding='3' align='center' class='main'><tr align='left' valign='middle' class='title'><td colspan='5'><a href='displaycategory.asp?C="& CategoryData(0, tempCnt) &"'>"& CategoryData(1, tempCnt) &"</a></td></tr>")
	response.write("<tr align='left' class='sub-title'><td width='20'></td><td width='60%'>论坛</td><td align='center'width='15%'>话题数</td><td align='center' width='15%'>总帖数</td><td align='center' width='20%'>最后回复</td></tr>")

	do until tempCnt = CategoryCnt  
		'If there aren't any forums for this category display message
		if  isnull(CategoryData(2, tempCnt)) = true then
			response.write("<tr align='left' valign='middle' class='body'><td colspan='5' valign='top'>There are no forums configured for this category.</td></tr>")
		else
			'Display forums for the current category
			response.write("<tr align='left' class='body'><td width='20' valign='top'>")
			'Check if the user is logged in and display the appropriate icon.
			if session("userid") <> "" and CategoryData(8,tempCnt) <> "" then
				'New posts
				if session("laston") < CategoryData(8,tempCnt) then
					response.write("<img src='Images/Icons/folder_replies.gif' align='absmiddle' alt='>> New Posts'>")
				else
					'No new posts
					response.write("<img src='Images/Icons/folder_noreplies.gif' align='absmiddle' alt='>> No New Posts'>")
				end if
			else
				'User not logged in, display no new posts icon
				response.write("<img src='Images/Icons/folder_noreplies.gif' align='absmiddle' alt='>> No New Posts'>")
			end if
			response.write("</td><td valign='middle'><a href='displayforum.asp?F="& CategoryData(2,tempCnt) &"'>"& CategoryData(3,tempCnt) &"</a><br>")
			if CategoryData(4,tempCnt) <> "" then
				response.write("&nbsp;&nbsp;"& CategoryData(4,tempCnt))
			end if
			
			response.write("</td><td align='center' valign='middle'>"& CategoryData(5,tempCnt) &"</td><td align='center' valign='middle'>"& CategoryData(6,tempCnt) &"</td>")		
			if isnull(CategoryData(7,tempCnt)) = false then
				response.write("<td align='right' valign='middle' nowrap>"& web_time(CategoryData(8,tempCnt), Site_Time_Format, "long") & "<br>by: "& CategoryData(10,tempCnt) &" [<a href='displaytopic.asp?T="& CategoryData(7,tempCnt) &"&goto=lastpost#last'>view</a>]")
			else
				response.write("<td align='center' valign='middle' nowrap>-")
			end if
			response.write("</td></tr>")
		end if
		tempCnt = tempCnt + 1
	loop
	response.write("</table>")
	
	if Site_View_Online = 1 then
		'Grab the user names and ID's of all members currently connected
		set rsUserStats = server.createobject("adodb.recordset")
		sqlUserStats = "SELECT User_ID, User_Name, User_Online_View, User_Laston_Date FROM Forum_Users WHERE User_Laston_Date >= '"& search_time(-10) &"' ORDER BY User_Laston_Date DESC;"
		rsUserStats.open sqlUserStats, adoConn, CMDText
		if not rsUserStats.eof then
			UserStatCnt = rsUserStats.recordCount
			UserStatData = rsUserStats.GetRows()
		else
			UserStatCnt = 0
		end if
		rsUserStats.close
		set rsUserStats = nothing
		'Check if we've broken the online max count and update if necassary
		if (UserStatCnt) > OnlineMax then
			set rsUpdateStats = server.createobject("adodb.recordset")
			sqlUpdateStats = "SELECT Stats_Online_Max FROM Forum_Stats;"
			rsUpdateStats.cursortype = 2
			rsUpdateStats.locktype = 3
			rsUpdateStats.open sqlUpdateStats, adoConn, CMDText
			rsUpdateStats("Stats_Online_Max") = UserStatCnt
			rsUpdateStats.update
			rsUpdateStats.close
			set rsUpdateStats = nothing
			
			'Update Current online maximum count
			OnlineMax = UserStatCnt
		end if
		'Display currently active users.
		response.write("<table width='100%' border='0' cellspacing='1' cellpadding='3' align='center' class='main'><tr class='title'><td align='left'>在线统计: "& UserStatCnt &" |最高峰同时在线人数: "& OnlineMax &"</td>")
		response.write("</tr><tr class='body'><td align='left'>在线名单:")
		
		'List all online users that have selected to be listed
		tempCnt = 0
		do until tempCnt = UserStatCnt
			if UserStatData(2, tempCnt) <> 0 then
				if UserStatData(0, tempCnt) = session("UserID") then
					response.write("<b>" & UserStatData(1, tempCnt) & "</b>")
				else
					response.write("<a href='profile.asp?I=" & UserStatData(0, tempCnt) & "'>" & UserStatData(1, tempCnt) & "</a>")
				end if
				if tempCnt + 1 < UserStatCnt then
					response.write(", ")
				end if
			end if
			tempCnt = tempCnt + 1
		loop
		response.write("</td></tr></table>")
	end if
end if
%>
<!--#include file="Includes/inc-footer.asp" -->
</body>
</html>

⌨️ 快捷键说明

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