<!-- #include file="conn.asp" -->
<!--#include file="../../bbs/forbbs.asp"-->
<%Call Head()
call saycard("编辑日志","left")
dim page,id,newContent,TP,newtitle,act
act=clng(request("act"))
if page="" then page="1"
id=request("id")
newtitle=Forbbs(request.form("newtitle"))
newContent=forbbs(request.form("newContent"))

if id="" or IsNumeric(id)=False then
  Call Error("ID无效！")
  end if



TP=request("TP")
if TP<>"" then

if act=2 then
if newtitle="" then
  Call Error("标题不能为空！")
  end if
  end if

if newContent="" then
  Call Error("内容不能为空！")
  end if
  	newContent=replace(newContent,"sid=sid","sid=@@sid@@")
  	
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from zonerj where id="&id,conn,1,2

if act=1 then
rs("txt")=rs("txt")+"[续]"+newContent
else
rs("tit")=newtitle
rs("txt")=newContent+"[br]["&fordate(now)&"被"&myni&"编辑]"
end if
rs.update
rs.close
set rs=nothing
response.write"编辑成功！<br/>"

else
set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select * from zonerj where id="&id,conn,1,1
if saytk>1 then
Response.Write "<form action=""editbbs.asp?id="&id&"&amp;sid="&sid&"&amp;saytk="&saytk&""" method=""post"">"
end if

if act=1 then
 Response.Write "续写内容：<br/>"&_
                "<input name=""newContent"" value=""""/><br/>"
else
set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select txt,tit from zonerj where id="&id,conn,1,1
dim V_content
V_content=rs("txt")
V_content=replace(V_content,"sid=@@sid@@","sid=sid")


 Response.Write "帖子标题：<br/>"&_
                "<input name=""newtitle"" value="""&ubb(rs("tit"))&"""/><br/>"&_
                "帖子内容：<br/>"&_
                "<input name=""newContent"" value="""&ubb(V_content)&"""/><br/>"
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
 if saytk>1 then
Response.Write "<input type=""hidden"" name=""act"" value=""" & act & """/>"&_
               "<input type=""hidden"" name=""TP"" value=""1""/>"&_
               "<input type=""submit"" value=""确定提交""/></form><br/>"
else
Response.Write "<anchor>[确定提交]"&_
               "<go href=""editbbs.asp?id="&id&"&amp;sid="&sid&"&amp;saytk="&saytk&""" method=""post"" accept-charset='utf-8'>"
if act=2 then
 Response.Write "<postfield name=""newtitle"" value=""$(newtitle)""/>"
end if
 Response.Write "<postfield name=""newContent"" value=""$(newContent)""/>"&_
                "<postfield name=""TP"" value=""1""/>"&_
                "<postfield name=""act"" value="""&act&"""/>"&_
                "</go></anchor><br/>"
end if
end If
response.write "<br/><a href='blog.asp?sid="&sid&"&amp;saytk="&saytk&"'>返回所有日记</a>"
%>
<!--#include file="fanhui.asp"-->
<%
Call Headsay()
%>                          