<!-- #include file="setup.asp" -->
<!-- #include file="ubb.asp" -->
<!-- #include file="pet_conn.asp" -->
<!-- #include file="pet_config.asp" -->
<%
top

if Request.Cookies("username")=empty then error("<li>您还未<a href=login.asp>登录</a>社区")

DetectPost

id=int(Request("id"))

sql="Select * From [forum] where ID="&ID&""
rs.Open sql,Conn,1
if rs("locktopic")=1 then error("<li>此主题已经关闭，不接受新的回复")
forumid=rs("forumid")
ReList=rs("ReList")
rs.close

username=Request.Cookies("username")
topic=HTMLEncode(Request("topic"))
content=ContentEncode(Request.Form("content"))



if badwords<>empty then
filtrate=split(badwords,"|")
for i = 0 to ubound(filtrate)
topic=ReplaceText(topic,""&filtrate(i)&"",string(len(filtrate(i)),"*"))
content=ReplaceText(content,""&filtrate(i)&"",string(len(filtrate(i)),"*"))
next
end if

If not conn.Execute("Select username From [prison] where username='"&username&"'" ).eof Then error("<li>您被关进<a href=prison.asp>监狱</a>")


sql="select * from bbsconfig where id="&forumid&""
Set Rs=Conn.Execute(sql)
bbsname=rs("bbsname")
followid=rs("followid")
rs.close

if membercode>1 or instr("|"&moderated&"|","|"&Request.Cookies("username")&"|")>0 then UserPopedomPass=1


if Request.ServerVariables("request_method") = "POST" and Request("preview")="" then

if Len(content)<2 then message=message&"<li>文章内容不能小于 2 字符"

if Request.Cookies("posttime")<>empty then
if DateDiff("s",Request.Cookies("posttime"),Now()) < int(PostTime) then message=message&"<li>为防止有人用程序灌水，论坛限制一个人两次发帖间隔必须大于"&PostTime&"秒！"
end if

if message<>"" then error(""&message&"")

sql="select * from [user] where username='"&HTMLEncode(username)&"'"
rs.Open sql,Conn,1,3


if rs("userlife")<3 then
message=message&"<li>您的体力值 < <FONT color=red>3</FONT> 不能发表文章<li>每有效停留时间<FONT color=red> 10 </FONT>分钟：体力值：<FONT color=red>+10</FONT>"
end if
if rs("experience")<1 and Reg10 = 1 then message=message&"<li>新注册用户登录社区停留<FONT color=red> 10 </FONT>分钟以上才可发表帖子"

if message<>"" then error(""&message&"")


if UserPopedomPass<>1 then rs("userlife")=rs("userlife")-3
rs("postrevert")=rs("postrevert")+1
rs("money")=rs("money")+hqian
rs("experience")=rs("experience")+hjingyan
rs("magicpower")=rs("magicpower")+hmeili
rs("power")=rs("power")+hweiwang
rs("landtime")=now()
rs.update
rs.close



sql="insert into [reforum"&ReList&"] (topicid,username,content,postip) values ('"&id&"','"&Request.Cookies("username")&"','"&content&"','"&Request.ServerVariables("REMOTE_ADDR")&"')"
conn.Execute(SQL) 

conn.execute("update [forum] set lastname='"&username&"',replies=replies+1,lasttime='"&now()&"' where ID="&ID&"")
conn.execute("update [bbsconfig] set lasttopic='<a href=ShowPost.asp?id="&id&">"&left(topic,15)&"</a>',lastname='"&username&"',lasttime='"&now()&"',today=today+1,tolrestore=tolrestore+1 where id="&forumid&"")
conn.execute("update [clubconfig] set today=today+1")

Response.Cookies("posttime")=now

conn_pet.ExeCute("UPDATE mypetdata SET mypetexp= mypetexp+"&DEF_PET_replytopicexp&" WHERE username ='"&Request.Cookies("username")&"' and mypetdead <1")

Application.Lock
Application(CacheName&"CountReforum") = Application(CacheName&"CountReforum")+1
Application.UnLock

