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

📄 forum.asp

📁 一个不错的ASP论坛源码
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<%
'########## Snitz Forums 2000 Version 3.1 SR4 ####################
'#                                                               #
'#  汉化修改: 资源搜罗站                                         #
'#  电子邮件: cgier@21cn.com                                     #
'#  主页地址: http://www.sdsea.com                               #
'#            http://www.99ss.net                                #
'#            http://www.cdown.net                               #
'#	     http://www.wzdown.com                               #
'#	     http://www.13888.net                                #
'#  论坛地址:http://ubb.yesky.net                                #
'#  最后修改日期: 2001/03/12    中文版本:Version 3.1 SR4        #
'#################################################################
'# 原始来源                                                      #
'# Snitz Forums 2000 Version 3.1 SR4                             #
'# Copyright 2000 http://forum.snitz.com - All Rights Reserved   #
'#################################################################
'#【版权声明】                                                   #
'#                                                               #
'# 本软体为共享软体(shareware)提供个人网站免费使用,请勿非法修改,#
'# 转载,散播,或用于其他图利行为,并请勿删除版权声明。          #
'# 如果您的网站正式起用了这个脚本,请您通知我们,以便我们能够知晓#
'# 如果可能,请在您的网站做上我们的链接,希望能给予合作。谢谢!  #
'#################################################################
'# 请您尊重我们的劳动和版权,不要删除以上的版权声明部分,谢谢合作#
'# 如有任何问题请到我们的论坛告诉我们                            #
'#################################################################

if Request.QueryString("FORUM_ID") = "" and (Request.Form("Method_Type") <> "login") and (Request.Form("Method_Type") <> "logout") then
	Response.Redirect "default.asp"
end if 
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<%
mypage = request("whichpage")

if mypage = "" then
	mypage = 1
end if
'############################################
sortorder = request.Form("newsort")
SortImg = request.Form("sortimg")
if sortorder <> "" then
   mypage = 1
else
   sortorder = request.Form("sort")
end if
'############################################
nDays = Request.Cookies(strCookieURL & "NumDays")
OlderThan = Request.Cookies(strCookieURL & "OlderThan") 'HuwR

if Request.form("cookie") = 1 then

	if strSetCookieToForum = "1" then
		Response.Cookies(strCookieURL & "NumDays").Path = strCookieURL
		Response.Cookies(strCookieURL & "OlderThan").Path = strCookieURL
	end if
	Response.Cookies(strCookieURL & "NumDays") = Request.Form("days")
	Response.Cookies(strCookieURL & "NumDays").expires = strForumTimeAdjust + 365
	Response.Cookies(strCookieURL & "OlderThan") = Request.Form("OlderThan")
	Response.Cookies(strCookieURL & "OlderThan").expires = strForumTimeAdjust + 365
	OlderThan = Request.Form("OlderThan")
	nDays = Request.Form("Days")
	mypage = 1
end if

if nDays = "" then
	nDays = 30
end if

defDate = DateToStr(dateadd("d", -(nDays), StrToDate(strForumTimeAdjust)))

if (strAuthType = "nt") then
	set my_Conn = Server.CreateObject("ADODB.Connection")
	my_Conn.Open strConnString
	call NTauthenticate()
	if (ChkAccountReg() = "1") then
		call NTUser()
	end if
end if

'if strPrivateForums = "1" then
'	if Request("Method_Type") = "" and (mLev <> 4) then
'		chkUser4()
'	end if
'end if
%>
<!--#INCLUDE FILE="inc_top.asp" -->
<%
'###############################################
	Dim objConn, strConn, CheckInTime, SQL, User, Timedout, Date
	Dim objRS, strSQL, houron, minon, Datec
	Dim OnlineLocation
	OnlineLocation = "<a href=forum.asp?" & Request.QueryString & ">" & Request.QueryString("Forum_Title") & "</a>"
	if Request.cookies("User")("Name") = "" then
		User = Request.ServerVariables("REMOTE_ADDR") & "Guest"
	else
		User = Request.cookies("User")("Name")
	end if
	Date = DateToStr(strForumTimeAdjust)
	CheckInTime = DateDiff( "s", CDate("01/01/1970"), Now)
	strSql = "SELECT " & strTablePrefix & "ONLINE.UserID "
	strSql = strSql & " FROM " & strTablePrefix & "ONLINE "
	strSql = strSql & " WHERE " & strTablePrefix & "ONLINE.UserID = '" & user & "'"
	set rsWho = my_Conn.Execute (strSql)
	Set objConn = Server.CreateObject("ADODB.Connection")
	objConn.ConnectionString = strConnString
	objConn.Open
	SQL = "UPDATE FORUM_ONLINE SET M_BROWSE = '" & OnlineLocation & "' , DateCreated = '" & Date & "' WHERE UserID = '" & User & "'"
	objConn.Execute SQL
	TimedOut = CheckInTime - 360 'time out the user
	SQL = "DELETE FROM FORUM_ONLINE WHERE CheckedIn < '" & TimedOut & "'"
	objConn.Execute SQL
'###############################################
if strPrivateForums = "1" then
	if Request("Method_Type") = "" and (mLev <> 4) then
		chkUser4()
	end if
end if


if (mLev = 4) or (chkForumModerator(Request.QueryString("FORUM_ID"), STRdbntUserName)= "1") or (lcase(strNoCookies) = "1") then
 	AdminAllowed = 1
else   
 	AdminAllowed = 0
end if

'## Forum_SQL - Find out if the Category is Locked or Un-Locked and if it Exists
strSql = "SELECT " & strTablePrefix & "CATEGORY.CAT_STATUS " 
strSql = strSql & " FROM " & strTablePrefix & "CATEGORY "
strSql = strSql & " WHERE " & strTablePrefix & "CATEGORY.CAT_ID = " & Request.QueryString("CAT_ID")

set rsCStatus = my_Conn.Execute (StrSql)

'## Forum_SQL - Find out if the Topic is Locked or Un-Locked and if it Exists
strSql = "SELECT " & strTablePrefix & "FORUM.F_STATUS,  " & strTablePrefix & "FORUM.F_PRIVATEFORUMS  "
strSql = strSql & " FROM " & strTablePrefix & "FORUM "
strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & Request.QueryString("FORUM_ID")

set rsFStatus = my_Conn.Execute (StrSql)
strPrivateForums =rsFStatus("F_PRIVATEFORUMS")
'## Forum_SQL - Get all topics from DB
strSql ="SELECT " & strTablePrefix & "TOPICS.T_STATUS, " & strTablePrefix & "TOPICS.CAT_ID, " 
strSql = strSql & strTablePrefix & "TOPICS.FORUM_ID, " & strTablePrefix & "TOPICS.TOPIC_ID, " 
strSql = strSql & strTablePrefix & "TOPICS.T_VIEW_COUNT, " & strTablePrefix & "TOPICS.T_SUBJECT, " 
strSql = strSql & strTablePrefix & "TOPICS.T_MAIL, " & strTablePrefix & "TOPICS.T_AUTHOR, " 
strSql = strSql & strTablePrefix & "TOPICS.T_REPLIES, " & strTablePrefix & "TOPICS.T_LAST_POST, "
strSql = strSql & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR, "  
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_NAME, "
strSql = strSql & strMemberTablePrefix & "MEMBERS_1.M_NAME AS LAST_POST_AUTHOR_NAME "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, "
strSql = strSql & strTablePrefix & "TOPICS, " 
strSql = strSql & strMemberTablePrefix & "MEMBERS AS " & strMemberTablePrefix & "MEMBERS_1 "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "TOPICS.T_AUTHOR "
strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR = "& strMemberTablePrefix & "MEMBERS_1.MEMBER_ID "
strSql = strSql & " AND " & strTablePrefix & "TOPICS.FORUM_ID = " & Request.QueryString("FORUM_ID") & " "
if nDays = "-1" then
	strSql = strSql & " AND   " & strTablePrefix & "TOPICS.T_STATUS <> 0 "
end if
if nDays > "0" then
	if OlderThan = "1" then
		strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_LAST_POST < '" & defDate & "'"
	else
		strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_LAST_POST > '" & defDate & "'"
	end if
end if
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_INPLACE DESC "
'############################################
select case sortorder
	case "1a", "1d"
		strSql = strSql & ",  " & strTablePrefix & "TOPICS.T_SUBJECT"
	case "2a", "2d"
		strSql = strSql & ",  " & strTablePrefix & "TOPICS.T_AUTHOR"
	case "3a", "3d"
		strSql = strSql & ",  " & strTablePrefix & "TOPICS.T_REPLIES"
	case "4a", "4d"
		strSql = strSql & ",  " & strTablePrefix & "TOPICS.T_VIEW_COUNT"
	case "5a", "5d"
		strSql = strSql & ",  " & strTablePrefix & "TOPICS.T_LAST_POST"
	case else
		strSql = strSql & ",  " & strTablePrefix & "TOPICS.T_LAST_POST"
End Select
If InStr(1, sortorder, "a", 1) Then
   strSql = strSql & " ASC"
   SortImg = "" & strImageURL & "icon_sortUP.gif"
Else
   strSql = strSql & " DESC"
   SortImg = "" & strImageURL & "icon_sortDOWN.gif"
End if
'############################################
if strDBType = "mysql" then 'MySql specific code
	if mypage > 1 then 
		intOffset = CInt((mypage-1) * strPageSize)
		strSql = strSql & " LIMIT " & intOffset & ", " & strPageSize & " "
	end if

	'## Forum_SQL - Get the total pagecount 
	strSql2 = "SELECT COUNT(" & strTablePrefix & "TOPICS.TOPIC_ID) AS PAGECOUNT "
	strSql2 = strSql2 & " FROM " & strTablePrefix & "TOPICS " 
	strSql2 = strSql2 & " WHERE   " & strTablePrefix & "TOPICS.TOPIC_ID > 0 " 
	strSql2 = strSql2 & " AND " & strTablePrefix & "TOPICS.FORUM_ID = " & Request.QueryString("FORUM_ID") & " "
	if nDays = "-1" then
		strSql2 = strSql2 & " AND   " & strTablePrefix & "TOPICS.T_STATUS <> 0 "
	end if
	if nDays > "0" then
		if OlderThan = "1" then
			strSql2 = strSql2 & " AND " & strTablePrefix & "TOPICS.T_LAST_POST < '" & defDate & "'"
		else
			strSql2 = strSql2 & " AND " & strTablePrefix & "TOPICS.T_LAST_POST > '" & defDate & "'"
		end if
	end if

	set rsCount = my_Conn.Execute(strSql2)
	if not rsCount.eof then
		maxpages = (rsCount("PAGECOUNT") \ strPageSize )
			if rsCount("PAGECOUNT") mod strPageSize <> 0 then
				maxpages = maxpages + 1
			end if
	else
		maxpages = 0
	end if 

⌨️ 快捷键说明

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