<!-- #include file="share.asp" -->
<!-- #include file="top.asp" -->
<%
dim bid  'as global var
dim bdid 'as global var
bdid=request("bdid")
if not bdid="" then
	bdid=cint(bdid)
else
	response.redirect "../error.asp?emsg=这个版面不存在。"
	response.end
end if
%>
				<%
				issure=request.form("issure")
				if issure="sure" then
					rid=request.form("rid")
					if rid="" then
						%>不知道你要删除的回复的id，无法继续。[rid: <%=rid%>]<p><%
					else
						delthis
					end if
				else
					showsure
				end if
				%>
<%
'=======================f===delete reply in reply=======
sub delthis
if session("bluelogin")="yes" then
if session("blueauthority")<=0 then
	response.redirect "error.asp?emsg=Sorry, 你的权限不够."
	response.end
else
	dim rs
	dim sql
	sql="select * from reply where rid="&rid
	set rs=server.createobject("adodb.recordset")
	'opendb
	on error resume next
	rs.open sql,conn, 1,3
	if rs.eof then
		response.redirect "error.asp?emsg=没有找到回复文章!"
		response.end
	else
		bid=rs("bid")
		rs.delete
		rs.update
	end if
	checkerr
	rs.close
	set rs=nothing
	'closedb
	delreplymk
	response.redirect "main.asp?bdid="&bdid
	response.end
end if
end if
end sub
sub delreplymk  '==============f===delete marks in book=========
	sql="select * from book where bid="&bid
	set rs=server.createobject("adodb.recordset")
	'opendb
	on error resume next
	rs.open sql, conn, 1,3
	if rs.eof then
		response.redirect "error.asp?emsg=可能出现了严重的错误，没有找到项目!"
		response.end
	else
		rn=rs("rn")
		if rn=1 then
			rs("rn")=0
			rs("addreply")=false
		elseif rn>1 then
			rs("rn")=rn-1
		else
			response.redirect "error.asp?emsg=可能出现了严重的错误，请联系管理员吧。"
			response.end
		end if
		rs.update
	end if
	checkerr
	rs.close
	set rs=nothing
	'closedb
end sub
%><% sub showsure %>
<html>
<head>
<title>[xframe]删除回复</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="blue.css" type="text/css">
<style type="text/css">
<!--
.hand { cursor: hand }
-->
</style>
</head>
<body bgcolor=#ffffff leftmargin="0" topmargin="0">
<table width="758" height="99%" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr>
    <td align="left" valign="top"><div align="center">
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>[是版主的不用客气,不用给面3niao!](哦,一定是垃圾哦!)</p>
        <!-- TemplateBeginEditable name="edithere" --> 
        <table width="100%" border="0" cellspacing="3" cellpadding="0" height="73">
          <tr align="left" valign="top"> 
            <td width="100%" align="center" valign="middle" height="200"> <img src="images/delete_big.gif"> 
              <form name="makesure" method="post" action="delreply.asp">
                你要删除此篇回复，继续？
                <p> 
                  <input type="hidden" name="issure" value="sure">
                  <input type="hidden" name="rid" value="<%=request("rid")%>">
                  <input type="hidden" name="bdid" value="<%=bdid%>">
                  <input type="submit" name="submit" value="yes">
                  &nbsp;&nbsp; 
                  <input type="button" name="cancel" value="no" onclick="history.go(-1);">
              </form></td>
          </tr>
        </table>
        <!-- TemplateEndEditable -->
        <p>&nbsp;</p>
      </div></td>
  </tr>
</table>
</body>
</html>
<% end sub %>