<!--#include file="connvod.asp"-->
<%
dim action : action = be("get","action")
dim p_id,p_name,p_coding,p_playtype,p_pagetype,p_url,p_pagebatchurl,p_manualurl,p_pagebatchid1,p_pagebatchid2,p_script,p_showtype,p_collecorder,p_savefiles,p_intolib,p_ontime,p_listcodestart,p_listcodeend,p_classtype,p_collect_type,p_time,p_listlinkstart,p_listlinkend,p_starringtype,p_starringstart,p_starringend,p_titletype,p_titlestart,p_titleend,p_pictype,p_picstart,p_picend,p_timestart,p_timeend,p_areastart,p_areaend,p_typestart,p_typeend,p_contentstart,p_contentend,p_playcodetype,p_playcodestart,p_playcodeend,p_playurlstart,p_playurlend,p_playlinktype,p_playlinkstart,p_playlinkend,p_playspecialtype,p_playspecialrrul,p_playspecialrerul,p_server,p_hitsstart,p_hitsend,p_lzstart,p_lzend,p_colleclinkorder,p_lzcodetype,p_lzcodestart,p_lzcodeend,p_languagestart,p_languageend,p_remarksstart,p_remarksend,p_directedstart,p_directedend,p_setnametype,p_setnamestart,p_setnameend


select case action
	case "add","edit" : headAdminCollect "视频自定义采集项目编辑" : edit
	case "save","savecs" : save
	case "del" : del
	case "copy" : copynew
	case "delall" : delall
	case "export" : export
	case "upexpsave" : upexpsave
	case "getcode" : getcode
	case "breakpoint" : breakpoint
	case else : clearsession : headAdminCollect "视频自定义采集项目管理" : main
end select

dispseObj()
on error resume next
if isObject(cjdb) then  set cjdb=nothing
on error goto 0

sub export
	dim rs,result,filedName,Filed,fileName,filePath
	set rs = cjdb.db("select * from tbl_vod_project where p_id="& be("all","p_id"),"rs1")
	if not rs.eof then
		fileName = rs(1)
		For Each Filed In rs.Fields
			filedName=LCase(Filed.name)
			result=result&"<"&filedName&">"&rs(filedName)&"</"&filedName&">"&vbcrlf
	 	Next
	end if
	cjdb.C(rs)
	filePath = "../../upload/export/"&fileName&".txt"
	objFile.createFile filePath,result
	redirect "collect_down.asp?file="& Server.UrlEncode (fileName)
end sub

sub upexpsave
	dim rs,fileName,stream,str,strsize,Match,matches
	strsize = Request.TotalBytes
	stream = Request.BinaryRead(strsize) 
	str = bytesToBstr(stream,"utf-8")
	str = getBody(str,"Content-Type: text/plain","-----------------------------")
	set rs = cjdb.db("select * from tbl_vod_project","rs3")
	rs.AddNew
	set Matches= regCollect(str,"<(p_[\s\S]*?)>([\s\S]*?)</\1>")
	For Each Match In Matches
		if Match.SubMatches(0) <> "p_id" Then
			if Match.SubMatches(0)="p_time" Then
				rs("p_time") = Now()
			else
				rs(""&Match.SubMatches(0)&"")=Match.SubMatches(1)
			end if
		end if
	Next
	rs.UpDate
	cjdb.C(rs)
	set Match=nothing
	set Matches=nothing
	showmsg "导入采集规则成功","collect_vod_manage.asp"
end sub

sub breakpoint
	writee gBreakpoint("../../upload/vodbreakpoint") & "正在载入断点续传数据，请稍后......"
end sub

sub saveok
	showmsg "采集栏目添加成功","collect_vod_manage.asp"
end sub

sub copynew
	dim rsCopy,rs,Filed
	set rsCopy = cjdb.db("select * from tbl_vod_project where p_id="&be("get","p_id"),"rs1")
	if not rsCopy.eof then
		set rs = cjdb.DB("select * from tbl_vod_project","rs3")
		rs.AddNew
		For Each Filed In rs.Fields
			if LCase(Filed.name) <> "p_id" then
				if LCase(Filed.name) = "p_name" then
					rs(Filed.name) = rsCopy(Filed.name)&"-[复制]"
				else
					rs(Filed.name) = rsCopy(Filed.name)
				end if
			end if
	 	Next
		rs.Update
		rs.MoveNext
		cjdb.C(rs)
	end if
	cjdb.C(rsCopy)
	showmsg "复制采集栏目成功！","collect_vod_manage.asp"
end sub

sub del()
	cjdb.DB "delete from tbl_vod_project WHERE p_id="&be("get","p_id"),"exe"
	showmsg "采集项目删除成功！","collect_vod_manage.asp"
end sub

sub delall()
	dim ids:ids=replace(request.Form("p_id")," ","")
	if not isN(ids) then
		cjdb.DB "delete from tbl_vod_project WHERE p_id in ("&ids&")","exe"
		showmsg "采集项目删除成功！","collect_vod_manage.asp"
	else
		showmsg "请选择相应项目！","collect_vod_manage.asp"
	end if
end sub

sub getcode
	dim charset,url,html
	charset = be("get","charset")
	url = be("get","url")
	html = getPage(url,charset)
	writeA html
end sub

sub edit
	dim rs,sql
 	
 	p_id = be("all","p_id")
 	p_pagetype=0
 	p_pagebatchid1=1
 	p_pagebatchid2=1
 	p_hitsstart=0
 	p_hitsend=0
 	if not isN(p_id) then
 		sql="select * from tbl_vod_project where p_id = "& p_id
		set rs = cjdb.db(sql,"rs1")
		p_id = rs("p_id")
		p_name = rs("p_name") : p_coding = rs("p_coding") : p_coding = lcase(p_coding) : p_playtype = rs("p_playtype") : p_pagetype = rs("p_pagetype")
		p_url = rs("p_url") : p_pagebatchurl = rs("p_pagebatchurl") : p_manualurl = rs("p_manualurl") : p_pagebatchid1 = rs("p_pagebatchid1")
		p_pagebatchid2 = rs("p_pagebatchid2") : p_script = rs("p_script") : p_showtype = rs("p_showtype") : p_collecorder = rs("p_collecorder")
		p_savefiles = rs("p_savefiles") : p_intolib = rs("p_intolib") : p_ontime = rs("p_ontime") : p_listcodestart = rs("p_listcodestart")
		p_listcodeend = rs("p_listcodeend") : p_classtype = rs("p_classtype") : p_collect_type = rs("p_collect_type") : p_time = rs("p_time")
		p_listlinkstart = rs("p_listlinkstart") : p_listlinkend = rs("p_listlinkend") : p_starringtype = rs("p_starringtype")
		p_starringstart = rs("p_starringstart") : p_starringend = rs("p_starringend") : p_titletype = rs("p_titletype")
		p_titlestart = rs("p_titlestart") : p_titleend = rs("p_titleend") : p_pictype = rs("p_pictype") : p_picstart = rs("p_picstart")
		p_picend = rs("p_picend") : p_timestart = rs("p_timestart") : p_timeend = rs("p_timeend") : p_areastart = rs("p_areastart")
		p_areaend = rs("p_areaend") : p_typestart = rs("p_typestart") : p_typeend = rs("p_typeend") : p_contentstart = rs("p_contentstart")
		p_contentend = rs("p_contentend") : p_playcodetype = rs("p_playcodetype") : p_playcodestart = rs("p_playcodestart")
		p_playcodeend = rs("p_playcodeend") : p_playurlstart = rs("p_playurlstart") : p_playurlend = rs("p_playurlend")
		p_playlinktype = rs("p_playlinktype") : p_playlinkstart = rs("p_playlinkstart") : p_playlinkend = rs("p_playlinkend")
		p_playspecialtype = rs("p_playspecialtype") : p_playspecialrrul = rs("p_playspecialrrul") : p_playspecialrerul = rs("p_playspecialrerul")
		p_server = rs("p_server") : p_hitsstart = rs("p_hitsstart") : p_hitsend = rs("p_hitsend")
		p_lzstart = rs("p_lzstart") : p_lzend = rs("p_lzend") : p_colleclinkorder = rs("p_colleclinkorder")
		p_lzcodetype = rs("p_lzcodetype") : p_lzcodestart = rs("p_lzcodestart") : p_lzcodeend = rs("p_lzcodeend")
		p_languagestart = rs("p_languagestart") : p_languageend = rs("p_languageend") : p_remarksstart = rs("p_remarksstart")
		p_remarksend = rs("p_remarksend") : p_directedstart = rs("p_directedstart") : p_directedend = rs("p_directedend")
		p_setnametype = rs("p_setnametype") : p_setnamestart = rs("p_setnamestart") : p_setnameend = rs("p_setnameend")
		cjdb.c(rs)
	end if
%>
<script>
$(document).ready(function(){
	$("#loading",window.parent.document).ajaxStart(function(){
		$(this).show();
	});
	$("#loading",window.parent.document).ajaxStop(function(){
    	$(this).hide();
 	});
});

function $$(id){return document.getElementById(id);}
function trim(s){ return (""+s).replace(/(^\s*)|(\s*$)/g,"");}
function isNum(s){
	var r,re;
	if(s==""){ return false; }
	re = /\d*/i;
	r = s.match(re);
	return (r==s);
}
function getBody(str,s1,s2){
	if(s2=='') return false;
	var tstr=str.toLowerCase(),ind=tstr.indexOf(s1.toLowerCase()),sLen=s1.length;
	if(ind==-1) return false;
	ind=sLen>0 ? ind+sLen : 0;
	s1 = s1.replace(/\\t/g,'\u0009').replace(/\\n/g,'\u000a').replace(/\\r/g,'\u000d');
	s2 = s2.replace(/\\t/g,'\u0009').replace(/\\n/g,'\u000a').replace(/\\r/g,'\u000d');
	return str.substr(ind,tstr.slice(ind).indexOf(s2.toLowerCase()));
}

function definiteUrl(ls,curl){
	var b,t,H,i,j,k,siteUrl,rg=/^\s*[\/\\]/i,ab=/^http:\/\//i,qt=/\\([\\\/])/ig;
	curl=trim(curl).replace(qt,"/");
	siteUrl=curl.replace(/(https?\:\/\/)((\w+)(\.\w+)*(:\d+)?)\/.*/i,"$1$2");
	curl=curl.replace(siteUrl,"");
	for(var i=0;i<ls.length;i++){
		H=""+ls[i];
		if(ab.test(H)){
		}else if(rg.test(H)){
			ls[i]=siteUrl+H
		}else{
			j=H.split("../").length,t=curl.split("/"),k=t.length
			t.length=j<k ? k-j : 0
			ls[i]=siteUrl+t.join("/")+"/"+H.replace(/([\.]{2}\/)/g,"")
		}
	}
	return ls;
}

var stepnum=1;
var listurl="",listcode="",listcutcode="",contenturl="",contentcode="";
function prestep(){
	if (stepnum>1){
		if (stepnum==2 ){
			$("#msgurl").html("");
			$("#htmlcode").val("");
			$("#htmltable").hide();
		}
		if ($("input[name='p_pagetype']:checked").val()=="3" && stepnum==3 ){
			stepnum--;
		}
		stepnum--;
		stepshow();
	}
	else{
		if(confirm("确实要离开该页面吗？\n\n这将会导致规则页面上未保存的数据丢失，确定？\n\n按“确定”继续，或按“取消”留在当前页面。")){
			history.go(-1);
		}
	}
}
function nextstep(){
	var rc = true;
	
	if(stepnum==1){
		if($("#p_name").val().trim()==""){
			alert("项目名称不能为空");
			$("#p_name").focus();
			return;
		}
		switch( $("input[name='p_pagetype']:checked").val() )
		{
			case "0":
				listurl = $("#p_url").val().trim();
				if( $("#p_url").val().trim()=="" ){
					rc=false;
					alert("采集地址不能为空");
					$("#p_url").focus();
				}
				break;
			case "1":
			case "3":
				listurl = $("#p_pagebatchurl").val().trim().replace("{ID}",$("#p_pagebatchid1").val());
				if( $("#p_pagebatchurl").val().trim()=="" ){
					rc=false;
					alert("采集地址不能为空");
					$("#p_pagebatchurl").focus();
				}
				if (rc && !isNum($("#p_pagebatchid1").val()) ){
					rc=false;
					alert("请输入数字");
					$("#p_pagebatchid1").focus();
				}
				if (rc && !isNum($("#p_pagebatchid2").val()) ){
					rc=false;
					alert("请输入数字");
					$("#p_pagebatchid2").focus();
				}
				break;
			case "2":
				listurl = $("#p_manualurl").val().trim().split("\r\n")[0];
				if( $("#p_manualurl").val().trim()=="" ){
					rc=false;
					alert("采集地址不能为空");
					$("#p_manualurl").focus();
				}
				break;
		}
		if( rc && !isNum($("#p_hitsstart").val()) ){
			rc=false;
			alert("随机人气必须是数字哦");
			$("#p_hitsstart").focus();
		}
		if( rc && !isNum($("#p_hitsend").val()) ){
			rc=false;
			alert("随机人气必须是数字哦");
			$("#p_hitsend").focus();
		}
		if(!rc){
			return;
		}
		else{
			if ($("input[name='p_pagetype']:checked").val()=="3"){
				stepnum++;
			}
			$("#listurl").val(listurl);
			showurl(listurl);
			$.ajax({ cache: false, dataType: 'html', type: 'GET', url: 'collect_vod_manage.asp?action=getcode&charset=' + $("#p_coding").val() + '&url=' + encodeURI(listurl),
				success: function(r){
					if(r!="false"){
						listcode = r;
						if($("#showcode").attr("checked")){
							$("#htmlcode").val(r);
							$("#htmltable").show();
						}
					}
					else{
						alert("获取页面代码出错，请重试");
						return;
					}
				},
				error:function(r){
					alert("err");
				}
			});
		}
	}
	else if(stepnum==2){
		if($("#p_listcodestart").val().trim()==""){
			rc=false;
			alert("列表开始代码不能为空");
			$("#p_listcodestart").focus();
		}
		if(rc && $("#p_listcodeend").val().trim()==""){
			rc=false;
			alert("列表结束代码不能为空");
			$("#p_listcodeend").focus();
		}
		if(rc && $("#p_listlinkstart").val().trim()==""){
			rc=false;
			alert("链接开始代码不能为空");
			$("#p_listlinkstart").focus();
		}
		if(rc && $("#p_listlinkend").val().trim()==""){
			rc=false;
			alert("链接结束代码不能为空");
			$("#p_listlinkend").focus();
		}
		
		if(rc && $("input[name='p_titletype']:checked").val() == "1"){
			if(rc && $("#p_listtitlestart").val().trim()==""){
				rc=false;
				alert("名称开始代码不能为空");
				$("#p_listtitlestart").focus();
			}
			if(rc && $("#p_listtitleend").val().trim()==""){
				rc=false;
				alert("名称结束代码不能为空");
				$("#p_listtitleend").focus();
			}
		}
		if(rc && $("input[name='p_starringtype']:checked").val() == "1"){
			if(rc && $("#p_liststarringstart").val().trim()==""){
				rc=false;
				alert("主演开始代码不能为空");
				$("#p_liststarringstart").focus();
			}
			if(rc && $("#p_liststarringend").val().trim()==""){
				rc=false;
				alert("主演结束代码不能为空");
				$("#p_liststarringend").focus();
			}
		}
		if(rc && $("input[name='p_pictype']:checked").val() == "1"){
			if(rc && $("#p_listpicstart").val().trim()==""){
				rc=false;
				alert("图片开始代码不能为空");
				$("#p_listpicstart").focus();
			}
			if(rc && $("#p_listpicend").val().trim()==""){
				rc=false;
				alert("图片结束代码不能为空");
				$("#p_listpicend").focus();
			}
		}
		if(!rc){
			return;
		}
		else{
			listcutcode=getBody(listcode,$("#p_listcodestart").val(), $("#p_listcodeend").val() );
			if(listcutcode==false){if(!confirm("截取 列表开始~列表结束 失败\n\n点[确定]忽略这错误提示，[取消]返回修改")){return;}}
			var mlink=getBody(listcutcode,$("#p_listlinkstart").val(), $("#p_listlinkend").val() );
			if(mlink==false){if(!confirm("截取 链接开始~链接结束 失败\n\n点[确定]忽略这错误提示，[取消]返回修改")){return;}}
			if($("input[name='p_titletype']:checked").val()=="1"){
				var title = getBody(listcutcode,$("#p_listtitlestart").val(), $("#p_listtitleend").val() );
				if(title==false){if(!confirm("截取 标题开始~标题结束 失败\n\n点[确定]忽略这错误提示，[取消]返回修改")){return;}}
			}
			if($("input[name='p_pictype']:checked").val()=="1"){
				var pic = getBody(listcutcode,$("#p_listpicstart").val(), $("#p_listpicend").val() );
				if(pic==false){if(!confirm("截取 图片开始~图片结束 失败\n\n点[确定]忽略这错误提示，[取消]返回修改")){return;}}
			}
			if($("input[name='p_starringtype']:checked").val()=="1"){
				var starring = getBody(listcutcode,$("#p_liststarringstart").val(), $("#p_liststarringend").val() );
				if(starring==false){if(!confirm("截取 主演开始~主演结束 失败\n\n点[确定]忽略这错误提示，[取消]返回修改")){return;}}
			}
			contenturl = definiteUrl([mlink],listurl);
			
			showurl(contenturl);
			$.ajax({ cache: false, dataType: 'html', type: 'GET', url: 'collect_vod_manage.asp?action=getcode&charset=' + $("#p_coding").val() + '&url=' + encodeURI(contenturl),
				success: function(r){
					if(r!="false"){
						contentcode = r;
						if($("#showcode").attr("checked")){
							$("#htmlcode").val(r);
							$("#htmltable").show();
						}
					}
					else{
						alert("获取内容页代码出错，请重试");
						return;
					}
				},
				error:function(r){
					alert("err");
				}
			});
		}
	}
	else if(stepnum==3){
		if( $("input[name='p_titletype']:checked").val()=="0" ){
			if( $("#p_titlestart").val()=="" || $("#p_titleend").val()==""){
				alert("截取 名称开始~名称结束 失败\n\n点[确定]忽略这错误提示，[取消]返回修改");
				return;
			}
		}
		$("#form1").attr("action","?action=savecs")
		$("#form1").submit();
		
	}
	else if(stepnum==4){
		alert(4);
		$("#form1").submit();
	}
	stepnum++;
	stepshow();
}
function stepshow()
{
	for(i=1;i<=4;i++){
		if(i==stepnum){
			$("#step"+i).show();
			$("#tabs"+i).attr("class","hover");
		}
		else{
			$("#step"+i).hide();
			$("#tabs"+i).removeClass("hover");
		}
	}
}
function showurl(s){
	$('#msgurl').html("&nbsp;&nbsp;当前采集地址：<font color=red>"+s+"</font>");
}
</script>
<div>
	<ul id="htmltabs" style="padding:0">
		<li id="tabs1" class="hover" style="cursor:pointer">1，采集基本信息</li>
		<li id="tabs2" style="cursor:pointer">2，采集列表信息</li>
		<li id="tabs3" style="cursor:pointer">3，采集内容信息</li>
		<li id="tabs4" style="cursor:pointer">4，采集测试结果</li>
	</ul>
