📄 newreply.asp
字号:
<!--#INCLUDE FILE="setup.asp" -->
<!--#include file="char.asp" -->
<!--#include file="ubbcode.asp" -->
<!--#include file="checkuser.asp" -->
<!--#INCLUDE FILE="theme.asp" -->
<%
locat="校园论坛"
act="回复主题"
call top(2,1)
dim RootID
if membername="" then
errmsg=errmsg+"<br>"+"<li>您还没有<a href=login.asp>登录</a>。"
call error("Information",errmsg)
else
if request("Action")="Reply" then
dim Topic
dim body
call savereply()
else
call ShowReplyForm()
end if
end if
function chktopic()
if request("RootID")="" then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>请指定要回复的贴子。"
elseif not isInteger(request("RootID")) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
else
RootID=request("RootID")
end if
if founderr then
call error("Exclmation",errmsg)
chktopic=false
exit function
end if
set rs=conn.execute("select locked from bbs where BBSID="&rootID&"")
if rs.bof and rs.eof then
foundErr = true
ErrMsg=ErrMsg+"<br>"+"<li>指定的贴子不存在</li>"
elseif rs("locked")=true and not sysadmin then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>本主题已被锁定,不能发表回复。"
end if
set rs=nothing
chktopic=not founderr
if founderr then
call error("Exclamation",errmsg)
end if
end function
sub ShowReplyForm()
if chktopic=false then
exit sub
end if
dim advmode
dim bisquotepost
dim postno
bisquotepost=false
if request("QuotePost")<>"" then
postno=clng(request("QuotePost"))
sql="select username,body,signtime from [bbs] where bbsid="&postno
set qrs=conn.execute(sql)
if not (qrs.eof and qrs.bof) then
content=reubbcode(qrs("body"))
content = replace(content, ">", ">")
content = replace(content, "<", "<")
content = Replace(content, "</P><P>", CHR(10) & CHR(10))
content = Replace(content, "<BR>", CHR(10))
quotecontent="[quote][b]以下是引用[i]"&qrs("username")&"在"&qrs("signtime")&"[/i]的发言:[/b]"
quotecontent=quotecontent+chr(13)+content+chr(13)+"[/quote]"
bisquotepost=true
end if
end if
if request("Mode")="Advanced" then
advmode=true
elseif request("Mode")="Typical" then
advmode=false
else
advmode=signmodeflag
end if
%>
<BR><BR>
<form action="NewReply.asp" method="POST" onSubmit="submitonce(this)" name="frmgbk">
<input type=hidden name=Action value="Reply">
<input type=hidden name=RootID value="<%=RootID%>">
<div align="center"><center>
<table bgColor="<%=Tablebordercolor%>" cellpadding=0 cellspacing=0 border=0 width=100% cellspacing="0">
<tr>
<td width="100%">
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<tr>
<th width="100%" bgcolor="<%=Tabletitlecolor%>" colspan=2 align=left><IMG SRC="IMAGES/nav.gif" hspace=3><strong>回复主题</strong> <%if advmode=false then%><A HREF="?RootID=<%=RootID%>&Mode=Advanced<%if bisquotepost=true then response.write "&QuotePost="&postno%>" title="当前为简洁模式,按此切换到高级发贴模式">[高级模式]</A><%else%><A HREF="?RootID=<%=RootID%>&Mode=Typical<%if bisquotepost=true then response.write "&QuotePost="&postno%>" title="当前为高级模式,按此切换到简洁发贴模式">[简洁模式]</A><%end if%></font></th>
</tr>
<tr bgcolor="<%=TablebodyColor2%>">
<td width="22%"><font color="<%=TableContentcolor%>"><b>作者</b>
</td>
<td width="78%"> <%=htmlencode(membername)%></font>
</td>
</tr>
<tr bgcolor="<%=TablebodyColor2%>">
<td width="22%"><font color="<%=TableContentcolor%>"><b>帖子标题</b>
<SELECT name=font onchange=DoTitle(this.options[this.selectedIndex].value)>
<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>
</td>
<td width="78%"> <font color="<%=TableContentcolor%>"><input name="title" size=68 maxlength=80 class=FormClass> 不超过50个汉字</font>
</td>
</tr>
<tr bgcolor="<%=TablebodyColor2%>">
<td width="22%" valign="middle"><font color="<%=TableContentcolor%>"><b>发贴心情</b></font></td>
<td width="78%">
<table border=0 width=100%><tr><td>
<%for i=1 to 18%>
<input type="radio" value="face<%=i%>" name="mood" <%if i=1 then response.write "checked"%>><img src="mood/face<%=i%>.gif" WIDTH="15" HEIGHT="15">
<%if i=9 then response.write "<br>"
next%>
</td></tr></table>
</td>
</tr>
<tr bgcolor="<%=tablebodycolor2%>">
<td> <B>帖子内容</B><BR> <a href=javascript:checklength()>[检测帖子长度]</a><BR><br><li>HTML标签:<font color=brown>OFF</font><BR><li>UBB标签:<%if ubbflag=true then response.write "<font color=#003399>ON" else response.write "<font color=brown>OFF"%></font><BR><li>最大长度:<font color=brown><%=MaxBoardSize%>KB</font><BR><BR>
<a href="javascript:openScript('help.asp?about=ubb',670,500)" style="cursor:help"><IMG SRC="IMAGES/help.gif" WIDTH="42" HEIGHT="17" BORDER=0 ALT="查看UBB代码使用说明"></a>
</td>
<td><table border=0><%if advmode=true then%><!--#INCLUDE FILE="ubbtools.asp" --><%end if%><tr><td> <textarea onkeydown=ctlent() name="content" rows="12" cols="68" title="可以使用Ctrl+Enter直接提交帖子" wrap="soft" ><%if bisquotepost=true then response.write quotecontent%></textarea></td><td> <font color=red>*</font></td></tr></table></td></tr>
<tr bgcolor="<%=TablebodyColor1%>">
<td valign=middle colspan=2 align=center><font color="<%=TableContentcolor%>">
<input type=Submit value="发 表" name=Sbmt>
<input type="reset" name="reset" value="清 除">
</td></tr>
</table>
</td>
</tr>
</table>
</center></div>
</form>
<script language="javascript">
function checklength(theform) {
var ly=frmgbk.content.value;
var strlen=strlength(ly);
alert("您的帖子长度为 "+strlen+" 字符.");
}
</script>
<%
end sub
sub savereply()
if chktopic=false then
exit sub
end if
if chkdata=false then
session("lastpost")=Now()
exit sub
end if
IP=Request.ServerVariables("REMOTE_ADDR")
mood=Request.Form("mood")&".gif"
UserName=Checkstr(membername)
Sql="insert into bbs(parentid,username,topic,body,signTime,ip,mood) values "&_
"("&RootID&",'"&UserName&"','"&topic&"','"&body&"',now(),'"&ip&"','"&mood&"')"
conn.execute(sql)
conn.execute("update bbs set replys=replys+1 where parentid=0 and bbsid="&rootid)
conn.execute("update config set bbsnum=bbsnum+1,todayNum="&alltodays())
session("lastpost")=Now()
rURL="ShowThread.asp?RootID="&rootid
rtitle="发表帖子成功"
rmsg="<FONT COLOR="&TableContentcolor&">本页面将在3秒后自动返回您所发表的帖子页面,<b>您可以选择以下操作:</b><br><ul>"&_
"<li><a href=ForumDisplay.asp><font color="&TableContentcolor&">返回校友论坛</font></a></li>"&_
"<li><a href=ShowThread.asp?RootID="&rootid&"><font color="&TableContentcolor&">发表的帖子</font></a></li>"&_
"</ul>"
redirect 3,rurl,rtitle,rmsg
set rs=nothing
end sub
function alltodays()
tmprs=conn.execute("Select count(bbsid) from bbs Where datediff('d',signtime,Now())=0")
alltodays=tmprs(0)
set tmprs=nothing
if isnull(alltodays) then alltodays=0
end function
function chkData()
if not isnull(session("lastpost")) then
if DateDiff("s",session("lastpost"),Now())<10 then
ErrMsg=ErrMsg+"<Br>"+"<li>本论坛限制发贴间隔时间为10秒,请稍后再发。"
call error("Exclamation",errmsg)
chkdata=false
exit function
end if
end if
if chkpost=false then
ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法,请不要从外部提交数据。"
call error("Critical",errmsg)
chkdata=false
exit function
end if
Topic=Checkstr(trim(request("title")))
if strLength(topic)>100 then
FoundErr=True
ErrMsg=ErrMsg+"<Br>"+"<li>主题长度不能超过100个字符!"
end if
Body=Checkstr(rtrim(request.form("content")))
if body="" then
ErrMsg=ErrMsg+"<Br>"+"<li>没有填写帖子内容。"
FoundErr=true
elseif strLength(body)>(Maxboardsize*1024) then
ErrMsg=ErrMsg+"<Br>"+"<li>帖子内容不得大于" & Maxboardsize & "KBytes"
FoundErr=true
end if
if founderr=true then
chkdata=false
call error("Information",errmsg)
else
chkdata=true
end if
end function
%>
<%call footer()%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -