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

📄 newthread.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.
'****************************************************************
BoardID = trim(request.QueryString("BoardID"))
if Not(IsNumeric(BoardID)) or BoardID = "0" then
	response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL="&BBSHomeUrl&"'>")
	response.End()
End if
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 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(7) <> 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 newpost()
End select
'----------------------------------
Sub newpost()	
%>
<br>
<table border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  <form name="myform" method="post" action="?action=add&BoardID=<%=BoardID%>" onSubmit="return validate(this)">
    <tr class="table-title"> 
      <td height="28" colspan="2"> 
        <div align="center">发布新主题</div></td>
  </tr>
    <tr class="table-dark"> 
      <td width="24%"> 
        <div align="right">图标:</div></td>
      <td width="76%"> 
        <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 class="table-dark"> 
      <td> 
        <div align="right">标题:</div></td>
      <td> 
        <select name="select" class="input2" onChange="javascript:document.myform.title.value=myform.title.value+this.value;document.myform.title.focus();">
          <option selected value="">选择话题</option>
          <option value=[原创]>[原创]</option>
          <option value=[转帖]>[转帖]</option>
          <option value=[灌水]>[灌水]</option>
          <option value=[讨论]>[讨论]</option>
          <option value=[求助]>[求助]</option>
          <option value=[推荐]>[推荐]</option>
          <option value=[公告]>[公告]</option>
          <option value=[注意]>[注意]</option>
          <option value=[贴图]>[贴图]</option>
          <option value=[建议]>[建议]</option>
          <option value=[下载]>[下载]</option>
          <option value=[分享]>[分享]</option>
        </select>
        <input name="title" type="text" class="input2" id="title" size="53" maxlength="50"></td>
  </tr>
    <tr class="table-dark"> 
      <td> 
        <div align="right">功能按钮:</div></td>
      <td><!--#include file = "INC/UBB.INC"--></td>
  </tr>
    <tr class="table-dark"> 
      <td> 
        <div align="right">上传文件:</div></td>
      <td><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 class="table-dark"> 
      <td valign="top" class="table-dark"> 
        <div align="right"><br>
          内容: </div></td>
      <td><textarea name="txtcontent" cols="60" rows="12" class="input2" id="txtcontent" onKeyDown="javascript: keyup();" title="可以使用Ctrl+Enter直接提交贴子"></textarea></td>
  </tr>
    <tr class="table-dark"> 
      <td> 
        <div align="right">查看本贴需要积分:</div></td>
      <td><input name="rating" type="text" id="rating" value="0" size="5" maxlength="5">
      </td>
  </tr>
    <tr class="table-dark"> 
      <td> 
        <div align="right">表情符号:</div></td>
      <td><!--#include file = "INC/emot.asp"--></td>
  </tr>
    <tr class="table-dark"> 
      <td> 
        <div align="right">选项:</div></td>
      <td> <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 class="table-dark"> 
      <td height="28" colspan="2"> 
        <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
	if trim(request.Form("UBB")) = "1" then
		noUBB = 0
	else
		noUBB = 1
	end if
	'---------------------------------------------------------------
	Conn.ExeCute("insert into JBB_thread(thread_title,Board_ID,posttime,postuserid,postusername,lastpost,lastposterid,lastposter,lastcontent,icons,rating) values('"& title &"',"& BoardID &",'"& Now() &"',"& userid &",'"& username &"','"& Now() &"',"& userid &",'"& username &"','"& lastcontent &"',"& icons &",'"& rating &"')")
	set rs = Conn.ExeCute("select max(threadID) from JBB_thread")
	if Not rs.eof then
		threadID = rs(0)
	End if
	set rs = Nothing
	session("LastPostTime") = Now()
	Conn.ExeCute("insert into JBB_post(threadid,beginpost,Board_ID,user_name,user_id,posttitle,posttime,postcontent,showsignature,ipaddress,icons,noUBB) values("& threadID &",1,"& BoardID &",'"& username &"',"& userid &",'"& title &"','"& Now() &"','"& content &"',"& showsignature &",'"& userip &"',"& icons &","& noUBB &")")
	Conn.ExeCute("update JBB_Board set lastposter='"& username &"',lastuserid="& userid &",lasttime='"& Now() &"',lastpost='"& title &"',lastpostid="& threadID &",threadcount=threadcount+1 where BoardID="&BoardID)
	if userOnline = true then
		Conn.ExeCute("update JBB_user set Cent=Cent+"& Board_Config(14) &",threadcount=threadcount+1 where userID="&userid)
	End if
	postCount2 = Application(JBBMasterCookies&"postCount")
	postCount2(0) = postCount2(0)+1
	Application.Lock
		Application(JBBMasterCookies&"postCount") = postCount2
		Application(JBBMasterCookies&"Board_Config"&BoardID) = ""
	Application.UnLock
	ShowMsg "感谢您发布新主题,正在转向到新的主题,如果您不想等待,请点击<a href=""showthread.asp?threadid="& threadid &""">这里</a><br>如果您想转到主题列表,请点击<a href=""Board.asp?BoardId="&BoardID&""">这里</a>"
	response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='2; URL=showthread.asp?threadid="& threadid &"'>")
End Sub
'--------------------------------------
Call Bottom()
%>

⌨️ 快捷键说明

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