<!-- #include file="../Inc.asp" -->
<!-- #include file="../ydzq.asp" -->
<!-- #include file="conn.asp" -->
<%
call zoneHead()
dim action,name,id
id=request.querystring("id")
action=request.querystring("action")
if action="ok" then
if id="" or Isnumeric(id)=False then
call zonecardy("出错了","blog.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"")
response.write "ID无效！<br/>"
call zoneLast()
call zonexml()
response.end
  end if
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select userid from [zonerjpl] where id="&id,conn,1,1
if rs("userid")<>myid or admin<>2 then
call zonecardy("出错了","blog.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"")
response.write "已删除成功，如不成功则权限不足！<br/>"
call zoneLast()
call zonexml()
response.end
  end if
  set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select userid,zonezid from [zonerjpl] where id="&id,conn,1,1
if rs.eof then
call zonecardy("出错了","blog.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"")
response.write "不存在的回复！<br/>"
call zoneLast()
call zonexml()
response.end
  end if
dim fid,zid
fid=rs("userid")
zid=rs("zonezid")
call zonecardy("删除日志评论","blog.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"")
	SQL="delete from zonerjpl Where id="&id&""
	Conn.Execute(SQL)
	SQL1="update zone set myrelnum = myrelnum-1  Where zoneid="&fid&""
	Conn.Execute(SQL1)
	SQL2="update zonerj set hc = hc-1 Where id="&zid&""
	Conn.Execute(SQL2)
Response.Write "成功删除日志评论！正在返回日志列表.."&_
               "<br/><a href='blog.asp?uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>日志列表</a><br/>"
call zoneLast()
call zonexml()
rs.close
set rs=nothing
else
call zonecard("删除日志评论","left")
 Response.Write "确认删除该日志评论？<br/>"&_
                "<a href='blogpl_del.asp?Action=ok&amp;id="&id&"&amp;uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>是的</a><br/>"&_
                "<a href='blog_view.asp?id="&id&"&amp;uid="&uid&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>取消</a><br/>"
call zoneLast()
call zonexml()
end if
conn.close
set conn=nothing
%>                         