<%@ Page Inherits="Dvbbs.bbs.UI.Admin.admin_gather" %>
<%@ Register tagPrefix="Dvbbs" namespace="Dvbbs.Controls" assembly="Dvbbs.Web"%>
<%@ Register tagPrefix="bbs" tagName="AdminHeader" src="controls/admin_header.ascx"%>
<%@ Register tagPrefix="bbs" tagName="AdminFooter" src="controls/admin_footer.ascx"%>
<style>
.TextOver { text-overflow:ellipsis; overflow:hidden; white-space: nowrap; padding:2px; width:80% }
</style>
<script language="javascript">
function get_radio_value(radio_array, exp)
{
	var i;
	var value = "";
	if ('undefined' === typeof(radio_array.value))
	{
		for (i = 0; i < radio_array.length; ++ i)  //radio_array.length是radio选项的个数
		{
			if (radio_array[i].checked)
			{
				value = radio_array[i].value;
			}
		}
	}
	else
	{
		value = radio_array.value;
	}
	if(value != "")
	{
		return exp + value;
	}
	else
	{
		alert("请先选择一个节点，再操作！"); //如果一项都没选则返回
		return "?action=manage";
	}
}
//获得 checkbox 的 checked 状态
function chkvalue(obj)
{
	var value;
	if(obj.checked)
	{
		obj.value = "1";
	}
	else
	{
		obj.value = "0";
	}
}
//根据 Val 设置 radiobox.checked
function chkradio(Obj, Val)
{
	if (Obj)
	{
		for (i = 0; i < Obj.length; i++)
		{
			if (Obj[i].value == Val)
			{
				Obj[i].checked = true;
				break;
			}
		}
	}
}
//根据 Val 设置 checkbox.checked
function chkbox(Obj,Val)
{
	if (Obj)
	{
		if (Val == "1")
		{
			Obj.checked = true;
			Obj.value = "1";
		}
		else
		{
			Obj.checked = false;
			Obj.value = "0";
		}
	}
}

//全选,取消全选
function CheckAll(form, val)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.name == val)
			e.checked = form.chkall.checked;
	}
}
</script>
<bbs:adminheader id="AdminHeader1" title="采集信息管理" runat="server"></bbs:adminheader>
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<tr>
		<th>
			采集信息管理</th>
	</tr>
	<tr>
		<td class="nf2">
			<div class="underline">功能说明：</div>
			<span>
				1. 认真阅读采集信息管理的有关规则，然后再进行操作。<br>
				2. 如果要采集信息，先要建立采集节点，填写采集的有关规则。<br>
				3. 采集节点信息是对当前的节点根据所提供的网址进行采集，采集的规则填写越好，采集到的信息就越全面。<br>
				4. 采集下来后的信息要进行检查及作一些管理操作，确认采集的信息符合自己的要求后再进行入库。
			</span>
		</td>
	</tr>
	<tr>
		<td bgcolor="#FFFFFF">
			<a href="admin_gather.aspx?action=manage">
				<%if(action != null && action == "manage"){ %>
				<b>节点管理</b><%}else {%>
				节点管理
				<%}%>
			</a>| <a href="admin_gather.aspx?action=addnode">
				<%if(action != null && action == "addnode"){ %>
				<b>添加新节点</b><%}else {%>
				添加新节点
				<%}%>
			</a>| <a href="admin_gather.aspx?action=getNode">
				<%if(action != null && action == "getNode"){ %>
				<b>已采集节点管理</b><%}else {%>
				已采集节点管理
				<%}%>
			</a>| <a href="admin_gather.aspx?action=piclist">
				<%if(action != null && action == "piclist"){ %>
				<b>采集图片管理</b><%}else {%>
				采集图片管理
				<%}%>
			</a>
			<% if(action != null && action == "editnode") { %>
			|<b>修改当前节点</b><%}%>
			<% if(action != null && action == "testnode") { %>
			|<b>测试当前节点</b><%}%>
			<% if(action != null && action == "gathernode") { %>
			|<b>采集当前节点</b><%}%>
		</td>
	</tr>
</table>
<!-- 节点管理 start -->
<% if ((action != null && action == "manage")) { %>
<br />
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<form name="manageform" method="post" action="admin_gather.aspx?action=<%=Request["action"]%>&nodeid=<%=Request["NodeID"]%>">
		<tr>
			<th colspan="7">
				节点列表
			</th>
		</tr>
		<tr>
			<td style="text-align:center;width:5%"><b>选择</b></td>
			<td style="text-align:center;width:36%"><b>节点名称</b></td>
			<td style="text-align:center;width:20%"><b>导入论坛版面</b></td>
			<td style="text-align:center;width:12%"><b>最后采集日期</b></td>
			<td style="text-align:center;width:12%"><b>加入日期</b></td>
			<td style="text-align:center;width:7%"><b>编码</b></td>
			<td style="text-align:center;width:8%"><b>网址数</b></td>
		</tr>
		<asp:Repeater enableviewstate="false" id="nodelist" runat="server">
			<ItemTemplate>
				<tr onMouseOver="this.bgColor='#ffffff'" onMouseOut="this.bgColor=''">
					<td><Dvbbs:Span id="NodeID" runat="server" /></td>
					<td><Dvbbs:Span id="NodeName" runat="server" /></td>
					<td><Dvbbs:Span id="BoardType" runat="server" /></td>
					<td align="center"><Dvbbs:Span id="LastGatherDate" runat="server" /></td>
					<td align="center"><Dvbbs:Span id="NodeAddDate" runat="server" /></td>
					<td align="center"><Dvbbs:Span id="PageEncode" runat="server" /></td>
					<td><Dvbbs:Span id="NewsNum" runat="server" /></td>
				</tr>
			</ItemTemplate>
		</asp:Repeater>
		<tr>
			<td colspan="7"><Dvbbs:Pager id="nodepager" per="10" runat="server" /></td>
		</tr>
		<tr>
			<td colspan="7">
				<font color="red"><b>重要：匹配你所要采集的网址 匹配模式</b></font>
				<SELECT id="rule_expr">
					<OPTION selected value="1">默认模式一</OPTION>
					<OPTION value="2">默认模式二</OPTION>
					<OPTION value="3">默认模式三</OPTION>
					<OPTION value="4">默认模式四</OPTION>
				</SELECT>
			</td>
		</tr>
		<tr>
			<td height="23" colspan="7" class="bottom">
				<button onClick="window.location=get_radio_value(this.form.NodeID,'?action=editnode&NodeID=');"
					class="button" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)"
					onMouseOut="IEvent('mouseout',this)">修改当前节点</button>&nbsp;&nbsp;
				<button onClick="window.location=get_radio_value(this.form.NodeID,'?action=testnode&rule_expr='+rule_expr.value+'&NodeID=');"
					class="button" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)"
					onMouseOut="IEvent('mouseout',this)">测试当前节点</button>&nbsp;&nbsp;
				<button onClick="window.location=get_radio_value(this.form.NodeID,'?action=gathernode&rule_expr='+rule_expr.value+'&NodeID=');"
					class="button" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)"
					onMouseOut="IEvent('mouseout',this)">采集当前节点</button>&nbsp;&nbsp;
				<button onClick="window.location=get_radio_value(this.form.NodeID,'?action=deletenode&NodeID=');"
					class="button" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)"
					onMouseOut="IEvent('mouseout',this)">删除当前节点</button>&nbsp;&nbsp;
			</td>
		</tr>
	</form>
</table>
<!-- 节点管理 end -->
<!-- 添加新节点 start -->
<% } else if ((action != null && action == "addnode")) { %>
<br />
<!-- 基本设置 start -->
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<th colspan="2">
		节点信息 -> 基本设置
	</th>
	<tr>
		<td colspan="2" class="nf2">
			<div class="underline">友情提示：</div>
			<span>添加节点成功后，您可以到“节点管理”，选取该节点，然后选择“修改当前节点”，进一步填写采集的相关规则，如信息获取规则、过滤设置等，以使采集信息更准确。</span>
		</td>
	</tr>
	<form name="addbasic" method="post" action="?action=node_addok&sort=basic">
		<tr>
			<td width="30%" class="left">节点名称</td>
			<td width="70%" class="right">
				<input type="text" name="NodeName" size="60" value="" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)"
					onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">
			</td>
		</tr>
		<tr>
			<td class="left">采集信息导入论坛版面ID</td>
			<td class="right">
				<select id="BoardID" name="BoardID">
					<% foreach (Dvbbs.bbs.Entity.BoardJumpList.BoardInfo bi in Dvbbs.bbs.Entity.ForumCaching.GetBoardJumpList()) { %>
					<option value="<%=bi.BoardId.ToString()%>"><%=bi.BoardType%></option>
					<% } %>
				</select>
			</td>
		</tr>
		<tr>
			<td class="left">来源网址</td>
			<td class="right">
				<input type="text" name="FromURL" size="60" value="http://" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">
			</td>
		</tr>
		<tr>
			<td class="left">页面编码</td>
			<td class="right">
				<input type="radio" class="radio" name="PageEncode" checked value="1">GBK&nbsp;&nbsp;<input type="radio" class="radio" name="PageEncode" value="2">GB2312&nbsp;&nbsp;
				<input type="radio" class="radio" name="PageEncode" value="3">UTF8&nbsp;&nbsp;<input type="radio" class="radio" name="PageEncode" value="4">BIG5</td>
		</tr>
		<tr>
			<td class="left">导入采集规则模板</td>
			<td class="right">
				<select id="importrule" name="importrule">
					<option id="-1" value="">请选择</option>
					<% System.Data.DataTable dt = conn.GetDataTable("Select NodeID, NodeName From " + Dvbbs.Utils.Fetch.TablePrefix + "NodeInfo ");
					   for(int i = 0; i < dt.Rows.Count; i++) {%>
					<option id="<%=i%>" value="<%=dt.Rows[i]["NodeID"]%>"><%=dt.Rows[i]["NodeName"]%></option>
					<% } %>
				</select>&nbsp;&nbsp;<span>您可以选择采集规则与要新添加的节点类似的节点导入采集规则。</span>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center" class="bottom">
				<input type="submit" name="Submit" value="添 加" onClick="" class="button" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" />
			</td>
		</tr>
	</form>
	<script language="JavaScript">
	<!--
	chkradio(document.addbasic.PageEncode,'1')
	//-->
	</script>
</table>
<!-- 基本设置 end -->
<!-- 添加新节点 end -->
<!-- 已采集节点管理 start -->
<% } else if ((action != null && action == "getNode")) { %>
<br />
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<th colspan="8">
		已采集新闻列表
	</th>
	<tr>
		<td colspan="8" class="nf2">
			<div class="underline">友情提示：</div>
			<span>
			1. 点击新闻标题链接，您可以预览采集来的新闻信息。<br />
			2. 如果您对采集到的信息不满意，您可以点击修改链接，对其进行修改。<br />
			3. 选择一条或多条已采集的新闻，可以将其放入论坛库或是删除。
			</span>
		</td>
	</tr>
	<form name="getnodelist" method="post" action="">
		<tr>
			<td align="center" width="6%">选 择</td>
			<td align="center" width="32%">标 题</td>
			<td align="center" width="14%">隶属论坛类型</td>
			<td align="center" width="10%">所属节点</td>
			<td align="center" width="10%">作 者</td>
			<td align="center" width="10%">来 源</td>
			<td align="center" width="10%">时 间</td>
			<td align="center" width="8%">操 作</td>
		</tr>
		<div style="overflow:hidden;">
			<asp:Repeater enableviewstate="false" id="getlist" runat="server">
				<ItemTemplate>
					<tr onMouseOver="this.bgColor='#ffffff'" onMouseOut="this.bgColor=''">
						<td align="center"><Dvbbs:Span id="NewsID" runat="server" /></td>
						<td align="center"><Dvbbs:Span id="NewsTitle" runat="server" /></td>
						<td><Dvbbs:Span id="BoardType" runat="server" /></td>
						<td><Dvbbs:Span id="NodeID" runat="server" /></td>
						<td><Dvbbs:Span id="NewsWriter" runat="server" /></td>
						<td><Dvbbs:Span id="NewsFrom" runat="server" /></td>
						<td align="center"><Dvbbs:Span id="NewsDate" runat="server" /></td>
						<td align="center"><Dvbbs:Span id="NewsID1" runat="server" /></td>
					</tr>
				</ItemTemplate>
			</asp:Repeater>
		</div>
		<tr>
			<td colspan="8">&nbsp;&nbsp; <input type="checkbox" name="chkall" class="checkbox" value="Y" onclick="CheckAll(this.form,'NewsID')">全选/取消&nbsp;&nbsp; 
				<!-- <input type="submit" name="Submit" class="button" onclick="{newsarray=chknews();this.form.action='?action=newsmanage&type=deletenews&newsarray='+newsarray;}"
					value="删除节点信息">&nbsp;&nbsp; 
				<input type="submit" name="Submit" class="button" onclick="{newsarray=chknews();this.form.action='?action=newsmanage&type=insert_topic&newsarray='+newsarray;}"
					value="放入论坛库"> -->
				<input type="submit" name="Submit" class="button" onclick="this.form.action='?action=newsmanage&type=deletenews'"
					value="删除节点信息" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)"
					onMouseOut="IEvent('mouseout',this)">&nbsp;&nbsp; <input type="submit" name="Submit" class="button" onclick="this.form.action='?action=newsmanage&type=insert_topic'"
					value="放入论坛库" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">
			</td>
		</tr>
		<tr>
			<td colspan="8"><Dvbbs:Pager id="getpager" per="15" runat="server" /></td>
		</tr>
		<script language="javascript">
		function chknews()
		{
			var j = 0;
			var arr = "";
			aa = document.getnodelist.elements("NewsID");
			for(i = 0; i < aa.length; i++)
			{
				if(aa[i].checked)
				{
					arr += aa[i].value + ";";
				}
			}
			return arr;
		}
		</script>
	</form>
</table>
<!-- 已采集节点管理 end -->
<!-- 采集图片管理 start -->
<% } else if ((action != null && action == "piclist")) { %>
<br />
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<th colspan="8">
		已采集图片列表
	</th>
	<tr>
		<td colspan="8" class="nf2">
			<div class="underline">友情提示：</div>
			<span>
			1. 点击文件名链接，您可以预览采集来的图片信息。<br />
			2. 如果您不需要该图片，可以点击删除链接，将其删除。<br />
			3. 选择一条或多条已采集的新闻，可以执行清理将它们清除。
			</span>
		</td>
	</tr>
	<form name="picform" method="post" action="">
		<tr>
			<td style="text-align:center;" width="8%">文件ID</td>
			<td style="text-align:center;" width="40%">文件名</td>
			<td style="text-align:center;" width="15%">文件大小</td>
			<td style="text-align:center;" width="20%">上传日期</td>
			<td style="text-align:center;">操作</td>
		</tr>
		<asp:Repeater enableviewstate="false" id="piclist" runat="server">
			<ItemTemplate>
				<tr onMouseOver="this.bgColor='#ffffff'" onMouseOut="this.bgColor=''">
					<td align="center"><Dvbbs:Span id="picID" runat="server" />
						<Dvbbs:Span id="picName" runat="server" /></td>
					<td align="center"><Dvbbs:Span id="picName1" runat="server" /></td>
					<td align="center"><Dvbbs:Span id="picSize" runat="server" /></td>
					<td align="center"><Dvbbs:Span id="uploadDate" runat="server" /></td>
					<td align="center"><Dvbbs:Span id="picName2" runat="server" /></td>
				</tr>
			</ItemTemplate>
		</asp:Repeater>
		<tr>
			<td colspan="5" style="text-align:left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="checkbox" name="chkall" class="checkbox" value="Y" onclick="CheckAll(this.form,'picName')">全选/取消&nbsp;&nbsp;
				<input type="submit" class="button" name="Submit" value=" 清 理 " onclick="this.form.action='?action=picmanage&mngtype=clearpic'"
					onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)"
					onMouseOut="IEvent('mouseout',this)">
			</td>
		</tr>
		<tr>
			<td colspan="5"><Dvbbs:Pager id="picpager" per="15" runat="server" /></td>
		</tr>
		<script language="javascript">
		function chkpics()
		{
			var j=0;
			var arr = "";
			aa = document.picform.elements("picName");
			for(i=0;i<aa.length;i++)
			{
				if(aa[i].checked)
				{
					arr += aa[i].value + ";";
				}
			}
			return arr;
		}
		</script>
	</form>
</table>
<!-- 采集图片管理 end -->
<!-- 修改当前节点 start -->
<% } else if ((action != null && action == "editnode")) { %>
<br />
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<tr>
		<th>
			修改节点 -
			<%=NodeName%>
		</th>
	</tr>
	<tr>
		<td height="23">
			<a href="?action=editnode&item=edit_basic&NodeID=<%=NodeID%>">
				<%if(action != null && action == "editnode" && item == "edit_basic"){ %>
				<b>基本设置</b><% } else { %>
				基本设置
				<%}%>
			</a>| <a href="?action=editnode&item=edit_rule&NodeID=<%=NodeID%>">
				<%if(action != null && action == "editnode" && item == "edit_rule"){ %>
				<b>信息获取规则</b><% } else {%>
				信息获取规则
				<%}%>
			</a>| <a href="?action=editnode&item=edit_filter&NodeID=<%=NodeID%>">
				<%if(action != null && action == "editnode" && item == "edit_filter"){ %>
				<b>过滤设置</b><% } else { %>
				过滤设置
				<%}%>
			</a>| <a href="?action=editnode&item=edit_other&NodeID=<%=NodeID%>">
				<%if(action != null && action == "editnode" && item == "edit_other"){ %>
				<b>其它选项</b><% } else { %>
				其它选项
				<%}%>
			</a>
		</td>
	</tr>
</table>
<!-- 基本设置 start -->
<%if(action != null && action == "editnode" && item == "edit_basic") {%>
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<tr class="category">
		<%=NodeName%>
		-> 基本设置
	</tr>
	<form name="editbasic" method="post" action="?action=editok&sort=basic&NodeID=<%=NodeID%>">
		<tr>
			<td width="30%" class="left">节点名称</td>
			<td width="70%" class="right">
				<input type="text" name="NodeName" size="60" value="<%=dtCurrNode.Rows[0]["NodeName"]%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">
			</td>
		</tr>
		<tr>
			<td class="left">采集信息导入论坛版面ID</td>
			<td class="right">
				<select id="boardid" name="boardid">
					<%
					Dvbbs.bbs.Entity.BoardJumpList b = Dvbbs.bbs.Entity.ForumCaching.GetBoardJumpList();
					if(b != null)
					{
						for(int i = 0; i < b.Count; i++)
						{
					%>
					<option value="<%=b[i].BoardId%>" <%=(dtCurrNode.Rows[0]["boardid"].ToString()==b[i].BoardId.ToString()?" selected=\"true\" ":"")%>><%=b[i].BoardType%></option>
					<%
						}
					}
					%>
				</select>
			</td>
		</tr>
		<tr>
			<td class="left">来源网址</td>
			<td class="right">
				<input type="text" name="FromURL" size="60" value="<%=dtCurrNode.Rows[0]["FromURL"]%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center" class="bottom">
				<input type="submit" name="Submit" value="保 存" onClick="" class="button" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" /></td>
		</tr>
	</form>
</table>
<!-- 基本设置 end -->
<!-- 信息获取规则 start -->
<%} else if(action != null && action == "editnode" && item == "edit_rule") {%>
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<tr>
		<td colspan="3">
			<%=NodeName%>
			-> 信息获取规则
		</td>
	</tr>
	<form name="editrule" method="post" action="?action=editok&sort=rule&NodeID=<%=NodeID%>">
		<tr>
			<td width="16%" align="center">
			</td>
			<td width="42%" align="center">开始代码
			</td>
			<td width="42%" align="center">结束代码
			</td>
		</tr>
		<tr valign="top">
			<td class="left">新闻标题</td>
			<td class="right">
				RSS:<br />
				<input type="text" name="NewsTitleS_RSS" size="45" value="<%=NewsTitleS_RSS%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><br />
				html:<br />
				<textarea name="NewsTitleS_html" style="width:95%;" rows="5" id="NewsTitleS_html" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(NewsTitleS_html.ToString())%></textarea></td>
			<td class="right">
				RSS:<br />
				<input type="text" name="NewsTitleE_RSS" size="45" value="<%=NewsTitleE_RSS%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><br />
				html:<br />
				<textarea name="NewsTitleE_html" style="width:95%;" rows="5" id="NewsTitleE_html" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(NewsTitleE_html.ToString())%></textarea></td>
		</tr>
		<tr valign="top">
			<td class="left">新闻来源</td>
			<td class="right">
				RSS:<br />
				<input type="text" name="NewsURLS_RSS" size="45" value="<%=NewsURLS_RSS%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><br />
				html:<br />
				<textarea name="NewsURLS_html" style="width:95%;" rows="5" id="NewsURLS_html" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(NewsURLS_html.ToString())%></textarea></td>
			<td class="right">
				RSS:<br />
				<input type="text" name="NewsURLE_RSS" size="45" value="<%=NewsURLS_RSS%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><br />
				html:<br />
				<textarea name="NewsURLE_html" style="width:95%;" rows="5" id="NewsURLE_html" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(NewsURLE_html.ToString())%></textarea></td>
		</tr>
		<tr valign="top">
			<td class="left">新闻作者</td>
			<td class="right">
				RSS:<br />
				<input type="text" name="NewsWriterS_RSS" size="45" value="<%=NewsURLS_RSS%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><br />
				html:<br />
				<textarea name="NewsWriterS_html" style="width:95%;" rows="5" id="NewsWriterS_html" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(NewsWriterS_html.ToString())%></textarea></td>
			<td class="right">
				RSS:<br />
				<input type="text" name="NewsWriterE_RSS" size="45" value="<%=NewsURLS_RSS%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><br />
				html:<br />
				<textarea name="NewsWriterE_html" style="width:95%;" rows="5" id="NewsWriterE_html" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(NewsWriterE_html.ToString())%></textarea></td>
		</tr>
		<tr valign="top">
			<td class="left">新闻发布时间</td>
			<td class="right">
				RSS:<br />
				<input type="text" name="NewsDateS_RSS" size="45" value="<%=NewsDateS_RSS%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><br />
				html:<br />
				<textarea name="NewsDateS_html" style="width:95%;" rows="5" id="NewsDateS_html" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(NewsDateS_html.ToString())%></textarea></td>
			<td class="right">
				RSS:<br />
				<input type="text" name="NewsDateE_RSS" size="45" value="<%=NewsDateE_RSS%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><br />
				html:<br />
				<textarea name="NewsDateE_html" style="width:95%;" rows="5" id="NewsDateE_html" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(NewsDateE_html.ToString())%></textarea></td>
		</tr>
		<tr valign="top">
			<td class="left">新闻内容</td>
			<td class="right">
				RSS:<br />
				<input type="text" name="NewsBodyS_RSS" size="45" value="<%=NewsBodyS_RSS%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><br />
				html:<br />
				<textarea name="NewsBodyS_html" style="width:95%;" rows="5" id="NewsBodyS_html" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(NewsBodyS_html.ToString())%></textarea></td>
			<td class="right">
				RSS:<br />
				<input type="text" name="NewsBodyE_RSS" size="45" value="<%=NewsBodyE_RSS%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><br />
				html:<br />
				<textarea name="NewsBodyE_html" style="width:95%;" rows="5" id="NewsBodyE_html" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(NewsBodyE_html.ToString())%></textarea></td>
		</tr>
		<tr valign="top">
			<td class="left">新闻链接</td>
			<td class="right">
				RSS:<br />
				<input type="text" name="NewsLinkS_RSS" size="45" value="<%=NewsLinkS_RSS%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">
			<td class="right">
				RSS:<br />
				<input type="text" name="NewslinkE_RSS" size="45" value="<%=NewsLinkE_RSS%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">
		</tr>
		<tr>
			<td colspan="3" align="center" class="bottom">
				<input type="submit" name="Submit" value="保 存" onClick="" class="button" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" /></td>
		</tr>
	</form>
</table>
<!-- 信息获取规则 end -->
<!-- 过滤设置 start -->
<%} else if(action != null && action == "editnode" && item == "edit_filter") {%>
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<tr>
		<%=NodeName%>
		-> 过滤设置
	</tr>
	<form name="editfilter" method="post" action="?action=editok&sort=filter&NodeID=<%=NodeID%>">
		<tr>
			<td width="30%" class="left">配色风格</td>
			<td width="70%" class="right"><select name="ColorStyle" id="ColorStyle">
					<option value="1">默认风格</option>
				</select>
			</td>
		</tr>
		<tr>
			<td class="left">版面设计模板</td>
			<td class="right"><select name="Template" id="Template">
					<option value="1">默认模板</option>
				</select>
			</td>
		</tr>
		<tr>
			<td class="left">新闻网址需要包含</td>
			<td class="right">
				<input name="urlInclude" value="<%=dtCurrNode.Rows[0]["urlInclude"]%>" type="text" id="urlInclude" size="51" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" /><br /><span>说明：当新闻网址包含该字符，系统才会采集。</span>
			</td>
		</tr>
		<tr>
			<td class="left">新闻网址不包含</td>
			<td class="right">
				<input name="urlUnInclude" value="<%=dtCurrNode.Rows[0]["urlUnInclude"]%>" type="text" id="urlUnInclude" size="51" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" /><br /><span>说明：当新闻网址不包含该字符，系统才会采集。</span>
			</td>
		</tr>
		<tr>
			<td class="left">新闻标题替换</td>
			<td class="right">
				被替换信息： <input name="TitleFind" value="<%=dtCurrNode.Rows[0]["TitleFind"]%>" type="text" id="TitleFind" size="40" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" /><br />
				替换后信息： <input name="TitleReplace" value="<%=dtCurrNode.Rows[0]["TitleReplace"]%>" type="text" id="TitleReplace" size="40" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" />
				<br /><span>说明：当新闻标题中出现“被替换信息”的内容时，将被“替换后信息”替换。</span>
			</td>
		</tr>
		<tr>
			<td class="left">新闻内容替换</td>
			<td valign="middle"  class="right">被替换信息： <textarea name="BobyFind" style="width:99%" rows="3" id="BobyFind" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(dtCurrNode.Rows[0]["BobyFind"].ToString())%></textarea><br />
				替换后信息： <textarea name="BodyReplace" style="width:99%" rows="3" id="BodyReplace" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(dtCurrNode.Rows[0]["BodyReplace"].ToString())%></textarea><br>
				<span>说明：当新闻内容中出现“被替换信息”的内容时，将被“替换后信息”替换。<br />如果要进行多个替换时，每个替换字符请用分号( ; )分割开。</span><br>
			</td>
		</tr>
		<tr>
			<td class="left">标签过滤</td>
			<td  class="right">
				<input type="text" size="80" id="StripTag" name="StripTag" value="<%=dtCurrNode.Rows[0]["StripTag"]%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" /><br />
				<span>说明：填入新闻采集内容时要过滤的html标签，多个标签的时候请用 | 分隔。<br />
					例如：要过滤标签iframe,font,span,则此处应填写：iframe|font|span</span>
			</td>
		</tr>
		<tr>
			<td colspan="4" align="center" class="bottom"><input type="submit" name="Submit" value="保 存" onClick="" class="button" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" /></td>
		</tr>
	</form>
</table>
<!-- 过滤设置 end -->
<!-- 其它选项 start -->
<%} else if(action != null && action == "editnode" && item == "edit_other") {%>
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<tr>
		<%=NodeName%>
		-> 其它选项
	</tr>
	<form id="editother" name="theOther" method="post" action="?action=editok&sort=other&NodeID=<%=NodeID%>">
		<tr>
			<td width="30%" class="left">页面编码</td>
			<td width="70%" class="right">
				<input type="radio" class="radio" name="PageEncode" checked value="1">GBK&nbsp;&nbsp;<input type="radio" class="radio" name="PageEncode" value="2">GB2312&nbsp;&nbsp;
				<input type="radio" class="radio" name="PageEncode" value="3">UTF8&nbsp;&nbsp;<input type="radio" class="radio" name="PageEncode" value="4">BIG5</td>
		</tr>
		<tr>
			<td class="left">是否同时也下载远程图片</td>
			<td class="right">
				<input type="radio" class="radio" name="IsDownPic" checked value="0" />是&nbsp;&nbsp;<input type="radio" class="radio" name="IsDownPic" value="1" />
				否<br /> <input name="PicSavePath" size="35" type="text" id="PicSavePath" value="../files/uploadfiles/gatherimgs/"
					readonly onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" /><span>图片保存目录</span></td>
		</tr>
		<tr>
			<td class="left">信息录入时间</td>
			<td class="right">
				<input type="radio" class="radio" name="InfoDate" value="1" checked />当前系统时间&nbsp;&nbsp;<input type="radio" class="radio" name="InfoDate" value="2" />
				新闻发布时间</td>
		</tr>
		<tr>
			<td class="left">关键字收录</td>
			<td class="right">
				<input name="KeyWords" value="<%=dtCurrNode.Rows[0]["KeyWords"]%>" type="text" id="KeyWords" size="40" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" /></td>
		</tr>
		<tr>
			<td class="left">分页变量类型</td>
			<td class="right">
				<select name="PageType" id="PageType">
					<%
						if(dtCurrNode.Rows[0]["PageType"].ToString()=="1")
						{
					%>
					<option value="1" selected="true">数字分页变量(1、2)</option>
					<option value="2">字符分页变量(aa_1230、str1230)</option>
					<%
						}
						else
						{
					%>
					<option value="1">数字分页变量(1、2)</option>
					<option value="2" selected="true">字符分页变量(aa_1230、str1230)</option>
					<%
						}
					%>
				</select>
				<br />
				<span>说明：数字分页类似 news.html?page=2；news.html?class=guonei&page=2<br />
				                      字符分页类似 news/list_02.html；news/list02.html</span>
			</td>
		</tr>
		<tr>
			<td class="left">分页变量起始值</td>
			<td class="right">
				<input name="PagerS" value="<%=dtCurrNode.Rows[0]["PagerS"]%>" type="text" id="PagerS" size="40" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" />
				<br />
				<span>说明：如果是数字分页变量，则分页变量起始值如：1、2<br />
									  如果是字符分页变量，则分页变量起始值如：01、02</span></td>
		</tr>
		<tr>
			<td class="left">分页变量结束值</td>
			<td class="right">
				<input name="PagerE" value="<%=dtCurrNode.Rows[0]["PagerE"]%>" type="text" id="PagerE" size="40" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" />
				<br>
				<span>说明：如果是数字分页变量，则分页变量结果值如：5、6；<br />
					                  如果是字符分页变量，则分页页变量结果值如：05、06</span></td>
		</tr>
		<tr>
			<td class="left">分页变量的名称</td>
			<td class="right">
				<input name="PagerName" value="<%=dtCurrNode.Rows[0]["PagerName"]%>" type="text" id="PagerName" value="" size="40" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" /><br />
				<span>说明：如果填写变量的起始值，就务必填写变量的结束值和变量的名称。<br />
									   如果是数字分页，类似 news.html?page=2，则分页变量名称为 page<br />
									   如果是字符分页，类似 news/list_02.html，则分页变量名称为 list_ </span>
			</td>
		</tr>
		<tr>
			<td height="30" colspan="2" class="bottom" align="center">
				<input type="submit" class="button" name="Submit" value="保 存" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" /></td>
		</tr>
	</form>
	<script language="JavaScript">
	<!--
	chkradio(document.editother.PageEncode,'<%=dtCurrNode.Rows[0]["PageEncode"]%>')
	chkradio(document.editother.IsDownPic,'<%=dtCurrNode.Rows[0]["IsDownPic"]%>')
	chkradio(document.editother.InfoDate,'<%=dtCurrNode.Rows[0]["InfoDate"]%>')
	//-->
	</script>
</table>
<!-- 其它选项 end -->
<%}%>
<!-- 修改当前节点 end -->
<!-- 测试当前节点 start -->
<% } else if ((action != null && action == "testnode")) { %>
<br />
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<th>
		测试节点 ->
		<%=NodeName%>
	</th>
	<form name="form1" method="post" action="?action=manage">
		<tr>
			<td>测试信息列表</td>
		</tr>
		<tr>
			<td>
				<textarea name="listnews" style="width:780;height:200;" rows="15" cols="20" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(NewsList.ToString())%>
				</textarea>
			</td>
		</tr>
		<tr>
			<td>网页规则测试</td>
		</tr>
		<tr>
			<td><textarea name="listhtml" style="width:780;height:200;" rows="15" cols="20" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(htmlCode.ToString())%>
				</textarea>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center" class="bottom">
				<input type="submit" class="button" name="back" value="返 回" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"></td>
		</tr>
	</form>
</table>
<!-- 测试当前节点 end -->
<!-- 采集当前节点 start -->
<% } else if ((action != null && action == "gathernode")) { %>
<br />
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<th colspan="6">
		采集内容管理 ->
		<%=NodeName%>
	</th>
	<tr>
		<td align="center" width="6%"><b>选择</b></td>
		<td align="center" width="48%"><b>内容标题</b></td>
		<td align="center" width="16%"><b>所属论坛类型</b></td>
		<td align="center" width="10%"><b>获取日期</b></td>
		<td align="center" width="10%"><b>是否下载</b></td>
		<td align="center" width="10%"><b>来源网页</b></td>
	</tr>
	<form name="begingather" method="post" action="">
		<asp:Repeater enableviewstate="false" id="gatherlist" runat="server">
			<ItemTemplate>
				<tr onMouseOver="this.bgColor='#ffffff'" onMouseOut="this.bgColor=''">
					<td align="center"><Dvbbs:Span id="NewsID" runat="server" /></td>
					<td align="left"><Dvbbs:Span id="NewsTitle" runat="server" /></td>
					<td align="left"><Dvbbs:Span id="BoardType" runat="server" /></td>
					<td align="center"><Dvbbs:Span id="gatherDate" runat="server" /></td>
					<td align="center"><Dvbbs:Span id="IsDownLoad" runat="server" /></td>
					<td align="center"><Dvbbs:Span id="NewsURL" runat="server" /></td>
				</tr>
			</ItemTemplate>
		</asp:Repeater>
		<tr>
			<td colspan="6" class="bottom">&nbsp;&nbsp;
				<input type="checkbox" name="chkall" onclick="CheckAll(begingather,'NewsID')" value="Y" class="checkbox">全选/取消&nbsp;&nbsp;
				<input type="submit" class="button" 
				onclick="this.form.action='?action=gather_web&NodeID='+<%=NodeID%>+'&rule_expr='+<%=rule%>"
					name="Submit" value="开始采集网页" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">
			</td>
		</tr>
	</form>
	<tr>
		<td colspan="6"><Dvbbs:Pager id="gatherpager" per="15" runat="server" /></td>
	</tr>
</table>
<!-- 采集当前节点 end -->
<!-- 修改采集信息 start -->
<% } else if ((action != null && action == "editnews")) { %>
<br />
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<th colspan="2">
		修改采集信息
	</th>
	<form name="editcurrnews" method="post" action="?action=newsmanage&type=editok&NewsID=<%=NewsID%>">
		<tr>
			<td width="30%" class="left">标题</td>
			<td width="70%" class="right">
				<input type="text" style="width:98%;" name="NewsTitle" value="<%=Server.HtmlEncode(dtCurrNewsInfo.Rows[0]["NewsTitle"].ToString())%>">
			</td>
		</tr>
		<tr>
			<td class="left">作者</td>
			<td class="right"><input type="text" style="width:98%;" name="NewsWriter" value="<%=dtCurrNewsInfo.Rows[0]["NewsWriter"]%>"></td>
		</tr>
		<tr>
			<td class="left">来源</td>
			<td class="right"><input type="text" style="width:98%;" name="NewsFrom" value="<%=dtCurrNewsInfo.Rows[0]["NewsFrom"]%>"></td>
		</tr>
		<tr>
			<td class="left">内容</td>
			<td class="right"><textarea name="NewsBody" style="width:98%;height:250;" rows="15" id="NewsBody"><%=Server.HtmlEncode(dtCurrNewsInfo.Rows[0]["NewsBody"].ToString())%></textarea></td>
		</tr>
		<tr>
			<td colspan="2" align="center" class="bottom"><input type="submit" name="Submit" value="保 存" onClick="" class="button" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" /></td>
		</tr>
	</form>
</table>
<!-- 修改采集信息 end -->
<% } %>
<script language="javascript">
function check()
{
	var j=0;
	var arr = "";
	aa = document.begingather.elements("NewsID");
	for(i=0;i<aa.length;i++)
	{
		if(aa[i].checked)
		{
			arr += aa[i].value + ";";
		}
	}
	return arr;
}
</script>
<bbs:AdminFooter runat="server" id="AdminFooter1" />
