📄 default.asp
字号:
<%
'#################################################################################
'## Snitz Forums 2000 v3.4.05
'#################################################################################
'## Copyright (C) 2000-05 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from our support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## manderson@snitz.com
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<!--#INCLUDE FILE="inc_moderation.asp" -->
<!--#INCLUDE FILE="inc_subscription.asp" -->
<%
Dim UnapprovedFound, UnModeratedPosts
if Request.QueryString("CAT_ID") <> "" and IsNumeric(Request.QueryString("CAT_ID")) = True then
Cat_ID = cLng(Request.QueryString("CAT_ID"))
end if
scriptname = request.servervariables("script_name")
if strAutoLogon = 1 then
if (ChkAccountReg() <> "1") then
Response.Redirect("register.asp?mode=DoIt")
end if
end if
if IsEmpty(Session(strCookieURL & "last_here_date")) then
Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName)
end if
if strModeration = "1" and mLev > 2 then
UnModeratedPosts = CheckForUnmoderatedPosts("BOARD", 0, 0, 0)
end if
' -- Get all the high level(board, category, forum) subscriptions being held by the user
Dim strSubString, strSubArray, strBoardSubs, strCatSubs, strForumSubs
if MySubCount > 0 then
strSubString = PullSubscriptions(0,0,0)
strSubArray = Split(strSubString,";")
if uBound(strSubArray) < 0 then
strBoardSubs = ""
strCatSubs = ""
strForumSubs = ""
else
strBoardSubs = strSubArray(0)
strCatSubs = strSubArray(1)
strForumSubs = strSubArray(2)
end if
end If
if strShowStatistics <> "1" then
'## Forum_SQL
strSql = "SELECT P_COUNT, T_COUNT, U_COUNT " &_
" FROM " & strTablePrefix & "TOTALS"
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.open strSql, my_Conn
Users = rs1("U_COUNT")
Topics = rs1("T_COUNT")
Posts = rs1("P_COUNT")
rs1.Close
set rs1 = nothing
end if
if (strShowModerators = "1") or (mlev = 4 or mlev = 3) then
'## Forum_SQL
strSql = "SELECT MO.FORUM_ID, ME.MEMBER_ID, ME.M_NAME " & _
" FROM " & strTablePrefix & "MODERATOR MO" & _
" , " & strMemberTablePrefix & "MEMBERS ME" & _
" WHERE (MO.MEMBER_ID = ME.MEMBER_ID )" & _
" ORDER BY MO.FORUM_ID, ME.M_NAME"
Set rsChk = Server.CreateObject("ADODB.Recordset")
rsChk.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rsChk.EOF then
recModeratorCount = ""
else
allModeratorData = rsChk.GetRows(adGetRowsRest)
recModeratorCount = UBound(allModeratorData,2)
end if
rsChk.close
set rsChk = nothing
if recModeratorCount = "" then
fMods = " "
else
mFORUM_ID = 0
mMEMBER_ID = 1
mM_NAME = 2
for iModerator = 0 to recModeratorCount
ModForumID = allModeratorData(mFORUM_ID, iModerator)
ModMemID = allModeratorData(mMEMBER_ID, iModerator)
ModMemName = replace(allModeratorData(mM_NAME, iModerator),"|","|")
if iModerator = 0 then
strForumMods = ModForumID & "," & ModMemID & "," & ModMemName
else
strForumMods = strForumMods & "|" & ModForumID & "," & ModMemID & "," & ModMemName
end if
next
end if
end if
'## Forum_SQL - Get all Categories from the DB
strSql = "SELECT CAT_ID, CAT_STATUS, CAT_NAME, CAT_ORDER, CAT_SUBSCRIPTION, CAT_MODERATION " &_
" FROM " & strTablePrefix & "CATEGORY "
'############################## Group Cat MoD #####################################
if Cat_ID <> "" then
strSql = strSql & " WHERE CAT_ID = " & Cat_ID
else
if Group > 1 and strGroupCategories = "1" then
strSql = strSql & " WHERE CAT_ID = 0"
if recGroupCatCount <> "" then
for iGroupCat = 0 to recGroupCatCount
strSql = strSql & " or CAT_ID = " & allGroupCatData(1, iGroupCat)
next
end if
end if
end if
'############################## Group Cat MoD #####################################
strSql = strSql & " ORDER BY CAT_ORDER ASC, CAT_NAME ASC;"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rs.EOF then
if Cat_ID <> "" then response.redirect("default.asp")
recCategoryCount = ""
else
allCategoryData = rs.GetRows(adGetRowsRest)
recCategoryCount = UBound(allCategoryData,2)
end if
rs.close
set rs = nothing
if mlev = 3 then
strSql = "SELECT FORUM_ID FROM " & strTablePrefix & "MODERATOR " & _
" WHERE MEMBER_ID = " & MemberID
Set rsMod = Server.CreateObject("ADODB.Recordset")
rsMod.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rsMod.EOF then
recModCount = ""
else
allModData = rsMod.GetRows(adGetRowsRest)
recModCount = UBound(allModData,2)
end if
RsMod.close
set RsMod = nothing
if recModCount <> "" then
for x = 0 to recModCount
if x = 0 then
ModOfForums = allModData(0,x)
else
ModOfForums = ModOfForums & "," & allModData(0,x)
end if
next
else
ModOfForums = ""
end if
else
ModOfForums = ""
end if
'## Forum_SQL - Build SQL to get forums via category
strSql = "SELECT F.FORUM_ID, F.F_STATUS, F.CAT_ID, F.F_SUBJECT, F.F_URL, F.F_TOPICS, " &_
"F.F_COUNT, F.F_LAST_POST, F.F_LAST_POST_TOPIC_ID, F.F_LAST_POST_REPLY_ID, F.F_TYPE, " & _
"F.F_ORDER, F.F_A_COUNT, F.F_SUBSCRIPTION, F_PRIVATEFORUMS, F_PASSWORD_NEW, " & _
"M.MEMBER_ID, M.M_NAME, " & _
"T.T_REPLIES, T.T_UREPLIES, " & _
"F.F_DESCRIPTION " & _
"FROM ((" & strTablePrefix & "FORUM F " &_
"LEFT JOIN " & strMemberTablePrefix & "MEMBERS M ON " &_
"F.F_LAST_POST_AUTHOR = M.MEMBER_ID) " & _
"LEFT JOIN " & strTablePrefix & "TOPICS T ON " & _
"F.F_LAST_POST_TOPIC_ID = T.TOPIC_ID) "
'############################## Group Cat MoD #####################################
if Cat_ID <> "" then
strSql = strSql & " WHERE F.CAT_ID = " & Cat_ID
else
if Group > 1 and strGroupCategories = "1" then
strSql = strSql & " WHERE F.CAT_ID = 0"
if recGroupCatCount <> "" then
for iGroupCat = 0 to recGroupCatCount
strSql = strSql & " OR F.CAT_ID = " & allGroupCatData(1, iGroupCat)
next
end if
end if
end if
'############################## Group Cat MoD #####################################
strSql = strSql & " ORDER BY F.F_ORDER ASC, F.F_SUBJECT ASC;"
set rsForum = Server.CreateObject("ADODB.Recordset")
rsForum.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rsForum.EOF then
recForumCount = ""
else
allForumData = rsForum.GetRows(adGetRowsRest)
recForumCount = UBound(allForumData,2)
end if
rsForum.close
set rsForum = nothing
if Cat_ID <> "" then
Cat_Name = allCategoryData(2,0)
Response.Write " <script language=""javascript"" type=""text/javascript"">" & vbNewLine & _
" document.title='" & chkString(Cat_Name,"pagetitle") & " - " & chkString(strForumTitle,"pagetitle") & "';" & vbNewLine & _
" </script>" & vbNewLine
end if
Response.Write " <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewline & _
" <tr>" & vbNewline & _
" <td>"
' If Whole Board Subscription is allowed, check for a subscription by this user.
if strSubscription = 1 and strEmail = 1 and strDBNTUserName <> "" then
Response.Write vbNewLine
Response.Write " <table width=""100%"" border=""0"">" & vbNewline
Response.Write " <tr>" & vbNewLine
Response.Write " <td align=""right"">"
If strBoardSubs = "Y" then
Response.Write ShowSubLink ("U", 0, 0, 0, "Y")
Else
Response.Write ShowSubLink ("S", 0, 0, 0, "Y")
End If
Response.Write "</td>" & vbNewLine
Response.Write " </tr>" & vbNewline
Response.Write " </table>" & vbNewline
Response.Write " </td>" & vbNewline
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -