<!--#include file="Item_Conn.asp"-->
<!--#include file="Item_Function.asp"-->

<%
Dim SqlItem,RsItem
Dim Action
Dim ItemID,ItemName,WebName,ClassID,SpecialID,ListStr,ListPaingType,ListPaingStr2,ListPaingID1,ListPaingID2,ListPaingStr3,Flag,ItemCollecDate
Dim ListUrl
Dim AllPage,iItem,ItemNum
Const MaxPerPage=10

Call Main()
'关闭数据库链接
Call CloseAllObj()
Call CloseConnItem()
%>
<%Sub Main
Call SetChannel()
%>
<html>
<head>
<title>采集系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../Skins/Admin_Style.Css" rel="stylesheet" type="text/css">
<script Language="JavaScript" src="../../Inc/Js/admin.js"></script>

<script language=javascript>
    function unselectall(thisform){
        if(thisform.chkAll.checked){
            thisform.chkAll.checked = thisform.chkAll.checked&0;
        }   
    }
    function CheckAll(thisform){
        for (var i=0;i<thisform.elements.length-6;i++){
            var e = thisform.elements[i];
            if (e.Name !="chkAll"&&e.disabled!=true)
                e.checked = thisform.chkAll.checked;
        }
    }
</script>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="title"> 
    <td height="22" colspan="2" align="center"><strong>采 集 系 统 项 目 管 理</strong></td>
  </tr>
  <tr class="tdbg"> 
    <td width="70" height="30"><strong>管理导航：</strong></td>
    <td><a href="Item_Start.asp">管理首页</a> | <a href="Item_AddNew.asp">添加新项目</a></td>
  </tr>
</table>
<br>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
    <tr> 
      <td height="22" colspan="2" class="title"> <div align="center"><b>新&nbsp;闻&nbsp;采&nbsp;集</b></div></td>
    </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<form name="myform" method="POST" action="Item_Collection.asp">
        <tr class="title"> 
          <TD width="5%" height=22 align=center>
            选择</DIV></TD>
          <TD width="17%" height=22  align=center>
            项目名称</DIV></TD>
          <TD width="15%" height=22  align=center>
            采集来源</DIV></TD>
          <TD width="15%" height=22  align=center>
            所属频道</TD>
            <TD width="15%" height=22  align=center>
            所属栏目</TD>
            <TD width="15%" height=22  align=center>
            所属专题</TD>
            <TD height=22  align=center>
            上次采集</TD>
           </TR>
<%
If Request("page")<>"" then
    CurrentPage=Cint(Request("Page"))
Else
    CurrentPage=1
End if      
set RsItem=server.createobject("adodb.recordset")         
SqlItem="select * from Item where Flag=True And ChannelDir<>'' And IsNull(ChannelDir)<>True order by ItemID DESC"         
RsItem.open SqlItem,ConnItem,1,1
If (Not RsItem.Eof) and (Not RsItem.Bof) Then

 RsItem.PageSize=MaxPerPage
 Allpage=RsItem.PageCount
 If CurrentPage>Allpage Then CurrentPage=1
 ItemNum=RsItem.RecordCount
 RsItem.MoveFirst
 RsItem.AbsolutePage=CurrentPage
 iItem=0
   Do while Not RsItem.Eof
           ChannelID=RsItem("ChannelID")
      If ChannelID="" Then
         ChannelID=1
      End If
      ClassID=RsItem("ClassID")
      SpecialID=RsItem("SpecialID")
      If ClassID="" Then
         ClassID=0
      End If             
      If SpecialID="" Then
         SpecialID=0
      End If          
      ItemID=RsItem("ItemID")
      ItemName=RsItem("ItemName")
      WebName=RsItem("WebName")
            ListPaingType=RsItem("ListPaingType")
            If  ListPaingType=0  Or ListPaingType=1  Then
            ListUrl=RsItem("ListStr")
      ElseIf  ListPaingType=2  Then
            ListUrl=Replace(RsItem("ListPaingStr2"),"{$ID}",CStr(RsItem("ListPaingID1")))
      ElseIf  ListPaingType=3  Then
            If  Instr(RsItem("ListPaingStr3"),"|")>0  Then
            ListUrl=Left(RsItem("ListPaingStr3"),Instr(RsItem("ListPaingStr3"),"|")-1)
         Else
               ListUrl=RsItem("ListPaingStr3")
         End  If
      Else
            ListUrl="异常"
      End  If
   %>
        <TR class="tdbg">
          <TD class="tdbg" style="WIDTH: 6%" align=center>
            <input type="checkbox" name="ItemID" value="<%=ItemID%>" onclick="unselectall(this.form)">
          </TD>
          <TD class="tdbg" align="center"><%=ItemName%>
          </TD>
          <TD class="tdbg"  align="center"><a href="<%=ListUrl%>" title="点击访问" target=_blank><%=WebName%></a>
          </TD>
          <TD class="tdbg" align="center"><%Call Admin_ShowChannel_Name(ChannelID)%>
          </TD>
          <TD class="tdbg" align="center"><%Call Admin_ShowClass_Name(ChannelID,ClassID)%>
          </TD>
          <TD class="tdbg" align="center"><%Call Admin_ShowSpecial_Name(ChannelID,SpecialID)%>
          </TD>
          <TD class="tdbg" align="center">
          <%
           set rs=connItem.execute("select Top 1 CollecDate From Histroly Where ItemID=" & ItemID & " Order by HistrolyID Desc")
           If not rs.eof Then
              ItemCollecDate=rs("CollecDate")
           else
              ItemCollecDate=""
           end if
           Set rs=Nothing
           if ItemCollecDate<>"" then
              Response.Write ItemCollecDate
           Else
              Response.Write "尚无记录"
           End If
          %>
          </TD>
        </TR>
<%    iItem=iItem+1
      If iItem>=MaxPerPage Then Exit Do
      RsItem.MoveNext
   Loop 
%>
    <tr class="tdbg"> 
      <td colspan=9 height="30">  
        <input name="Action" type="hidden"  value="Start">
        &nbsp;<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox" >全选
      </td>
    </tr>
    <tr class="tdbg"> 
      <td colspan=9 height="30">  
        &nbsp;<input name="SetAttribute" type="checkbox" id="SetAttribute" onclick=checkattribute(this.form) value="Yes" > <span id=showw>打开属性设置</span>
      </td>
    </tr>
    <tr class="tdbg" ID=AttributeTemp style="Display:none;"> 
      <td colspan=9>
<!--====================================================-->
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" class="tdbg">
    <tr class="tdbg"> 
      <td height="30" width="20%" align="right"><strong> 所属频道：</strong></td>
      <td><select ID="ChannelID" name="ChannelID" onChange="changelocation(document.myform.ChannelID.options[document.myform.ChannelID.selectedIndex].value)"><%call Admin_ShowChannel_Option(2)%></select>
      </td>
    </tr>
    <tr class="tdbg"> 
      <td height="30" width="20%" align="right"><strong> 所属栏目：</strong></td>
      <td><select name="ClassID" ID="ClassID"><%=ShowClass_Option(ChannelID,0,0,1)%></select>
      </td>
    </tr>
    <tr class="tdbg"> 
      <td height="30" width="20%" align="right"><strong> 所属专题：</strong></td>
      <td class="tdbg"><%=ShowSpecial_Option(ChannelID,0,1)%>
      </td>
    </tr>
    <tr class="tdbg">
      <td height="30" width="20%" align="right"><b>内容分页方式：</b></td>
      <td><select name="PaginationType">
            <option value="0" selected>不分页</option>
            <option value="1">自动分页</option>
          </select>        
        自动分页时的每页大约字符数（包含HTML标记）：<input name="MaxCharPerPage" type="text" value="10000" size="8" maxlength="8">      </td>
    </tr>
    <tr class="tdbg">
      <td height="30" width="20%" align="right"><b>文章阅读等级：</b></td>
      <td><select name='ReadLevel' id='ReadLevel'>
      <option value='1'>管理员</option>
      <option value='2'>VIP会员</option>
      <option value='3'>收费会员</option>
      <option value='4'>注册会员</option>
      <option value='5' selected>游客</option>
      </select>
      <FONT color=#0000ff>只有具有相应权限的人才能阅读此文章。</FONT>
      </td>
    </tr>
    <tr class="tdbg">
      <td height="30" width="20%" align="right"><b>文章评分等级：</b></td>
      <td><select name="Stars">
            <option value="5">★★★★★</option>
            <option value="4">★★★★</option>
            <option value="3" selected>★★★</option>
            <option value="2">★★</option>
            <option value="1">★</option>
            <option value="0">无</option>
          </select>
      </td>
    </tr>  
    <tr class="tdbg">
      <td height="30" width="20%" align="right"><b>文章阅读<%=Cl.Web_Setting(28)%>：</b></td>
      <td><input name='ReadPoint' type='text' id='ReadPoint' value='0' size='5' maxlength='3'>
      <font color='#0000FF'>如果大于0，则用户阅读此文章时将消耗相应<%=Cl.Web_Setting(28)%>。（对游客无效）</font>
      </td>
    </tr>   
    <tr class="tdbg">
      <td height="30" width="20%" align="right"><b>点击数初始值：</b></td>
      <td><input name="Hits" type="text" id="Hits" value="0" size="10" maxlength="10">
        <font color='#0000FF'>这功能是提供给管理员作弊用的。不过尽量不要用呀！^_^</font> 
      </td>
    </tr>
    <tr class="tdbg">
      <td height="30" width="20%" align="right"><b>新闻录入时间：</b></td>
      <td><input name="UpdateType" type="radio" value="0" checked>当前时间
       &nbsp;<input name="UpdateType" type="radio" value="1">标签中的时间
       &nbsp;<input name="UpdateType" type="radio" value="2">自定义：
       <input name="UpdateTime" type="text" value="<%=Now()%>">
        　</td>
    </tr>  
    <tr class="tdbg">
      <td height="30" width="20%" align="right"><b>新闻录入：</b></td>
      <td><input name="InputerType" type="radio" value="0" checked>当前用户
       &nbsp;<input name="InputerType" type="radio" value="1">指定用户
       <input name="Inputer" type="text" value="<%=Cl.User_Info(5)%>">
        　</td>
    </tr>
    <tr class="tdbg">
      <td height="30" width="20%" align="right"><b>责任编辑：</b></td>
      <td><input name="EditorType" type="radio" value="0" checked>当前用户
       &nbsp;<input name="EditorType" type="radio" value="1">指定用户
       <input name="Editor" type="text" value="<%=Cl.User_Info(5)%>">
        　</td>
    </tr>
    <tr class="tdbg">
      <td height="30" width="20%" align="right"><b>新闻性质：</b></td>
      <td> 
        <input name="IncludePicYn" type="checkbox" value="yes">
        包含图片
        <input name="DefaultPicYn" type="checkbox" value="yes">
        首页图片
        <input name="OnTop" type="checkbox" value="yes">
        固顶文章        
        <input name="Elite" type=checkbox value="yes">
        推荐文章
        <input name="Hot" type="checkbox" value="yes">
        热点文章
      </td>
    </tr>  
    <tr class="tdbg">
      <td height="30" width="20%" align="right"><b>评论链接：</b></td>
      <td>
         <input name="ShowCommentLink" type="radio" id="ShowCommentLink" value="Yes" Checked>显示评论链接&nbsp;&nbsp;
         <input name="ShowCommentLink" type="radio" id="ShowCommentLink" value="No">不显示评论链接
      </td>
    </tr>  

    <tr class="tdbg">
      <td height="30" width="20%" align="right"><b>标签过滤：</b></td>
      <td>
        <input name="Script_Iframe" type="checkbox" value="yes" checked>
        Iframe
        <input name="Script_Object" type="checkbox" value="yes" onclick='return confirm("确定要选择该标记吗？这将删除正文中的所有Object标记，结果将导致该文章中的所有Flash动画被删除！");'>
        Object
        <input name="Script_Script" type="checkbox" value="yes">
        Script
        <input name="Script_Div" type="checkbox"  value="yes">
        Div
        <input name="Script_Class" type="checkbox"  value="yes">
        Class
        <input name="Script_Table" type="checkbox"  value="yes">
        Table
        <input name="Script_Tr" type="checkbox"  value="yes">
        Tr
        <br>
        <input name="Script_Span" type="checkbox"  value="yes">
        Span&nbsp;&nbsp;
        <input name="Script_Img" type="checkbox" value="yes">
        Img&nbsp;&nbsp;&nbsp;
        <input name="Script_Font" type="checkbox"  value="yes">
        Font&nbsp;&nbsp;
        <input name="Script_A" type="checkbox" value="yes">
        A&nbsp;&nbsp;
        <input name="Script_Html" type="checkbox" value="yes" onclick='return confirm("确定要选择该标记吗？这将删除正文中的所有Html标记，结果将导致该文章的可阅读性降低！");'>
        Html&nbsp;
        <input name="Script_Td" type="checkbox"  value="yes">
        Td
        </td>
    </tr>
    <tr class="tdbg">
      <td height="30" width="20%" align="right"> <b>列表深度：</b></td>
      <td>
        <input name="CollecListNum" type="text" id="CollecListNum" value="0" size="10" maxlength="10">&nbsp;&nbsp;&nbsp;
		<font color='#0000FF'>0为所有的列表</font></td>
    </tr>
    <tr class="tdbg">
      <td height="30" width="20%" align="right"> <b>新闻数量：</b></td>
      <td>
        <input name="CollecNewsNum" type="text" id="CollecNewsNum" value="0" size="10" maxlength="10">&nbsp;&nbsp;&nbsp; 
		<font color='#0000FF'>0为所有的新闻<span lang="en-us">(</span>每一列表的新闻限制数量<span lang="en-us">)</span></font></td>
    </tr>
    <tr class="tdbg">
      <td height="30" width="20%" align="right"> <b>采集选项：</b></td>
      <td>
        <input name="Passed" type="checkbox" value="yes" checked>
        立即发布
        <input name="SaveFiles" type="checkbox" value="yes" <%If Cl.ChkObjInstalled(Trim(Cl.Web_Info(13)))=False Then Response.Write "disabled"%>>
        保存图片
        <input name="CollecOrder" type="checkbox" value="yes">
        倒序采集
        <input name="LinkUrlYn" type="checkbox" value="yes">
        外部链接
      </td>
    </tr>
