<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="Inc/Function.asp"-->
<!--#include file="../Inc/config.asp"-->
<%
dim id
id=request.QueryString("id")
set rs=server.CreateObject("adodb.recordset")
sql = "select * from news where id = "&id&""
rs.open sql,conn,1,3
zdfy=rs("zdfy")
pone=rs("zmone")
if rs.bof and rs.eof then
response.Write "<script language=javascript>alert(""不存在此数据！"");window.history.back();</script>"
response.End()
end if
dim picUrl
dim picUrlArray
dim x,y
picUrl = getPicUrl(rs("content"))
if picUrl <> "" then
picUrl = left(picUrl,len(picUrl)-1)
picUrlArray = split(picUrl,",")
for x = 0 to ubound(picUrlArray)
if instr(picUrlArray(x),"") > 0 then
DeleteFile(picUrlArray(x))
end if
next
end if

if rs("zdfy")=0  then
if Instr(rs("content"),"[zmcmsfy]")=0 then
call DeleteFile("../showinfo/"&NewName&""&Separated&""&pone&""&Separated&""&ID&""&Separated&"1.html")
else
arrContent=split(rs("content"),"[zmcmsfy]")
pages=Ubound(arrContent)+1
for i=1 to pages
call DeleteFile("../showinfo/"&NewName&""&Separated&""&pone&""&Separated&""&ID&""&Separated&""&i&".html")
next
end if
else
ContentLen=len(rs("content")) '文章内容长度
maxpages=int(ContentLen/zdfy) '计算分页数
If (maxpages * zdfy)<ContentLen Then
maxpages=maxpages+1
End If
if maxpages<=1 then
call DeleteFile("../showinfo/"&NewName&""&Separated&""&ID&""&Separated&"1.html")
else
for i=1 to maxpages
call DeleteFile("../showinfo/"&NewName&""&Separated&""&ID&""&Separated&""&i&".html")
next
end if
end if
rs.delete
response.Write "<script language=javascript>alert(""删除成功！"");window.location.href=""news_manage.asp""</script>"
rs.close
%>