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

📄 forum.asp

📁 代码名称: Snitz Forums 2000 代码语言: 英文 代码类型: 国外代码 运行环境: ASP 授权方式: 免费代码 代码大小: 530kb 代码等级: 3 整
💻 ASP
📖 第 1 页 / 共 4 页
字号:
<%
'#################################################################################
'## 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"-->
<%
Dim ArchiveView
Dim HeldFound, UnApprovedFound, UnModeratedPosts, UnModeratedFPosts
Dim HasHigherSub
HasHigherSub = false
'#################################################################################

if (Request("FORUM_ID") = "" or IsNumeric(Request("FORUM_ID")) = False) and (Request.Form("Method_Type") <> "login") and (Request.Form("Method_Type") <> "logout") then
	Response.Redirect "default.asp"
else
	Forum_ID = cLng(Request("FORUM_ID"))
end if 

'-------------------------------------------
' FORUM SORTING MOD VARIABLES
'-------------------------------------------

' Code Mod for mypage variable
dim mypage : mypage = request("whichpage")
if ((Trim(mypage) = "") or IsNumeric(mypage) = False) then mypage = 1
mypage = cLng(mypage)

' Topic Sorting Variables
dim strtopicsortord :strtopicsortord = request("sortorder")
dim strtopicsortfld :strtopicsortfld = request("sortfield")
dim strtopicsortday :strtopicsortday = request("days")
dim inttotaltopics : inttotaltopics = 0
dim strSortCol, strSortOrd

Select Case strtopicsortord
	Case "asc"
		strSortOrd = " ASC"
	Case Else
		strSortOrd = " DESC"
End Select

Select Case strtopicsortfld
	Case "topic"
		strSortCol = "T_SUBJECT" & strSortOrd
	Case "author"
		strSortCol = "M_NAME" & strSortOrd
	Case "replies"
		strSortCol = "T_REPLIES" & strSortOrd
	Case "views"
		strSortCol = "T_VIEW_COUNT" & strSortOrd
	Case "lastpost"
		strSortCol = "T_LAST_POST" & strSortOrd
	Case Else
		strtopicsortfld = "lastpost"
		strSortCol = "T_LAST_POST" & strSortOrd
End Select
strQStopicsort = "FORUM_ID=" & Forum_ID
'-------------------------------------------
if request("ARCHIVE") = "true" then
	strActivePrefix = strTablePrefix & "A_"
	ArchiveView = "true"
	ArchiveLink = "ARCHIVE=true&"
elseif request("ARCHIVE") <> "" then
	Response.Redirect "default.asp"
	Response.End
else
	strActivePrefix = strTablePrefix
	ArchiveView = ""
	ArchiveLink = ""
end if
%>
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_func_chknew.asp" -->
<!--#INCLUDE FILE="inc_subscription.asp" -->
<!--#INCLUDE FILE="inc_moderation.asp" -->
<%

nDays = Request.Cookies(strCookieURL & "NumDays")

if Request.form("cookie") = 1 then
	if strSetCookieToForum = "1" then
		Response.Cookies(strCookieURL & "NumDays").Path = strCookieURL
	end if
	Response.Cookies(strCookieURL & "NumDays") = Request.Form("days")
	Response.Cookies(strCookieURL & "NumDays").expires = dateAdd("yyyy", 1, strForumTimeAdjust)
	nDays = Request.Form("Days")
	mypage = 1
end if

if request("ARCHIVE") = "true" then
	nDays = "0"
end if

Response.Write	"    <script language=""JavaScript"" type=""text/javascript"">" & vbNewLine & _
		"    function ChangePage(fnum){" & vbNewLine & _
		"    	if (fnum == 1) {" & vbNewLine & _
		"    		document.PageNum1.submit();" & vbNewLine & _
		"    		}" & vbNewLine & _
		"    	else {" & vbNewLine & _
		"    		document.PageNum2.submit();" & vbNewLine & _
		"    	}" & vbNewLine & _
		"    }" & vbNewLine & _
		"    </script>" & vbNewLine


