📄 projectmodify.asp
字号:
<%
option explicit
response.buffer=true
Dim Rs,Sql,action,ErrMsg,channelid,classid,classname,classinfo,FoundErr
Dim CurrentPage,Allpage,ProjectNum,iProject,ProjectID,ProjectCollectionTime,RsHistroy
Dim ProjectName,WebName,WebUrl,ListIndex,Url,Urlstr,ShowCode,ListCode
Dim ListStartString,ListEndString,ListType,ListPageStr,PageStart,PageEnd,PageOrder,strRemoteListUrl
Dim LinkStartStr,LinkEndStr,linkurl,NewsArray,Testi,ProjectName_Z,ListCode_z
Dim TitleStartStr,TitleEndStr,ContentStartStr,ContentEndStr,title,content
Dim UserName,Rank
Const PerPage=10
Action=Request.QueryString("Action")
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/function.asp"-->
<html>
<head>
<title>通用文章采集系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script language="javascript">
function unselectall(thisform){
if(thisform.chkAll.checked){
thisform.chkAll.checked = thisform.chkAll.checked&0;
}
}
function CheckAll(thisform){
for (var i=0;i<thisform.elements.length;i++){
var e = thisform.elements[i];
if (e.Name != "chkAll"&&e.disabled!=true)
e.checked = thisform.chkAll.checked;
}
}
</script>
<style type="text/css">
<!--
.STYLE1 {
color: #000000;
font-weight: bold;
}
.STYLE2 {color: #FF0000}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder">
<tr>
<th height="22" colspan="2" align="center">
<span class="STYLE1">采 集 项 目 管 理</span></th>
</tr>
</table>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder">
<tr>
<td height="30" colspan="2">
说明:</td>
</tr>
<tr>
<td width="65" height="30">
<strong>管理导航:</strong></td>
<td height="30">
<a href="projectmanage.asp">管理首页</a> | <a href="?action=Modify_Project">添加项目</a>:<%if action="Modify_Project" then %><span
class="STYLE2">基本设置</span><%else%>基本设置<%end if%>
>>
<%if action="Modify_Project1" then %>
<span class="STYLE2">列表设置</span><%else%>列表设置<%end if%>
>>
<%if action="Modify_Project2" then %>
<span class="STYLE2">链接设置</span><%else%>链接设置<%end if%>
>>
<%if action="Modify_Project3" then %>
<span class="STYLE2">标题/内容设置</span><%else%>标题/内容设置<%end if%>
>>
<%if action="Modify_Project4" then %>
<span class="STYLE2">采样测试</span><%else%>采样测试<%end if%>
>>
<%if action="Modify_Project5" then %>
<span class="STYLE2">属性设置</span><%else%>属性设置<%end if%>
>>
<%if action="Modify_Project6" then %>
<span class="STYLE2">完成</span><%else%>完成<%end if%>
>> <a href="javascript:history.back()">返回</a></td>
</tr>
</table>
<br>
<%if Action="Modify_Project" then
ProjectID=Trim(Request("ProjectID"))
If ProjectID="" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>参数错误,项目ID不能为空!</li>"
Else
ProjectID=Clng(ProjectID)
End If
If FoundErr<>True Then
Sql ="select ProjectID,ProjectName,WebName,WebUrl,ChannelID,ClassID,ListIndex from Project where ProjectID=" & ProjectID
Set Rs=Server.CreateObject("adodb.recordset")
Rs.Open Sql,ConnHistroy,1,1
If Rs.Eof And Rs.Bof Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>参数错误,没有找到该项目!</li>"
Else
ProjectName=Rs("ProjectName")
ListIndex=Rs("ListIndex")
WebName=Rs("WebName")
WebUrl=Rs("WebUrl")
ChannelID=Rs("ChannelID")
ClassID=Rs("ClassID")
End If
Rs.Close
Set Rs=Nothing
session("ProjectID")=ProjectID
End If
If FoundErr=True Then
Call WriteErrMsg(ErrMsg)
Response.end
End if
%>
<script language="javascript">
var onecount;
onecount=0;
subcat = new Array();
<%
set rs=server.createobject("adodb.recordset")
sql="select * from class"
rs.open sql,conn,1,1
dim i
i =0
do while not rs.eof and i<=rs.recordcount
%>
subcat[<%=i%>] = new Array("<%=rs("channelid")%>","<%=rs("classname")%>","<%=rs("classid")%>");
<%
i=i+1
rs.movenext
loop
%>
onecount=<%=rs.recordcount%>;
function changelocation(locationid)
{
document.form2.Class.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][0] == locationid)
{
document.form2.Class.options[document.form2.Class.length] = new Option(subcat[i][1], subcat[i][2]);
}
}
}
</script>
<center>
<form method="POST" action="?Action=Modify_Project1" name="form2">
<table border="0" cellpadding="0" cellspacing="0" width="97%" class="tableBorder">
<tr>
<td width="100%" height="30" valign="middle">
<font color="#FF0000">采集项目:基本设置</font>
</td>
</tr>
<tr>
<td width="100%" valign="top">
<table cellpadding="0" cellspacing="0" width="100%" id="table1" bgcolor="#ffffff">
<tr height="25">
<td width="30%" align="right">
<b>项目名称:</b></td>
<td width="65%">
<input type="text" name="ProjectName" size="31" value="<%=ProjectName%>">
<font color="red">*</font>如:搜狐网-娱乐资讯
</td>
</tr>
<tr height="25">
<td width="30%" align="right">
<b>所属栏目:</b></td>
<td width="65%">
<select name="Channel" onchange="changelocation(document.form2.Channel.options[document.form2.Channel.selectedIndex].value)"
size="1">
<option selected value="">未指定条件</option>
<%
set rs=conn.execute("select channelid,channelname from channel order by channelid asc")
do while not rs.eof
if rs("channelid")=channelid then
%>
<option value='<%=rs("channelid")%>' selected>
<%=rs("channelname")%>
</option>
<%
else
%>
<option value='<%=rs("channelid")%>'>
<%=rs("channelname")%>
</option>
<%
end if
rs.movenext
loop
rs.close
%>
</select>
<select name="Class">
<%
set rs=conn.execute("select classid,classname from class where channelid="&channelid)
do while not rs.eof
if rs("classid")=classid then
%>
<option selected value="<%=rs("classid")%>">
<%=rs("classname")%>
</option>
<%
else
%>
<option value="<%=rs("classid")%>">
<%=rs("classname")%>
</option>
<%
end if
rs.movenext
loop
rs.close
%>
</select>
<font color="red">*</font></td>
</tr>
<tr height="25">
<td width="30%" align="right">
<b>被采集网站名称:</b></td>
<td width="65%">
<input type="text" name="WebName" size="21" value="<%=WebName%>">
<font color="red">*</font></td>
</tr>
<tr height="25">
<td width="30%" align="right">
<b>被采集网站地址:</b></td>
<td width="65%">
<input type="text" name="WebUrl" size="41" value="<%=WebUrl%>">
<font color="red">*</font></td>
</tr>
<tr height="25">
<td width="30%" align="right">
<b>列表索引页面:</b></td>
<td width="65%">
<input type="text" name="ListIndex" size="61" value="<%=ListIndex%>">
<font color="red">*</font><br />
(可以看到所有新闻列表的页面,如<a href="http://www.trfsoft.com/Knowledge.aspx" target="_blank">http://www.trfsoft.com/Knowledge.aspx</a>)
</td>
</tr>
<tr height="25">
<td width="30%" align="right">
<b>是否显示源码:</b></td>
<td width="65%">
<input type="radio" name="ShowCode" value="yes">显示
<input type="radio" name="ShowCode" value="no" checked>
不显示</td>
</tr>
<tr height="25">
<td width="30%" align="right">
</td>
<td width="65%">
<input type="submit" value="下一步" name="B2"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</center>
<%end if%>
<%
if Action="Modify_Project1" then
ProjectName=Trim(Request.Form("ProjectName"))
session("ProjectName")=ProjectName
ChannelID=Trim(Request.Form("Channel"))
ClassID=Trim(Request.Form("Class"))
WebName=Trim(Request.Form("WebName"))
WebUrl=Trim(Request.Form("WebUrl"))
ListIndex=Trim(Request.Form("ListIndex"))
If ListIndex<>"" then
Url=split(ListIndex,"/")
Urlstr=""
For i=0 To Ubound(Url)-1
Urlstr=Urlstr&Url(i)&"/"
Next
session("Urlstr")=Urlstr
weburl=Url(0)&"//"&Url(2)
session("weburl")=weburl
end if
ShowCode=Trim(Request.Form("ShowCode"))
If ProjectName="" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>项目名称不能为空</li>"
End If
If ChannelID="" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>所属频道不能为空</li>"
End If
If ClassID="" 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 ListIndex="" Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>列表索引页面不能为空</li>"
End If
If FoundErr=True then
Call WriteErrMsg(ErrMsg)
Response.end
Else
ListCode=GetHttpPage(ListIndex)
If ListCode="$False$" Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -