📄 default.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" -->
<%
'Retrieve all categories and the forums that they contain.
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 ORDER BY FC.Category_Order ASC, FF.Forum_Order ASC, FF.Forum_Name ASC;"
rsCategories.Open sqlcategories, adoConn, CMDText
if rsCategories.eof or rsCategories.bof then
CaegoryCnt = 0
else
CategoryCnt = rsCategories.recordCount
CategoryData = rsCategories.GetRows()
end if
rsCategories.close
set rsCategories = nothing
'If we haven't returned any categories and/or forums then they have yet to be configured
if CategoryCnt = 0 then
%>
<table border="0" cellspacing="1" cellpadding="2" align="center" class="main">
<tr valign="middle" class="title">
<td align="center"><%=Site_Name%> // Error</td>
</tr>
<tr valign="top" class="body">
<td align="center">Unfortunately the forums that you are trying to access have not yet been configured, please come back and try again later. We apolagise for the inconvenience.</td>
</tr>
</table>
<%
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 Forums
do until tempCnt = CategoryCnt
'If this is the first time through the loop draw the table header
if tempCnt = 0 then
response.write("<table width='100%' border='0' cellspacing='1' cellpadding='3' align='center' class='main'>")
end if
if (CategoryData(1,tempCnt) <> tempCategory)then
'If this is a new category close the last table and start a new one
tempCategory = CategoryData(1,tempCnt)
if tempCnt <> 0 then
response.write("</table>")
response.write("<table width='100%' border='0' cellspacing='1' cellpadding='3' align='center' class='main'>")
end if
response.write("<tr align='left' class='title'>")
response.write("<td colspan='5'><a href='displaycategory.asp?C="& CategoryData(0, tempCnt) &"'>"& CategoryData(1, tempCnt) &"</a></td>")
if isnull(CategoryData(2, tempCnt)) = true then
response.write("<tr align='left' class='body'><td colspan='5' valign='top'>There are no forums configured for this category.</td></tr>")
else
response.write("</tr><tr align='left' class='sub-title'><td width='20'></td><td width='60%'>论坛</td>")
response.write("<td width='15%' align='center'>总帖数</td><td width='15%' align='center'>话题数</td><td width='20%' align='center'>最后回复</td></tr>")
end if
end if
if isnull(CategoryData(2, tempCnt)) = false then
'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
'Forum title
response.write("</td><td valign='middle'><a href='displayforum.asp?F="& CategoryData(2,tempCnt) &"'>"& CategoryData(3,tempCnt) &"</a>")
if CategoryData(4,tempCnt) <> "" then
'write forum description
response.write("<br> "& 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
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'>")
response.write("<td align='left'>在线统计: "& UserStatCnt &" | 最高峰同时在线人数: "& OnlineMax &"</td>")
response.write("</tr><tr class='body'><td align='left' valign='top'>在线名单: ")
'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 + -