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

📄 newreply.asp

📁 BBS论坛的开发和设计
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="admin/BBSConfig.asp"-->
<!--#include file="INC/online.asp"-->
<!--#include file="INC/ShowMsg.asp"-->
<!--#include file="INC/header.asp"-->
<!--#include file="INC/Board_Config.asp"-->
<%
'****************************************************************
'*  joinboard BBS Ver2.3.0/友盟论坛 Ver2.3.0
'*
'*  版权所有: JoinBoard V2.3
'*
'*  程序制作: 友盟工作室
'*           
'*  主页地址: http://joinboard.com    友盟论坛
'*
'*  论坛地址: http://bbs.joinboard.com/、http://youmeng.com
'*	                 
'****************************************************************
'*  Powered by: JoinBoard V2.3
'* Copyright 2003-2004.  - All Rights Reserved.
'*  JoinBoard is a trademark of YouMeng Studio.
'****************************************************************
threadID = trim(request.QueryString("threadID"))
if Not(IsNumeric(threadID)) or threadID = "0" then
	postID = trim(request.QueryString("postID"))
	if Not(IsNumeric(postID)) or postID = "0" then
		response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL="&BBSHomeUrl&"'>")
		response.End()
	else
		sql_where=" JBB_post.postID="&postID
	End if
else
	sql_where=" JBB_thread.threadID="&threadID
End if
		set rs = Conn.ExeCute("select JBB_post.threadID,JBB_post.Board_ID,JBB_post.posttitle,JBB_post.postcontent,JBB_post.user_id,JBB_thread.thread_title,JBB_thread.postuserid,JBB_thread.openpost,JBB_thread.rating,JBB_post.beginpost from JBB_post left JOIN JBB_thread on(JBB_post.threadID=JBB_thread.threadID) where "&sql_where)
		if Not rs.eof then
			threadID = rs("threadID")
			posttitle = rs("posttitle")			
				if trim(request.QueryString("quote")) = "yes" then
				    if rs("beginpost")=1 and rs("rating")<>0 then
					postcontent ="&nbsp;&nbsp;&nbsp;&nbsp;[color=#DC143C]积分帖内容,不可被引用![/color]"
				    else
					postcontent = rs("postcontent")
					if len(postcontent) => 200 then
						postcontent=right(postcontent,199)+"..."
					End if
				    end if
					postcontent="[quote][i]最初由 "&rtrim(request.QueryString("quoteer"))&" 发表[/i]"&chr(13)&postcontent&chr(13)&"[/quote]"&chr(13)
				End if
			postuserid = trim(rs("user_id"))
			if rs("openpost") then openpost = true
			if posttitle = "" then posttitle = rs("thread_title")			
			BoardID = rs("Board_ID")
		else
			set rs = Nothing
			response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL="&BBSHomeUrl&"'>")
			response.End()			
		End if
		set rs = Nothing
	Board_info BoardID
	Board_Config = Application(JBBMasterCookies&"Board_Config"&BoardID)
	title = Board_Config(2)
	if Board_Config(6)=true then styleid = Board_Config(5)
%>
<!--#include file="INC/style.asp"-->
<!--#include file = "INC/CODE.ASP"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="joinboard,forum,bbs,youmeng,友盟论坛">
<script>
function gopreview()
{
document.preview.txtcontent.value=document.myform.txtcontent.value;
var popupWin = window.open('', 'preview_page','scrollbars=yes,width=550,height=400');
document.preview.submit()
}
</script>
<title><%=BBS_Config(0)&" - "& Board_Config(2) &" - 回复主题"%></title>
<link href="<%=Css_path%>" rel="stylesheet" type="text/css">
<script language="javascript">
<!--
function validate(theform) {
	if (theform.title.value=="" ) {
		alert("标题不可为空.");
		theform.title.focus();
		return false; }
	if (theform.txtcontent.value=="" ) {
		alert("内容不可为空.");
		theform.txtcontent.focus();
		return false; }
	if (theform.title.value.length > 50) {
		alert("标题不可超过50字,当前为"+ theform.title.value.length +"字");
		theform.title.focus();
		return false;}
	if (theform.txtcontent.value.length><%=Board_Config(23)%>) {
   		alert("本版块贴子内容不可超过<%=Board_Config(23)%>字,当前为"+ theform.txtcontent.value.length +"字");
    	theform.txtcontent.focus();
    	return (false); }
	else { return true; }
}

function insertstr(str)
{document.myform.txtcontent.value=document.myform.txtcontent.value+str;}
//-->
</script>

<SCRIPT LANGUAGE="JavaScript">
function keyup(eventobject)
{
	if(event.ctrlKey && window.event.keyCode==13 && document.myform.Submit.disabled==false)
	{
		document.myform.submit();
		document.myform.Submit.disabled=true;
	}
}
</SCRIPT>
</head>
<body leftmargin="0" topmargin="0">
<%
Call onlineuser()
call top()

response.Write "<table border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"" class=""path-table"">"
response.Write "<tr><td>"
response.Write "<img src="""& BBS_Skin(3) &"JBB_bullet.gif"">&nbsp;<a href="""&BBSHomeUrl&""">"& BBS_Config(0) &"</a>&nbsp;<img src="""& BBS_Skin(3) &"JBB_bullet.gif"">&nbsp;<a href=""board.asp?BoardID="& BoardID &""">"& Board_Config(2) &"</a>&nbsp;<img src="""& BBS_Skin(3) &"JBB_bullet.gif"">&nbsp;发布回复"
response.Write "</td></tr></table>"

if openpost <> true then
	showMsg "该主题已经关闭,不允许回复!"
	Call bottom()
	response.End()
End if
if Board_Config(17) = True or Board_Config(18) = True then
	if usergroup <= 4 then 
		enter = true
	End if 
else
	enter = true
End if
'-----------------------------------------------
if user_group(8)=true and userid=postuserid then postreply = true
if user_group(9)=true and userid<>postuserid then postreply = true
'response.Write(userid&"<br>"&postuserid)
if postreply <> true or enter <> true then
	loginform "对不起,您不可以回复此主题或者您还没有登录,点击 <a href=""javascript:history.back()"">这里</a> 返回"
	Call Bottom()
	response.End()
End if
'-----------------------------------------
if DateDiff("s",Session("LastPostTime"),now()) < Board_Config(22) then
	ShowMsg "为防止有人恶意灌水, 管理员设置此版块两次发帖必须有一定的间隔时间, <br>请您等 "& Board_Config(22) - DateDiff("s",Session("LastPostTime"),now()) &" 秒后再发帖,点击 <a href=""javascript:history.back()"">这里</a> 返回"
	Call Bottom()
	response.End()
End if
'-----------------------------------------
action = Trim(Request.QueryString("action"))
select case action
	Case "add"
		Call add()
	Case else
		Call newreply()
End select
'----------------------------------
Sub newreply()	
%>
<br>
<table border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  <form name="myform" method="post" action="?action=add&threadID=<%=threadID%>&postID=<%=postID%>" onSubmit="return validate(this)">
    <tr> 
      <td height="28" colspan="2"  class="table-title"> 
        <div align="center">回复:<%=posttitle%></div></td>
    </tr>
    <tr> 
      <td width="24%" class="table-dark"> 
        <div align="right">图标:</div></td>
      <td width="76%" class="table-dark"> 
        <input type="radio" value="0" name="icon" checked>
        No&nbsp; <input type="radio" value="1" name="icon"> <img src="images/posticon/icon1.gif" width="15" height="15">&nbsp; 
        <input type="radio" value="2" name="icon"> <img src="images/posticon/icon2.gif" width="15" height="15">&nbsp; 
        <input type="radio" value="3" name="icon"> <img src="images/posticon/icon3.gif" width="15" height="15">&nbsp; 
        <input type="radio" value="4" name="icon"> <img src="images/posticon/icon4.gif">&nbsp; 
        <input type="radio" value="5" name="icon"> <img src="images/posticon/icon5.gif">&nbsp; 
        <input type="radio" value="6" name="icon"> <img src="images/posticon/icon6.gif">&nbsp; 
        <input type="radio" value="7" name="icon"> <img src="images/posticon/icon7.gif">&nbsp; 
        <br> <input type="radio" value="8" name="icon"> <img src="images/posticon/icon8.gif">&nbsp; 
        <input type="radio" value="9" name="icon"> <img src="images/posticon/icon9.gif">&nbsp; 
        <input type="radio" value="10" name="icon"> <img src="images/posticon/icon10.gif">&nbsp; 
        <input type="radio" value="11" name="icon"> <img src="images/posticon/icon11.gif">&nbsp; 
        <input type="radio" value="12" name="icon"> <img src="images/posticon/icon12.gif">&nbsp; 
        <input type="radio" value="13" name="icon"> <img src="images/posticon/icon13.gif">&nbsp; 
        <input type="radio" value="14" name="icon"> <img src="images/posticon/icon14.gif">&nbsp; 
        <input type="radio" value="15" name="icon"> <img src="images/posticon/icon15.gif">&nbsp; 
      </td>
    </tr>
    <tr> 
      <td class="table-dark"> 
        <div align="right">标题:</div></td>
      <td class="table-dark"> 
        <input name="title" type="text" class="input2" id="title" value="Re:<%=posttitle%>" size="53" maxlength="50"></td>
    </tr>
    <tr> 
      <td class="table-dark"> 
        <div align="right">功能按钮:</div></td>
      <td class="table-dark">
<!--#include file = "INC/UBB.INC"--></td>
    </tr>
    <tr> 
      <td class="table-dark"> 
        <div align="right">上传文件:</div></td>
      <td class="table-dark">
<iframe name="ad" frameborder=0 width=100% height=24 scrolling=no src="up.asp?Folder=<%=BoardID%>&uptype=Board&bgcolor=<%=replace(table_dark_color,"#","")%>"></iframe>
        最大:<%=Board_Config(20)%>字节&nbsp;&nbsp;支持类型:<%=Board_Config(19)%> </td>
    </tr>
    <tr> 
      <td valign="top" class="table-dark"> 
        <div align="right"><br>
          内容: </div></td>
      <td class="table-dark">
