?? newthread.asp
字號(hào):
<%@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
'*
'* 版權(quán)所有: 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) &" - 發(fā)布新主題"%></title>
<link href="<%=Css_path%>" rel="stylesheet" type="text/css">
<script language="javascript">
<!--
function validate(theform) {
if (theform.title.value=="" ) {
alert("標(biāo)題不可為空.");
theform.title.focus();
return false; }
if (theform.txtcontent.value=="" ) {
alert("內(nèi)容不可為空.");
theform.txtcontent.focus();
return false; }
if (theform.title.value.length > 50) {
alert("標(biāo)題不可超過50字,當(dāng)前為"+ theform.title.value.length +"字");
theform.title.focus();
return false;}
if (theform.txtcontent.value.length><%=Board_Config(23)%>) {
alert("本版塊貼子內(nèi)容不可超過<%=Board_Config(23)%>字,當(dāng)前為"+ 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""> <a href="""&BBSHomeUrl&""">"& BBS_Config(0) &"</a> <img src="""& BBS_Skin(3) &"JBB_bullet.gif""> <a href=""board.asp?BoardID="& BoardID &""">"& Board_Config(2) &"</a> <img src="""& BBS_Skin(3) &"JBB_bullet.gif""> 發(fā)布新主題"
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 "對(duì)不起,您不可以發(fā)布新主題或者您還沒有登錄,點(diǎn)擊 <a href=""javascript:history.back()"">這里</a> 返回"
Call Bottom()
response.End
End if
'-----------------------------------------
if DateDiff("s",Session("LastPostTime"),now()) < Board_Config(22) then
ShowMsg "為防止有人惡意灌水, 管理員設(shè)置此版塊兩次發(fā)帖必須有一定的間隔時(shí)間, <br>請(qǐng)您等 "& Board_Config(22) - DateDiff("s",Session("LastPostTime"),now()) &" 秒后再發(fā)帖,點(diǎn)擊 <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">發(fā)布新主題</div></td>
</tr>
<tr class="table-dark">
<td width="24%">
<div align="right">圖標(biāo):</div></td>
<td width="76%">
<input type="radio" value="0" name="icon" checked>
No
<input type="radio" value="1" name="icon">
<img src="images/posticon/icon1.gif" width="15" height="15">
<input type="radio" value="2" name="icon">
<img src="images/posticon/icon2.gif" width="15" height="15">
<input type="radio" value="3" name="icon">
<img src="images/posticon/icon3.gif" width="15" height="15">
<input type="radio" value="4" name="icon">
<img src="images/posticon/icon4.gif"> <input type="radio" value="5" name="icon">
<img src="images/posticon/icon5.gif"> <input type="radio" value="6" name="icon">
<img src="images/posticon/icon6.gif"> <input type="radio" value="7" name="icon">
<img src="images/posticon/icon7.gif"> <br>
<input type="radio" value="8" name="icon">
<img src="images/posticon/icon8.gif"> <input type="radio" value="9" name="icon">
<img src="images/posticon/icon9.gif"> <input type="radio" value="10" name="icon">
<img src="images/posticon/icon10.gif"> <input type="radio" value="11" name="icon">
<img src="images/posticon/icon11.gif"> <input type="radio" value="12" name="icon">
<img src="images/posticon/icon12.gif"> <input type="radio" value="13" name="icon">
<img src="images/posticon/icon13.gif"> <input type="radio" value="14" name="icon">
<img src="images/posticon/icon14.gif"> <input type="radio" value="15" name="icon">
<img src="images/posticon/icon15.gif"> </td>
</tr>
<tr class="table-dark">
<td>
<div align="right">標(biāo)題:</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=[原創(chuàng)]>[原創(chuàng)]</option>
<option value=[轉(zhuǎn)帖]>[轉(zhuǎn)帖]</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)%>字節(jié) 支持類型:<%=Board_Config(19)%> </td>
</tr>
<tr class="table-dark">
<td valign="top" class="table-dark">
<div align="right"><br>
內(nèi)容: </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">表情符號(hào):</div></td>
<td><!--#include file = "INC/emot.asp"--></td>
</tr>
<tr class="table-dark">
<td>
<div align="right">選項(xiàng):</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">使用我的個(gè)性簽名 </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=" 提 交 ">
<input type="reset" name="Submit2" value="重置">
<input type="button" name="button" value="預(yù)覽" onclick="gopreview()">
[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 ")
content = replace(content,"<script","<script ")
if len(Content) > Board_Config(23) then
ShowMsg "內(nèi)容均不可超過 "&Board_Config(23)&" 字,<a href=""javascript:history.back()"">點(diǎn)擊這里返回.</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 "標(biāo)題和內(nèi)容均不可為空,<a href=""javascript:history.back()"">點(diǎn)擊這里返回.</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 "感謝您發(fā)布新主題,正在轉(zhuǎn)向到新的主題,如果您不想等待,請(qǐng)點(diǎn)擊<a href=""showthread.asp?threadid="& threadid &""">這里</a><br>如果您想轉(zhuǎn)到主題列表,請(qǐng)點(diǎn)擊<a href=""Board.asp?BoardId="&BoardID&""">這里</a>"
response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='2; URL=showthread.asp?threadid="& threadid &"'>")
End Sub
'--------------------------------------
Call Bottom()
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -