<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta name="robots" content="noindex,nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="img/style.css" rel="stylesheet" type="text/css" />
<title>添加采集项目</title>
<script src="js/common.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
<style type="text/css">
input {
	height:12px;
}
.txt {
	width:250px;
}
.tb2 td {
	padding:2px 5px 2px 5px;
	height:25px;
	text-align:left;
}
.tb2 .thc {
	text-align:center;
	line-height:30px;
	background-color: #F5F7F8;
	font-size:18px;
	font-weight:bold;
	color:#000
}
.tb2 .thr {
	text-align:center;
	height:20px
}
.label {
	padding:0;
	width:150px;
	text-align:right;
	border-right:1px solid #DEEFFA;
}
.rb1 {
	height:22px
}
.red {
	color:red
}
.blue {
	color:blue
}
form, fieldset {
	margin:0;
	padding:0
}
.tb td {
	text-align:left;
}
</style>
<script type="text/javascript">
function show(){
	var arg=arguments;
	for(var i=0;i<arg.length;i++){
		$(arg[i]).style.display="";
	}
}

function hide(){
	var arg=arguments;
	for(var i=0;i<arg.length;i++){
		$(arg[i]).style.display="none";
	}
}
</script>
</head>
<!--当前导航-->
<body bgcolor="#F7FBFF">
<script type="text/JavaScript">if(parent.$('admincpnav')) parent.$('admincpnav').innerHTML='后台首页&nbsp;&raquo;&nbsp;采集&nbsp;&raquo;&nbsp;自定义采集 ';</script>
<div class="r_main">
  <div class="r_content">
    <div class="r_content_1" align=center>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tb">
        <thead>
          <tr class="thead">
            <th>&nbsp;<font color="#000000">操作选项： </font><a href="admin_collect.php">管理采集规则</a> | <a href="?action=add">添加采集规则</a></th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1. 通过本向导将传统的采集规则转换成采集规则</td>
          </tr>
        </tbody>
      </table>
      <table class="tb2">
        <thead>
          <tr>
            <th colspan="2" class="thc">使用采集规则向导生成采集规则</th>
          </tr>
          <tr>
            <th colspan="2" class="thr"><font id="stephit1" color="red">１. 设置基本参数</font>&nbsp;&nbsp;<font id="stephit2">２. 采集列表连接设置</font>&nbsp;&nbsp;<font id="stephit3">３. 采集内容与影片地址设置</font>&nbsp;&nbsp;<font id="stephit4">４. 在线模拟预览结果</font>&nbsp;&nbsp;<font id="stephit5">５. 完成向导并真实演示</font></th>
          </tr>
        </thead>
      </table>
      <form name="addruleform" id="addruleform" method="post" action="?action=addrule">
        <input type='hidden' name='step' value='2' />
        <input type="hidden" name="id" value="<?php echo $id;?>" />
        <table class="tb2">
          <tbody>
            <tr>
              <td class="label">采集规则名称：</td>
              <td><input type="text" class="txt" name="itemname" value="" /></td>
            </tr>
            <tr>
            <tr>
              <td class="label">入库方式：</td>
              <td><input type="radio" class="radio" name="intodatabase" value="0"<?php if($atd["intodatabase"]==0) echo " checked";?> />
                入临时库
                <input type="radio" class="radio" name="intodatabase" value="1"<?php if($atd["intodatabase"]==1) echo " checked";?>/>
                直接入库</td>
            </tr>
            <?php if($cofrom!=1) {?>
            <tr>
              <td class="label">只采集最近：</td>
              <td><select name="getherday">
                  <option value="0">不限</option>
                  <?php for($i=1;$i<=31;$i++){echo "<option value=\"".$i."\">".$i."</option>";}?>
                </select>
                天 * 选择天数还要填写第3步的 <span class="red">影片日期 开始代码 和 结束代码</span>才有效</td>
            </tr>
            <?php }?>
            <tr>
              <td class="label">目标站点URL：</td>
              <td><input type="text" class="txt" name="siteurl" value="" /></td>
            </tr>
            <tr>
              <td class="label">网页编码：</td>
              <td><select name="coding" size="1">
                  <option value="gb2312" selected="selected">GB2312</option>
                  <option value="utf-8">UTF-8</option>
                  <option value="big5">BIG5</option>
                </select></td>
            </tr>
            <tr>
              <td class="label">使用SOCK获取：</td>
              <td><label for="sock">
                  <input name="sock" type="checkbox" id="sock" value="1" class="checkbox">
                  是的，使用SOCK</label>
                <span class="red">使用SOCK可以有效的突破各种防盗链</span></td>
            </tr>
            <tr <?php if($cofrom==1){echo 'style=display:none;';} ?>>
              <td class="label">播放器来源：</td>
              <?php if($cofrom==1) {?>
              <td><input name='playfrom' value="seacms"/> </td>
              <?php }else{?>
              <td><select name='playfrom'>
                  <option value=''>暂没有数据</option>
                  <?php echo makePlayerSelect($pstr);?>
                </select></td>
              <?php }?>
            </tr>
            
            <tr <?php if($cofrom==1){echo 'style=display:none;';} ?>>
              <td class="label">下载来源：</td>
              <td><select name='downfrom'>
                  <option value=''>暂没有数据</option>
                  <?php echo makedownSelect($pstr);?>
                </select></td>
            </tr>
            <tr>
              <td>分类设置：</td>
              <td><input type="radio" class="radio" name="autocls" value="0" onclick="show('selcls');" checked/>
                固定分类
                <input type="radio" class="radio" name="autocls" value="1" onclick="hide('selcls');"/>
                智能归类(若归类失败，影片将自动加到临时库)</td>
            </tr>
            <tr id="selcls" style="">
              <td class="label">所属分类：</td>
              <?php if($cofrom==1) {?>
              <td><select name="classid">
                  <option value="0">请选择数据分类</option>
                  <?php makeTypeOptionSelected(0,"&nbsp;|&nbsp;","",$vtype,1); ?>
                </select></td>
              <?php }else{?>
              <td><select name="classid">
                  <option value="0">请选择数据分类</option>
                  <?php makeTypeOptionSelected(0,"&nbsp;|&nbsp;","",$vtype,0); ?>
                </select></td>
              <?php }?>
            </tr>
            <tr>
              <td class="label">初始点击数：</td>
              <td><input type="text" name="inithit" value="0" />
                &nbsp;<font color="red">-1为随机点击数</font></td>
            </tr>
            <tr>
              <td class="label">分页设置：</td>
              <td><input type="radio" class="radio" name="pageset" value="0" onclick="hide('page_0','page_1','page_2');show('page_0');" checked/>
                不分页
                <input type="radio" class="radio" name="pageset" value="1" onclick="hide('page_0','page_1','page_2');show('page_1');"/>
                变量分页
                <input type="radio" class="radio" name="pageset" value="2" onclick="hide('page_0','page_1','page_2');show('page_2');"/>
                手动输入分页 </td>
            </tr>
            <tr id="page_0" style="">
              <td class="label">采集网址：</td>
              <td><input type="text" class="txt" name="pageurl0" value="" /></td>
            </tr>
          </tbody>
          <tbody id="page_1" style="display:none">
            <tr>
              <td class="label">远程列表分页URL：</td>
              <td><input type="text" class="txt" name="pageurl1" value="" />
                &nbsp;ID变量<font color="red">(*)</font></td>
            </tr>
            <tr>
              <td class="label">远程列表起始页：</td>
              <td>标准格式：Http://www.damin.com/list/list_(*).html<br />
                开始页：
                <input type="text" name="istart" value="1" style="width: 60px"/>
                - 结束页：
                <input type="text" name="iend" value="1" style="width: 60px" />
                &nbsp;例如：1 - 10 或者 10 - 1</td>
            </tr>
          </tbody>
          <tbody id="page_2" style="display:none">
            <tr>
              <td class="label">手动分页：</td>
              <td><textarea name="pageurl2" rows="6" cols="80" wrap="off"></textarea></td>
            </tr>
          </tbody>
          <tbody>
            <tr>
              <td class="label">采集方式：</td>
              <td><input type="checkbox" class="checkbox" name="reverse" value="1"/>
                倒序采集</td>
            </tr>
          </tbody>
          <tbody>
          	<tr>
			<td class="label">内容过滤设置：</td>
			<td>
			<?php 
				$filter = explode("|","IFRAME|OBJECT|BUTTON|CLASS|HTML|SPAN|DIV|P|SCRIPT|APPLET|STRONG|STYLE|TABLE|FONT|IMG|A");
				for($i=0;$i<count($filter);$i++)
				{
                	echo "<input type=\"checkbox\" class=\"checkbox\" name=\"removecode[]\" value=\"$filter[$i]\" />$filter[$i]";
					if($filter[$i]=="P")echo "<br>";
				}
			?>
			</td>
		</tr>
          </tbody>
            </tbody>
          
        </table>
        <table class="tb2">
          <tbody>
            <tr>
              <td class="label"></td>
              <td><input type="button" class="rb1" name="back" value="返回上一步" onclick="javascript:history.back(-1)" />
                &nbsp;&nbsp;
                <input type="submit" name="Submit" class="rb1" value="保存信息并进入下一步设置" onClick="if($('itemname').value.length==0){alert('没有填写项目名称');return false;};"/>
                &nbsp;&nbsp;
                <input id="showcode" class="checkbox" type="checkbox" value="1" name="showcode">
                下一步显示源码</td>
            </tr>
          </tbody>
        </table>
      </form>
    </div>
  </div>
</div>
<div class="bottom">
  <table width="100%" cellspacing="5">
    <tr>
      <td align="center"><?php echo $cfg_powerby?></td>
    </tr>
  </table>
</div>
</body>
</html>