<textarea name="txtcontent" cols="60" rows="12" class="input2" id="txtcontent" onKeyDown="javascript: keyup();" title="可以使用Ctrl+Enter直接提交贴子"><%=postcontent%></textarea>
      </td>
    </tr>
    <tr class="table-dark"> 
      <td> 
        <div align="right">表情符号:</div></td>
      <td> 
        <!--#include file = "INC/emot.asp"--></td>
    </tr>
    <tr> 
      <td class="table-dark"> 
        <div align="right">选项:</div></td>
      <td class="table-dark"> 
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="5">
<input name="showsignature" type="checkbox" id="showsignature2" value="1" checked>
            </td>
            <td width="120">使用我的个性签名&nbsp;</td>
            <td width="5"> 
              <input name="UBB" type="checkbox" id="UBB2" value="1" checked>
            </td>
            <td>使用UBB代码 </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr> 
      <td height="28" colspan="2" class="table-dark"> 
        <div align="center"> 
          <input type="submit" name="Submit" value="  提 交  ">
          &nbsp; 
          <input type="reset" name="Submit2" value="重置">
          &nbsp; 
          <input type="button" name="button" value="预览" onclick="gopreview()">
          &nbsp;[Ctrl+Enter快速提交]</div></td>
    </tr>
  </form>
</table><form name=preview action=preview.asp method=post target=preview_page>
<input type=hidden name=txtcontent value=>
<input type=hidden name=BoardID value=<%=BoardID%>>
</form>
<br>
<%
End Sub
'--------------------------------------
Sub add()
	icons = Trim(Request.Form("icon"))
	title = replace(Trim(Request.Form("title")),"'","''")
	content = replace(rTrim(Request.Form("txtcontent")),"'","''")
	title = replace(title,"<script","<script&nbsp;")
	content = replace(content,"<script","<script&nbsp;")
	if len(Content) > Board_Config(23) then
		ShowMsg "内容均不可超过 "&Board_Config(23)&" 字,<a href=""javascript:history.back()"">点击这里返回.</a>"
		Call Bottom()
		response.end
	end if
	rating = Trim(Request.Form("rating"))
		if Not(IsNumeric(rating)) then rating = 0
	showsignature = Trim(Request.Form("showsignature"))
		if showsignature = "" then showsignature = 0 else showsignature = 1 End if
	if icons = "" or title = "" or content = "" then
		ShowMsg "标题和内容均不可为空,<a href=""javascript:history.back()"">点击这里返回.</a>"
		Call Bottom()		
		response.end
	End if
	if userid = "" then userid = 0
	if username = "" then username = "游客"
	if len(content) => 20 then
		lastcontent = left(content,20)+"..."
	else
		lastcontent = content
	End if
	content = replace(content,"'","''")
	lastcontent = replace(lastcontent,"'","''")
	if trim(request.Form("UBB")) = "1" then
		noUBB = 0
	else
		noUBB = 1
	end if
	'---------------------------------------------------------------
	session("LastPostTime") = Now()
	Conn.ExeCute("insert into JBB_post(threadid,Board_ID,user_name,user_id,posttitle,posttime,postcontent,showsignature,ipaddress,icons,noUBB) values("& threadID &","& BoardID &",'"& username &"',"& userid &",'"& title &"','"& Now() &"','"& content &"',"& showsignature &",'"& userip &"',"& icons &","& noUBB &")")
	Conn.ExeCute("update JBB_thread set lastpost='"& Now() &"',lastposterid='"& userid &"',lastposter='"& username &"',replycount=replycount+1,lastcontent = '"& lastcontent &"' where threadID="&threadID)
	if userOnline = true then
		Conn.ExeCute("update JBB_user set Cent=Cent+"& Board_Config(15) &",replycount=replycount+1 where userID="&userid)
	End if
	Conn.ExeCute("update JBB_Board set lastposter='"& username &"',lastuserid="& userid &",lasttime='"& Now() &"',lastpost='"& title &"',lastpostid="& threadID &",replycount=replycount+1 where BoardID="&BoardID)
	postCount2 = Application(JBBMasterCookies&"postCount")
	postCount2(1) = postCount2(1)+1
	Application.Lock
		Application(JBBMasterCookies&"postCount") = postCount2
		Application(JBBMasterCookies&"Board_Config"&BoardID) = ""
	Application.UnLock
	ShowMsg "感谢您的回复,正在转向到主题,如果您不想等待,请点击<a href=""showthread.asp?threadid="& threadid &"&page=end#end"">这里</a><br>如果您想转到主题列表,请点击<a href=""Board.asp?BoardId="&BoardID&""">这里</a>"
	response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='2; URL=showthread.asp?threadid="& threadid &"&page=end#end'>")
End Sub
'--------------------------------------
Call Bottom()
%>

⌨️ 快捷键说明

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