<!-- #include file="setup.asp" -->
<%
if Request.Cookies("username")=empty then error("<li>您还未<a href=login.asp>登录</a>社区")
id=int(Request("id"))
top

sql="Select * From [forum] where ID="&ID&""
rs.Open sql,Conn,1
forumid=rs("forumid")
ReList=rs("ReList")
rs.close

if membercode>3 or instr("|"&Conn.Execute("Select moderated From [bbsconfig] where id="&forumid&"")(0)&"|","|"&Request.Cookies("username")&"|")>0 then
UserPopedomPass=1
end if

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

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

topic=HTMLEncode(Request.Form("idtopic"))
content=ContentEncode(Request.Form("content"))
color=HTMLEncode(Request.Form("color"))




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 content=empty then message=message&"<li>内容没有填写"

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

if isnumeric(""&Request("retopicid")&"") then


sql="select * from [reforum"&ReList&"] where id="&Request("retopicid")&""
else
sql="select * from [forum] where ID="&ID&" and forumid="&forumid&""
end if

rs.Open sql,Conn,1,3
if rs("username")<>Request.Cookies("username") and UserPopedomPass<>1 then error("<li>对不起，您的权限不够！")

if UserPopedomPass=1 and color<>"" then topic="<font color="&color&">"&topic&"</font>"
if topic<>empty then rs("topic")=""&topic&""

if membercode < 5 then content=""&content&"<br>［此帖子已被 "&Request.Cookies("username")&" 在 "&now()&" 编辑过，内容己经不同了］"
rs("content")=content



rs.update
rs.close



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=ShowForum.asp?forumid="&forumid&">")

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

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

if isnumeric(Request("retopicid")) then
sql="select * from [reforum"&ReList&"] where id="&Request("retopicid")&""
else
sql="select * from [forum] where ID="&id&" and forumid="&forumid&""
end if
Set Rs=Conn.Execute(sql)
if rs.eof then error("<li>数据库中不存在此帖子的数据")
if rs("username")<>Request.Cookies("username") and UserPopedomPass<>1 then error("<li>对不起，您的权限不够！")
content =rs("content")
rs.close

%>

<!-- #include file="inc/validate.asp" -->
	<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%>"><%=Request("topic")%></a> → 编辑帖子</td>
		</tr>
	</table><br>

<script>
function showadv(){
if (document.yuziform.advshow.checked == true) {
adv.style.display = "";
}else{
adv.style.display = "none";
}
}

function title_color(color){document.yuziform.topic.style.color = color;}
</script>
<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>

<SCRIPT>function title_color(color){document.yuziform.idtopic.style.color = color;}</SCRIPT>

<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='<%=server.htmlencode(content)%>'>


<TR>
<TD id=titlelarge vAlign=left colSpan=2 height=25 class=a1><b>编辑帖子</b></TD></TR>
<TR class=a4>
<TD width="20%" height=25><B>文章标题</B>&nbsp; 
<%if not isnumeric(Request("retopicid")) then%>
<%  Set rs= Server.CreateObject("ADODB.Recordset")
 sql="select focus from [bbsconfig] where id="&forumid&""
 rs.open sql,conn,1,1
 focus=""&rs("focus")&""
%>
<select name="focus"><option value="">专题</option>
 <%
if focus<>empty then
focus=split(focus,"|")
for i=1 to Ubound(focus)
response.Write("<option value="&focus(i)&" >"&focus(i)&"</option>")
 next
 end if
 %></select>
</TD>

<TD width=574 height=25>
<INPUT maxLength=50 size=60 name=idtopic value="<%=Request("topic")%>">
<%if UserPopedomPass=1 then %>
<SELECT name=color onchange="title_color(this.options[this.selectedIndex].value)">
<option value="">颜色</option>
<option style=background-color:Black;color:Black value=Black>黑色</option>
<option style=background-color:green;color:green value=green>绿色</option>
<option style=background-color:red;color:red value=red>红色</option>
<option style=background-color:blue;color:blue value=blue>蓝色</option>
<option style=background-color:Navy;color:Navy value=Navy>深蓝</option>
<option style=background-color:Teal;color:Teal value=Teal>青色</option>
<option style=background-color:Purple;color:Purple value=Purple>紫色</option>
<option style=background-color:Fuchsia;color:Fuchsia value=Fuchsia>紫红</option>
<option style=background-color:Gray;color:Gray value=Gray>灰色</option>
<option style=background-color:Olive;color:Olive value=Olive>橄榄</option></SELECT>
<%end if%>
</TD></TR>
<%end if%>

