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

📄 messpost.asp

📁 电子商务网络购物系统
💻 ASP
字号:
<% Option Explicit %>
<!-- #include file="includes/header.asp" -->
<!--#include file="functions/editpost.asp" -->
<!--#include file="includes/emoticons.asp" -->
<%
Response.Buffer = True 

Dim strMode	
Dim intForumID	
Dim lngTopicID	
Dim lngMessageID
Dim strForumName
Dim blnForumLocked
Dim intTopicPriority
Dim strPostPage 
Dim intTotalNumOfThreads
Dim intRecordPositionPageNum
Dim strMessage	
Dim strQuoteUsername
Dim strQuoteMessage		
Dim lngQuoteUserID
Dim intIndexPosition
Dim intNumberOfOuterLoops
Dim intLoop	
Dim intInnerLoop

If bannedIP() Then
	Set rsConn = Nothing
	adoCon.Close
	Set adoCon = Nothing
	Response.Redirect("nopermission.asp?M=IP")
End If

lngTopicID = 0
lngMessageID = 0
intTopicPriority = 0
intRecordPositionPageNum = 1
strMode = Request.QueryString("mode")
intForumID = CInt(Request.QueryString("fid"))
lngTopicID = CLng(Request.QueryString("tid"))

	strSQL = "SELECT timesbbs.* FROM timesbbs WHERE bbsid = " & intForumID & ";"
rsConn.Open strSQL, adoCon

If NOT rsConn.EOF Then
	strForumName = rsConn("bbsname")
	blnForumLocked = CBool(rsConn("Locked"))
	Call forumPermisisons(intForumID, intGroupID, CInt(rsConn("Read")), CInt(rsConn("Post")), CInt(rsConn("replypost")), CInt(rsConn("editpost")), CInt(rsConn("delpost")), CInt(rsConn("toppost")), 0, 0, CInt(rsConn("Attachments")), CInt(rsConn("imgup")))
	If NOT rsConn("Password") = "" and NOT Request.Cookies("PrForum")("Forum" & intForumID) = rsConn("codes") Then
		rsConn.Close
		Set rsConn = Nothing 
		Set adoCon = Nothing
		Set adoCon = Nothing		
		Response.Redirect "password.asp?fid=" & intForumID
	End If
End If
rsConn.Close

If (blnRead = False AND blnModerator = False AND blnAdmin = False) Then blnForumLocked = True
If strMode = "quote" Then
	intTotalNumOfThreads = Request.QueryString("NOP")
	intRecordPositionPageNum = Request.QueryString("tpn")
	strSQL = "SELECT timesuser.userid, timesuser.Username, timespost.Message "
	strSQL = strSQL & "FROM timespost INNER JOIN timesuser ON timespost.userid = timesuser.userid "
	strSQL = strSQL & "WHERE timespost.postid = " & CLng(Request.QueryString("pid"))
	rsConn.Open strSQL, adoCon 
	strQuoteUsername = rsConn("Username")
	strQuoteMessage = rsConn("Message")
	lngQuoteUserID = CLng(rsConn("userid"))
	rsConn.Close
	If lngQuoteUserID = 2 Then
			strSQL = "SELECT timesguest.Name FROM timesguest WHERE timesguest.postid = " & CLng(Request.QueryString("pid")) & ";"
		rsConn.Open strSQL, adoCon

		If NOT rsConn.EOF Then strQuoteUsername = rsConn("Name")
		rsConn.Close
	End If
	strMessage = "[QUOTE=" & strQuoteUsername & "] "
	strMessage = strMessage & strQuoteMessage
	strMessage = EditPostConvertion (strMessage)
	strMessage = strMessage & "[/QUOTE]"
End If
%>
<title>发新主题</title>
<script language="JavaScript">
function CheckForm () {
	var errorMsg = "";
<%
'If this is a new post then check for a subject heading
If strMode = "new" Then
%>	
	//Check for a subject
	if (document.frmAddMessage.subject.value==""){
		errorMsg += "\n\t贴子 \t- 为你的新贴子定一个主题";
	}
<%
End If
%>
	
	//Check for message
	if (document.frmAddMessage.message.value==""){
		errorMsg += "\n\t贴子\t- 输入贴子内容后发送";
	}
	
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "_______________________________________________________________\n\n";
		msg += "表单不完整,请填写完全\n";
		msg += "请修正后再发表\n";
		msg += "_______________________________________________________________\n\n";
		msg += "以下区域需要修改: \n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	//Reset the submition page back to it's original place
	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" width="71%" class="bold"><img src="images/open.gif" border="0" align="absmiddle">&nbsp;<a href="index.asp" target="_self" class="boldLink"><% = strMainForumName %></a><% = strNavSpacer %><% Response.Write ("<a href=""topic.asp?fid=" & intForumID & """ target=""_self"" class=""boldLink"">" & strForumName & "</a>" & strNavSpacer) %><a href="messpost.asp" target="_self" class="boldLink"><% If strMode = "quote" Then Response.Write("回复主题") Else Response.Write("发表新主题") %></a><br /></td>
  </tr>
</table><%

'Clean up
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
If ((blnPost = True AND strMode = "new") OR (blnReply = True AND strMode = "quote")) AND blnActiveMember = True AND (blnForumLocked = False OR blnAdmin = True) Then
	If IEWin = True AND blnIEEditor = True AND blnWYsiWYGEditor = True Then
		%><!--#include file="includes/repost.asp" --><%
	Else
		%><!--#include file="includes/message.asp" --><%
	End If
ElseIf blnActiveMember = False Then %>
<div align="center"><br /><br /><span class="text">对不起, 因为您的论坛会员尚未激活你没有权利使用此服务!</span><br /><br /><br /><br /><br /></div>
<% ElseIf blnForumLocked = True Then %>
<div align="center"><br /><br /><span class="text">对不起, 这个论坛被管理员锁定.</span><br /><br /><br /><br /><br /></div>
<% ElseIf blnPost = False AND strMode <> "reply" Then %>
<div align="center"><br /><br /><span class="text">对不起,你没有权限在本论坛发言</span><br /><br /><br /><br /><br /></div>
<% ElseIf blnReply = False AND intGroupID <> 2 Then %>
<div align="center"><br /><br /><span class="text">对不起,你没有权限在本论坛发言</span><br /><br /><br /><br /><br /></div>
<% Else %>
<div align="center"><br /><br /><span class="text">你必须先注册</span><br /><br />
<a href="reg.asp?fid=<%= intForumID %>" target="_self"><img src="images/register.gif"  alt="注册" border="0" align="absmiddle"></a>&nbsp;&nbsp;<a href="login.asp?fid=<%= intForumID %>" target="_self"><img src="images/login.gif"  alt="登录" border="0" align="absmiddle"></a><br /><br /><br /><br /></div>
<% End If %>
<br /><br />

<!-- #include file="includes/footer.asp" -->

⌨️ 快捷键说明

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