</div>
<table class="tb2">
<tr>
<td>
	<span id="msgurl"></span>
</td>
</tr>
<tr id="htmltable" style="display:none">
	<th colspan="2"><textarea id="htmlcode" style="width:99%;height:200px;font-family:Fixedsys" wrap="off" readonly></textarea></th>
</tr>
</table>

<form action="?action=save" method="post" id="form1" name="form1">
<table class="tb" id="step1">
	<INPUT id="p_id" name="p_id" type="hidden" value="<%=p_id%>" >
	<INPUT id="listurl" name="listurl" type="hidden" value="" >
	<tbody>
    <tr>
	<td width="15%" >项目名称：</td>
	<td>
	<INPUT id="p_name" name="p_name" size="50" value="<%=p_name%>" >
	</td>
	</tr>
	<tr>
	<td>采集过程方式：</td>
	<td>
	<input name="p_showtype" type="radio" value="0" <%If p_showtype=0 Then writeA "checked"%>>显示采集一个列表 &nbsp;&nbsp;
	<input name="p_showtype" type="radio" value="1" <%If p_showtype=1 Then writeA "checked"%>>显示采集一条数据 &nbsp;&nbsp;
	</td>
	</tr>
	<tr>
	<td>采集参数：</td>
	<td>
	<input id="p_collecorder" name="p_collecorder" type="checkbox" value="1" <%If p_collecorder=1 Then writeA "checked"%>>分页倒序采集 &nbsp;
	<input id="p_colleclinkorder" name="p_colleclinkorder" type="checkbox" value="1" <%If p_colleclinkorder=1 Then writeA "checked"%>>列表倒序采集 &nbsp;
	<input id="p_savefiles" name="p_savefiles" type="checkbox" value="1" <%If p_savefiles=1 Then writeA "checked"%>> 采集中保存图片(采集过程方式为:显示采集一条数据时使用)
	</td>
	</tr>
	<tr>
	<td>目标网页编码：</td>
	<td>
	<select id="p_coding" name="p_coding">
	<option value="gb2312" <%if p_coding="gb2312" then writeA"selected"%>>gb2312</option>
	<option value="gbk" <%if p_coding="gbk" then writeA"selected"%>>gbk</option>
	<option value="utf-8" <%if p_coding="utf-8" then writeA"selected"%>>utf-8</option>
	<option value="big5" <%if p_coding="big5" then writeA"selected"%>>big5</option>
	</select>
	</td>
    </tr>
    <tr>
	<td>播放器：</td>
	<td>
	<select id="p_playtype" name="p_playtype">
	<%=makeSelectPlayer(p_playtype)%>
	</select>
	</td>
	</tr>
	<tr>
	<td>服务器组：</td>
	<td>
	<select id="p_server" name="p_server">
	<option value='0'>无服务器组</option>
	<%=makeSelectServer(p_server)%>
	</select>
	</td>
    </tr>
    <tr>
	<td>分页设置：</td>
	<td>
	<input type="radio" value="0" name="p_pagetype" checked="checked" onClick="showpageshow('0');" <% if p_pagetype=0 then writeA "checked" %>>
不分页&nbsp;&nbsp;
<input type="radio" value="1" name="p_pagetype" onClick="showpageshow('1');" <% if p_pagetype=1 then writeA "checked" %>>
批量分页&nbsp;
<input type="radio" value="2" name="p_pagetype" onClick="showpageshow('2');" <% if p_pagetype=2 then writeA "checked" %>>
手动分页&nbsp;
<input type="radio" value="3" name="p_pagetype" onClick="showpageshow('3');" <% if p_pagetype=3 then writeA "checked" %>> 
按ID直接采集内容
	</td>
	</tr>
	<tr id="IndexCutPage" >
	<td >采集地址：</td>
	<td>
	<INPUT id="p_url" name="p_url" size="50" value="<%=p_url%>">
	</td>
	</tr>
	<tr id="HandCutPage" style="display:none">
	<td><span id="CutPageName"></span>：</td>
	<td><input id="p_pagebatchurl" name="p_pagebatchurl" type="text" value="<%=p_pagebatchurl%>" size="60">
	分页代码 <font color=red>{ID}</font><br>
	标准格式：Http://www.xxxxx.com/list/list_{ID}.html<br>
	采集范围：
	<input id="p_pagebatchid1" name="p_pagebatchid1" type="text" value="<%=p_pagebatchid1%>" size="4">
	To
	<input id="p_pagebatchid2" name="p_pagebatchid2" type="text" value="<%=p_pagebatchid2%>" size="4">
	例如：1 - 9</td>
	</tr>
	<tr  id="ListContent" style="display:none">
	<td>手动分页：</td>
	<td><textarea id="p_manualurl" name="p_manualurl" cols="60" rows="3"><%=p_manualurl%></textarea></td>
	</tr>
	<tr>
	<td>随机人气：</td>
	<td>
  从&nbsp;<input id="p_hitsstart" name="p_hitsstart" type="text" size="4" value="<%=p_hitsstart%>">
  到 &nbsp; <input id="p_hitsend" name="p_hitsend" type="text" size="4" value="<%=p_hitsend%>">
  之间 (前小后大)
	</td>
	</tr>
	<tr>
	<td>过滤选项：</td>
	<td height=16 >
	<input name="p_script" type="checkbox" value="1" <%If (p_script and 1)>0 Then writeA "checked"%>>
	Iframe
	<input name="p_script" type="checkbox" value="2" <%If (p_script and 2)>0 Then writeA "checked"%>>
	Object
	<input name="p_script" type="checkbox" value="4" <%If (p_script and 4)>0 Then writeA "checked"%>>
	Script
	<input name="p_script" type="checkbox" value="8" <%If (p_script and 8)>0 Then writeA "checked"%>>
	Div
	<input name="p_script" type="checkbox" value="16" <%If (p_script and 16)>0 Then writeA "checked"%>>
	Class
	<input name="p_script" type="checkbox" value="32" <%If (p_script and 32)>0 Then writeA "checked"%>>
	Table
	<br><br>
	<input name="p_script" type="checkbox" value="64" <%If (p_script and 64)>0 Then writeA "checked"%>>
	Span
	<input name="p_script" type="checkbox" value="128" <%If (p_script and 128)>0 Then writeA "checked"%>>
	  Img
	<input name="p_script" type="checkbox" value="256" <%If (p_script and 256)>0 Then writeA "checked"%>>
	Font
	<input name="p_script" type="checkbox" value="512" <%If (p_script and 512)>0 Then writeA "checked"%>>
	A
	<input name="p_script" type="checkbox" value="1024" <%If (p_script and 1024)> 0 Then writeA "checked"%>>
	Tr
	<input name="p_script" type="checkbox" value="2048" <%If (p_script and 2048)> 0 Then writeA "checked"%>>
	Td
	<input name="p_script" type="checkbox" value="4096" <%If (p_script and 4096)>0 Then writeA "checked"%>>
	Html
	</td>
	</tr>
	</tbody>
</table>


<table class="tb" id="step2" style="display:none">
	<tbody>
	<tr>
	<td vAlign=center width="20%" >列表开始代码：</td>
	<td>
	<span onClick="if($$('p_listcodestart').rows>2)$$('p_listcodestart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_listcodestart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_listcodestart" name="p_listcodestart" cols="70" rows="3"><%=p_listcodestart%></textarea>
	</td>
	</tr>
	<tr>
	<td>列表结束代码：</td>
	<td>
	<span onClick="if($$('p_listcodeend').rows>2)$$('p_listcodeend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_listcodeend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_listcodeend" name="p_listcodeend" cols="70" rows="3"><%=p_listcodeend%></textarea>
	</td>
	</tr>
	<tr>
	<td>链接开始代码：</td>
	<td>
	<span onClick="if($$('p_listlinkstart').rows>2)$$('p_listlinkstart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_listlinkstart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_listlinkstart" name="p_listlinkstart" cols="70" rows="3"><%=p_listlinkstart%></textarea>
	</td>
    </tr>
    <tr>
	<td>链接结束代码：</td>
	<td>
	<span onClick="if($$('p_listlinkend').rows>2)$$('p_listlinkend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_listlinkend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_listlinkend" name="p_listlinkend" cols="70" rows="3"><%=p_listlinkend%></textarea>
	</td>
	</tr>
    <tr>
	<td>列表采集名称：</td>
	<td>
	<input type="radio" value="0" name="p_titletype" <%if p_titletype=0 then%>checked="checked"<%end if%> onClick="ChangeCutPara('0','trp_listtitlestart','trp_listtitleend');ChangeCutPara('1','trp_titlestart','trp_titleend');">
否&nbsp;&nbsp;
	<input type="radio" value="1" name="p_titletype" <%if p_titletype=1 then%>checked="checked"<%end if%> onClick="ChangeCutPara('1','trp_listtitlestart','trp_listtitleend');ChangeCutPara('0','trp_titlestart','trp_titleend');">
是&nbsp;
	</td>
    </tr>
	<tr id="trp_listtitlestart" <%if p_titletype=0 then%>style="display:none"<%end if%>>
	<td>名称开始代码：</td>
	<td>
	<span onClick="if($$('p_listtitlestart').rows>2)$$('p_listtitlestart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_listtitlestart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_listtitlestart" name="p_listtitlestart" cols="70" rows="3"><%=p_titlestart%></textarea>
	</td>
    </tr>
    <tr id="trp_listtitleend" <%if p_titletype=0 then%>style="display:none"<%end if%>>
	<td>名称结束代码：</td>
	<td>
	<span onClick="if($$('p_listtitleend').rows>2)$$('p_listtitleend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_listtitleend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_listtitleend" name="p_listtitleend" cols="70" rows="3"><%=p_titleend%></textarea>
	</td>
    </tr>
    <tr>
	<td>列表采集主演：</td>
	<td>
	<input type="radio" value="0" name="p_liststarringtype" <%if p_starringtype=0 then%>checked="checked"<%end if%> onClick="ChangeCutPara('0','trp_liststarringstart','trp_liststarringend');ChangeCutPara('1','trp_starringstart','trp_starringend');">
否&nbsp;&nbsp;
	<input type="radio" value="1" name="p_liststarringtype" <%if p_starringtype=1 then%>checked="checked"<%end if%> onClick="ChangeCutPara('1','trp_liststarringstart','trp_liststarringend');ChangeCutPara('0','trp_starringstart','trp_starringend');">
是&nbsp;
	</td>
    </tr>
	<tr id="trp_liststarringstart" <%if p_starringtype=0 then%>style="display:none"<%end if%>>
	<td>主演开始代码：</td>
	<td>
	<span onClick="if($$('p_liststarringstart').rows>2)$$('p_liststarringstart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_liststarringstart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_liststarringstart" name="p_liststarringstart" cols="70" rows="3"><%=p_starringstart%></textarea>
	</td>
    </tr>
    <tr id="trp_liststarringend" <%if p_starringtype=0 then%>style="display:none"<%end if%>>
	<td>主演结束代码：</td>
	<td>
	<span onClick="if($$('p_liststarringend').rows>2)$$('p_liststarringend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_liststarringend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_liststarringend" name="p_liststarringend" cols="70" rows="3"><%=p_starringend%></textarea>
	</td>
	</tr>
	<tr>
	<td>列表采集图片：</td>
	<td>
	<input type="radio" value="0" name="p_pictype" <%if p_pictype=0 then%>checked="checked"<%end if%> onClick="ChangeCutPara('0','trp_listpicstart','trp_listpicend');ChangeCutPara('1','trp_picstart','trp_picend');">
否&nbsp;&nbsp;
	<input type="radio" value="1" name="p_pictype" <%if p_pictype=1 then%>checked="checked"<%end if%> onClick="ChangeCutPara('1','trp_listpicstart','trp_listpicend');ChangeCutPara('0','trp_picstart','trp_picend');">
是&nbsp;
	</td>
    </tr>
    <tr id="trp_listpicstart" <%if p_pictype=0 then%>style="display:none"<%end if%>>
	<td>图片开始代码：</td>
	<td>
	<span onClick="if($$('p_listpicstart').rows>2)$$('p_listpicstart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_listpicstart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_listpicstart" name="p_listpicstart" cols="70" rows="3"><%=p_picstart%></textarea>
	</td>
	</tr>
	<tr id="trp_listpicend" <%if p_pictype=0 then%>style="display:none"<%end if%>>
	<td>图片结束代码：</td>
	<td>
	<span onClick="if($$('p_listpicend').rows>2)$$('p_listpicend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_listpicend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_listpicend" name="p_listpicend" cols="70" rows="3"><%=p_picend%></textarea>
	</td>
    </tr>
	</tbody>
</table>

<table class="tb" id="step3" style="display:none">
	<tbody>
	<%if p_titletype = 0 then%>
	<tr id="trp_titlestart">
	<td vAlign=center width="20%" >名称开始代码：</td>
	<td>
	<span onClick="if($$('p_titlestart').rows>2)$$('p_titlestart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_titlestart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_titlestart" name="p_titlestart" cols="70" rows="3"><%=p_titlestart%></textarea>	  </td>
	</tr>
	<tr id="trp_titleend">
	<td>名称结束代码：</td>
	<td>
	<span onClick="if($$('p_titleend').rows>2)$$('p_titleend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_titleend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_titleend" name="p_titleend" cols="70" rows="3"><%=p_titleend%></textarea>	  </td>
	</tr>
	<%end if%>
	<tr>
	<td>连载代码范围：</td>
	<td><input type="radio" value="0" name="p_lzcodetype" onClick="ChangeCutPara('0','trp_lzcodestart','trp_lzcodeend');" <% if p_lzcodetype=0 then writeA "checked" %>>  
	关闭&nbsp;&nbsp; <input type="radio" value="1" name="p_lzcodetype" onClick="ChangeCutPara('1','trp_lzcodestart','trp_lzcodeend');" <% if p_lzcodetype=1 then writeA "checked" %>> 开启</td>
	</tr> 
	<tr  id="trp_lzcodestart" <% if p_lzcodetype=0 then%> style="display:none"<%end if%>>
	<td>连载范围开始代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_lzcodestart').rows>2)$$('p_lzcodestart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_lzcodestart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_lzcodestart" name="p_lzcodestart" cols="70" rows="3" id="p_lzcodestart"><%=p_lzcodestart%></textarea></td>
	</tr>
	<tr  id="trp_lzcodeend" <% if p_lzcodetype=0 then%> style="display:none"<%end if%>>
	<td>连载范围结束代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_lzcodeend').rows>2)$$('p_lzcodeend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_lzcodeend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_lzcodeend" name="p_lzcodeend" cols="70" rows="3" id="p_lzcodeend"><%=p_lzcodeend%></textarea></td>
	</tr>
	<tr>
	<td vAlign=center >连载开始代码：</td>
	<td>
	<span onClick="if($$('p_lzstart').rows>2)$$('p_lzstart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_lzstart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_lzstart" name="p_lzstart" cols="70" rows="3"><%=p_lzstart%></textarea>	 
	</td>
    </tr>
    <tr>
	<td vAlign=center >连载结束代码：</td>
	<td>
	<span onClick="if($$('p_lzend').rows>2)$$('p_lzend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_lzend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_lzend" name="p_lzend" cols="70" rows="3"><%=p_lzend%></textarea>	 
	</td>
	</tr>
    <tr>
	<td vAlign=center >备注开始代码：</td>
	<td>
	<span onClick="if($$('p_remarksstart').rows>2)$$('p_remarksstart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_remarksstart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_remarksstart" name="p_remarksstart" cols="70" rows="3"><%=p_remarksstart%></textarea>	 
	</td>
	</tr>
	<tr>
	<td vAlign=center >备注结束代码：</td>
	<td>
	<span onClick="if($$('p_remarksend').rows>2)$$('p_remarksend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_remarksend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_remarksend" name="p_remarksend" cols="70" rows="3"><%=p_remarksend%></textarea>	 
	</td>
    </tr>
	<%if p_starringtype = 0 then%>
	<tr id="trp_starringstart">
	<td>主演开始代码：</td>
	<td>
	<span onClick="if($$('p_starringstart').rows>2)$$('p_starringstart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_starringstart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_starringstart" name="p_starringstart" cols="70" rows="3"><%=p_starringstart%></textarea>	  </td>
	</tr>
	<tr id="trp_starringend">
	<td>主演结束代码：</td>
	<td>
	<span onClick="if($$('p_starringend').rows>2)$$('p_starringend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_starringend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
 <textarea id="p_starringend" name="p_starringend" cols="70" rows="3"><%=p_starringend%></textarea>	  </td>
	</tr>
	<%end if%>
	<tr id="trp_directedstart">
	<td>导演开始代码：</td>
	<td>
	<span onClick="if($$('p_directedstart').rows>2)$$('p_directedstart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_directedstart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_directedstart" name="p_directedstart" cols="70" rows="3"><%=p_directedstart%></textarea>	  </td>
	</tr>
	<tr id="trp_directedend">
	<td>导演结束代码：</td>
	<td>
	<span onClick="if($$('p_directedend').rows>2)$$('p_directedend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_directedend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_directedend" name="p_directedend" cols="70" rows="3"><%=p_directedend%></textarea>	  </td>
    </tr>
    <%if p_pictype = 0 then%>
    <tr id="trp_picstart">
	<td>图片开始代码：</td>
	<td>
	<span onClick="if($$('p_picstart').rows>2)$$('p_picstart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_picstart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_picstart" name="p_picstart" cols="70" rows="3"><%=p_picstart%></textarea>	  </td>
    </tr>
    <tr id="trp_picend">
	<td>图片结束代码：</td>
	<td>
	<span onClick="if($$('p_picend').rows>2)$$('p_picend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_picend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea id="p_picend" name="p_picend" cols="70" rows="3"><%=p_picend%></textarea>	  </td>
	</tr>
    <%end if%>
	<tr>
	<td><font color="#FF0000">栏目设置：</font></td>
	<td>
	<input type="radio" value="0" name="p_classtype" onClick="$('#trp_typestart').css('display','none');$('#trp_typeend').css('display','none');$('#trp_classtype').css('display','');$('#p_collect_type').css('display','');" <% if p_classtype=0 then writeA "checked" %>>
	固定栏目&nbsp;&nbsp; 
	<input type="radio" value="1" name="p_classtype" onClick="$('#trp_classtype').css('display','none');$('#p_collect_type').css('display','none');$('#trp_typestart').css('display','');$('#trp_typeend').css('display','');" <% if p_classtype=1 then writeA "checked" %>>
按对应栏目自动转换</td>
	</tr>
	<tr id="trp_classtype" <% if p_classtype=1 then writeA "style=""display:none""" %>>
	<td><font color="#FF0000">选择入库栏目：</font></td>
	<td id="CollectClassN2" >
	<select name="p_collect_type" id="p_collect_type" size="1">
	<option value="0">请选择入库分类</option>
	<%=makeSelectAll("{pre}vod_type","t_id","t_name","t_pid","t_sort",0,"","&nbsp;|&nbsp;&nbsp;",p_collect_type)%>
	</select></td>
    </tr>
	<tr  id="trp_typestart" <% if p_classtype <>1 then writeA "style=""display:none""" %>>
	<td><font color="#FF0000">栏目开始代码：</font></td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_typestart').rows>2)$$('p_typestart').rows-=1" style='cursor:hand'><b>缩小</b></span> 	<span onClick="$$('p_typestart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_typestart" cols="70" rows="3" id="p_typestart"><%=p_typestart%></textarea></td>
	</tr>
	<tr  id="trp_typeend" <% if p_classtype <>1 then writeA "style=""display:none""" %>>
	<td><font color="#FF0000">栏目结束代码：</font></td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_typeend').rows>2)$$('p_typeend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_typeend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_typeend" cols="70" rows="3" id="p_typeend"><%=p_typeend%></textarea></td>
	</tr>	
	<tr>
	<td>上映日期开始代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_timestart').rows>2)$$('p_timestart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_timestart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_timestart" cols="70" rows="3" id="p_timestart"><%=p_timestart%></textarea></td>
	</tr>
	<tr>
	<td>上映日期结束代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_timeend').rows>2)$$('p_timeend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_timeend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_timeend" cols="70" rows="3" id="p_timeend"><%=p_timeend%></textarea></td>
	</tr>
	<tr>
	<td>地区开始代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_areastart').rows>2)$$('p_areastart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_areastart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_areastart" id="p_areastart" cols="70" rows="3"><%=p_areastart%></textarea></td>
	</tr>
	<tr>
	<td>地区结束代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_areaend').rows>2)$$('p_areaend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_areaend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_areaend" id="p_areaend" cols="70" rows="3"><%=p_areaend%></textarea></td>
	</tr>
	<tr>
	<td>语言开始代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_languagestart').rows>2)$$('p_languagestart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_languagestart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
 <textarea name="p_languagestart" id="p_languagestart" cols="70" rows="3"><%=p_languagestart%></textarea></td>
 </tr>
 <tr>
 <td>语言结束代码：</td>
 <td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_languageend').rows>2)$$('p_languageend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_languageend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_languageend" id="p_languageend" cols="70" rows="3"><%=p_languageend%></textarea></td>
	</tr>
	<tr>
	<td>介绍开始代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_contentstart').rows>2)$$('p_contentstart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_contentstart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_contentstart" cols="70" rows="3" id="p_contentstart"><%=p_contentstart%></textarea></td>
	</tr>
	<tr>
	<td>介绍结束代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if(document.form1.p_contentend.rows>2)document.form1.p_contentend.rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="document.form1.p_contentend.rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_contentend" cols="70" rows="3" id="p_contentend"><%=p_contentend%></textarea></td>
	</tr>
	<tr>
	<td>播放列表范围：</td>
	<td><input type="radio" value="0" name="p_playcodetype" onClick="ChangeCutPara('0','trp_playcodestart','trp_playcodeend');" <% if p_playcodetype=0 then writeA "checked" %>>  
 关闭&nbsp;&nbsp; <input type="radio" value="1" name="p_playcodetype" onClick="ChangeCutPara('1','trp_playcodestart','trp_playcodeend');" <% if p_playcodetype=1 then writeA "checked" %>> 
	开启</td>
	</tr> 
	<tr  id="trp_playcodestart" <% if p_playcodetype=0 then%>style="display:none"<%end if%>>
	<td>播放列表开始代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_playcodestart').rows>2)$$('p_playcodestart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_playcodestart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_playcodestart" cols="70" rows="3" id="p_playcodestart"><%=p_playcodestart%></textarea></td>
	</tr>
	<tr  id="trp_playcodeend" <% if p_playcodetype=0 then%>style="display:none" <%end if%>>
	<td>播放列表结束代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_playcodeend').rows>2)$$('p_playcodeend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_playcodeend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_playcodeend" cols="70" rows="3" id="p_playcodeend"><%=p_playcodeend%></textarea></td>
	</tr>
	<tr>
	<td><font color="#FF0000">获取地址设置：</font></td>
	<td>
	<input type="radio" value="0" name="p_playlinktype" onClick="ChangeCutPara('0','trp_playlinkstart','trp_playlinkend');" <%if p_playlinktype=0 then%>checked<%end if%>> 
  内容页获取地址&nbsp;&nbsp; <input type="radio" value="1" name="p_playlinktype" <%if p_playlinktype=1 then%>checked<%end if%> onClick="ChangeCutPara('1','trp_playlinkstart','trp_playlinkend');">
  每播放页获取单地址
  &nbsp;&nbsp; <input type="radio" value="2" name="p_playlinktype" <%if p_playlinktype=2 then%>checked<%end if%> onClick="ChangeCutPara('1','trp_playlinkstart','trp_playlinkend');">
  播放链接中获取地址
  &nbsp;&nbsp; <input type="radio" value="3" name="p_playlinktype" <%if p_playlinktype=3 then%>checked<%end if%> onClick="ChangeCutPara('1','trp_playlinkstart','trp_playlinkend');">
  单播放页获取所有播放地址
	</td>
	</tr>
	<tr id="trp_playlinkstart" <% if p_playlinktype=0 then%>style="display:none" <%end if%>>
	<td>播放链接开始代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_playlinkstart').rows>2)$$('p_playlinkstart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_playlinkstart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_playlinkstart" cols="70" rows="3" id="p_playlinkstart"><%=p_playlinkstart%></textarea></td>
	</tr>
	<tr id="trp_playlinkend" <% if p_playlinktype=0 then%>style="display:none" <%end if%>>
	<td>播放链接结束代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_playlinkend').rows>2)$$('p_playlinkend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_playlinkend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_playlinkend" cols="70" rows="3" id="p_playlinkend"><%=p_playlinkend%></textarea></td>
	</tr>
	<tr id="trp_playspecialtype" >
	<td>特殊播放链接处理：</td>
	<td><input type="radio" value="0" name="p_playspecialtype" checked="checked" onClick="ChangeCutPara('0','Listurl2','Listurl3');" <% if p_playspecialtype=0 then writeA "checked"%>>
  不作设置&nbsp;&nbsp;
	<input type="radio" value="1" name="p_playspecialtype" onClick="ChangeCutPara('1','Listurl2','Listurl3');" <% if p_playspecialtype=1 then writeA "checked"%>>
	替换地址<br>
	<font color="red">对于使用了JavaScript:openwindow形式的连接请使用以下格式处理:<br>
	脚本连接:内容[变量] 内容 如:javaScript:OpenWnd([变量],[变量])<br>
	实际连接:内容[变量] 内容 如:play.asp?id=[变量]&type=[变量]<br>
	2个区域的变量数量必须一致否则无法正确获取替换</font>
	</td>
	</tr>
	<tr  id="Listurl2" <% if p_playspecialtype<>1 then writeA "style=""display:none""" %>>
	<td>要替换的地址：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_playspecialrrul').rows>2)$$('p_playspecialrrul').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_playspecialrrul').rows+=1" style='cursor:hand'><b>扩大</b></span> &nbsp;&nbsp;可用标签：<font onmouseover="getActiveText(document.form1.p_playspecialrrul);" onClick="addTag('[变量]')" style="CUrsOR: hand"><b>[变量]</b></font><br />
	<textarea name="p_playspecialrrul" cols="70" rows="3" id="p_playspecialrrul"><%=p_playspecialrrul%></textarea></td>
	</tr>
	<tr  id="Listurl3" <% if p_playspecialtype <>1 then writeA "style=""display:none""" %>>
	<td>替换为的地址：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if(document.form1.p_playspecialrerul.rows>2)document.form1.p_playspecialrerul.rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="document.form1.p_playspecialrerul.rows+=1" style='cursor:hand'><b>扩大</b></span> &nbsp;&nbsp;可用标签：<font onmouseover="getActiveText(document.form1.p_playspecialrerul);" onClick="addTag('[变量]')" style="CUrsOR: hand"><b>[变量]</b></font><br />
	<textarea name="p_playspecialrerul" cols="70" rows="3" id="p_playspecialrerul"><%=p_playspecialrerul%></textarea></td>
	</tr>
	<tr>
	<td>地址开始代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_playurlstart').rows>2)$$('p_playurlstart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_playurlstart').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_playurlstart" cols="70" rows="3" id="p_playurlstart"><%=p_playurlstart%></textarea></td>
	</tr>
	<tr>
	<td>地址结束代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_playurlend').rows>2)$$('p_playurlend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_playurlend').rows+=1" style='cursor:hand'><b>扩大</b></span><br>
	<textarea name="p_playurlend" cols="70" rows="3" id="p_playurlend"><%=p_playurlend%></textarea></td>
	</tr>
	<tr id="trp_setnametype" >
	<td>截取集数名称：</td>
	<td><input type="radio" value="0" name="p_setnametype" checked="checked" onClick="ChangeCutPara('0','trp_setnamestart','trp_setnameend');" <% if p_setnametype=0 then writeA "checked"%>>
	不截取&nbsp;&nbsp;
	<input type="radio" value="1" name="p_setnametype" onClick="ChangeCutPara('1','trp_setnamestart','trp_setnameend');" <% if p_setnametype=1 then writeA "checked"%>>
	播放地址中截取&nbsp;&nbsp;
	<input type="radio" value="2" name="p_setnametype" onClick="ChangeCutPara('1','trp_setnamestart','trp_setnameend');" <% if p_setnametype=2 then writeA "checked"%>>
	播放页中截取&nbsp;&nbsp;
	<input type="radio" value="3" name="p_setnametype" onClick="ChangeCutPara('1','trp_setnamestart','trp_setnameend');" <% if p_setnametype=3 then writeA "checked"%>>
	内容页中截取&nbsp;&nbsp;
	<br>
	</td>
	</tr>
	<tr  id="trp_setnamestart" <% if p_setnametype <>1 then writeA "style=""display:none""" %>>
	<td>集数名称开始代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_setnamestart').rows>2)$$('p_setnamestart').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_setnamestart').rows+=1" style='cursor:hand'><b>扩大</b></span> &nbsp;&nbsp;可用标签：<font onmouseover="getActiveText(document.form1.p_setnamestart);" onClick="addTag('[变量]')" style="CUrsOR: hand"><b>[变量]</b></font><br />
	<textarea name="p_setnamestart" cols="70" rows="3" id="p_setnamestart"><%=p_setnamestart%></textarea></td>
	</tr>
	<tr  id="trp_setnameend" <% if p_setnametype <>1 then writeA "style=""display:none""" %>>
	<td>集数名称结束代码：</td>
	<td>&nbsp;&nbsp;输入区域： <span onClick="if($$('p_setnameend').rows>2)$$('p_setnameend').rows-=1" style='cursor:hand'><b>缩小</b></span> <span onClick="$$('p_setnameend').rows+=1" style='cursor:hand'><b>扩大</b></span> &nbsp;&nbsp;可用标签：<font onmouseover="getActiveText(document.form1.p_setnameend);" onClick="addTag('[变量]')" style="CUrsOR: hand"><b>[变量]</b></font><br />
	<textarea name="p_setnameend" cols="70" rows="3" id="p_setnameend"><%=p_setnameend%></textarea></td>
	</tr>
  </tbody>
</table>

<table class="tb" id="step4" style="display:none">
	<tbody>
	<tr>
	<td>
	<strong>正在获取数据请稍后...</strong>
	</td>
	</tr>
</table>
	
<table class="tb2">
<tr>
<td>
	&nbsp;&nbsp;<input type="button" class="btn" name="back" value="上一步" onclick="prestep()" />&nbsp;&nbsp;<input type="button" class="btn" name="next" value="下一步" onclick="nextstep()" />&nbsp;&nbsp;<input type="checkbox" class="checkbox" name="showcode" id="showcode" value="1"/>下一步显示源码 &nbsp;&nbsp;<input type="submit" class="btn" value="保存规则"/>
</td>
</tr>
</table>
</form>

<script language="JavaScript">
var currObj = "uuuu";
function getActiveText(obj)
{
	obj.focus();
	currObj = obj;
}
function addTag(ibTag)
{
	var isClose = false;
	var obj_ta = currObj;
	if (obj_ta.isTextEdit){
		obj_ta.focus();
		var sel = document.selection;
		var rng = sel.createRange();
		rng.colapse;
		if((sel.type == "Text" || sel.type == "None") && rng != null){
			rng.text = ibTag;
		}
		obj_ta.focus();
		return isClose;
	}
	else return false;
}

function ChangeCutPara(flag,e1,e2)
{
	switch (flag)
	{
		case "0" :
		$("#"+e1).css("display","none");
		$("#"+e2).css("display","none");
		break;
	case "1" :
		$("#"+e1).css("display","");
		$("#"+e2).css("display","");
		break;
	}
}
function showpageshow(flag)
{
	switch (flag)
	{
	case "0" :
	$("#IndexCutPage").css("display","");
	$("#HandCutPage").css("display","none");
	$("#ListContent").css("display","none");
	break;
	case "1" :
	$("#IndexCutPage").css("display","none");
	$("#HandCutPage").css("display","");
	$("#ListContent").css("display","none");
	$("#CutPageName").html("批量分页");
	break;
	case "2" :
	$("#IndexCutPage").css("display","none");
	$("#HandCutPage").css("display","none");
	$("#ListContent").css("display","");
	break;
	case "3" :
	$("#IndexCutPage").css("display","none");
	$("#HandCutPage").css("display","");
	$("#ListContent").css("display","none");
	$("#CutPageName").html("按ID采集内容页");
	break;
	default :
	$("#IndexCutPage").css("display","none");
	$("#HandCutPage").css("display","none");
	$("#ListContent").css("display","none");
	break;
	}
}
showpageshow("<%=p_pagetype%>");

</script>
<%
end sub

sub save
	dim sql,rs,strICListCode,strListUrl,strListCode,strListCodeCut,linkarr,titlearr,picarr,linkarrcode,titlearrcode,picarrcode,linkcode,titlecode,piccode,UrlTest,starringarr,starringarrcode,starringcode,lzcode,directedcode,typearr,p_server_Address
	dim isadd,sarr,i
	
	'1
	p_id = Request.Form("p_id")
	p_name = Request.Form("p_name") : p_coding = Request.Form("p_coding") 
	p_playtype = Request.Form("p_playtype") : p_pagetype = Request.Form("p_pagetype") : p_url = Request.Form("p_url")
	p_pagebatchurl = Request.Form("p_pagebatchurl") : p_manualurl = Request.Form("p_manualurl")
	p_pagebatchid1 = Request.Form("p_pagebatchid1") : p_pagebatchid2 = Request.Form("p_pagebatchid2")
	p_collecorder = Request.Form("p_collecorder") : p_savefiles = Request.Form("p_savefiles")
	p_intolib = Request.Form("p_intolib") : p_ontime = Request.Form("p_ontime")
	p_server = Request.Form("p_server") : p_hitsstart = request.Form("p_hitsstart")
	p_hitsend = request.Form("p_hitsend") : p_colleclinkorder= request.Form("p_colleclinkorder")
	p_showtype = request.Form("p_showtype")
	p_script = Request.Form("p_script")
	sarr = split(p_script,",")
	p_script=0
	for i=0 to ubound(sarr)
		if not isN(sarr(i)) then
			p_script = p_script or sarr(i)
		end if
	next
	if isN(p_collecorder) then p_collecorder = 0
	if isN(p_colleclinkorder) then p_colleclinkorder = 0
	if isN(p_savefiles) then p_savefiles = 0
	if isN(p_intolib) then p_intolib = 0
	if isN(p_ontime) then p_ontime = 0
	if isN(p_hitsstart) then p_hitsstart = 0
	if isN(p_hitsend) then p_hitsend = 0
	
	
	'2
	p_listcodestart = request.Form("p_listcodestart") :  p_listcodeend = request.Form("p_listcodeend")
	p_listlinkstart = request.Form("p_listlinkstart") :  p_listlinkend = request.Form("p_listlinkend")
	p_starringtype = request.form("p_starringtype")
	p_titletype = request.form("p_titletype")
	p_pictype = request.form("p_pictype")
	if isN(p_starringtype) then p_starringtype = 0 else p_starringtype=clng(p_starringtype)
	if isN(p_titletype) then p_titletype = 0 else p_titletype=clng(p_titletype)
	if isN(p_pictype) then p_pictype = 0 else p_pictype=clng(p_pictype)
	
	'3
	p_timestart=  request.Form("p_timestart") 
	p_timeend = request.Form("p_timeend") : p_areastart=  request.Form("p_areastart") 
	p_areaend = request.Form("p_areaend") : p_classtype=  request.Form("p_classtype") 
	p_collect_type = request.Form("p_collect_type") : p_typestart=  request.Form("p_typestart") 
	p_typeend = request.Form("p_typeend") : p_contentstart=  request.Form("p_contentstart") 
	if isN(p_collect_type) then p_collect_type=0
	
	p_contentend = request.Form("p_contentend") : p_playcodetype=  request.Form("p_playcodetype") 
	p_playcodestart = request.Form("p_playcodestart") : p_playcodeend=  request.Form("p_playcodeend") 
	p_playurlstart = request.Form("p_playurlstart") : p_playurlend=  request.Form("p_playurlend") 
	p_playlinktype = request.Form("p_playlinktype") : p_playlinkstart=  request.Form("p_playlinkstart") 
	
	p_playlinkend = request.Form("p_playlinkend") : p_playspecialtype=  request.Form("p_playspecialtype") 
	p_playspecialrrul = request.Form("p_playspecialrrul") : p_timestart=  request.Form("p_timestart") 
	p_playspecialrerul = request.Form("p_playspecialrerul")
	
	if p_starringtype=1 then
		p_starringstart = request.form("p_liststarringstart")
		p_starringend = request.form("p_liststarringend")
	else
		p_starringstart = request.form("p_starringstart")
		p_starringend = request.form("p_starringend")
	end if
	if p_titletype=1 then
		p_titlestart = request.Form("p_listtitlestart")
		p_titleend = request.Form("p_listtitleend")
	else
		p_titlestart = request.Form("p_titlestart")
		p_titleend = request.Form("p_titleend")
	end if
	if p_pictype=1 then
		p_picstart = request.Form("p_listpicstart")
		p_picend = request.Form("p_listpicend")
	else
		p_picstart = request.Form("p_picstart")
		p_picend = request.Form("p_picend")
	end if
	
	p_lzstart = request.Form("p_lzstart") :	p_lzend = request.Form("p_lzend")
	p_lzcodetype = request.Form("p_lzcodetype")
	p_lzcodestart = request.Form("p_lzcodestart") :	p_lzcodeend = request.Form("p_lzcodeend")
	
	p_languagestart = request.Form("p_languagestart") :	p_languageend = request.Form("p_languageend")
	p_remarksstart = request.Form("p_remarksstart") :	p_remarksend = request.Form("p_remarksend")
	p_directedstart = request.Form("p_directedstart") :	p_directedend = request.Form("p_directedend")
	
	p_setnametype= request.Form("p_setnametype")
	p_setnamestart=  request.Form("p_setnamestart") :  p_setnameend =request.Form("p_setnameend")
	strListUrl = request.Form("listurl")
	
	if isN(p_id) then p_id=0 : isadd = true else isadd= false
	sql="select * from tbl_vod_project "
	if not isadd then sql = sql & " where p_id = " &p_id 
	
	set rs = cjdb.DB (sql,"rs3") 
	if isadd then rs.Addnew
	
	'step1
	rs("p_name") = p_name
	rs("p_coding") = p_coding
	rs("p_playtype") = p_playtype
	rs("p_pagetype") = p_pagetype
	rs("p_url") = p_url
	rs("p_pagebatchurl") = p_pagebatchurl
	rs("p_manualurl") = p_manualurl
	rs("p_pagebatchid1") = p_pagebatchid1
	rs("p_pagebatchid2") = p_pagebatchid2
	rs("p_script") = p_script
	rs("p_collecorder") = p_collecorder
	rs("p_savefiles") = p_savefiles
	rs("p_intolib") = p_intolib
	rs("p_ontime") = p_ontime
	rs("p_server") = p_server
	rs("p_hitsstart")=p_hitsstart
	rs("p_hitsend")=p_hitsend
	rs("p_colleclinkorder")=p_colleclinkorder
	rs("p_showtype")=p_showtype
	
	'step2
	rs("p_listcodestart") = p_listcodestart
	rs("p_listcodeend") = p_listcodeend
	rs("p_listlinkstart") = p_listlinkstart
	rs("p_listlinkend") = p_listlinkend
	rs("p_starringtype") = p_starringtype
	rs("p_titletype") = p_titletype
	rs("p_pictype") = p_pictype
	
	rs("p_starringstart") = p_starringstart
	rs("p_starringend") = p_starringend
	rs("p_titlestart") = p_titlestart
	rs("p_titleend") = p_titleend
	rs("p_picstart") = p_picstart
	rs("p_picend") = p_picend
	
	'3
	rs("p_lzstart") = p_lzstart
	rs("p_lzend") = p_lzend
	rs("p_timestart") = p_timestart
	rs("p_timeend") = p_timeend
	rs("p_areastart") = p_areastart
	rs("p_areaend") = p_areaend
	rs("p_classtype") = p_classtype
	rs("p_collect_type") = p_collect_type
	rs("p_typestart") = p_typestart
	rs("p_typeend") = p_typeend
	rs("p_contentstart") = p_contentstart
	rs("p_contentend") = p_contentend
	rs("p_playcodetype") = p_playcodetype
	rs("p_playcodestart") = p_playcodestart
	rs("p_playcodeend") = p_playcodeend
	rs("p_playurlstart") = p_playurlstart
	rs("p_playurlend") = p_playurlend
	rs("p_playlinktype") = p_playlinktype
	rs("p_playlinkstart") = p_playlinkstart
	rs("p_playlinkend") = p_playlinkend
	rs("p_playspecialtype") = p_playspecialtype 
	rs("p_playspecialrrul") = p_playspecialrrul
	rs("p_playspecialrerul") = p_playspecialrerul
	rs("p_lzcodetype") = p_lzcodetype
	rs("p_lzcodestart") = p_lzcodestart
	rs("p_lzcodeend") = p_lzcodeend
	rs("p_languagestart") = p_languagestart
	rs("p_languageend") = p_languageend
	rs("p_remarksstart") = p_remarksstart
	rs("p_remarksend") = p_remarksend
	rs("p_directedstart") = p_directedstart
	rs("p_directedend") = p_directedend
	rs("p_setnametype") = p_setnametype
	rs("p_setnamestart") = p_setnamestart
	rs("p_setnameend") = p_setnameend
	
 	rs.Update
 	cjdb.C(rs)
 	if action="save" then
 	  	alertUrl "保存成功","collect_vod_manage.asp"
 	else
 		headAdminCollect "视频自定义采集项目测试"
 		
 		if p_server > 0 then p_server_Address = getVodXmlText("vodserver.xml","servers/server", p_server , 1)
 		
 		if p_pagetype <> 3 then
		if isN(session("strListCode")) then
			strListCode = getPage(strListUrl,p_coding)
			session("strListCode") = strListCode
		else
			strListCode = session("strListCode")
		end if
		
		if isN(session("strListCodeCut")) then
			strListCodeCut = getBody(strListCode,p_ListCodeStart,p_ListCodeEnd)
			session("strListCodeCut") = strListCodeCut
		else
			strListCodeCut = session("strListCodeCut")
		end if
		
		if isN(session("linkarrcode")) then
			linkarrcode = getArray(strListCodeCut,p_ListLinkStart,p_ListLinkEnd)
			session("linkarrcode") = linkarrcode
		else
			linkarrcode = session("linkarrcode")
		end if
		
		if p_StarringType = 1 then starringarrcode = getArray(strListCodeCut,p_StarringStart,p_StarringEnd)
		if p_TitleType = 1 then titlearrcode = getArray(strListCodeCut,p_TitleStart,p_TitleEnd)
		if p_PicType = 1 then picarrcode = getArray(strListCodeCut,p_PicStart,p_PicEnd)
		
		Select Case linkarrcode
		Case False
			errmsg "采集提示","<li>在获取链接列表时出错。</li>"
		Case Else
			linkarr = Split(linkarrcode,"$Array$")
			UrlTest = linkarr(0)
			UrlTest = DefiniteUrl(UrlTest,strListUrl)
			linkcode = getPage(UrlTest,p_coding)
		End Select
	else
		strListUrl = p_pagebatchurl
		p_pagebatchurl = replaceStr(p_pagebatchurl,"{ID}",p_pagebatchid1)
		UrlTest = p_pagebatchurl
		linkcode = getPage(UrlTest,p_coding)
	end if
	
	if linkcode = False then 
		errmsg "采集提示","获取内容页失败!"
	end if
	
	if p_TitleType = 1 then
		Select Case titlearrcode
		Case False
			titlecode = "获取失败"
		Case Else
			titlearr = Split(titlearrcode,"$Array$")
			titlecode = titlearr(0)
		End Select
	else
		titlecode = getBody(linkcode,p_TitleStart,p_TitleEnd)
	end if
	
	if p_StarringType = 1 then
		Select Case starringarrcode
		Case False
			starringcode = "获取失败"
		Case Else
			starringarr = Split(starringarrcode,"$Array$")
			starringcode = starringarr(0)
		End Select
	else
		starringcode = getBody(linkcode,p_StarringStart,p_StarringEnd)
	end if
	
	if p_PicType = 1 then
		Select Case picarrcode
		Case False
			piccode = "获取失败"
		Case Else
			picarr = Split(picarrcode,"$Array$")
			piccode = picarr(0)
		End Select
	else
		piccode = getBody(linkcode,p_PicStart,p_PicEnd)
	end if
	
	
	dim areacode,timecode,contentcode,typecode,weburl,playcode,lzfwcode,remarkscode,languagecode,setnames
	
	if p_LzCodeType = 1 then
		lzfwcode = getBody(linkcode,p_LzCodeStart,p_LzCodeEnd)
		lzcode = getBody(lzfwcode,p_LzStart,p_LzEnd)
		lzcode = ReplaceStr(lzcode,"False","0")
	else
		lzcode = getBody(linkcode,p_LzStart,p_LzEnd)
		lzcode = ReplaceStr(lzcode,"False","0")
	end if
	
	if p_ClassType = 1 then
		typecode = getBody(linkcode,p_TypeStart,p_TypeEnd)
	else
		typecode = p_collect_type
		typearr = getValueByArray(cachevodtype, typecode)
		if isarray(typearr) then 
			typecode = typearr(1)
		else
			typecode = "未知"
		end if
	end if
	
	typecode = Filterscript(typecode,p_script)
	
	remarkscode = getBody(linkcode,p_RemarksStart,p_RemarksEnd)
	remarkscode = ReplaceStr(remarkscode,"False","")
	remarkscode = Filterscript(remarkscode,p_script)
	
	directedcode = getBody(linkcode,p_DirectedStart,p_DirectedEnd)
	directedcode = ReplaceStr(directedcode,"False","未知")
	directedcode = Filterscript(directedcode,p_script)
	
	languagecode = getBody(linkcode,p_LanguageStart,p_LanguageEnd)
	languagecode = ReplaceStr(languagecode,"False","未知")
	languagecode = Filterscript(languagecode,p_script)
	
	areacode = getBody(linkcode,p_AreaStart,p_AreaEnd)
	areacode = ReplaceStr(areacode,"False","未知")
	areacode = Filterscript(areacode,p_script)
	
	timecode = getBody(linkcode,p_TimeStart,p_TimeEnd)
	timecode = ReplaceStr(timecode,"False",now)
	timecode = Filterscript(timecode,p_script)
	
	starringcode = ReplaceStr(starringcode,"False","未知")
	starringcode = Filterscript(starringcode,p_script)
	
	piccode = replaceStr(piccode,"False","")
	piccode = DefiniteUrl(piccode,UrlTest)
	piccode = Filterscript(piccode,p_script)
	
	titlecode = replaceStr(titlecode,"False","未知")
	titlecode =	Filterscript(titlecode,p_script)
	titlecode = replaceFilters(titlecode,p_id,1)
	
	contentcode = getBody(linkcode,p_ContentStart,p_ContentEnd)
	contentcode = ReplaceStr(contentcode,"False","未知")
	contentcode = Filterscript(contentcode,p_script)
	contentcode = replaceFilters(contentcode,p_id,2)
	
	if p_PlayCodeType = 1 then
		playcode = getBody(linkcode,p_PlayCodeStart,p_PlayCodeEnd)
		
		if p_PlayLinkType >0 then
			weburl = getArray(playcode,p_PlayLinkStart,p_PlayLinkEnd)
		else
			weburl = getArray(playcode,p_PlayUrlStart,p_PlayUrlEnd)
		end if
		if p_setNameType=3 then
			setnames = getArray(playcode,p_setNameStart,p_setNameEnd)
		end if
	else
		if p_PlayLinkType >0 then
			weburl = getArray(linkcode,p_PlayLinkStart,p_PlayLinkEnd)
		else
			weburl = getArray(linkcode,p_PlayUrlStart,p_PlayUrlEnd)
		end if
		if p_setNameType=3 then
			setnames = getArray(linkcode,p_setNameStart,p_setNameEnd)
		end if
	end if
	%>
<table class="tb">
	<tbody>
	<tr>
	<td colspan="2" align="center">保存规则并采集测试结果</td>
	</tr>
	<tr>
	<td width="20%" >名称：</td><td> <input type="text" size="50" name="d_name" value="<%=titlecode%>" />  连载:<input type="text" size="10" name="d_state" value="<%=lzcode%>" /> 备注：<input type="text" size="10" name="d_remarks" value="<%=remarkscode%>" /> </td>
	</tr>
	<tr>
	<td>演员：</td><td> <input type="text" size="50" name="d_starrinig" value="<%=starringcode%>" /> </td>
    </tr>
    <tr>
	<td>导演：</td><td> <input type="text" size="50" name="d_directed" value="<%=directedcode%>" /> </td>
    </tr>
    <tr>
	<td>上映年代：</td><td> <input type="text" size="50" name="d_year" value="<%=timecode%>" /> </td>
    </tr>
    <tr>
	<td>栏目：</td><td> <input type="text" size="50" name="d_typename" value="<%=typecode%>" /> </td>
    </tr>
    <tr>
	<td>地区：</td><td> <input type="text" size="50" name="d_area" value="<%=areacode%>" /> </td>
    </tr>
    <tr>
	<td>语言：</td><td> <input type="text" size="50" name="d_language" value="<%=languagecode%>" /> </td>
    </tr>
    <tr>
	<td>图片：</td><td> <input type="text" size="50" name="d_pic" value="<%=piccode%>" /> </td>
    </tr>
    <tr>
	<td>介绍：</td><td> <textarea name="d_content" style="width:500px;height:100px;"/><%=htmlFilter(contentcode)%></textarea> </td>
    </tr>
    <%
		 dim webArray,Keyurl,urli,webCode,url,playUrlTest,tmpA,setname,j,tmpB,tmpC,setnameArray
		 
		 if weburl <> False Then
		 	 webArray=Split(weburl,"$Array$")
		 	 setnameArray=Split(setnames,"$Array$")
		 	 
			  For i=0 To Ubound(webArray)
			  	playUrlTest = webArray(i)
			  	
				if p_PlaySpecialType = 1 and instr(p_PlaySpecialRrul,"[变量]") > 0 then
					playUrlTest =  SpecialLink(playUrlTest,p_PlaySpecialRrul,p_PlaySpecialRerul)
					if playUrlTest=False then  Exit For
				end if
				
				setname=""
				if p_PlayLinkType = 1 then
					playUrlTest = DefiniteUrl(playUrlTest,UrlTest)
					webCode = getPage(playUrlTest,p_coding)
					url = getBody(webCode,p_PlayUrlStart,p_PlayUrlEnd)
					url = replaceFilters(url,p_id,3)
                elseif p_PlayLinkType = 2 then
                	if isN(p_PlayUrlEnd) then
                		tmpA = InStr(playUrlTest, p_PlayUrlStart)
                		url = right(playUrlTest,len(playUrlTest)-tmpA-len(p_PlayUrlStart)+1)
                	else
                		url = getBody(playUrlTest,p_PlayUrlStart,p_PlayUrlEnd)
                	end if
					url = replaceFilters(url,p_id,3)
				elseif p_PlayLinkType = 3 then
					playUrlTest = DefiniteUrl(playUrlTest,UrlTest)
					webCode = getPage(playUrlTest,p_coding)
					tmpB = getArray(webCode,p_PlayUrlStart,p_PlayUrlEnd)
					
					tmpC = Split(tmpB,"$Array$")
					For j=0 To Ubound(tmpC)
						url = tmpC(j)
						url = replaceFilters(url,p_id,3)
						%>
				<tr>
			      <td>地址：</td><td> <%=p_server_Address & url%> </td>
			    </tr>
				<%
					next
					exit for
				else
				   url = replaceFilters(playUrlTest,p_id,3)
				end if
				if p_setNameType = 1 then
					setname = getBody(url,p_setNameStart,p_setNameEnd)
					url = setname & "$" & url
				elseif p_setNameType = 2 and p_PlayLinkType = 1 then
					setname = getBody(webCode,p_setNameStart,p_setNameEnd)
					url = setname & "$" & url
				elseif p_setNameType=3 then
					url = setnameArray(i) & "$" & url
				end if
				%>
	<tr>
      <td>播放链接：</td><td> <%=playUrlTest%> </td>
    </tr>
    <tr>
      <td>地址：</td><td> <%=p_server_Address & url%> </td>
    </tr>
				<%
			  next
		 end if
	%>
	<tr>
	<td colspan="2"><input type="button" onClick="window.location.href='javascript:history.go(-1)'" value="返回规则">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" onClick="window.location.href='?action=main'" value="返回列表"></td>
	</tr>
</tbody>
</table>
<%
 	end if
end sub

sub main
	dim pagenum,sql,rs
	pagenum = be("all","page")
	if not isNum(pagenum) then pagenum = 1
	if pagenum < 1 then pagenum = 1
	pagenum = clng(pagenum)
	
	sql="Select * from tbl_vod_project order by p_id desc"
	set rs = cjdb.db (sql,"rs1")
%>
<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1">
	<tr>
	<td>
		菜单：<a href="collect_vod_manage.asp?action=add">添加采集规则</a> | <a href="collect_vod_change.asp">分类转换</a> | <a href="collect_vod_filters.asp">信息过滤</a> 
	</td>
	</tr>
</table>

<form action="" method="post" name="form1">
<table class="tb">
	<tr>
	  <td width="4%">&nbsp;</td>
      <td>项目名称</td>
      <td width="10%">播放类型</td>
      <td width="10%">入库分类</td>
      <td width="20%">上次采集</td>
      <td width="25%">操作</td>
    </tr>
	<%
		if rs.eof then
	 %>
    <tr><td align="center" colspan="6" >没有任何记录!</td></tr>
    <%
		else
			Dim i,typearr
			rs.PageSize = app_pagenum
		    rs.AbsolutePage = pagenum
		  	for i = 1 to rs.PageSize
		  		if rs.eof then exit for
	%>
    <tr>
	  <td><input name="p_id" type="checkbox" id="p_id" value="<%=rs("p_id")%>" /></td>
      <td><a href="?action=edit&p_id=<%=rs("p_id")%>"><%=rs("p_name")%></a></td>
	  <td><%=rs("p_playtype")%></td>
	  <td>
	  <%
	  	if rs("p_classtype") = 1 Then
	  		writeA "<font color=red>自定义分类</font>"
	  	else
	  		typearr = getValueByArray(cachevodtype, rs("p_collect_type"))
	  		if isarray(typearr) then
				writeA typearr(1)
			else
				writeA "未知"
			end if
	  	end if
	  %>
	  </td>
      <td><%=getColorDay(rs("p_time"))%></td>
 	  <td>
 	  <A href="collect_vod_cj.asp?p_id=<%= rs("p_id") %>">采集</A>｜
 	  <A href="?action=edit&p_id=<%=rs("p_id")%>">修改</A>｜
 	  <A href="?action=copy&p_id=<%= rs("p_id") %>">复制</A>｜
 	  <A href="?action=export&p_id=<%= rs("p_id") %>">导出</A>｜
 	  <A href="?action=del&p_id=<%=rs("p_id")%>">删除</A>
 	  </td>
    </tr>
	<%
	rs.MoveNext
	next 
	end if
	%>
	<tr>
	<td  colspan="6">
	全选<input name="chkall" type="checkbox" id="chkall" value="1" onClick="checkAll(this.checked,'p_id');"/>&nbsp;
	<input type="submit" value="批量删除" onClick="if(confirm('确定要删除吗')){form1.action='?action=delall';}else{return false}"  class="input"/>
	<input type="submit" value="批量采集" onClick="if(confirm('确定要批量采集吗')){form1.action='collect_vod_cj.asp?action=pl';}else{return false}"  class="input"/>
	<input type="button" value="导入规则" onClick="$('#win1').window('open');" class="input"/>
	</td>
	</tr>
    <tr align="center">
      <td colspan="6">
      <%=pagelist_manage(rs.PageCount,pagenum,rs.RecordCount,app_pagenum,"collect_vod_manage.asp?page={p}")%>
      </td>
    </tr>
  </form>
</table>

<div id="win1" class="easyui-window" title="窗口" style="padding:5px;width:400px;" closed="true" closable="true" minimizable="false" maximizable="false">
<form enctype="multipart/form-data" action="?action=upexpsave" method="post">
<table class="tb">
  <tbody>
  	<tr>
  		<td colspan="2" align="center">
  		上传采集规则
         <input type="file" id="file1" name="file1">
		<input type="submit" name="submit" value="开始导入">
		</td>
  	</tr>
</table>
</form>
</div>
<%
cjdb.c(rs)
end sub
%>