message=message&"<li>回复主题成功<li><a href=ShowPost.asp?id="&id&">返回主题</a><li><a href=ShowForum.asp?forumid="&forumid&">返回论坛</a><li><a href=Default.asp>返回论坛首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=ShowPost.asp?id="&id&">")


end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''






if Request("quote")=1 and Request("preview")="" then

if isnumeric(""&Request("retopicid")&"") then
sql="select * from [reforum"&ReList&"] where id="&Request("retopicid")&""
else
sql="select * from [forum] where ID="&id&""
end if
Set Rs=Conn.Execute(sql)
content =rs("content")
content=UBBCode(content)
lock=rs("lock")
if lock=0 then
quote="[quote]原文由 [B][color=#ff4242]"&rs("username")&"[/color][/B] 发表:<br>"&vbCrlf&""&content&""&vbCrlf&"[/quote]"
else
quote="[quote]原文由 [B][color=#ff4242]"&rs("username")&"[/color][/B] 发表:<br>"&vbCrlf&"[color=#ff4242]帖子内容已被屏蔽[/color]"&vbCrlf&"[/quote]"
end if
rs.close

end if


%>
	<table border="0" width="<%=dkuan%>" align="center" cellspacing="1" cellpadding="4" class=a2>
		<tr class=a3>
			<td height="25">&nbsp;<img src=images/Forum_nav.gif>&nbsp; <%ClubTree%> → <%ForumTree(followid)%><%=ForumTreeList%> <a href=ShowForum.asp?forumid=<%=forumid%>><%=bbsname%></a> → <a href="ShowPost.asp?id=<%=id%>"><%=topic%></a> → 回复帖子</td>
		</tr>
	</table><br>



<SCRIPT>valigntop()</SCRIPT>
<TABLE cellSpacing=1 cellPadding=5 width=<%=dkuan%> border=0 class=a2 align="center">





<form name="yuziform" method="post" onSubmit="return CheckForm(this);">
<input name="content" type="hidden" value='<%=quote%>'>
<input type="hidden" value="<%=Request("topic")%>" name="topic">

<input type=hidden name=id value=<%=id%>>
<script>
function showdz(sid)
{
whichEl = eval("dz" + sid);
if (whichEl.style.display == "none")
{
eval("dz" + sid + ".style.display=\"\";");
}
else
{
eval("dz" + sid + ".style.display=\"none\";");
}
}
</script>

<TR>
<TD vAlign=left class=a1 colSpan=2 height=25><b>回复文章</b></TD></TR>
<TR>
<TD width=160 class=a4 height=25><B>用户名称</B></TD>
<TD width=574 class=a4 height=25><%=Request.Cookies("username")%> [<a href="login.asp?menu=out">退出登录</a>]</TD>
</TR>
<TR>
<TD vAlign=top class=a3>
<TABLE cellSpacing=0 cellPadding=0 width=100% align=left border=0>

<TR>
<TD vAlign=top align=left width=100% class=a3><B>文章内容</B><BR>
(<a href="javascript:CheckLength();">查看内容长度</a>)<BR><BR>
</TD></TR>
<TR>
<TD vAlign=center align=center width=100%>
<TABLE
style="BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; BORDER-BOTTOM: 1px inset"
cellSpacing=1 cellPadding=3 border=0>
<TR align=middle>
<td>
<a href=zt.asp target=_blank><font color=red><b>转贴工具</b></font></a>
</td>

</TR></TABLE>
<br>
<INPUT id=showdz0 name=showdz0 type=checkbox value=1 onclick="showdz(0)"><label for=showdz0> 巧嘴娃娃系列</label><br>
<INPUT id=showdz1 name=showdz1 type=checkbox value=1 onclick="showdz(1)"><label for=showdz1> 显示表情选项</label><br>
<INPUT id=showdz2 name=showdz2 type=checkbox value=1 onclick="showdz(2)"><label for=showdz2> 显示贴图选项</label><br>
<INPUT id=showdz3 name=showdz3 type=checkbox value=1 onclick="showdz(3)"><label for=showdz3> 发贴动作选项</label><br>
<INPUT id=showdz4 name=showdz4 type=checkbox value=1 onclick="showdz(4)"><label for=showdz4> 魔幻特效选项</label><br>

</TD></TR>
</TABLE></TD>
<TD class=a3 height=250>

<script src="inc/mt.js" ></script>
<SCRIPT src="inc/post.js"></SCRIPT>
</TD></TR>

<TR>
<TD align=left class=a3>
<IMG src=images/affix.gif><b>增加附件</b>
<%if membercode>filecode then%>
<TD align=left class=a3><font color="FFFFFF"><b><IFRAME src="upfile.asp" frameBorder=0 width="100%" scrolling=no height=25></IFRAME></b></font></TD></TR>
<%else%>
<TD align=left class=a3 width="300"><font color="#FF0000"><b>您没有上传附件的权限......加油哦......^_^</b></font></TD></TR>
<%end if%>

<!-------------------------------------------------->
<TR id=dz0 style=DISPLAY:none>
<TD vAlign=top align=left width=160 class=a4>巧嘴娃娃系列<br><font color=red>使用需要50金币/个</font></td>
<TD class=a4 width=77.9%>
<iframe src="images/swf/qiaozui.asp" height="51" width="551" scrolling="no" frameborder=0 marginwidth="1" marginheight="1" allowtransparency="true">浏览器不支持嵌入式框架，或被配置为不显示嵌入式框架.</iframe>
</td></tr>

<TR id=dz1 style=DISPLAY:none>
<TD align=center width=160 class=a4>表情图片系列<br>　</td>
<TD class=a4 width=77.9%>
<script>
ii=0
for(i=1;i<=75;i++) {
index = Math.floor(Math.random() * 75+1);
ii=ii+1
document.write(" <a href=javascript:emoticon('"+index+"')><img border=0 src=images/Emotions/"+index+".gif></a>")
if (ii==75){document.write("<br>");ii=0;}
}
</script>
</td></tr>

<TR id=dz2 style=DISPLAY:none>
<TD align=center width=160 class=a4>贴图图片系列<br>　</td>
<TD class=a4 width=77.9%>
<script>

ii=0
for(i=1;i<=58;i++) {
index = Math.floor(Math.random() * 58+1);
ii=ii+1
document.write(" <a href=javascript:emoticon1('"+index+"')><img border=0 src=images/dongzuo/em"+index+".gif></a>")
if (ii==58){document.write("<br>");ii=0;}
}
</script>
</td></tr>

<TR id=dz3 style=DISPLAY:none>
<TD align=center width=160 class=a4>发贴动作系列<br>　</td>
<TD class=a4 width=77.9%>
&nbsp;<a href="javascript:emotshow('\/招呼')" style="CURSOR: hand">招呼</a> 
&nbsp;<a href="javascript:emotshow('\/欢迎')" style="CURSOR: hand">欢迎</a> 
&nbsp;<a href="javascript:emotshow('\/灌水')" style="CURSOR: hand">灌水</a> 
&nbsp;<a href="javascript:emotshow('\/无聊')" style="CURSOR: hand">无聊</a> 
&nbsp;<a href="javascript:emotshow('\/负责')" style="CURSOR: hand">负责</a> 
&nbsp;<a href="javascript:emotshow('\/生气')" style="CURSOR: hand">生气</a> 
&nbsp;<a href="javascript:emotshow('\/高兴')" style="CURSOR: hand">高兴</a> 
&nbsp;<a href="javascript:emotshow('\/鼓掌')" style="CURSOR: hand">鼓掌</a> 
&nbsp;<a href="javascript:emotshow('\/等待')" style="CURSOR: hand">等待</a> 
&nbsp;<a href="javascript:emotshow('\/反对')" style="CURSOR: hand">反对</a> 
&nbsp;<a href="javascript:emotshow('\/浪漫')" style="CURSOR: hand">浪漫</a> 
&nbsp;<a href="javascript:emotshow('\/不要')" style="CURSOR: hand">不要</a> 
&nbsp;<a href="javascript:emotshow('\/找死')" style="CURSOR: hand">找死</a> 
&nbsp;<a href="javascript:emotshow('\/去死')" style="CURSOR: hand">去死</a> 
&nbsp;<a href="javascript:emotshow('\/狂笑')" style="CURSOR: hand">狂笑

</a><br> 
&nbsp;<a href="javascript:emotshow('\/傻笑')" style="CURSOR: hand">傻笑</a> 
&nbsp;<a href="javascript:emotshow('\/痛哭')" style="CURSOR: hand">痛哭</a> 
&nbsp;<a href="javascript:emotshow('\/道别')" style="CURSOR: hand">道别</a> 
&nbsp;<a href="javascript:emotshow('\/跳舞')" style="CURSOR: hand">跳舞</a> 
&nbsp;<a href="javascript:emotshow('\/失望')" style="CURSOR: hand">失望</a> 
&nbsp;<a href="javascript:emotshow('\/害羞')" style="CURSOR: hand">害羞</a> 
&nbsp;<a href="javascript:emotshow('\/比酷')" style="CURSOR: hand">比酷</a> 
&nbsp;<a href="javascript:emotshow('\/救命')" style="CURSOR: hand">救命</a> 
&nbsp;<a href="javascript:emotshow('\/狂妄')" style="CURSOR: hand">狂妄</a> 
&nbsp;<a href="javascript:emotshow('\/拳击')" style="CURSOR: hand">拳击</a> 
&nbsp;<a href="javascript:emotshow('\/我踢')" style="CURSOR: hand">我踢</a> 
&nbsp;<a href="javascript:emotshow('\/我踩')" style="CURSOR: hand">我踩</a> 
&nbsp;<a href="javascript:emotshow('\/饶命')" style="CURSOR: hand">饶命</a> 
&nbsp;<a href="javascript:emotshow('\/眨眼')" style="CURSOR: hand">眨眼</a> 
&nbsp;<a href="javascript:emotshow('\/臭美')" style="CURSOR: hand">臭美

</a><br> 
&nbsp;<a href="javascript:emotshow('\/变态')" style="CURSOR: hand">变态</a> 
&nbsp;<a href="javascript:emotshow('\/拼酒')" style="CURSOR: hand">拼酒</a> 
&nbsp;<a href="javascript:emotshow('\/深情')" style="CURSOR: hand">深情</a> 
&nbsp;<a href="javascript:emotshow('\/恶心')" style="CURSOR: hand">恶心</a> 
&nbsp;<a href="javascript:emotshow('\/惊讶')" style="CURSOR: hand">惊讶</a> 
&nbsp;<a href="javascript:emotshow('\/抽烟')" style="CURSOR: hand">抽烟</a> 
&nbsp;<a href="javascript:emotshow('\/怀疑')" style="CURSOR: hand">怀疑</a> 
&nbsp;<a href="javascript:emotshow('\/拉勾')" style="CURSOR: hand">拉勾</a> 
&nbsp;<a href="javascript:emotshow('\/经典')" style="CURSOR: hand">经典</a> 
&nbsp;<a href="javascript:emotshow('\/唱歌')" style="CURSOR: hand">唱歌</a> 
&nbsp;<a href="javascript:emotshow('\/ＯＫ')" style="CURSOR: hand">ＯＫ</a> 
&nbsp;<a href="javascript:emotshow('\/同意')" style="CURSOR: hand">同意</a> 
&nbsp;<a href="javascript:emotshow('\/生日')" style="CURSOR: hand">生日</a> 
&nbsp;<a href="javascript:emotshow('\/kiss')" style="CURSOR: hand">kiss</a> 
&nbsp;<a href="javascript:emotshow('\/晕倒')" style="CURSOR: hand">晕倒

</a><br> 
&nbsp;<a href="javascript:emotshow('\/气你')" style="CURSOR: hand">气你</a> 
&nbsp;<a href="javascript:emotshow('\/错啦')" style="CURSOR: hand">错啦</a> 
&nbsp;<a href="javascript:emotshow('\/加油')" style="CURSOR: hand">加油</a> 
&nbsp;<a href="javascript:emotshow('\/恭喜')" style="CURSOR: hand">恭喜</a> 
&nbsp;<a href="javascript:emotshow('\/简单')" style="CURSOR: hand">简单</a> 
&nbsp;<a href="javascript:emotshow('\/鼓励')" style="CURSOR: hand">鼓励</a> 
&nbsp;<a href="javascript:emotshow('\/过奖')" style="CURSOR: hand">过奖</a> 
&nbsp;<a href="javascript:emotshow('\/原谅')" style="CURSOR: hand">原谅</a> 
&nbsp;<a href="javascript:emotshow('\/大笑')" style="CURSOR: hand">大笑</a> 
&nbsp;<a href="javascript:emotshow('\/感动')" style="CURSOR: hand">感动</a> 
&nbsp;<a href="javascript:emotshow('\/叹气')" style="CURSOR: hand">叹气</a> 
&nbsp;<a href="javascript:emotshow('\/道谢')" style="CURSOR: hand">道谢</a> 
&nbsp;<a href="javascript:emotshow('\/摇头')" style="CURSOR: hand">摇头</a> 
&nbsp;<a href="javascript:emotshow('\/点头')" style="CURSOR: hand">点头</a> 
&nbsp;<a href="javascript:emotshow('\/拥抱')" style="CURSOR: hand">拥抱</a>
</td></tr>

<TR id=dz4 style=DISPLAY:none>
<TD align=center width=160 class=a4>魔幻特效选项<br>　</td>
<TD class=a4 width=77.9%>
&nbsp;<img src=images/ybb/html.gif alt=插入代码 align=absmiddle style=cursor:hand onClick=YBBhtml()> 
&nbsp;<img src=images/ybb/light.gif alt=发光文字 align=absmiddle style=cursor:hand onClick=YBBlight()> 
&nbsp;<img src=images/ybb/fly.gif alt=飞行文字 align=absmiddle style=cursor:hand onClick=YBBfly()> 
&nbsp;<img src=images/ybb/move.gif alt=移动文字 align=absmiddle style=cursor:hand onClick=YBBmove()> 
&nbsp;<img src=images/ybb/glow.gif alt=彩闪文字 align=absmiddle style=cursor:hand onClick=YBBglow()> 
&nbsp;<img src=images/ybb/shadow.gif alt=阴影文字 align=absmiddle style=cursor:hand onClick=YBBshadow()>
&nbsp;<img src=images/ybb/blur.gif alt=模糊文字 align=absmiddle style=cursor:hand onClick=YBBblur()> 
&nbsp;<img src=images/ybb/ysqq.gif alt=魔幻表情 align=absmiddle style=cursor:hand onClick=YSQQ()> 
</td></tr>
<!-------------------------------------------------->


<TR>
<TD align=middle class=a3 colSpan=2 height=27>
<INPUT tabIndex=4 type=submit value=回复主题 name=submit1>&nbsp; <input name=preview type="Button" value=" 预 览 " onclick="Gopreview()">   <INPUT type=reset value=" 重 置 "></TD></TR></FORM>
</TABLE>
<SCRIPT>valignbottom()</SCRIPT>
<form name=preview action=preview.asp method=post target=preview_page><input name="content" type="hidden"></form>

<%

htmlend
'#############TCBBS特殊贴#############
sub szhotdog_sppost
if instr(lcase(content),"[replyview]")>0 then
content="<font color=red>此内容不能引用</font>"
elseif instr(lcase(content),"[buy=")>0 then
content="<font color=red>此内容不能引用</font>"
elseif instr(lcase(content),"[point=")>0 then
content="<font color=red>此内容不能引用</font>"
elseif instr(lcase(content),"[fact=")>0 then
content="<font color=red>此内容不能引用</font>"
elseif instr(lcase(content),"[money=")>0 then
content="<font color=red>此内容不能引用</font>"
elseif instr(lcase(content),"[power=")>0 then
content="<font color=red>此内容不能引用</font>"
elseif instr(lcase(content),"[magicpower=")>0 then
content="<font color=red>此内容不能引用</font>"
end if
end sub
%>
'#############TCBBS特殊贴#############