if mLev = 4 then
	AdminAllowed = 1
	ForumChkSkipAllowed = 1
elseif mLev = 3 then
	if chkForumModerator(Forum_ID, chkString(strDBNTUserName,"decode")) = "1" then
	 	AdminAllowed = 1
		ForumChkSkipAllowed = 1
	else   
		if lcase(strNoCookies) = "1" then
	 		AdminAllowed = 1
			ForumChkSkipAllowed = 0
		else
			AdminAllowed = 0
			ForumChkSkipAllowed = 0
		end if
	end if
elseif lcase(strNoCookies) = "1" then
	AdminAllowed = 1
	ForumChkSkipAllowed = 0
else
	AdminAllowed = 0
	ForumChkSkipAllowed = 0
end if

if strPrivateForums = "1" and (Request.Form("Method_Type") <> "login") and (Request.Form("Method_Type") <> "logout") and ForumChkSkipAllowed = 0 then
	result = ChkForumAccess(Forum_ID, MemberID, true)
end if

if strModeration = "1" and AdminAllowed = 1 then
	UnModeratedPosts = CheckForUnModeratedPosts("FORUM", Cat_ID, Forum_ID, 0)
end if

' -- Get all the high level(board, category, forum) subscriptions being held by the user
Dim strSubString, strSubArray, strBoardSubs, strCatSubs, strForumSubs, strTopicSubs
if MySubCount > 0 then
	strSubString = PullSubscriptions(0, 0, 0)
	strSubArray  = Split(strSubString,";")
	if uBound(strSubArray) < 0 then
		strBoardSubs = ""
		strCatSubs = ""
		strForumSubs = ""
		strTopicSubs = ""
	else
		strBoardSubs = strSubArray(0)
		strCatSubs = strSubArray(1)
		strForumSubs = strSubArray(2)
		strTopicSubs = strSubArray(3)
	end if
end if

'## Forum_SQL - Find out the Category/Forum status and if it Exists
strSql = "SELECT C.CAT_STATUS, C.CAT_SUBSCRIPTION, " & _ 
	 "C.CAT_MODERATION, C.CAT_NAME, C.CAT_ID, " & _
	 "F.F_STATUS, F.F_SUBSCRIPTION, " & _ 
	 "F.F_MODERATION, F_DEFAULTDAYS, F.F_SUBJECT " & _
	 " FROM " & strTablePrefix & "CATEGORY C, " & _
	 strTablePrefix & "FORUM F " & _
	 " WHERE F.FORUM_ID = " & Forum_ID & _ 
	 " AND C.CAT_ID = F.CAT_ID " & _
	 " AND F.F_TYPE = 0"

set rsCFStatus = my_Conn.Execute (StrSql)

if rsCFStatus.EOF or rsCFStatus.BOF then
	rsCFStatus.close
	set rsCFStatus = nothing
	Response.Redirect("default.asp")
else
	Cat_ID = rsCFStatus("CAT_ID")
	Cat_Name = rsCFStatus("CAT_NAME")
	Cat_Status = rsCFStatus("CAT_STATUS")
	Cat_Subscription = rsCFStatus("CAT_SUBSCRIPTION")
	Cat_Moderation = rsCFStatus("CAT_MODERATION")
	Forum_Status = rsCFStatus("F_STATUS")
	Forum_Subject = rsCFStatus("F_SUBJECT")
	Forum_Subscription = rsCFStatus("F_SUBSCRIPTION")
	Forum_Moderation = rsCFStatus("F_MODERATION")
	if nDays = "" then
		nDays = rsCFStatus("F_DEFAULTDAYS")
	end if
	rsCFStatus.close
	set rsCFStatus = nothing
end if

if strModeration = 1 and Cat_Moderation = 1 and (Forum_Moderation = 1 or Forum_Moderation = 2) then
	Moderation = "Y"
end if
' DEM --> End of Code added for Moderation

⌨️ 快捷键说明

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