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

📄 topic.asp

📁 代码名称: Snitz Forums 2000 代码语言: 英文 代码类型: 国外代码 运行环境: ASP 授权方式: 免费代码 代码大小: 530kb 代码等级: 3 整
💻 ASP
📖 第 1 页 / 共 5 页
字号:

		LastPostReplyID = cLng(Request.QueryString("REPLY_ID"))

		if iReplyCount <> "" then
			for iReply = 0 to iReplyCount
				intReplyID = arrReplyData(rREPLY_ID,iReply)
				if LastPostReplyID = intReplyID then
					intPageNumber = ((iReply+1)/strPageSize)
					if intPageNumber > cLng(intPageNumber) then
						intPageNumber = cLng(intPageNumber) + 1
					end if
					strwhichpage = "whichpage=" & intPageNumber & "&"
					exit for
				end if
			next
		else
			strwhichpage = ""
		end if

		rsReplies.Close
		set rsReplies = nothing
	else
		set rsReplies = Server.CreateObject("ADODB.Recordset")
		rsReplies.cachesize = strPageSize
		rsReplies.pagesize = strPageSize

		rsReplies.open strSql1 & strSql2 & strSql3 & strSql4, my_Conn, adOpenStatic, adLockReadOnly, adCmdText

		LastPostReplyID = cLng(Request.QueryString("REPLY_ID"))
		rsReplies.Find = "REPLY_ID=" & LastPostReplyID & ""

		if not (rsReplies.EOF or rsReplies.BOF) then
			if rsReplies.absolutepage > 1 then strwhichpage = "whichpage=" & rsReplies.absolutepage & "&"
		else
			strwhichpage = ""
		end if

		rsReplies.Close
		set rsReplies = nothing
	end if

	Response.Redirect("topic.asp?" & strwhichpage & "TOPIC_ID=" & Topic_ID & "&#" & LastPostReplyID & "")
	Response.End
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

if (Moderation = "Y" and Topic_Status > 1 and Topic_Author <> MemberID) then
	Response.write  "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><br />Viewing of this Topic is not permitted until it has been moderated.<br />Please try again later</font></p>" & vbNewLine & _
			"<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back</a></font></p><br />" & vbNewLine
	WriteFooter
	Response.end
else
	Response.Write	"    <script language=""JavaScript"" type=""text/javascript"">" & vbNewLine & _
			"    <!--" & vbNewLine & _
			"    function jumpTo(s) {if (s.selectedIndex != 0) location.href = s.options[s.selectedIndex].value;return 1;}" & vbNewLine & _
			"    // -->" & vbNewLine & _
			"    </script>" & vbNewLine

	'## Forum_SQL
	strSql = "SELECT M.M_NAME, M.M_RECEIVE_EMAIL, M.M_AIM, M.M_ICQ, M.M_MSN, M.M_YAHOO"
	strSql = strSql & ", M.M_TITLE, M.MEMBER_ID, M.M_HOMEPAGE, M.M_LEVEL, M.M_POSTS, M.M_COUNTRY"
	strSql = strSql & ", R.REPLY_ID, R.FORUM_ID, R.R_AUTHOR, R.TOPIC_ID, R.R_MESSAGE, R.R_LAST_EDIT"
	strSql = strSql & ", R.R_LAST_EDITBY, R.R_SIG, R.R_STATUS, R.R_DATE"
	if CanShowSignature = 1 then
		strSql = strSql & ", M.M_SIG"
	end if
	strSql2 = " FROM " & strMemberTablePrefix & "MEMBERS M, " & strActivePrefix & "REPLY R "
	strSql3 = " WHERE M.MEMBER_ID = R.R_AUTHOR "
	strSql3 = strSql3 & " AND R.TOPIC_ID = " & Topic_ID & " "
		' DEM --> if not a Moderator, all unapproved posts should not be viewed.
		if AdminAllowed = 0 then
			strSql3 = strSql3 & " AND (R.R_STATUS < "
			if Moderation = "Y" then
				' Ignore unapproved/rejected posts
				strSql3 = strSql3 & "2"
			else
				' Ignore any previously rejected topic
				strSql3 = strSql3 & "3"
			end if
		strSql3 = strSql3 & " OR R.R_AUTHOR = " & MemberID & ")"
	end if
	strSql4 = " ORDER BY R.R_DATE ASC"

	if strDBType = "mysql" then 'MySql specific code
		if mypage > 1 then
 			intOffset = cLng((mypage-1) * strPageSize)
			strSql5 = " LIMIT " & intOffset & ", " & strPageSize & " "
		end if

		'## Forum_SQL - Get the total pagecount 
		strSql1 = "SELECT COUNT(R.TOPIC_ID) AS REPLYCOUNT "
		
		set rsCount = my_Conn.Execute(strSql1 & strSql2 & strSql3)
		iPageTotal = rsCount(0).value
		rsCount.close
		set rsCount = nothing

		if iPageTotal > 0 then
			maxpages = (iPageTotal  \ strPageSize )
			if iPageTotal mod strPageSize <> 0 then
				maxpages = maxpages + 1
			end if
			if iPageTotal < (strPageSize + 1) then
				intGetRows = iPageTotal
			elseif (mypage * strPageSize) > iPageTotal then
				intGetRows = strPageSize - ((mypage * strPageSize) - iPageTotal)
			else
				intGetRows = strPageSize
			end if
		else
			iPageTotal = 0
			maxpages = 0
		end if
	
		if iPageTotal > 0 then
			set rsReplies = Server.CreateObject("ADODB.Recordset")
			rsReplies.Open strSql & strSql2 & strSql3 & strSql4 & strSql5, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
				arrReplyData = rsReplies.GetRows(intGetRows)
				iReplyCount = UBound(arrReplyData, 2)
			rsReplies.Close
			set rsReplies = nothing
		else
			iReplyCount = ""
		end if
		
	else 'end MySql specific code
	
		set rsReplies = Server.CreateObject("ADODB.Recordset")
		rsReplies.cachesize = strPageSize
		rsReplies.open strSql & strSql2 & strSql3 & strSql4, my_Conn, adOpenStatic, adLockReadOnly, adCmdText

			if not (rsReplies.EOF or rsReplies.BOF) then
				rsReplies.pagesize = strPageSize
				rsReplies.absolutepage = mypage '**
				maxpages = cLng(rsReplies.pagecount)
				if maxpages >= mypage then
					arrReplyData = rsReplies.GetRows(strPageSize)
					iReplyCount = UBound(arrReplyData, 2)
				else
					iReplyCount = ""
				end if
			else  '## No replies found in DB
				iReplyCount = ""
			end if

		rsReplies.Close
		set rsReplies = nothing
	end if

	Response.Write	"      <table border=""0"" width=""100%"">" & vbNewLine & _
			"        <tr>" & vbNewLine & _
			"          <td width=""50%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
			"          " & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & "&nbsp;<a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
			"          " & getCurrentIcon(strIconBar,"","align=""absmiddle""")
	if Cat_Status <> 0 then 
		Response.Write	getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""")
	else 
		Response.Write	getCurrentIcon(strIconFolderClosed,"","align=""absmiddle""")
	end if
	Response.Write	"&nbsp;<a href=""default.asp?CAT_ID=" & Cat_ID & """>" & ChkString(Cat_Name,"display") & "</a><br />" & vbNewLine & _
			"          " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""")
	if ArchiveView = "true" then
		Response.Write	getCurrentIcon(strIconFolderArchived,"","align=""absmiddle""")
	else
		if Forum_Status <> 0 and Cat_Status <> 0 then
			Response.Write	getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""")
		else
			Response.Write	getCurrentIcon(strIconFolderClosed,"","align=""absmiddle""")
		end if
	end if
	Response.Write	"&nbsp;<a href=""forum.asp?" & ArchiveLink & "FORUM_ID=" & Forum_ID & """>" & ChkString(Forum_Subject,"display") & "</a><br />" & vbNewLine
	if ArchiveView = "true" then
		Response.Write	"          " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderArchived,"","align=""absmiddle""") & "&nbsp;"
	elseif Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0 then
		Response.Write	"          " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpenTopic,"","align=""absmiddle""") & "&nbsp;"
	else
		Response.Write	"          " & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderClosedTopic,"","align=""absmiddle""") & "&nbsp;"
	end if
	if Request.QueryString("SearchTerms") <> "" then
		Response.Write	SearchHiLite(ChkString(Topic_Subject,"title"))
	else
		Response.Write	ChkString(Topic_Subject,"title")
	end if
	Response.Write	"</font></td>" & vbNewLine & _
			"          <td align=""center"" width=""50%"">" & vbNewLine
	call PostingOptions()
	Response.Write	"</td>" & vbNewLine & _
			"        </tr>" & vbNewLine & _
			"      </table>" & vbNewLine & _
			"    </td>" & vbNewLine & _
			"  </tr>" & vbNewLine & _
			"</table>" & vbNewLine
	if maxpages > 1 then
		Response.Write	"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""1"" width=""95%"">" & vbNewLine & _
				"  <tr>" & vbNewLine & _
				"    <td align=""right"" valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>"
		if mypage > 1 then Response.Write("<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&whichpage=" & mypage-1 & SearchLink & """ title=""Goto the Previous page in this Topic""" & dWStatus("Goto the Previous page in this Topic") & ">Previous Page</a>")
		'if mypage > 1 then Response.Write("<a href=""javascript: onclick=document.PageNum1.whichpage.value=" & mypage-1 & ";document.PageNum1.submit();"" title=""Goto the Previous page in this Topic""" & dWStatus("Goto the Previous page in this Topic") & ">Previous Page</a>")
		if mypage > 1 and mypage < maxpages then Response.Write(" | ")
		if mypage < maxpages then Response.Write("<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&whichpage=" & mypage+1 & SearchLink & """ title=""Goto the Next page in this Topic""" & dWStatus("Goto the Next page in this Topic") & ">Next Page</a>")
		'if mypage < maxpages then Response.Write("<a href=""javascript: onclick=document.PageNum1.whichpage.value=" & mypage+1 & ";document.PageNum1.submit();"" title=""Goto the Next page in this Topic""" & dWStatus("Goto the Next page in this Topic") & ">Next Page</a>")
		Response.Write	"</td>" & vbNewLine & _
			"  </tr>" & vbNewLine & _
			"</table>" & vbNewLine
	end if
	Response.Write	"<table align=""center"" border=""0"" cellPadding=""0"" cellSpacing=""0"" width=""95%"">" & vbNewLine & _
			"  <tr>" & vbNewLine & _
			"    <td>" & vbNewLine & _
  			"      <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
			"        <tr>" & vbNewLine & _
			"          <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
			"            <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
			"              <tr>" & vbNewLine & _
			"                <td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""" & strTopicWidthLeft & """"

⌨️ 快捷键说明

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