<!--#include file="Item_Conn.asp"-->
<!--#include file="Item_Function.asp"-->
<%
Dim Action, SaveEdit, SqlItem, RsItem, SqlF,RsF, ItemID, ItemName, WebName, WebUrl
Dim LoginType, LoginUrl, LoginPostUrl, LoginUser, LoginPass, LoginFalse, LoginResult, LoginData
Dim ListStr, LsString, LoString, ListPaingType, LPsString, LPoString, ListPaingStr1, ListPaingStr2
Dim ListPaingID1, ListPaingID2, ListPaingStr3, HsString, HoString, HttpUrlType, HttpUrlStr
Dim TsString, ToString, CsString, CoString, DateType, DsString, DoString, UpDateTime, AuthorType, AsString
Dim AoString, AuthorStr, CopyFromType, FsString, FoString, CopyFromStr, KeyType, KsString, KoString, KeyStr
Dim NewsPaingType, NPsString, NPoString, NewsPaingStr, NewsPaingHtml
Dim NewsPaingNext, NewsPaingNextCode, ContentTemp
Dim UrlTest, NewsUrl, NewsCode, NewsArrayCode, NewsArray
Dim Title, Content, Author, CopyFrom, Key
Dim Arr_Filters, Filteri, FilterStr
Dim UpDateType, Testi
Dim ListUrl,ListCode,ListPaingNext
Dim ClassID, SpecialID, ItemDemo, tClass, tSpecial
Dim UploadFiles, strInstallDir, strChannelDir
strInstallDir	= Trim(request.ServerVariables("SCRIPT_NAME"))
strInstallDir	= left(strInstallDir,instrrev(lcase(strInstallDir),"/")-1)
strInstallDir	= left(strInstallDir,instrrev(lcase(strInstallDir),"/"))
strChannelDir	= "Test"
Action			= Trim(Request("Action"))
SaveEdit		= Trim(Request("SaveEdit"))
ItemID			= Cl.ChkClng(Request("ItemID"))
if ItemID=0 then Call Admin_ShowErr("<br><li>参数错误，项目ID不能为空！</li>")
%>
<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>
</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" class="topbg"><strong>采 集 系 统 项 目 管 理</td>
  </tr>
  <tr class="tdbg"> 
    <td width="65" height="30"><strong>管理导航：</strong></td>
    <td height="30">项目编辑 >> 
	<a href="Item_Modify.asp?ItemID=<%=ItemID%>"><%if Action="" then%><font color=red>基本设置</font><%else%>基本设置<%end if%></a> >>
	<a href="Item_Modify.asp?Action=Step2&ItemID=<%=ItemID%>"><%if Action="Step2" then%><font color=red>列表设置</font><%else%>列表设置<%end if%></a> >>
	<a href="Item_Modify.asp?Action=Step3&ItemID=<%=ItemID%>"><%if Action="Step3" then%><font color=red>链接设置</font><%else%>链接设置<%end if%></a> >>
	<a href="Item_Modify.asp?Action=Step4&ItemID=<%=ItemID%>"><%if Action="Step4" then%><font color=red>正文设置</font><%else%>正文设置<%end if%></a> >>
	<a href="Item_Modify.asp?Action=Step5&ItemID=<%=ItemID%>"><%if Action="Step5" then%><font color=red>采样测试</font><%else%>采样测试<%end if%></a> >>
	<a href="Item_Attribute.asp?ItemID=<%=ItemID%>"><%if Action="" then%><font color=red>属性设置</font><%else%>属性设置<%end if%></a> >> 完成</td>         
  </tr>         
</table>
<br>
<%
Select Case Action
Case "Step2"
	Call Step2()
Case "Step3"
	Call Step3()
Case "Step4"
	Call Step4()
Case "Step5"
	Call Step5()
Case "Step6"
	Call Step6()
Case Else
	Call Main()
End Select
Footer

Call CloseConnItem()

Sub Main
	SqlItem ="select ItemID,ItemName,WebName,WebUrl,ChannelID,ClassID,SpecialID,LoginType,LoginUrl,LoginPostUrl,LoginUser,LoginPass,LoginFalse,ItemDemo from Item where ItemID=" & ItemID
	Set RsItem=Server.CreateObject("adodb.recordset")
	RsItem.Open SqlItem,ConnItem,1,1
	If RsItem.Eof And RsItem.Bof  Then
		Call Admin_ShowErr("<br><li>参数错误，没有找到该项目！</li>")
	Else
		ItemName	= RsItem("ItemName")
		ItemDemo	= RsItem("ItemDemo")
		WebName		= RsItem("WebName")
		WebUrl		= RsItem("WebUrl")
		ChannelID	= RsItem("ChannelID")
		ClassID		= RsItem("ClassID")
		SpecialID	= RsItem("SpecialID")
		LoginType	= RsItem("LoginType")
		LoginUrl	= RsItem("LoginUrl")
		LoginPostUrl= RsItem("LoginPostUrl")
		LoginUser	= RsItem("LoginUser")
		LoginPass	= RsItem("LoginPass")
		LoginFalse	= RsItem("LoginFalse")
	End If
	RsItem.Close : Set RsItem=Nothing
	Call SetChannel()
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
<form method="post" action="Item_Modify.asp?Action=Step2" name="myform">
    <tr> 
      <td height="22" colspan="2" class="title"> <div align="center"><strong>编 辑 项 目--基 本 设 置</strong></div></td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg"><strong>项目名称：</strong></td>
      <td class="tdbg" width="75%">
		<input name="ItemName" type="text" size="27" maxlength="30" value="<%=ItemName%>">&nbsp;&nbsp;<font color=red>*</font>如：创力－新闻中心 既简单又明了 
      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg"><strong> 所属频道：</strong></td>
      <td class="tdbg" width="75%"><select ID="ChannelID" name="ChannelID" onChange="changelocation(document.myform.ChannelID.options[document.myform.ChannelID.selectedIndex].value)"><%call Admin_ShowChannel_Option(ChannelID)%></select>
      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg"><strong> 所属栏目：</strong></td>
      <td class="tdbg" width="75%"><select name="ClassID" ID="ClassID"><%=ShowClass_Option(ChannelID,ClassID,0,1)%></select>
      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg"><strong> 所属专题：</strong></td>
      <td class="tdbg" width="75%"><select name="SpecialID" ID="SpecialID">
<%=ShowSpecial_Option(ChannelID,SpecialID,1)%></select>
      </td>
    </tr>
    <tr>
      <td width="20%" class="tdbg"><strong> 网站名称：</strong></td>
      <td class="tdbg" width="75%">
		<input name="WebName" type="text" size="27" maxlength="30" value="<%=WebName%>">
      </td>
    </tr>
    <tr>
      <td width="20%" class="tdbg"><strong> 网站网址：</strong></td>
      <td class="tdbg" width="75%"><input name="WebUrl" type="text" size="49" maxlength="150" value="<%=WebUrl%>">
      </td>
    </tr>
   <tr class="tdbg"> 
      <td width="150" class="tdbg"><strong> 网站登录：</strong></td>
      <td class="tdbg">
		<input type="radio" value="0" name="LoginType" <%if LoginType=0 Then Response.Write "checked"%> onClick="Login.style.display='none'">不需要登录<span lang="en-us">&nbsp;
		</span>
		<input type="radio" value="1" name="LoginType" <%if LoginType=1 Then Response.Write "checked"%> onClick="Login.style.display=''">设置参数

      </td>
    </tr>
   <tr class="tdbg" id="Login" style="<%If LoginType=0 Then Response.write "display:none"%>"> 
      <td width="150" class="tdbg"><strong> 登录参数：</strong></td>
      <td class="tdbg">
        登录地址：<input name="LoginUrl" type="text" size="40" maxlength="150" value="<%=LoginUrl%>"><br>
        提交地址：<input name="LoginPostUrl" type="text" size="40" maxlength="150" value="<%=LoginPostUrl%>"><br>
        用户参数：<input name="LoginUser" type="text" size="30" maxlength="150" value="<%=LoginUser%>"><br>
        密码参数：<input name="LoginPass" type="text" size="30" maxlength="150" value="<%=LoginPass%>"><br> 
		失败信息：<input name="LoginFalse" type="text" size="30" maxlength="150" value="<%=LoginFalse%>"></td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg"><strong>模板备注：</strong></td>
      <td class="tdbg" width="75%"><textarea name="ItemDemo" cols="49" rows="5"><%=ItemDemo%></textarea></td>
    </tr>
    <tr class="tdbg"> 
      <td colspan="2" align="center" class="tdbg">
        <input name="ItemID" type="hidden" id="ItemID" value="<%=ItemID%>">
        <input name="Action" type="hidden" id="Action" value="SaveEdit">
        <input name="Cancel" type="button" id="Cancel" value=" 返&nbsp;&nbsp;回 " onClick="window.location.href='Item_Start.asp'">
        &nbsp; 
        <input  type="submit" name="Submit" value="下&nbsp;一&nbsp;步"></td>
    </tr>
</form>
</table>
<%
End  Sub

Sub Step2()
	If SaveEdit="Yes" Then
		ItemName	= Trim(Request.Form("ItemName"))
		WebName		= Trim(Request.Form("WebName"))
		WebUrl		= Trim(Request.Form("WebUrl"))
		ChannelID	= Cl.ChkClng(Request.Form("ChannelID"))
		ClassID		= Cl.ChkClng(Request.Form("ClassID"))
		SpecialID	= Cl.ChkClng(Request.Form("SpecialID"))
		LoginType	= Cl.ChkClng(Request.Form("LoginType"))
		LoginUrl	= Trim(Request.Form("LoginUrl"))
		LoginPostUrl= Trim(Request.Form("LoginPostUrl"))
		LoginUser	= Trim(Request.Form("LoginUser"))
		LoginPass	= Trim(Request.Form("LoginPass"))
		LoginFalse	= Trim(Request.Form("LoginFalse"))
		ItemDemo	= Trim(Request.Form("ItemDemo"))
		If ItemName="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>项目名称不能为空</li>"
		End If
		If WebName="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>网站名称不能为空</li>"
		End If
		If WebUrl="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>网站网址不能为空</li>" 
		End If
		If ChannelID=0 Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>未指定频道</li>"
		End If
		If ClassID<=0 then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>指定的栏目有下属子栏目或者非法的栏目（外部栏目或不存在的栏目）</li>"
		Else
			set tClass=Cl.Execute("select C.Child,C.LinkUrl,D.ChannelDir From Cl_Class C inner join Cl_Channel D on C.ChannelID=D.ChannelID Where C.ChannelID="  & ChannelID & " and C.ClassID=" & ClassID)
			If tClass.bof and tClass.eof then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>在本频道内找不到指定的栏目</li>"
			Else
				if tClass(0)>0 then
					FoundErr=True
					ErrMsg=ErrMsg & "<br><li>指定的栏目有下属子栏目</li>"
				End if
				If tClass(1)<>"" then
					FoundErr=True
					ErrMsg=ErrMsg & "<br><li>不能指定外部栏目</li>"
				End if
				strChannelDir=tClass(2)
			End if
			Set tClass=Nothing
		End if
		If SpecialID>0 Then
			set tSpecial=Cl.Execute("select SpecialID From Cl_Special Where ChannelID="  & ChannelID)
			If tSpecial.bof and tSpecial.eof then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>在本频道内找不到指定的专题</li>"
				End If
			Set tSpecial=Nothing
		End If
		If LoginType=1 Then
			If LoginUrl="" Or LoginPostUrl="" Or LoginUser="" Or LoginPass="" Or LoginFalse="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>网站登录信息不完整</li>"
			End If
		End If
		If FoundErr=True Then Admin_ShowErr(ErrMsg)
		SqlItem="Select top 1 *  from Item Where ItemID=" & ItemID
		Set RsItem=server.CreateObject("adodb.recordset")
		RsItem.Open SqlItem,ConnItem,2,3
		RsItem("ItemName")	= ItemName
		RsItem("WebName")	= WebName
		RsItem("WebUrl")	= WebUrl
		RsItem("ChannelID")	= ChannelID
		RsItem("ChannelDir")= strChannelDir
		RsItem("ClassID")	= ClassID
		RsItem("SpecialID")	= SpecialID
		RsItem("LoginType")	= LoginType
		If Logintype=1 Then
			RsItem("LoginUrl")	= LoginUrl
			RsItem("LoginPostUrl")=LoginPostUrl
			RsItem("LoginUser")	= LoginUser
			RsItem("LoginPass")	= LoginPass
			RsItem("LoginFalse")= LoginFalse
		End If
		RsItem("ItemDemo")	= ItemDemo
		RsItem.UpDate
		RsItem.Close : Set RsItem=Nothing
	End If
	SqlItem="Select * from Item Where ItemID=" & ItemID
	Set RsItem=server.CreateObject("adodb.recordset")
	RsItem.Open SqlItem,ConnItem,1,1
	If RsItem.Eof And RsItem.Bof Then
		RsItem.Close : Set RsItem=Nothing
		Admin_ShowErr("<br><li>没有找到该项目!</li>")
	Else
		LoginType		= RsItem("LoginType")
		LoginUrl		= RsItem("LoginUrl")
		LoginPostUrl	= RsItem("LoginPostUrl")
		LoginUser		= RsItem("LoginUser")
		LoginPass		= RsItem("LoginPass")
		LoginFalse		= RsItem("LoginFalse")
		ListStr			= RsItem("ListStr")
		LsString		= RsItem("LsString")
		LoString		= RsItem("LoString")
		ListPaingType	= RsItem("ListPaingType")
		LPsString		= RsItem("LPsString")
		LPoString		= RsItem("LPoString")
		ListPaingStr1	= RsItem("ListPaingStr1")
		ListPaingStr2	= RsItem("ListPaingStr2")
		ListPaingID1	= RsItem("ListPaingID1")
		ListPaingID2	= RsItem("ListPaingID2")
		ListPaingStr3	= RsItem("ListPaingStr3")
		If ListPaingStr3<>"" Then
			ListPaingStr3=Replace(ListPaingStr3,"|",CHR(13))
		End If
	End If
	RsItem.Close : Set RsItem=Nothing
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
<form method="post" action="Item_Modify.asp?Action=Step3" name="form1">
    <tr> 
      <td height="22" colspan="2" class="title"> <div align="center"><strong>编 辑 项 目--列  表 设 置</strong></div></td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg"><strong>列表索引页面：</strong></td>
      <td class="tdbg" width="75%">
		<input name="ListStr" type="text" size="58" maxlength="200" value="<%=ListStr%>">&nbsp;&nbsp;列表的第一页 
      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg" ><strong>列表开始标记：</strong></td>
      <td class="tdbg" width="75%">
      <textarea name="LsString" cols="49" rows="7"><%=LsString%></textarea><br>
      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg" ><strong>列表结束标记：</strong></td>
      <td class="tdbg" width="75%">
      <textarea name="LoString" cols="49" rows="7"><%=LoString%></textarea><br>
      </td>
    </tr>

    <tr>
      <td width="20%" class="tdbg"><strong> 列表索引分页：</strong></td>
      <td class="tdbg" width="75%">
		<input type="radio" value="0" name="ListPaingType" <%If ListPaingType=0 Then Response.Write "checked"%> onClick="ListPaing1.style.display='none';ListPaing12.style.display='none';ListPaing2.style.display='none';ListPaing3.style.display='none'">不作设置&nbsp;
		<input type="radio" value="1" name="ListPaingType" <%If ListPaingType=1 Then Response.Write "checked"%> onClick="ListPaing1.style.display='';ListPaing12.style.display='';ListPaing2.style.display='none';ListPaing3.style.display='none'">设置标签&nbsp;
		<input type="radio" value="2" name="ListPaingType" <%If ListPaingType=2 Then Response.Write "checked"%> onClick="ListPaing1.style.display='none';ListPaing12.style.display='none';ListPaing2.style.display='';ListPaing3.style.display='none'">批量生成&nbsp;
		<input type="radio" value="3" name="ListPaingType" <%If ListPaingType=3 Then Response.Write "checked"%> onClick="ListPaing1.style.display='none';ListPaing12.style.display='none';ListPaing2.style.display='none';ListPaing3.style.display=''">手动添加
	   </td>
    </tr>
	<tr class="tdbg" id="ListPaing1" style="display:'<%If ListPaingType<>1 Then Response.Write "none"%>'">
      <td width="20%" class="tdbg"><strong><font color=blue>下页开始标记：</font></strong><p>　</p><p>　</p>
      <strong><font color=blue>下页结束标记：</font></strong>
      </td>
      <td class="tdbg" width="75%">
		<textarea name="LPsString" cols="49" rows="7"><%=LPsString%></textarea><br>
		<textarea name="LPoString" cols="49" rows="7"><%=LPoString%></textarea>
	   </td>
    </tr>
	<tr class="tdbg" id="ListPaing12" style="display:'<%If ListPaingType<>1 Then Response.Write "none"%>'">
      <td width="20%" class="tdbg"><strong><font color=blue>索引分页重定向：</font></strong>
      </td>
      <td class="tdbg" width="75%">
		<input name="ListPaingStr1" type="text" size="58" maxlength="200" value="<%=ListPaingStr1%>">
	   </td>
    </tr>
    <tr class="tdbg" id="ListPaing2" style="display:'<%If ListPaingType<>2 Then Response.Write "none"%>'"> 
      <td width="20%" class="tdbg"><strong><font color=blue>批量生成：</font></strong></td>
      <td class="tdbg" width="75%">
        原字符串：<br>
		<input name="ListPaingStr2" type="text" size="58" maxlength="200" value="<%=ListPaingStr2%>"><br>
                格式：http://www.aspoo.cn/list.asp?page={$ID}<br><br>
	    生成范围：<br>
		<input name="ListPaingID1" type="text" size="8" maxlength="200" value="<%=ListPaingID1%>"><span lang="en-us"> To </span><input name="ListPaingID2" type="text" size="8" maxlength="200" value="<%=ListPaingID2%>"><br>
               格式：只能是数字，可升序或者降序。
      </td>
    </tr>
    <tr class="tdbg" id="ListPaing3" style="display:'<%If ListPaingType<>3 Then Response.Write "none"%>'"> 
      <td width="20%" class="tdbg"><strong><font color=blue>手动添加：</font></strong>
      </td>
      <td class="tdbg" width="75%">
      <textarea name="ListPaingStr3" cols="49" rows="7"><%=ListPaingStr3%></textarea><br>
      格式：输入一个网址后按回车，再输入下一个。
      </td>
    </tr>

    <tr class="tdbg"> 
      <td colspan="2" align="center" class="tdbg">
        <input name="ItemID" type="hidden" id="ItemID" value="<%=ItemID%>">
        <input name="SaveEdit" type="hidden" id="SaveEdit" value="Yes">
        <input  type="submit" name="Submit" value="下&nbsp;一&nbsp;步"></td>
    </tr>
</form>
</table>
<%
End Sub

Sub Step3()
	If SaveEdit="Yes" Then
		ListStr			= Trim(Request.Form("ListStr"))
		LsString		= Trim(Request.Form("LsString"))
		LoString		= Trim(Request.Form("LoString"))
		ListPaingType	= Trim(Request.Form("ListPaingType"))
		LPsString		= Trim(Request.Form("LPsString"))
		LPoString		= Trim(Request.Form("LPoString"))
		ListPaingStr1	= Trim(Request.Form("ListPaingStr1"))
		ListPaingStr2	= Trim(Request.Form("ListPaingStr2"))
		ListPaingID1	= Trim(Request.Form("ListPaingID1"))
		ListPaingID2	= Trim(Request.Form("ListPaingID2"))
		ListPaingStr3	= Trim(Request.Form("ListPaingStr3"))
		If LsString="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>列表开始标记不能为空</li>"
		End If
		If LoString="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>列表结束标记不能为空</li>" 
		End If
		Select Case ListPaingType
		Case 0,1
			If ListStr="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>列表索引页不能为空</li>"
			Else
				ListStr=Trim(ListStr)
			End If
			If ListPaingType=1  Then
				If LPsString="" or LPoString="" Then
					FoundErr=True
					ErrMsg=ErrMsg & "<br><li>索引分页开始/结束标记不能为空</li>" 
				End If
				If ListPaingStr1<>"" and Len(ListPaingStr1)<15 Then
					FoundErr=True
					ErrMsg=ErrMsg & "<br><li>索引分页重定向设置不正确(至少15个字符)</li>" 
				End If
			End  If
		Case 2
			If ListPaingStr2="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>批量生成字符不能为空</li>"
			End If
			If isNumeric(ListPaingID1)=False or isNumeric(ListPaingID2)=False Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>批量生成的范围只能是数字</li>"
			Else
				ListPaingID1=Clng(ListPaingID1)
				ListPaingID2=Clng(ListPaingID2)
				If ListPaingID1=0 And ListPaingID2=0 Then
					FoundErr=True
					ErrMsg=ErrMsg & "<br><li>批量生成范围设置不正确</li>"
				End If
			End If
		Case 3
			If ListPaingStr3="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>列表索引分页不能为空，请手动添加</li>"
			Else
				ListPaingStr3=Replace(ListPaingStr3,CHR(13),"|") 
			End If
		Case Else
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>请选择列表索引分页类型</li>" 
		End Select

		If FoundErr=True Then Admin_ShowErr(ErrMsg)

		SqlItem="Select * from Item Where ItemID=" & ItemID
		Set RsItem=server.CreateObject("adodb.recordset")
		RsItem.Open SqlItem,ConnItem,2,3
		RsItem("LsString")		= LsString
		RsItem("LoString")		= LoString
		RsItem("ListPaingType")	= ListPaingType
		Select Case ListPaingType
		Case 0,1
			RsItem("ListStr")	= ListStr
			If ListPaingType=1  Then
				RsItem("LPsString")	= LPsString
				RsItem("LPoString")	= LPoString
				RsItem("ListPaingStr1")=ListPaingStr1
			End If
		Case 2
			RsItem("ListPaingStr2")	= ListPaingStr2
			RsItem("ListPaingID1")	= ListPaingID1
			RsItem("ListPaingID2")	= ListPaingID2
		Case 3
			RsItem("ListPaingStr3")	= ListPaingStr3
		End Select
		RsItem.UpDate
		RsItem.Close : Set RsItem=Nothing
	End if
	GetTest3
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
    <tr> 
		<td height="22" colspan="2" class="title" align="center"><strong>编 辑 项 目--列 表 截 取 测 试</strong></td>
    </tr>
	<tr class="tdbg"> 
		<td class="tdbg" colspan="2" align="center"><iframe marginwidth=0 marginheight=0 frameborder=0 name="url" width="800" height="300" src="<%=ListUrl%>"></iframe> </td>
	</tr>
	<tr> 
		<td height="22" colspan="2" class="title" align="center"><strong>项 目 编 辑--采集目标源码</strong>
		<Input type="radio" value="0" name="code" onClick="javascript:Content.style.height='1';" >不查看
		<Input type="radio" value="1" name="code" onClick="javascript:Content.style.height='300';" checked>查看源码</td>
	</tr>
	<tr class="tdbg"> 
		<td class="tdbg" class="tdbg" colspan="2" align="center"><TEXTAREA NAME="Content" ROWS="" COLS="" style="width:800px;height:300px"><%=ListCode%></TEXTAREA></td>
	</tr>
</table>
<%If ListPaingType=1 Then%>
<br>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
    <tr class="tdbg"> 
      <td height="22" colspan="2" class="tdbg" >
      <%Response.Write "<br>下一页列表：<a  href='" & ListPaingNext  &  "' target=_blank><font  color=red>"  &  ListPaingNext  &  "</font></a>"%>
      </td>
    </tr>
</table>
<br>
<%End If%>
<form method="post" action="Item_Modify.asp?Action=Step4" name="form1">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
    <tr> 
      <td height="22" colspan="2" class="title"> <div align="center"><strong>编 辑 项 目--链 接 设 置</strong></div></td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg" ><strong>链接开始标记：</strong></td>
      <td class="tdbg" width="75%">
      <textarea name="HsString" cols="49" rows="7"><%=HsString%></textarea></td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg" ><strong>链接结束标记：</strong></td>
      <td class="tdbg" width="75%">
      <textarea name="HoString" cols="49" rows="7"><%=HoString%></textarea></td>
    </tr>
    <tr>
      <td width="20%" class="tdbg"><strong> 链接特殊处理：</strong></td>
      <td class="tdbg" width="75%">
		<input type="radio" value="0" name="HttpUrlType" <%If HttpUrlType=0 Then Response.Write "checked"%> onClick="HttpUrl1.style.display='none'"> 自动处理&nbsp;
		<input type="radio" value="1" name="HttpUrlType" <%If HttpUrlType=1 Then Response.Write "checked"%> onClick="HttpUrl1.style.display=''"> 重新定位
	   </td>
    </tr>
	<tr class="tdbg" id="HttpUrl1" style="display:'<%If HttpUrlType=0 Then Response.Write "none"%>'">
      <td width="20%" class="tdbg"><strong>绝对链接字符：</strong></td>
      <td class="tdbg" width="75%">
		<input name="HttpUrlStr" type="text" size="49" maxlength="200" value="<%=HttpUrlStr%>"></td>
    </tr>
    <tr class="tdbg"> 
      <td colspan="2" align="center" class="tdbg">
        <input name="SaveEdit" type="hidden" id="SaveEdit" value="Yes">
        <input name="ItemID" type="hidden" id="ItemID" value="<%=ItemID%>">
        <input  type="button" name="button1" value="上&nbsp;一&nbsp;步" onClick="window.location.href='javascript:history.go(-1)'" >
        &nbsp;&nbsp;&nbsp;&nbsp; 
        <input  type="submit" name="Submit" value="下&nbsp;一&nbsp;步"></td>
    </tr>
</table>
</form>
<%
End Sub

Sub Step4()
	If SaveEdit="Yes" Then
		HsString		= Request.Form("HsString")
		HoString		= Request.Form("HoString")
		HttpUrlType		= Cl.ChkClng(Request.Form("HttpUrlType"))
		HttpUrlStr		= Trim(Request.Form("HttpUrlStr"))
		If HsString="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>链接开始标记不能为空</li>"
		End If
		If HoString="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>链接结束标记不能为空</li>" 
		End If
		If HttpUrlType=1 Then
			If HttpUrlStr="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>请设置绝对链接地址</li>"
			Else
				If Len(HttpUrlStr)<15 Then
					FoundErr=True
					ErrMsg=ErrMsg & "<br><li>绝对链接地址设置不正确(至少15个字符)</li>"
				 End If
			End If
		End If
		If FoundErr=True Then Admin_ShowErr(ErrMsg)
		SqlItem="Select ItemID,HsString,HoString,HttpUrlType,HttpUrlStr From Item Where ItemID=" & ItemID
		Set RsItem=server.CreateObject("adodb.recordset")
		RsItem.Open SqlItem,ConnItem,2,3
		RsItem("HsString")=HsString
		RsItem("HoString")=HoString
		RsItem("HttpUrlType")=HttpUrlType
		If HttpUrlType=1 Then
			RsItem("HttpUrlStr")=HttpUrlStr
		End If
		RsItem.UpDate
		RsItem.Close : Set RsItem=Nothing
	End If
	GetTest4
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >        
    <tr> 
      <td height="22" colspan="2" class="title" align="center"><strong>编 辑 项 目--列 表 新 闻 链 接 测 试</strong></td>
    </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
    <tr> 
      <td height="22" colspan="2" class="tdbg">以下是分析后所得到的新闻绝对链接地址，请查看是否正确。<br>
<%
For Testi=0 To Ubound(NewsArray)
   Response.Write "<a href='" & NewsArray(Testi) & "' target=_blank>" & NewsArray(Testi) & "</a><br>"
Next
%>
<br>
下一步将抽取第一条新闻进行测试，在填写以下标记时尽量不要使用第一条新闻。
      </td>
    </tr>
</table>
<form method="post" action="Item_Modify.asp?Action=Step5" name="form1">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
    <tr> 
      <td height="22" colspan="2" class="title"> <div align="center"><strong>编 辑 项 目--正 文 设 置</strong></div>
      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg" ><strong>标题开始标记：</strong><p>　</p><p>　</p>
      <strong>标题结束标记：</strong></td>
      <td class="tdbg" width="75%">
      <textarea name="TsString" cols="49" rows="7"><%=TsString%></textarea><br>
      <textarea name="ToString" cols="49" rows="7"><%=ToString%></textarea></td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg" ><strong>正文开始标记：</strong><p>　</p><p>　</p>
      <strong>正文结束标记：</strong></td>
      <td class="tdbg" width="75%">
      <textarea name="CsString" cols="49" rows="7"><%=CsString%></textarea><br>
      <textarea name="CoString" cols="49" rows="7"><%=CoString%></textarea></td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg" ><b>时<span lang="en-us">&nbsp; </span>间<span lang="en-us">&nbsp;
		</span>设<span lang="en-us">&nbsp; </span>置：</b></td>
      <td class="tdbg" width="75%">
      	<input type="radio" value="0" name="DateType" <%If DateType=0 Then Response.Write "checked"%> onClick="Date1.style.display='none'">不作设置&nbsp;
		<input type="radio" value="1" name="DateType" <%If DateType=1 Then Response.Write "checked"%>  onClick="Date1.style.display=''">设置标签&nbsp;
    </tr>
    <tr class="tdbg" id="Date1" style="display:'<%If DateType<>1 Then Response.Write "none"%>'"> 
      <td width="20%" class="tdbg" ><strong><font color=blue>时间开始标记：</font></strong><p>　</p>
		<p>　</p>
      <strong><font color=blue>时间结束标记：</font></strong></td>
      <td class="tdbg" width="75%">
      <textarea name="DsString" cols="49" rows="7"><%=DsString%></textarea><br>
      <textarea name="DoString" cols="49" rows="7"><%=DoString%></textarea></td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg" ><b>作<span lang="en-us">&nbsp; </span>者<span lang="en-us">&nbsp;
		</span>设<span lang="en-us">&nbsp; </span>置：</b></td>
      <td class="tdbg" width="75%">
      	<input type="radio" value="0" name="AuthorType" <%If AuthorType=0 Then Response.Write "checked"%> onClick="Author1.style.display='none';Author2.style.display='none'">不作设置&nbsp;
		<input type="radio" value="1" name="AuthorType" <%If AuthorType=1 Then Response.Write "checked"%> onClick="Author1.style.display='';Author2.style.display='none'">设置标签&nbsp;
		<input type="radio" value="2" name="AuthorType" <%If AuthorType=2 Then Response.Write "checked"%> onClick="Author1.style.display='none';Author2.style.display=''">指定作者</td>
    </tr>
    <tr class="tdbg" id="Author1" style="display:'<%If AuthorType<>1 Then Response.Write "none"%>'"> 
      <td width="20%" class="tdbg" ><strong><font color=blue>作者开始标记：</font></strong><p>　</p>
		<p>　</p>
      <strong><font color=blue>作者结束标记：</font></strong></td>
      <td class="tdbg" width="75%">
      <textarea name="AsString" cols="49" rows="7"><%=AsString%></textarea><br>
      <textarea name="AoString" cols="49" rows="7"><%=AoString%></textarea></td>
    </tr>
    <tr class="tdbg" id="Author2" style="display:'<%If AuthorType<>2 Then Response.Write "none"%>'"> 
      <td width="20%" class="tdbg" ><strong><font color=blue>请指定作者：</font></strong></td>
      <td class="tdbg" width="75%">
      <input name="AuthorStr" type="text" id="AuthorStr" value="<%=AuthorStr%>">
      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg" ><b>来&nbsp; 源&nbsp;
		设&nbsp; 置：</b></td>
      <td class="tdbg" width="75%">
      	<input type="radio" value="0" name="CopyFromType" <%If CopyFromType=0 Then Response.Write "checked"%> onClick="CopyFrom1.style.display='none';CopyFrom2.style.display='none'">不作设置&nbsp;
		<input type="radio" value="1" name="CopyFromType" <%If CopyFromType=1 Then Response.Write "checked"%> onClick="CopyFrom1.style.display='';CopyFrom2.style.display='none'">设置标签&nbsp;
		<input type="radio" value="2" name="CopyFromType" <%If CopyFromType=2 Then Response.Write "checked"%> onClick="CopyFrom1.style.display='none';CopyFrom2.style.display=''">指定来源</td>
    </tr>
    <tr class="tdbg" id="CopyFrom1" style="display:'<%If CopyFromType<>1 Then Response.Write "none"%>'"> 
      <td width="20%" class="tdbg" ><strong><font color=blue>来源开始标记：</font></strong><p>　</p>
		<p>　</p>
      <strong><font color=blue>来源结束标记：</font></strong></td>
      <td class="tdbg" width="75%">
      <textarea name="FsString" cols="49" rows="7"><%=FsString%></textarea><br>
      <textarea name="FoString" cols="49" rows="7"><%=FoString%></textarea></td>
    </tr>
    <tr class="tdbg" id="CopyFrom2" style="display:'<%If CopyFromType<>2 Then Response.Write "none"%>'"> 
      <td width="20%" class="tdbg" ><strong><font color=blue>请指定来源：</font></strong></td>
      <td class="tdbg" width="75%">
      <input name="CopyFromStr" type="text" id="CopyFromStr" value="<%=CopyFromStr%>">
      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="20%" class="tdbg" ><b>关键字词设置：</b></td>
      <td class="tdbg" width="75%">
      	<input type="radio" value="0" name="KeyType" <%If KeyType=0 Then Response.Write "checked"%> onClick="Key1.style.display='none';Key2.style.display='none'">标题生成&nbsp;
		<input type="radio" value="1" name="KeyType" <%If KeyType=1 Then Response.Write "checked"%> onClick="Key1.style.display='';Key2.style.display='none'">标签生成&nbsp;
		<input type="radio" value="2" name="KeyType" <%If KeyType=2 Then Response.Write "checked"%> onClick="Key1.style.display='none';Key2.style.display=''">自定义关键字</td>
    </tr>
    <tr class="tdbg" id="Key1" style="display:'<%If KeyType<>1 Then Response.Write "none"%>'"> 
      <td width="20%" class="tdbg" ><strong><font color=blue>关键词开始标记：</font></strong><p>　</p>
		<p>　</p>
      <strong><font color=blue>关键词结束标记：</font></strong></td>
      <td class="tdbg" width="75%">
      <textarea name="KsString" cols="49" rows="7"><%=KsString%></textarea><br>
      <textarea name="KoString" cols="49" rows="7"><%=KoString%></textarea></td>
    </tr>
    <tr class="tdbg" id="Key2" style="display:'<%If KeyType<>2 Then Response.Write "none"%>'"> 
      <td width="20%" class="tdbg" ><strong><font color=blue>请指定关键：</font></strong></td>
      <td class="tdbg" width="75%">
      <input name="KeyStr" type="text" id="KeyStr" value="<%=KeyStr%>">
      </td>
    </tr>
    <tr>
      <td width="20%" class="tdbg"><strong>正文分页设置：</strong></td>
      <td class="tdbg" width="75%">
		<input type="radio" value="0" name="NewsPaingType" <%If NewsPaingType=0 Then Response.Write "checked"%> onClick="NewsPaing1.style.display='none';NewsPaing12.style.display='none';NewsPaing13.style.display='none';NewsPaing2.style.display='none'">不作设置&nbsp;
		<input type="radio" value="1" name="NewsPaingType" <%If NewsPaingType=1 Then Response.Write "checked"%> onClick="NewsPaing1.style.display='';NewsPaing12.style.display='';NewsPaing13.style.display='';NewsPaing2.style.display='none'">设置标签&nbsp;
		<input type="radio" value="2" name="NewsPaingType" <%If NewsPaingType=2 Then Response.Write "checked"%> onClick="NewsPaing1.style.display='none';NewsPaing12.style.display='none';NewsPaing13.style.display='none';NewsPaing2.style.display=''">手动设置
	   </td>
    </tr>
	<tr class="tdbg" id="NewsPaing1" style="display:'<%If NewsPaingType<>1 Then Response.Write "none"%>'">
      <td width="20%" class="tdbg"><strong><font color=blue>下页开始标记：</font></strong><p>　</p><p>　</p>
      <strong><font color=blue>下页结束标记：</font></strong></td>
      <td class="tdbg" width="75%">
		<textarea name="NPsString" cols="49" rows="7"><%=NPsString%></textarea><br>
		<textarea name="NPoString" cols="49" rows="7"><%=NPoString%></textarea></td>
    </tr>
    <tr class="tdbg" class="tdbg" id="NewsPaing12" style="display:'<%If NewsPaingType<>1 Then Response.Write "none"%>'"> 
      <td width="20%" class="tdbg"><b><font color="#0000FF">分页绝对链接：</font></b></td>
      <td class="tdbg" width="75%">
		<input name="NewsPaingStr" type="text" size="58" value="<%=NewsPaingStr%>"></td>
    </tr>
    <tr class="tdbg" class="tdbg" id="NewsPaing13" style="display:'<%If NewsPaingType<>1 Then Response.Write "none"%>'"> 
      <td width="20%" class="tdbg"><b><font color="#0000FF">分页链接字符：</font></b></td>
      <td class="tdbg" width="75%">
		<input name="NewsPaingHtml" type="text" size="58" value="<%=NewsPaingHtml%>"></td>
    </tr>

    <tr class="tdbg" class="tdbg" id="NewsPaing2" style="display:'<%If NewsPaingType<>2 Then Response.Write "none"%>'"> 
      <td width="20%" class="tdbg"><strong><font color=blue>手&nbsp; 动&nbsp; 设&nbsp; 置：</font></strong></td>
      <td class="tdbg" width="75%">
		<input name="NewsPaingStr2" type="text" value="预留功能" size="58">
      </td>
    </tr>
    <tr class="tdbg"> 
      <td colspan="2" align="center" class="tdbg"><br>
        <input name="SaveEdit" type="hidden" id="SaveEdit" value="Yes">
        <input name="ItemID" type="hidden" id="ItemID" value="<%=ItemID%>">
        <input  type="button" name="button1" value="上&nbsp;一&nbsp;步" onClick="window.location.href='javascript:history.go(-1)'" >
        &nbsp;&nbsp;&nbsp;&nbsp; 
        <input  type="submit" name="Submit" value="下&nbsp;一&nbsp;步"></td>
        <input type="hidden" name="UrlTest" id="UrlTest" value="<%=UrlTest%>">
    </tr>
</table>
</form>
<%
End Sub

Sub Step5()
	If SaveEdit="Yes" Then
		TsString	= Request.Form("TsString")
		ToString	= Request.Form("ToString")
		CsString	= Request.Form("CsString")
		CoString	= Request.Form("CoString")
		DateType	= Cl.ChkClng(Request.Form("DateType"))
		DsString	= Request.Form("DsString")
		DoString	= Request.Form("DoString")
		AuthorType	= Cl.ChkClng(Request.Form("AuthorType"))
		AsString	= Request.Form("AsString")
		AoString	= Request.Form("AoString")
		AuthorStr	= Request.Form("AuthorStr")
		CopyFromType= Cl.ChkClng(Request.Form("CopyFromType"))
		FsString	= Request.Form("FsString")
		FoString	= Request.Form("FoString")
		CopyFromStr	= Request.Form("CopyFromStr")
		KeyType		= Cl.ChkClng(Request.Form("KeyType"))
		KsString	= Request.Form("KsString")
		KoString	= Request.Form("KoString")
		KeyStr		= Request.Form("KeyStr")
		NewsPaingType=Cl.ChkClng(Request.Form("NewsPaingType"))
		NpsString	= Request.Form("NpsString")
		NpoString	= Request.Form("NpoString")
		NewsPaingStr= Request.Form("NewsPaingStr")
		NewsPaingHtml=Request.Form("NewsPaingHtml")
		'if instr(dostring,"&nbsp;") then
		'	response.write "ok"
		'end if
		UrlTest		= Trim(Request.Form("UrlTest"))
		If UrlTest="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>参数错误，数据传递时发生错误</li>"
		Else
			NewsUrl=UrlTest
		End If
		If TsString="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>标题开始标记不能为空</li>"
		End If
		If ToString="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>标题结束标记不能为空</li>" 
		End If
		If CsString="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>正文开始标记不能为空</li>"
		End If
		If CoString="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>正文结束标记不能为空</li>" 
		End If
		If DateType=1 Then
			If DsString="" or DoString="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>请将时间的开始/结束标记填写完整</li>" 
			End If
		Else
			DateType=0 
		End If
		Select Case AuthorType
		Case 1
			If AsString="" or AoString="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>请将作者开始/结束标记填写完整！</li>" 
			End If
		Case 2
			If AuthorStr="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>请指定作者</li>" 
			End If
		Case Else
			AuthorType=0 
		End Select
		Select Case CopyFromType
		Case 1
			If FsString="" or FoString="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>请将来源开始/结束标记填写完整！</li>" 
			End If
		Case 2
			If CopyFromStr="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>请指定来源</li>" 
			End If
		Case Else
			CopyFromType=0
		End Select
		Select Case KeyType
		Case 1
			If KsString="" or KoString="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>关键字开始/结束标记不能为空</li>" 
			End If
		Case 2
			If KeyStr="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>请指定关键字</li>" 
			End If
		Case Else
			KeyType=0 
		End Select
		Select Case NewsPaingType
		Case 1
			If NPsString="" or NPoString="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>分页开始/结束标记不能为空</li>" 
			End If
			If NewsPaingStr<>"" And Len(NewsPaingStr)<15 Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>新闻分页绝对链接设置不正确(至少15个字符)</li>" 
			End If
		Case 2
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>暂不支持手动设置分页类型</li>" 
		Case Else
			NewsPaingType=0
		End Select
		If FoundErr=True Then Admin_ShowErr(ErrMsg)
		SqlItem="Select * from Item Where ItemID=" & ItemID
		Set RsItem=server.CreateObject("adodb.recordset")
		RsItem.Open SqlItem,ConnItem,2,3
		RsItem("TsString")=TsString
		RsItem("ToString")=ToString
		RsItem("CsString")=CsString
		RsItem("CoString")=CoString
		RsItem("DateType")=DateType
		If DateType=1 Then
			RsItem("DsString")=DsString
			RsItem("DoString")=DoString
		End If
		RsItem("AuthorType")=AuthorType
		If AuthorType=1 Then
			RsItem("AsString")=AsString
			RsItem("AoString")=AoString
		ElseIf AuthorType=2 Then
			RsItem("AuthorStr")=AuthorStr
		End If
		RsItem("CopyFromType")=CopyFromType
		If CopyFromType=1 Then
			RsItem("FsString")=FsString
			RsItem("FoString")=FoString
		ElseIf CopyFromType=2 Then
			RsItem("CopyFromStr")=CopyFromStr
		End If
		RsItem("KeyType")=KeyType
		If KeyType=1 Then
			RsItem("KsString")=KsString
			RsItem("KoString")=KoString
		ElseIf KeyType=2 Then
			RsItem("KeyStr")=KeyStr
		End If
		RsItem("NewsPaingType")=NewsPaingType
		If NewsPaingType=1 Then
			RsItem("NPsString")=NPsString
			RsItem("NPoString")=NPoString
			RsItem("NewsPaingStr")=NewsPaingStr
			RsItem("NewsPaingHtml")=NewsPaingHtml
		End If
		RsItem.UpDate
		RsItem.Close : Set RsItem=Nothing
	End If
	GetTest5
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
    <tr> 
      <td height="22" colspan="2" class="title"> <div align="center"><strong>编 辑 项 目--采 样 测 试</strong></div></td>
    </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
  <tr align="center" class="tdbg"> 
    <td colspan="2" valign="bottom"><span lang="zh-cn">
	<font size="5"><%=Title%></span></font></td>
  </tr>
  <tr align="center" class="tdbg">
    <td colspan="2">
        作者：<%=Author%>&nbsp;&nbsp;来源：<%=CopyFrom%>&nbsp;&nbsp;更新时间：<%=UpDateTime%>
    </td>
  </tr>
  <tr class="tdbg">
    <td colspan="2">
      <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="5">
        <tr>
          <td height="200" valign="top"><p><span lang="zh-cn"><%=Content%></span></p><br>
          <b>关键字：<%=Key%></b>
          </td>
        </tr>
      </table>
    </td>
  </tr>
<form method="post" action="Item_Attribute.asp" name="form1">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
    <tr class="tdbg"> 
      <td colspan="2" align="center" class="tdbg">
        <input name="SaveEdit" type="hidden" id="SaveEdit" value="Yes">
        <input name="ItemID" type="hidden" id="ItemID" value="<%=ItemID%>">
        <input name="Cancel" type="button" id="Cancel" value=" 上&nbsp;一&nbsp;步 " onClick="window.location.href='javascript:history.go(-1)'">
        &nbsp; 
        <input  type="submit" name="Submit" value="  下&nbsp;一&nbsp;步 "></td>
    </tr>
</table>
</form>
<%
End Sub

Sub GetTest5()
	SqlItem="Select * from Item Where ItemID=" & ItemID
	Set RsItem=server.CreateObject("adodb.recordset")
	RsItem.Open SqlItem,ConnItem,1,1
	If RsItem.Eof And RsItem.Bof Then
        FoundErr=True
		ErrMsg=ErrMsg  &  "<br><li>参数错误，找不到该项目</li>"
	Else
		LoginType		= RsItem("LoginType")
		LoginUrl		= RsItem("LoginUrl")
		LoginPostUrl	= RsItem("LoginPostUrl")
		LoginUser		= RsItem("LoginUser")
		LoginPass		= RsItem("LoginPass")
		LoginFalse		= RsItem("LoginFalse")
		ListStr			= RsItem("ListStr")
		LsString		= RsItem("LsString")
		LoString		= RsItem("LoString")
		ListPaingType	= RsItem("ListPaingType")
		LPsString		= RsItem("LPsString")
		LPoString		= RsItem("LPoString")
		ListPaingStr1	= RsItem("ListPaingStr1")
		ListPaingStr2	= RsItem("ListPaingStr2")
		ListPaingID1	= RsItem("ListPaingID1")
		ListPaingID2	= RsItem("ListPaingID2")
		ListPaingStr3	= RsItem("ListPaingStr3")
      	HsString		= RsItem("HsString")
		HoString		= RsItem("HoString")
		HttpUrlType		= RsItem("HttpUrlType")
		HttpUrlStr		= RsItem("HttpUrlStr")
      	TsString		= RsItem("TsString")
		ToString		= RsItem("ToString")
		CsString		= RsItem("CsString")
		CoString		= RsItem("CoString")
      	DateType		= RsItem("DateType")
		DsString		= RsItem("DsString")
		DoString		= RsItem("DoString")
		AuthorType		= RsItem("AuthorType")
		AsString		= RsItem("AsString")
		AoString		= RsItem("AoString")
		AuthorStr		= RsItem("AuthorStr")
		CopyFromType	= RsItem("CopyFromType")
		FsString		= RsItem("FsString")
		FoString		= RsItem("FoString")
		CopyFromStr		= RsItem("CopyFromStr")
		KeyType			= RsItem("KeyType")
		KsString		= RsItem("KsString")
		KoString		= RsItem("KoString")
		KeyStr			= RsItem("KeyStr")
		NewsPaingType	= RsItem("NewsPaingType")
		NPsString		= RsItem("NPsString")
		NPoString		= RsItem("NPoString")
		NewsPaingStr	= RsItem("NewsPaingStr")
		NewsPaingHtml	= RsItem("NewsPaingHtml")
      	UpDateType		= RsItem("UpDateType")
	End If
	RsItem.Close : Set RsItem=Nothing
	If LoginType=1 Then
		If LoginUrl="" or LoginPostUrl="" or LoginUser="" Or LoginPass="" Or LoginFalse="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>您要采集的网站需要登录！请将登录信息填写完整</li>"
		End If
	End If
	If LsString="" Then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>列表开始标记不能为空！</li>"
	End If
	If LoString="" Then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>列表结束标记不能为空！</li>"
	End If
	If ListPaingType=0 Or ListPaingType=1 Then
		If ListStr="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>列表索引页不能为空！</li>"
		End If
		If ListPaingType=1 Then    
			If LPsString="" Or LPoString="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>索引分页开始、结束标记不能为空！</li>"
			End If
		End If      
		If  ListPaingStr1<>""  And  Len(ListPaingStr1)<15  Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>索引分页重定向设置不正确！</li>"
        End  IF
	ElseIf ListPaingType=2 Then
		If ListPaingStr2="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>批量生成原字符串不能为空！</li>"
		End If
		If IsNumeric(ListPaingID1)=False or IsNumeric(ListPaingID2)=False Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>批量生成的范围只能是数字！</li>"
		Else
			ListPaingID1=Clng(ListPaingID1)
			ListPaingID2=Clng(ListPaingID2)
			If ListPaingID1=0 And ListPaingID2=0 Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>批量生成的范围不正确！</li>"
			End If
		End If 
	ElseIf ListPaingType=3 Then
		If ListPaingStr3="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>索引分页不能为空！</li>"
		End If
	Else
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请选择索引分页类型</li>"
	End If
	If  HsString="" or  HoString="" Then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>链接开始/结束标记不能为空！</li>"
	End If

	If FoundErr=True then Admin_ShowErr(ErrMsg)
	If SaveEdit="Yes" Then
		Select Case ListPaingType
		Case 0,1
            ListUrl=ListStr
		Case 2
			ListUrl=Replace(ListPaingStr2,"{$ID}",CStr(ListPaingID1))
		Case 3
			If Instr(ListPaingStr3,"|")> 0 Then
				ListUrl=Left(ListPaingStr3,Instr(ListPaingStr3,"|")-1)
			Else
				ListUrl=ListPaingStr3
			End If
		End Select
		If LoginType=1 Then
			LoginData=UrlEncoding(LoginUser & "&" & LoginPass)
			LoginResult=PostHttpPage(LoginUrl,LoginPostUrl,LoginData)
			If Instr(LoginResult,LoginFalse)>0 Then
				Admin_ShowErr("<br><li>登录网站时发生错误，请确认登录信息的正确性！</li>")
			End If
		End If
		ListCode=GetHttpPage(ListUrl)
		If ListCode<>"$False$" Then
            ListCode=GetBody(ListCode,LsString,LoString,False,False)
            If ListCode<>"$False$" Then
               NewsArrayCode=GetArray(ListCode,HsString,HoString,False,False)
               If NewsArrayCode="$False$" Then Admin_ShowErr("<br><li>在获取链接列表时出错。</li>")
                  If Instr(NewsArrayCode,"$Array$")>0 Then
					NewsArray=Split(NewsArrayCode,"$Array$")
                     If HttpUrlType=1 Then
                        NewsUrl=Trim(Replace(HttpUrlStr,"{$ID}",NewsArray(0)))
                     Else
                        NewsUrl=Trim(DefiniteUrl(NewsArray(0),ListUrl))
                     End If
                  Else
                     FoundErr=True
                     ErrMsg=ErrMsg & "<br><li>只发现一个有效链接？：" & NewsArrayCode & "</li>"
                 End If
           Else
               FoundErr=True
              ErrMsg=ErrMsg & "<br><li>在截取列表时发生错误。</li>"
           End If
        Else
            FoundErr=True
           ErrMsg=ErrMsg & "<br><li>在获取:" & ListUrl & "网页源码时发生错误。</li>"
        End If
	End If
	If FoundErr=True Then Admin_ShowErr(ErrMsg)
	NewsCode=GetHttpPage(NewsUrl)
	If NewsCode<>"$False$" Then
		Title	= GetBody(NewsCode,TsString,ToString,False,False)
		Content	= GetBody(NewsCode,CsString,CoString,False,False)
		If Title="$False$" or  Content="$False$"  Then
			Admin_ShowErr("<br><li>在截取新闻标题/正文的时候发生错误：" & NewsUrl & "</li>")
		End IF
		Title=HtmlEnCode(Title)
		'新闻分页
		If NewsPaingType=1 Then
			NewsPaingNext=GetPaing(NewsCode,NPsString,NPoString,False,False)
			Do While NewsPaingNext<>"$False$"
				If NewsPaingStr="" or Isnull(NewsPaingStr)=True Then
					NewsPaingNext=DefiniteUrl(NewsPaingNext,NewsUrl)
				Else
					NewsPaingNext=Replace(NewsPaingStr,"{$ID}",NewsPaingNext)
				End If
				If NewsPaingNext="" or NewsPaingNext="$False$" Then Exit Do
				NewsPaingNextCode=GetHttpPage(NewsPaingNext)                  
				ContentTemp=GetBody(NewsPaingNextCode,CsString,CoString,False,False)
				If ContentTemp="$False$" Then
					Exit Do
				Else
					Content=Content & NewsPaingHtml & ContentTemp
					NewsPaingNext=GetPaing(NewsPaingNextCode,NPsString,NPoString,False,False)
				End If
			Loop
		End If

		If UpDateType=0 Then
			UpDateTime=Now()
		ElseIf UpDateType=1 Then
			If DateType=0 then
				UpDateTime=Now()
			Else
				UpDateTime=GetBody(NewsCode,DsString,DoString,False,False)
				UpDateTime=HtmlEnCode(UpDateTime)
				If IsDate(UpDateTime)=True Then
					UpDateTime=CDate(UpDateTime)
				Else
					UpDateTime=Now()
				End If
			End If
		ElseIf UpDateType=2 Then  
		Else
			UpDateTime=Now()
		End If

        '作者
		If AuthorType=1 Then
			Author=GetBody(NewsCode,AsString,AoString,False,False)
		ElseIf AuthorType=2 Then
			Author=AuthorStr
		End If
		If Author="$False$" Or Trim(Author)="" Then
			Author="佚名"
		Else
			Author=HtmlEnCode(Author)
		End If

        '来源
		If CopyFromType=1 Then
			CopyFrom=GetBody(NewsCode,FsString,FoString,False,False)
		ElseIf CopyFromType=2 Then
			CopyFrom=CopyFromStr
		End If
		If CopyFrom="$False$" Or Trim(CopyFrom)="" Then
			CopyFrom="不详"
		Else
			CopyFrom=HtmlEnCode(CopyFrom)
		End If
		If KeyType=0 Then
			Key=Title
			Key=CreateKeyWord(Key,2)
		ElseIf KeyType=1 Then
			Key=GetBody(NewsCode,KsString,KoString,False,False)
			Key=HtmlEnCode(Key)
			Key=CreateKeyWord(Key,2)
		ElseIf KeyType=2 Then
			Key=HtmlEnCode(Key)
		End If
		If Key="$False$" Or Trim(Key)="" Then
			Key="创力"
		End If
	Else
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>在获取源码时发生错误："& NewsUrl &"</li>"
	End If 

	If FoundErr=True Then Admin_ShowErr(ErrMsg)
	Call GetFilters
	Call Filters
	Content=ReplaceSaveRemoteFile(Content,strInstallDir,strChannelDir,False,NewsUrl)

End Sub

Sub GetTest3()
	SqlItem="Select * from Item Where ItemID=" & ItemID
	Set RsItem=server.CreateObject("adodb.recordset")
	RsItem.Open SqlItem,ConnItem,1,1
	If RsItem.Eof And RsItem.Bof Then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>参数错误，项目ID不能为空</li>"
	Else
		LoginType	= RsItem("LoginType")
		LoginUrl	= RsItem("LoginUrl")
		LoginPostUrl= RsItem("LoginPostUrl")
		LoginUser	= RsItem("LoginUser")
		LoginPass	= RsItem("LoginPass")
		LoginFalse	= RsItem("LoginFalse")
		ListStr		= RsItem("ListStr")
		LsString	= RsItem("LsString")
		LoString	= RsItem("LoString")
		ListPaingType=RsItem("ListPaingType")
		LPsString	= RsItem("LPsString")
		LPoString	= RsItem("LPoString")
		ListPaingStr1=RsItem("ListPaingStr1")
		ListPaingStr2=RsItem("ListPaingStr2")
		ListPaingID1= RsItem("ListPaingID1")
		ListPaingID2= RsItem("ListPaingID2")
		ListPaingStr3=RsItem("ListPaingStr3")
		HsString	= RsItem("HsString")
		HoString	= RsItem("HoString")
		HttpUrlType	= RsItem("HttpUrlType")
		HttpUrlStr	= RsItem("HttpUrlStr")
	End If
	RsItem.Close : Set RsItem=Nothing     
	If LsString="" Then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>列表开始标记不能为空！</li>"
	End If
	If LoString="" Then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>列表结束标记不能为空！</li>"
	End If
	If ListPaingType=0 Or ListPaingType=1 Then
		If ListStr="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>列表索引页不能为空！</li>"
		End If
		If ListPaingType=1 Then    
			If LPsString="" Or LPoString="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>索引分页开始/结束标记不能为空！</li>"
			End If
			If ListPaingStr1<>"" And Len(ListPaingStr1)<15 Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>索引分页绝对链接设置不正确(请留空或者字符>15个)！</li>"
			End If
		End If      
	ElseIf ListPaingType=2 Then
		If ListPaingStr2="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>批量生成原字符串不能为空！</li>"
		End If
		If IsNumeric(ListPaingID1)=False or IsNumeric(ListPaingID2)=False Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>批量生成的范围不正确！无</li>"
		Else
			ListPaingID1=Clng(ListPaingID1)
			ListPaingID2=Clng(ListPaingID2)
			If ListPaingID1=0 And ListPaingID2=0 Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>批量生成的范围不正确！</li>"
			End If
		End If 
	ElseIf ListPaingType=3 Then
		If ListPaingStr3="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>索引分页不能为空！</li>"
		End If
	Else
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>参数错误，请选择索引分页类型</li>"
	End If
 
	If LoginType=1 Then
		If LoginUrl="" or LoginPostUrl="" or LoginUser="" Or LoginPass="" Or LoginFalse="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>请将登录信息填写完整</li>"
		End If
	End If

	If FoundErr=True Then Admin_ShowErr(ErrMsg)
	Select Case ListPaingType
	Case 0,1
		ListUrl=ListStr
	Case 2
		ListUrl=Replace(ListPaingStr2,"{$ID}",CStr(ListPaingID1))
	Case 3
		If Instr(ListPaingStr3,"|")> 0 Then
			ListUrl=Left(ListPaingStr3,Instr(ListPaingStr3,"|")-1)
		Else
			ListUrl=ListPaingStr3
		End If
	End Select
	If LoginType=1 then
		LoginData=UrlEncoding(LoginUser & "&" & LoginPass)
		LoginResult=PostHttpPage(LoginUrl,LoginPostUrl,LoginData)
		If Instr(LoginResult,LoginFalse)>0 Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>登录网站时发生错误，请确认登录信息的正确性！</li>"
		End If
	End If
	If FoundErr=True Then Admin_ShowErr(ErrMsg)
	ListCode=GetHttpPage(ListUrl)
	If ListCode<>"$False$" Then
		If ListPaingType=1 Then
			ListPaingNext=GetPaing(ListCode,LPsString,LPoString,False,False)
			If ListPaingNext<>"$False$" then
				If ListPaingStr1<>"" Then
				ListPaingNext=Replace(ListPaingStr1,"{$ID}",ListPaingNext)
				Else
				ListPaingNext=DefiniteUrl(ListPaingNext,ListUrl)
				End If
			End If
		End If
		ListCode=GetBody(ListCode,LsString,LoString,False,False)
		If ListCode="$False$" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>在截取列表时发生错误。</li>"
		End If
	Else
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>在获取:" & ListUrl & "网页源码时发生错误。</li>"
	End If
	If FoundErr=True Then Admin_ShowErr(ErrMsg)
End Sub

Sub GetTest4()
	SqlItem="Select * from Item Where ItemID=" & ItemID
	Set RsItem=server.CreateObject("adodb.recordset")
	RsItem.Open SqlItem,ConnItem,1,1
	If RsItem.Eof And RsItem.Bof Then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>参数错误，项目ID不能为空</li>"
	Else
		LoginType		= RsItem("LoginType")
		LoginUrl		= RsItem("LoginUrl")
		LoginPostUrl	= RsItem("LoginPostUrl")
		LoginUser		= RsItem("LoginUser")
		LoginPass		= RsItem("LoginPass")
		LoginFalse		= RsItem("LoginFalse")
		ListStr			= RsItem("ListStr")
		LsString		= RsItem("LsString")
		LoString		= RsItem("LoString")
		ListPaingType	= RsItem("ListPaingType")
		LPsString		= RsItem("LPsString")
		LPoString		= RsItem("LPoString")
		ListPaingStr1	= RsItem("ListPaingStr1")
		ListPaingStr2	= RsItem("ListPaingStr2")
		ListPaingID1	= RsItem("ListPaingID1")
		ListPaingID2	= RsItem("ListPaingID2")
		ListPaingStr3	= RsItem("ListPaingStr3")
		HsString		= RsItem("HsString")
		HoString		= RsItem("HoString")
		HttpUrlType		= RsItem("HttpUrlType")
		HttpUrlStr		= RsItem("HttpUrlStr")
		TsString		= RsItem("TsString")
		ToString		= RsItem("ToString")
		CsString		= RsItem("CsString")
		CoString		= RsItem("CoString")
		DateType		= RsItem("DateType")
		DsString		= RsItem("DsString")
		DoString		= RsItem("DoString")
		AuthorType		= RsItem("AuthorType")
		AsString		= RsItem("AsString")
		AoString		= RsItem("AoString")
		AuthorStr		= RsItem("AuthorStr")
		CopyFromType	= RsItem("CopyFromType")
		FsString		= RsItem("FsString")
		FoString		= RsItem("FoString")
		CopyFromStr		= RsItem("CopyFromStr")
		KeyType			= RsItem("KeyType")
		KsString		= RsItem("KsString")
		KoString		= RsItem("KoString")
		KeyStr			= RsItem("KeyStr")
		NewsPaingType	= RsItem("NewsPaingType")
		NPsString		= RsItem("NPsString")
		NPoString		= RsItem("NPoString")
		NewsPaingStr	= RsItem("NewsPaingStr")
		NewsPaingHtml	= RsItem("NewsPaingHtml")
	End If
	RsItem.Close : Set RsItem=Nothing     
	If LsString="" Then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>列表开始标记不能为空！</li>"
	End If
	If LoString="" Then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>列表结束标记不能为空！</li>"
	End If
	If ListPaingType=0 Or ListPaingType=1 Then
		If ListStr="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>列表索引页不能为空！</li>"
		End If
		If ListPaingType=1 Then    
			If LPsString="" Or LPoString="" Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>索引分页开始、结束标记不能为空！</li>"
			End If
		End If      
		If ListPaingStr1<>"" And Len(ListPaingStr1)<15 Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>索引分页重定向设置不正确！</li>"
        End IF
	ElseIf ListPaingType=2 Then
		If ListPaingStr2="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>批量生成原字符串不能为空！</li>"
		End If
		If IsNumeric(ListPaingID1)=False or IsNumeric(ListPaingID2)=False Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>批量生成的范围只能是数字！</li>"
		Else
			ListPaingID1=Clng(ListPaingID1)
			ListPaingID2=Clng(ListPaingID2)
			If ListPaingID1=0 And ListPaingID2=0 Then
				FoundErr=True
				ErrMsg=ErrMsg & "<br><li>批量生成的范围不正确！</li>"
			End If
		End If 
	ElseIf ListPaingType=3 Then
		If ListPaingStr3="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>索引分页不能为空！</li>"
		End If
	Else
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请选择返回上一步设置索引分页类型</li>"
	End If
 	If LoginType=1 Then
		If LoginUrl="" or LoginPostUrl="" or LoginUser="" Or LoginPass="" Or LoginFalse="" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>请将登录信息填写完整</li>"
		End If
	End If
	If FoundErr=True Then Admin_ShowErr(ErrMsg)
	Select Case ListPaingType
	Case 0,1
           ListUrl=ListStr
	Case 2
		ListUrl=Replace(ListPaingStr2,"{$ID}",CStr(ListPaingID1))
	Case 3
		If Instr(ListPaingStr3,"|")> 0 Then
			ListUrl=Left(ListPaingStr3,Instr(ListPaingStr3,"|")-1)
		Else
			ListUrl=ListPaingStr3
		End If
	End Select
	If SaveEdit="Yes" And LoginType=1 Then
		LoginData=UrlEncoding(LoginUser & "&" & LoginPass)
		LoginResult=PostHttpPage(LoginUrl,LoginPostUrl,LoginData)
		If Instr(LoginResult,LoginFalse)>0 Then
			Admin_ShowErr("<br><li>登录网站时发生错误，请确认登录信息的正确性！</li>")
		End If
	End  If
	ListCode=GetHttpPage(ListUrl)
	If ListCode<>"$False$" Then
		ListCode=GetBody(ListCode,LsString,LoString,False,False)
		If ListCode="$False$" Then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>在截取列表时发生错误。</li>"
		End If
	Else
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>在获取:" & ListUrl & "网页源码时发生错误。</li>"
	End If
	If FoundErr=True Then Admin_ShowErr(ErrMsg)
	NewsArrayCode=GetArray(ListCode,HsString,HoString,False,False)
	If NewsArrayCode="$False$" Then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>在分析：" & ListUrl & "新闻列表时发生错误！</li>"
	Else
		NewsArray=Split(NewsArrayCode,"$Array$")
		If IsArray(NewsArray)=True Then
			For Testi=0 To Ubound(NewsArray)
				If HttpUrlType=1 Then
					NewsArray(Testi)=Replace(HttpUrlStr,"{$ID}",NewsArray(Testi))
				Else
					NewsArray(Testi)=DefiniteUrl(NewsArray(Testi),ListUrl)
				End If
			Next
			UrlTest=NewsArray(0)
			NewsCode=GetHttpPage(UrlTest)
		Else
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>在分析：" & ListUrl & "新闻列表时发生错误！</li>"
		End If            
	End If
	If FoundErr=True Then Admin_ShowErr(ErrMsg)
End Sub
%>
