<!--#include file="../Inc/Config.asp" -->
<!--#include file="../Inc/AdminClass.asp" -->
<!--#include file="Admin_Check.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<link href="../Inc/edit.CSS" rel="stylesheet" type="text/css">
</head>
<link href="../Inc/edit.CSS" rel="stylesheet" type="text/css"> 
<body bgcolor="#5578b8" leftmargin="0" topmargin="2">
<%
dim UP,url,BLOG_ID,path,objFSO
BLOG_ID=REQUEST.FORM("ID")
IF BLOG_ID<>"" THEN
	UP=TRIM(request.form("Submit"))
	url=replace(Request.ServerVariables("HTTP_REFERER"),"page=","")
	If UP="删除" then
		conn.execute("delete from Article where Article_id in("&BLOG_ID&")")
		conn.execute("delete from Tb_Reply where Reply_Blog_ID in("&BLOG_ID&")")
		conn.execute("delete from TrackBack where ArticleID in("&BLOG_ID&")")
		Set Adminobj=Nothing:Set Cblogobj=Nothing
		Application.Lock
			Application.Contents.RemoveAll()
		Application.UnLock
		Response.write"<script>alert('删除文章成功!');location.href='"&url&"';</script>"		
		Response.End
	ELSEIF UP="推荐" then
		Conn.execute ("update Article set [Top]=1 where Article_Id in("&blog_id&")")
		CblogObj.DelCahe ("Recommends_Articles")
		Set Adminobj=Nothing:Set Cblogobj=Nothing
		Response.write"<script>alert('推荐文章成功!');location.href='"&url&"';</script>"		
		Response.End
	ELSEIF UP="首页头条" then
		Conn.execute ("update Article set [Top]=2 where Article_Id in("&blog_id&")")
		CblogObj.DelCahe ("strip")
		Set Adminobj=Nothing:Set Cblogobj=Nothing
		Response.write"<script>alert('推荐文章成功!');location.href='"&url&"';</script>"		
		Response.End
	ELSEIF UP="取消推荐或头条" then
		Conn.execute ("update Article set [Top]=0 where Article_Id in("&blog_id&")")
		CblogObj.DelCahe ("strip|Recommends_Articles")
		Set Adminobj=Nothing:Set Cblogobj=Nothing
		Response.write"<script>alert('取消推荐或头条成功!');location.href='"&url&"';</script>"		
		Response.End
	END IF
End if
%>
<SCRIPT language=javascript src="../inc/js.js"></SCRIPT>
<table width="99%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF">
  <form name="form1" method="get" action="ArticlesList.asp">
    <tr bgcolor="#f0f5f9"> 
      <td colspan="5"> <div align="center">查询文章: 
          <input name="KEY" type="text" id="KEY">
          　By: 
          <select name="select">
            <option value="Article_Title" selected>标题</option>
            <option value="Article_zy">摘要</option>
          </select>
          <input type="submit" name="Submit3" value="Search">
        </div></td>
    </tr>
  </form>
  <tr bgcolor="#cfdded"> 
    <td width="30" bgcolor="#cfdded"> <div align="center">选中</div></td>
    <td width="332" bgcolor="#cfdded">标题</td>
    <td width="80"> <div align="center">用户名</div></td>
    <td width="140"><div align="center">IP</div></td>
    <td width="140"> <div align="center">BLOG</div></td>
  </tr>
  <form name="add" method="post" action="ArticlesList.asp">
    <%
dim where,key,selects,Pages,sqlstr,sql,rsarrer,rscount,iii
Pages = Request.QueryString("page")
If Not IsNumeric(Pages) Or Pages = "" Then
	Pages = 1
Else
	Pages = CLng(Pages)
End If
WHERE="WHERE [Top]>=0 "
KEY=replace(REQUEST.QueryString("KEY"),"'","''")
SELECTS=replace(REQUEST.QueryString("select"),"'","''")
IF KEY<>"" THEN
	WHERE=WHERE&" AND "&SELECTS&" LIKE '%"&KEY&"%' "
END IF
sqlstr="select Article_ID,User_ID,User_Name,Article_Title,Article_Time,[Top],IP from Article "&WHERE&" order by Article_ID desc"
Set rs = Server.CreateObject("Adodb.RecordSet")
rs.open sqlstr,Conn, 1, 1
SqlCount=SqlCount+1
if rs.bof and rs.eof then
	response.write("<tr><td height=25 colspan=3><div align=center>没有任何文章</div></td></tr>")
else
rs.PageSize = 25
rs.AbsolutePage = pages
rscount=rs.RecordCount
rsarrer=rs.getrows(25)
for iii=0 to Ubound(rsarrer,2)
%>
    <tr bgcolor="#f0f5f9"> 
      <td><div align="center"> 
          <input name="ID" type="checkbox" id="ID" value="<%=rsarrer(0,iii)%>">
        </div></td>
      <td bgcolor="#f0f5f9"><a href="<%=CblogObj.GetDir(rsarrer(1,iii))%>/Show.asp?/_articleid/<%=rsarrer(0,iii)%>.html" target="_blank"><%=rsarrer(3,iii)%></a>
        <%IF rsarrer(5,iii)=1 Then Response.Write "[荐]"%>
        <%IF rsarrer(5,iii)=2 Then Response.Write "[首页头条]"%>
      </td>
      <td> <div align="center"> <%=rsarrer(2,iii)%> </div></td>
      <td> 
        <div align="center"><%=rsarrer(6,iii)%></div></td>
      <td> <div align="center"><a href="<%=CblogObj.GetDir(rsarrer(1,iii))%>" target="_blank">发布的博客</a></div></td>
    </tr>
    <%
next
END IF
%>
    <tr bgcolor="#f0f5f9"> 
      <td colspan="5"><div align="center"> 
          <input name="act" type="hidden" id="act" value="OK">
          <INPUT name=all type=button id="all" onclick=CheckAll(this.form) value=全选>
          <INPUT name=sall type=button id="sall" onclick=CheckOthers(this.form) value=反选>
          <input name="Submit2" type="reset" class="in" value=" Reset ">
          <INPUT name=Submit type=submit class="in" id="Submit" onClick="return ConfirmDel();" value=删除>
          <input name="Submit" type="submit" id="Submit2" value="推荐">
          <input name="Submit" type="submit" id="Submit" value="首页头条">
          <input name="Submit" type="submit" id="Submit" value="取消推荐或头条">
        </div></td>
    </tr>
  </form>
  <tr bgcolor="#f0f5f9"> 
    <td colspan="5"> <div align="center"> 
        <%call pagelist(rscount,pages,25)%>
      </div></td>
  </tr>
</table>
<br>
<div align="center"><%set adminobj=nothing:set cblogobj=nothing%></div>
</body>
</html>
