<!-- #include file="../Inc.asp" -->
<!-- #include file="../ydzq.asp" -->
<!-- #include file="conn.asp" -->
<!--#include file="../forbbs.asp"-->
<%Call Head()
call zonecard("编辑日志","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
if uid="" or IsNumeric(uid)=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 rs("uid")<>myid and admin<>2 then
  Call Error("权限不足！")
  end if
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/>"
response.write "<anchor>返回上级<prev/></anchor><br/>"
dim rsfrdt
set rsfrdt=Server.CreateObject("ADODB.Recordset")
rsfrdt.open"select * from frzonedt",conn,1,2
rsfrdt.addnew
rsfrdt("txt")="<a href=""index.asp?uid="&myid&"&amp;sid=[sid]"">"&myni&"</a>修改了"
rsfrdt("fgid")=myid
rsfrdt("rjid")=id
rsfrdt("rc")=1
rsfrdt("htm")=now()
rsfrdt.update
rsfrdt.close
set rsfrdt=nothing
else
set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select * from zonerj where id="&id,conn,1,1
if rs("uid")<>myid and admin<>2 then
  Call Error("权限不足！")
rs.close
set rs=nothing
  end if
if myid=clng(uid) then
response.write "<a href=""index_gl.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">个人中心</a>|"
end if
response.write "<a href=""index.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">主页</a>|"&_
               "<a href='blog.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>日志</a>|"&_
               "<a href='user_info.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>个人档</a><br/>"&_
               zonepost("editbbs.asp?uid="&uid&"&amp;id="&id&"&amp;sid="&sid&"&amp;saytk="&saytk&"")
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 v=2 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?uid="&uid&"&amp;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
call zonelast()
Call Headsay()
%>                          