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

📄 post.asp

📁 电子商务网络购物系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!-- #include file="includes/header.asp" -->
<!--#include file="functions/formatpost.asp" -->
<!--#include file="includes/emoticons.asp" -->
<%
Response.Buffer = True
Private Function searchHighlighter(ByVal strMessage, ByVal sarySearchWord)

	Dim intHighlightLoopCounter
	Dim strTempMessage
	Dim lngMessagePosition
	Dim intHTMLTagLength
	Dim intSearchWordLength
	Dim blnTempUpdate
	For lngMessagePosition = 1 to Len(strMessage)
		blnTempUpdate = False
		If Mid(strMessage, lngMessagePosition, 1) = "<" Then
			intHTMLTagLength = (InStr(lngMessagePosition, strMessage, ">", 1) - lngMessagePosition)
			strTempMessage = strTempMessage & Mid(strMessage, lngMessagePosition, intHTMLTagLength)
			lngMessagePosition = lngMessagePosition + intHTMLTagLength
		End If
		For intHighlightLoopCounter = 0 to UBound(sarySearchWord)
			If sarySearchWord(intHighlightLoopCounter) <> "" Then
				intSearchWordLength = Len(sarySearchWord(intHighlightLoopCounter))
				If LCase(Mid(strMessage, lngMessagePosition, intSearchWordLength)) = LCase(sarySearchWord(intHighlightLoopCounter)) Then
					strTempMessage = strTempMessage & "<span class=""highlight"">" & Mid(strMessage, lngMessagePosition, intSearchWordLength) & "</span>"
					lngMessagePosition = lngMessagePosition + intSearchWordLength - 1
					blnTempUpdate = True
				End If
			End If
		Next
		If blnTempUpdate = False Then
			strTempMessage = strTempMessage & Mid(strMessage, lngMessagePosition, 1)
		End If
	Next
	searchHighlighter = strTempMessage
End Function

Dim rsST 
Dim rsND
Dim intForumID
Dim strForumName		'
Dim lngTopicID
Dim strSubject
Dim strUsername 
Dim lngUserID
Dim dtmTopicDate		
Dim strMessage
Dim lngMessageID
Dim strAuthorHomepage
Dim strAuthorLocation
Dim strAuthorAvatar
Dim strAuthorSignature
Dim lngAuthorNumOfPosts
Dim dtmAuthorRegistration
Dim lngNumberOfViews
Dim intStatus
Dim strStatus
Dim strMode
Dim intTopicPageNumber
Dim blnNoThread
Dim blnIsModerator
Dim blnForumLocked
Dim blnTopicLocked		
Dim intThreadNo
Dim intPriority
Dim strPostPage 
Dim intRecordPositionPageNum
Dim intTotalNumOfPages
Dim intRecordLoopCounter
Dim intTopicPageLoopCounter	
Dim intTotalNumOfThreads	
Dim strAuthorIP
Dim strSearchKeywords
Dim sarySearchWord
Dim strGroupName
Dim intRankStars
Dim strRankCustomStars
Dim lngPollID
Dim blnPollNoReply
Dim blnBannedIP
Dim dtmLastEntryDate
Dim intIndexPosition
Dim intNumberOfOuterLoops
Dim intLoop
Dim intInnerLoop
Dim strMemberTitle

strMode = "reply"
lngMessageID = 0
intForumID = 0
lngTopicID = 0
intThreadNo = 0
blnNoThread = False
blnIsModerator = False
blnPollNoReply = False
blnBannedIP = False

If bannedIP() Then
	blnBannedIP = True
	blnActiveMember = False
End If

If Request.QueryString("tpn") = "" Then
	intRecordPositionPageNum = 1
Else
	intRecordPositionPageNum = CInt(Request.QueryString("tpn"))
End If
lngTopicID = CLng(Request.QueryString("tid"))
intTopicPageNumber = CInt(Request.QueryString("pn"))
If lngTopicID = 0 Then
	Set rsConn = Nothing
	adoCon.Close
	Set adoCon = Nothing
	Response.Redirect "index.asp"
End If
strSearchKeywords = Trim(Mid(Request.QueryString("kw"), 1, 35))
sarySearchWord = Split(Trim(strSearchKeywords), " ")
Set rsND = Server.CreateObject("ADODB.Recordset")
	strSQL = "SELECT  timestopic.*, timespost.*, timesuser.Username, timesuser.Homepage, timesuser.Location, timesuser.postnum, timesuser.joindtm, timesuser.Signature, timesuser.Active, timesuser.Avatar, timesuser.rank, timesgrp.Name, timesgrp.Stars, timesgrp.cusstars "
	strSQL = strSQL & "FROM timestopic, timespost, timesuser, timesgrp "
	strSQL = strSQL & "WHERE timestopic.topicid = timespost.topicid AND timesuser.userid = timespost.userid AND timesuser.grpid = timesgrp.grpid AND timestopic.topicid = " & lngTopicID & " "
	strSQL = strSQL & "ORDER BY timespost.msgdtm ASC;"
rsND.CursorType = 1
rsND.Open strSQL, adoCon
rsND.PageSize = intThreadsPerPage
If rsND.EOF Then
	strSubject = "没有帖子"
	blnNoThread = True
Else
	intTotalNumOfPages = rsND.PageCount
	intTotalNumOfThreads = rsND.RecordCount
	If (intRecordPositionPageNum > intTotalNumOfPages) OR (Request.QueryString("get") = "last") Then
		rsND.AbsolutePage = intTotalNumOfPages
		intRecordPositionPageNum = intTotalNumOfPages
	Else
		rsND.AbsolutePage = intRecordPositionPageNum
	End If
	lngNumberOfViews = CLng(rsND("viewnum"))
	lngNumberOfViews = lngNumberOfViews + 1
		strSQL = "UPDATE timestopic SET "
		strSQL = strSQL & "timestopic.viewnum=" & lngNumberOfViews
		strSQL = strSQL & " WHERE (((timestopic.topicid)=" & lngTopicID & "));"
	adoCon.Execute(strSQL)
	intForumID = Cint(rsND("bbsid"))
	lngPollID = CLng(rsND("pollid"))
	strSubject = rsND("Subject")
	blnTopicLocked = CBool(rsND("Locked"))
	intPriority = CInt(rsND("Priority"))
	dtmLastEntryDate = CDate(rsND("lastdtm"))
	If(CDate(Session("dtmLastVisit")) < dtmLastEntryDate) AND (Request.Cookies("RT" & lngTopicID) = "") Then
		Response.Cookies("RT")("tid" & lngTopicID) = 1
	End If
End If

If Request.QueryString("pr") = "3" Then intForumID = Cint(Request.QueryString("fid"))
Set rsST = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT timesbbs.* FROM timesbbs WHERE timesbbs.bbsid = " & intForumID & ";"
rsST.Open strSQL, adoCon

If NOT rsST.EOF Then
	strForumName = rsST("bbsname")
	blnForumLocked = CBool(rsST("Locked"))
	Call forumPermisisons(intForumID, intGroupID, CInt(rsST("Read")), CInt(rsST("Post")), CInt(rsST("replypost")), CInt(rsST("editpost")), CInt(rsST("delpost")), 0, CInt(rsST("addpoll")), CInt(rsST("Vote")), CInt(rsST("Attachments")), CInt(rsST("imgup")))
	If blnRead = False Then
		rsND.Close
		Set rsND = Nothing
		rsST.Close
		Set rsST = Nothing
		Set rsConn = Nothing
		adoCon.Close
		Set adoCon = Nothing
		Response.Redirect "nopermission.asp"
	End If
	If rsST("Password") <> "" AND Request.Cookies("PrForum")("Forum" & intForumID) <> rsST("codes") Then
		rsND.Close
		Set rsND = Nothing
		rsST.Close
		Set rsST = Nothing
		Set rsConn = Nothing
		adoCon.Close
		Set adoCon = Nothing
		Response.Redirect "password.asp?RP=PT&fid=" & intForumID & "&tid=" & lngTopicID
	End If
End If
%>
<title><% = strMainForumName %>: <% = strSubject %></title>
<script language="JavaScript">

function CheckForm() {
	var errorMsg = "";
	if (document.frmAddMessage.message.value==""){
		errorMsg += "\n\t贴子\t- 输入贴子内容后发送";
	}
	if (errorMsg != ""){
		msg = "以下区域需要修改\n\n";
		msg += "输入不完整,请确定全部填写\n";
		msg += "请修正后再发表\n";
		msg += "以下区域需要修改\n\n";
		msg += "以下区域需要修改\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}

	document.frmAddMessage.action = "postmess.asp?pn=<% = Request.QueryString("pn") %>"
	document.frmAddMessage.target = "_self";

	return true;
}
</script>

<table width="96%" border="0" cellspacing="0" cellpadding="3" align="center"><tr>
  <td align="left" class="heading"><%
If blnForumLocked = True Then %>
<span class="smText">(<img src="images/forumlocked.gif" align="baseline" alt="论坛已锁">论坛已锁)</span>
<%
End If %></td>
</tr>
 <tr>
  <td width="96%" class="bold"><img src="images/open.gif" border="0" align="absmiddle">&nbsp;<a href="index.asp" target="_self" class="boldLink"><% = strMainForumName %></a>
  <%= strNavSpacer %>
  <%
If rsST.EOF Then %>
<span class="bold">目前还没有论坛</span>
<% Else %>
<a href="topic.asp?fid=<%= intForumID %>&pn=<%= intTopicPageNumber %>" target="_self" class="boldLink"><%= strForumName %></a>
<% End If %>
<%= strNavSpacer %>
<a href="post.asp?tid=<%= lngTopicID %>&pn=<%= intTopicPageNumber %>" target="_self" class="boldLink"><%= strSubject %></a>
<% rsST.Close %></td>
 </tr>
</table>
 <table width="96%" border="0" cellspacing="0" cellpadding="4" align="center">
 <tr>   <%
If blnReply = True AND blnActiveMember = True Then
	If intRecordPositionPageNum = intTotalNumOfPages Then %>
	<td><a href="#reply" target="_self"><img src="images/reply.gif"  border="0" align="absmiddle" alt="回 复 主 题"></a>
	<%	Else %>
	<td><a href="post.asp?tid=<%= lngTopicID %>&pn=<%= intTopicPageNumber %>&tpn=<%= intTotalNumOfPages %>#reply" target="_self"><img src="images/reply.gif"  border="0" align="absmiddle" alt="回复主题"></a>
	<%
	End If
Else %>
<td><a href="messpost.asp?mode=reply&fid=<%= intForumID %>"  target="_self"><img src="images/reply.gif"  border="0" align="absmiddle" alt="回复主题"></a>
<%
End If %>
<a href="messpost.asp?mode=new&fid=<%= intForumID %>"  target="_self"><img src="images/postnew.gif"  border="0" align="absmiddle" alt="发表新主题"></a>
<%
If blnPollCreate = True Then
%>
<a href="poll.asp?fid=<%= intForumID %>"  target="_self"><img src="images/newpoll.gif"  border="0" align="absmiddle" alt="发起投票"></a>
<%
End If
	If blnAdmin  OR blnModerator Then %>
	<a href="javascript:openWin('putopicadmin.asp?tid=<%= lngTopicID %>','admin','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=450')"><img src="images/admin.gif" align="absmiddle" border="0" alt="管理主题"></a>	
	<%End If %>
</td>

⌨️ 快捷键说明

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