<TR>
<TD vAlign=top class=a3 width="20%">
<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 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>
</script>
</TR></TABLE></TD></TR><TR><TD>
   <p align="center">
<INPUT id=advcheck name=advshow type=checkbox value=1 onclick=showadv()><label for=advcheck> 显示投票选项</label><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>
<INPUT id=showdz5 name=showdz5 type=checkbox value=1 onclick="showdz(5)"><label for=showdz5> 特殊贴子选项</label><br>


</TD></TR>
</TABLE>
</TD><TD class=a3 height=250>
<script src="inc/mt.js" ></script>
<SCRIPT src="inc/post.js"></SCRIPT>

<TR id=adv style=DISPLAY:none>
<TD vAlign=top align=left width=160 class=a4>
<FONT color=000000><B>投票项目</B><BR>
每行一个投票项目<BR><BR>
<INPUT type=radio CHECKED value=0 name=multiplicity id=multiplicity>
<label for=multiplicity>单选投票</label>
<BR><INPUT type=radio value=1 name=multiplicity id=multiplicity_1> <label for=multiplicity_1>多选投票</label></FONT>

</TD>
<TD class=a4>
<TEXTAREA name=vote rows=5 style="width:100%"></TEXTAREA>
</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="red"><b>您没有上传附件的权限......加油哦......^_^</b></font></TD></TR>
<%end if%>

<!-------------------------------------------------->
<TR>
<TR id=dz0 style=DISPLAY:none>
<TD align=center 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<=56;i++) {
index = Math.floor(Math.random() * 56+1);
ii=ii+1
document.write(" <a href=javascript:emoticon('"+index+"')><img border=0 src=images/Emotions/"+index+".gif></a>")
if (ii==56){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 id=dz5 style=DISPLAY:none>
<TD align=center width=160 class=a4>特殊贴子选项<br>　</td>
<TD class=a4 width=77.9%>
&nbsp;<img src=images/ybb/replyview.gif alt=回复查看 align=absmiddle style=cursor:hand onClick=replyview()> 
&nbsp;<img src=images/ybb/power.gif alt=威望查看 align=absmiddle style=cursor:hand onClick=power()> 
&nbsp;<img src=images/ybb/fact.gif alt=帮派查看 align=absmiddle style=cursor:hand onClick=fact()> 
&nbsp;<img src=images/ybb/glamour.gif alt=魅力查看 align=absmiddle style=cursor:hand onClick=magicpower()> 
&nbsp;<img src=images/ybb/point.gif alt=经验查看 align=absmiddle style=cursor:hand onClick=point()> 
&nbsp;<img src=images/ybb/money.gif alt=限钱查看 align=absmiddle style=cursor:hand onClick=money()>
&nbsp;<img src=images/ybb/buy.gif alt=金钱查看 align=absmiddle style=cursor:hand onClick=buypost()> 
</td></tr>
<!-------------------------------------------------->


<TR>
<TD align=middle class=a3 colSpan=2 height=27>
<INPUT tabIndex=4 type=submit value=确定编辑 name=submit1> <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 checkbuy(contentT)
if instr(lcase(contentT),"[buy=")>0 then
contentT1=split(contentT,"[buy=")
contentT2=replace(contentT,contentT1(0)&"[buy=","")
contentT2=split(contentT2,"]")
	if isnumeric(contentT2(0)) then
		if conn.execute("select [money] from [user] where username='"&Request.Cookies("username")&"'")(0)-(5*int(contentT2(0)))>0 and int(contentT2(0))>0 then
		'contentT=replace(replace(contentT,"[guy]","[￥sppost]"),"[$/sppost]","[￥/sppost]")
			if instr(lcase(contentT),"[/guy]")>0 then
			filtrate=split(content,"[/guy]")
			for i = 0 to ubound(filtrate)
			
			next
			if i>2 then error("<li>[guy]授权命令错误"&i)
			else
			contentT=contentT&"[guy][/guy]"
			end if
		conn.execute("update [user] set [money]=[money]-"&(5*int(contentT2(0)))&" where username='"&Request.Cookies("username")&"'")
		else
		contentT=replace(contentT,"[buy=","")
		end if
	else
	contentT=replace(contentT,"[buy=","")
	end if
end if
content=contentT
end sub
%>
'###############TCBBS特殊贴##############