</table>
<!--====================================================-->
</td>
    </tr>
    <tr class="tdbg"> 
      <td colspan=9 height="30">  
        &nbsp;&nbsp;&nbsp;采集模式：<input name="CollecType" type="radio" id="CollecType" value="1" checked onclick="javascript:document.myform.Content_View.checked=false">快速模式&nbsp;&nbsp;
        <input name="CollecType" type="radio" id="CollecType" value="0" onclick="javascript:document.myform.Content_View.checked=true">稳定模式&nbsp;&nbsp;
        <input name="CollecType" type="radio" id="CollecType" value="2" disabled>筛选模式&nbsp;&nbsp;
        <input name="CollecTest" type="checkbox" id="CollecTest" value="yes" onclick="javascript:document.myform.Content_View.checked=true">采集测试&nbsp;&nbsp;<input name="Content_View" type="checkbox" id="Content_View" value="yes">正文预览&nbsp;&nbsp;<input type="submit" value="开始采集" name="StartMe">&nbsp;&nbsp;
      </td>
    </tr>
<%Else%>
<tr class="tdbg">
        <td colspan='9' class="tdbg" align="center"><br>系统中暂无可用采集项目！</td>
</tr>
<%End If
 RsItem.Close
Set RsItem=Nothing
%>
</form>  
</TABLE>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
    <tr> 
      <td height="22" colspan="2" class="tdbg">
<%
Response.Write Cl.ShowPage("Item_Start.asp",ItemNum,MaxPerPage,"个","项目")
%>

      </td>
    </tr>
</table>

</body>
</html>
<script LANGUAGE='JavaScript'>
<!--
function checkattribute(){
if (document.getElementById('SetAttribute').checked == true) {
	document.getElementById('AttributeTemp').style.display = '';
	document.getElementById('showw').innerText='关闭属性设置';
}else{
	document.getElementById('AttributeTemp').style.display = 'none';
	document.getElementById('showw').innerText='打开属性设置';
}
}
//-->
</script>
<%end sub%>
