📄 admin_mov_filteradd.asp
字号:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
Const PurviewLevel=1
%>
<!--#include file="../conn.asp"-->
<!--#include file="../inc/Function.asp"-->
<!--#include file="Admin_ChkPurview.asp"-->
<!--#include file="Admin_mov_Conn.asp"-->
<!--#include file="Admin_mov_Function.asp"-->
<html>
<head>
<title>电影采集系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="Admin_Style.css">
<SCRIPT language=javascript>
function showset(thisform)
{
if(thisform.FilterType.selectedIndex==1)
{
FilterType1.style.display = "none";
FilterType2.style.display = "";
}
else
{
FilterType1.style.display = "";
FilterType2.style.display = "none";
}
}
</script>
<style type="text/css">
<!--
.style1 {color: #555555}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
<tr class='topbg'>
<td height="22" colspan="2" align="center" ><strong>采 集 系 统 项 目 管 理</strong></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
<tr class="tdbg">
<td width="70" height="30"><strong>管理导航:</strong></td>
<td height="30"><a href="Admin_mov_Filters.asp">管理首页</a> | <a href="Admin_mov_FilterAdd.asp">添加新项目</a></td>
</tr>
</table><br>
<%
Dim stAction,stFoundErr,stErrMsg
Dim FilterName,ItemID,FilterObject,FilterType,FilterContent,FisString,FioString,FilterRep,FilterID,sType,Flag
Dim rrs,SqlItemR
Flag=True
sType=Trim(Request("Type"))
FilterID=Trim(Request("FilterID"))
If sType="modify" then
Set rrs=server.createobject("adodb.recordset")
SqlItemR="Select * from Filters Where FilterID=" & FilterID
rrs.open SqlItemR,ConnItem,1,1
ItemID=rrs("ItemID")
FilterName=rrs("FilterName")
FilterObject=rrs("FilterObject")
FilterType=rrs("FilterType")
FilterContent=rrs("FilterContent")
FisString=rrs("FisString")
FioString=rrs("FioString")
FilterRep=rrs("FilterRep")
Flag=rrs("Flag")
rrs.close
set rrs=nothing
Else
End if
stAction=Trim(Request("Action"))
If stAction="SaveAdd" Then
Call Save()
Else
Call Main()
End If
'关闭数据库链接
Call CloseConn()
Call CloseConn_User()
Call CloseConnItem()
%>
<%Sub Main%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" ><form method="post" action="Admin_mov_FilterAdd.asp" name="form1">
<tr>
<td height="22" colspan="2" class="title"> <div align="center"><strong>添 加 新 过 滤</strong></div></td>
</tr>
<tr class="tdbg">
<td width="150" class="tdbg" align=center><strong> 过滤名称:</strong></td>
<td class="tdbg"><input name="FilterName" type="text" id="FilterName" size="25" maxlength="30" value="<%=FilterName%>"> </td>
</tr>
<tr class="tdbg">
<td width="150" class="tdbg" align=center><strong> 所属项目:</strong></td>
<td class="tdbg"><%Call ShowItem_Option(ItemID)%></td>
</tr>
<tr class="tdbg">
<td width="150" class="tdbg" align=center><strong> 过滤对象:<strong></td>
<td class="tdbg"><select name="FilterObject" id="FilterObject"><option value="1"<%if FilterObject=1 or FilterObject="" then Response.write " selected"%>>标题过滤</option><option value="2"<%if FilterObject=2 then Response.write " selected"%>>正文过滤</option><option value="3"<%if FilterObject=3 then Response.write " selected"%>>地址过滤</option></select></td>
</tr>
<tr class="tdbg">
<td width="150" class="tdbg" align=center><strong> 过滤类型:</strong></td>
<td class="tdbg"><select name="FilterType" id="FilterType" onchange=showset(this.form)><option value="1"<%if FilterType=1 or FilterType="" then Response.write " selected"%> >简单替换</option><option value="2"<%if FilterType=2 then Response.write " selected"%>>高级过滤</option></select></td>
</tr>
<tr class="tdbg" id="FilterType1" style="display:<%if FilterType=2 then Response.write "none"%>">
<td width="150" class="tdbg" align=center><strong> 内容:</strong></td>
<td class="tdbg"><textarea name="FilterContent" cols="49" rows="5"><%=FilterContent%></textarea></td>
</tr>
<tr class="tdbg" id="FilterType2" style="display:<%if FilterType=1 or FilterType="" then Response.write "none"%>">
<td width="150" class="tdbg" align=center><strong> 开始标记:</strong><br><br><br><br><br><strong> 结束标记:</strong></td>
<td class="tdbg">
<textarea name="FisString" cols="49" rows="5"><%=FisString%></textarea><br>
<textarea name="FioString" cols="49" rows="5"><%=FioString%></textarea>
</td>
</tr>
<tr class="tdbg" id="FilterRep">
<td width="150" class="tdbg" align=center><strong> 替换:</strong></td>
<td class="tdbg"><textarea name="FilterRep" cols="49" rows="5"><%=FilterRep%></textarea> </td>
</tr>
<tr class='tdbg'>
<td align='center' width="150"><b>是否启用:</b></td><td> <input name='Flag' type='checkbox' id='Flag' value='Yes'<%if Flag<>False then response.write "Checked"%>></td>
</tr>
<tr class="tdbg">
<td colspan="2" align="center" class="tdbg"><input name="FilterID" type="hidden" id="FilterID" value="<%=FilterID%>"><input name="Action" type="hidden" id="Action" value="SaveAdd"><input type="submit" name="Submit" value="确 定" > <input name="Cancel" type="button" id="Cancel" value="取 消" onClick="window.location.href='Admin_mov_Filters.asp'"></td>
</tr>
</form>
</table>
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="border" >
<tr>
<td colspan='2' height="20" align="center">该插件修改自亿翔网提供的采集插件,修改作者QQ:271513820</td>
</tr>
</table>
</body>
</html>
<%End Sub%>
<%
Sub Save()
Dim SqlItem,RsItem
Dim FilterName,ItemID,FilterObject,FilterType,FilterContent,FisString,FioString,FilterRep,Flag
FilterName=Trim(Request.Form("FilterName"))
ItemID=Trim(Request.Form("ItemID"))
FilterObject=Request.Form("FilterObject")
FilterType=Clng(Request.Form("FilterType"))
FilterContent=Request.Form("FilterContent")
FisString=Request.Form("FisString")
FioString=Request.Form("FioString")
FilterRep=Request.Form("FilterRep")
Flag=Request.Form("Flag")
If FilterName="" Then
stFoundErr=True
stErrMsg=stErrMsg & "<br><li>过滤名称不能为空</li>"
End If
If ItemID="" Then
stFoundErr=True
stErrMsg=stErrMsg & "<br><li>请选择过滤所属项目</li>"
Else
ItemID=Clng(ItemID)
If ItemID="" Then
stFoundErr=True
stErrMsg=stErrMsg & "<br><li>请选择过滤所属项目</li>"
End If
End If
If FilterObject="" Then
stFoundErr=True
stErrMsg=stErrMsg & "<br><li>请选择过滤对象</li>"
Else
FilterObject=Clng(FilterObject)
End If
If FilterType="" Then
stFoundErr=True
stErrMsg=stErrMsg & "<br><li>请选择过滤类型</li>"
Else
FilterType=Clng(FilterType)
If FilterType=1 Then
If FilterContent="" Then
stFoundErr=True
stErrMsg=stErrMsg & "<br><li>过滤的内容不能为空</li>"
End If
ElseIf FilterType=2 Then
If FisString="" or FioString="" Then
stFoundErr=True
stErrMsg=stErrMsg & "<br><li>开始/结束标记不能为空</li>"
End If
Else
stFoundErr=True
stErrMsg=stErrMsg & "<br><li>参数错误,请从有效链接进入</li>"
End If
End If
If stFoundErr<>True Then
SqlItem ="select top 1 * from Filters"
if FilterID<>"" then
SqlItem=SqlItem&" where FilterID="&FilterID&""
End if
Set RsItem=server.CreateObject("adodb.recordset")
RsItem.open SqlItem,ConnItem,1,3
if FilterID="" then
RsItem.AddNew
End if
RsItem("FilterName")=FilterName
RsItem("ItemID")=ItemID
RsItem("FilterObject")=FilterObject
RsItem("FilterType")=FilterType
If FilterType=1 Then
RsItem("FilterContent")=FilterContent
ElseIf FilterType=2 Then
RsItem("FisString")=FisString
RsItem("FioString")=FioString
End If
RsItem("FilterRep")=FilterRep
if Flag="Yes" then
RsItem("Flag")=True
Else
RsItem("Flag")=False
End if
RsItem.Update
RsItem.Close
Set RsItem=Nothing
Response.Redirect "Admin_mov_Filters.asp"
Else
Response.write stErrmsg
Call WriteErrMsg()
End If
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -