Site.asp
资源名称:eat.rar [点击查看]
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:17k
源码类别:
数据库编程
开发平台:
ASP/ASPX
- <!--#include file="../../FS_Inc/Const.asp" -->
- <!--#include file="../../FS_Inc/Function.asp"-->
- <!--#include file="inc/Function.asp"-->
- <!--#include file="../../FS_InterFace/MF_Function.asp" -->
- <%
- Dim Conn,CollectConn
- MF_Default_Conn
- MF_Collect_Conn
- MF_Session_TF
- Dim Rs
- if Request("Action") = "Del" then
- if Request("id") <> "" then
- CollectConn.Execute("delete from FS_Site where ID in (" & Replace(Request("id"),"***",",") & ")")
- end If
- if Request("SiteFolderID") <> "" then
- CollectConn.Execute("delete from FS_SiteFolder where ID in (" & Replace(Request("SiteFolderID"),"***",",") & ")")
- end if
- Response.Redirect("site.asp")
- Response.End
- elseif Request("Action") = "Lock" then
- if Request("LockID") <> "" then
- CollectConn.Execute("Update FS_Site Set IsLock=1 where ID in (" & Replace(Request("LockID"),"***",",") & ")")
- Response.Redirect("site.asp")
- Response.End
- end if
- elseif Request("Action") = "UNLock" then
- if Request("LockID") <> "" then
- CollectConn.Execute("Update FS_Site Set IsLock=0 where ID in (" & Replace(Request("LockID"),"***",",") & ")")
- Response.Redirect("site.asp")
- Response.End
- end if
- end if
- if Request.Form("vs")="add" then
- if Request.Form("SiteName")="" or Request.Form("objURL")="" then
- Response.write"<script>alert(""请填写完整!"");location.href=""javascript:history.back()"";</script>"
- Response.end
- end if
- Dim Sql
- Set Rs = Server.CreateObject ("ADODB.RecordSet")
- Sql = "Select * from FS_Site where 1=0"
- Rs.Open Sql,CollectConn,1,3
- Rs.AddNew
- Rs("SiteName") = Request.Form("SiteName")
- Rs("objURL") = Request.Form("objURL")
- Rs("folder") = Request.Form("SiteFolder")
- if Request.Form("IsIFrame") = "1" then
- Rs("IsIFrame") = True
- else
- Rs("IsIFrame") = False
- end if
- if Request.Form("IsReverse") = "1" then
- Rs("IsReverse") = 1
- else
- Rs("IsReverse") = 0
- end if
- if Request.Form("IsScript") = "1" then
- Rs("IsScript") = True
- else
- Rs("IsScript") = False
- end if
- if Request.Form("IsClass") = "1" then
- Rs("IsClass") = True
- else
- Rs("IsClass") = False
- end if
- if Request.Form("IsFont") = "1" then
- Rs("IsFont") = True
- else
- Rs("IsFont") = False
- end if
- if Request.Form("IsSpan") = "1" then
- Rs("IsSpan") = True
- else
- Rs("IsSpan") = False
- end if
- if Request.Form("IsObject") = "1" then
- Rs("IsObject") = True
- else
- Rs("IsObject") = False
- end if
- if Request.Form("IsStyle") = "1" then
- Rs("IsStyle") = True
- else
- Rs("IsStyle") = False
- end if
- if Request.Form("IsDiv") = "1" then
- Rs("IsDiv") = True
- else
- Rs("IsDiv") = False
- end if
- if Request.Form("IsA") = "1" then
- Rs("IsA") = True
- else
- Rs("IsA") = False
- end if
- if Request.Form("Audit") = "1" then
- Rs("Audit") = True
- else
- Rs("Audit") = False
- end if
- if Request.Form("TextTF") = "1" then
- Rs("TextTF") = True
- else
- Rs("TextTF") = False
- end if
- if Request.Form("SaveRemotePic") = "1" then
- Rs("SaveRemotePic") = True
- else
- Rs("SaveRemotePic") = False
- end if
- if Request.Form("Islock") <> "" then
- Rs("Islock") = True
- else
- Rs("Islock") = False
- end if
- Rs.UpDate
- Rs.Close
- Set Rs = Nothing
- Set CollectConn = Nothing
- Response.Redirect("Site.asp")
- Response.End
- elseif Request("vs")="addfolder" then
- Dim SiteFolder,SiteFolderDetail,SqlStr
- SiteFolder = Request.Form("SiteFolder")
- SiteFolderDetail = Request.Form("SiteFolderDetail")
- If SiteFolder = "" or SiteFolderDetail = "" Then
- Response.write"<script>alert(""请填写完整!"");location.href=""javascript:history.back()"";</script>"
- Response.end
- End If
- Set Rs = Server.CreateObject ("ADODB.RecordSet")
- if Request("SiteFolderID") <> "" then
- SqlStr = "Select * from FS_SiteFolder where ID=" & Request("SiteFolderID")
- else
- SqlStr = "Select * from FS_SiteFolder where 1=0"
- end if
- Rs.Open SqlStr,CollectConn,1,3
- Rs.AddNew
- Rs("SiteFolder") = SiteFolder
- Rs("SiteFolderDetail") = SiteFolderDetail
- Rs.UpDate
- Rs.Close
- Set Rs = Nothing
- Set Conn = Nothing
- Set CollectConn = Nothing
- Response.Redirect("Site.asp")
- Response.end
- elseif Request("vs")="Copy" then
- Dim SiteID,SiteFolderID,RsCopySourceObj,RsCopyObjectObj,FiledObj
- SiteID = Request("SiteID")
- SiteFolderID = Request("SiteFolderID")
- if SiteID <> "" then
- Set RsCopySourceObj = CollectConn.Execute("Select * from FS_Site where ID in (" & Replace(SiteID,"***",",") & ")")
- do while Not RsCopySourceObj.Eof
- Set RsCopyObjectObj = Server.CreateObject("ADODB.RecordSet")
- RsCopyObjectObj.Open "Select * from FS_Site where 1=0",CollectConn,3,3
- RsCopyObjectObj.AddNew
- For Each FiledObj In RsCopyObjectObj.Fields
- if LCase(FiledObj.name) <> "id" then
- RsCopyObjectObj(FiledObj.name) = RsCopySourceObj(FiledObj.name)
- end if
- Next
- RsCopyObjectObj.Update
- RsCopySourceObj.MoveNext
- Loop
- Set RsCopySourceObj = Nothing
- Set RsCopyObjectObj = Nothing
- end If
- if SiteFolderID <> "" then
- Set RsCopySourceObj = CollectConn.Execute("Select * from FS_SiteFolder where ID in (" & Replace(SiteFolderID,"***",",") & ")")
- do while Not RsCopySourceObj.Eof
- Set RsCopyObjectObj = Server.CreateObject("ADODB.RecordSet")
- RsCopyObjectObj.Open "Select * from FS_SiteFolder where 1=0",CollectConn,3,3
- RsCopyObjectObj.AddNew
- For Each FiledObj In RsCopyObjectObj.Fields
- if LCase(FiledObj.name) <> "id" then
- RsCopyObjectObj(FiledObj.name) = RsCopySourceObj(FiledObj.name)
- end if
- Next
- RsCopyObjectObj.Update
- RsCopySourceObj.MoveNext
- Loop
- Set RsCopySourceObj = Nothing
- Set RsCopyObjectObj = Nothing
- end if
- Set CollectConn = Nothing
- Response.Redirect("Site.asp")
- Response.end
- end if
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>修改新闻</title>
- </head>
- <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
- <script language="JavaScript" src="js/PublicJS.js"></script>
- <body leftmargin="2" topmargin="2">
- <%
- if Request("Action") = "Addsite" then
- Call Add()
- ElseIf Request("Action") = "Addsitefolder" Then
- Call AddFolder()
- ElseIf Request("Action") = "SubFolder" Then
- Call Main(Request("FolderID"))
- Else
- Call Main("0")
- end if
- Sub Main(f_FolderID)
- if f_FolderID = "" then f_FolderID = "0"
- Session("SessionReturnValue") = ""
- %>
- <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
- <tr class="hback">
- <td height="26" colspan="5" valign="middle">
- <table width="100%" height="20" border="0" cellpadding="5" cellspacing="1">
- <tr>
- <td width=55 align="center" alt="添加采集栏目" style="cursor:hand" onClick="location='?Action=Addsitefolder';" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">新建栏目</td>
- <td width=2 class="Gray">|</td>
- <td width=55 align="center" alt="添加采集站点" style="cursor:hand" onClick="location='?Action=Addsite';" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">新建站点</td>
- <td width=2 class="Gray">|</td>
- <td width=35 align="center" alt="后退" style="cursor:hand" onClick="history.back();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">后退</td>
- <td> </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
- <tr class="xingmu">
- <td width="50%" height="26" nowrap bgcolor="#FFFFFF" class="xingmu">
- <div align="center">名称</div></td>
- <td width="6%" height="26" nowrap bgcolor="#FFFFFF" class="xingmu">
- <div align="center">状态</div></td>
- <td width="10%" height="26" bgcolor="#FFFFFF" class="xingmu" nowrap>
- <div align="center">采集对象页</div></td>
- <td height="26" nowrap class="xingmu">
- <div align="center">操作</div></td>
- </tr>
- <%
- if f_FolderID = "0" then
- Dim RsSite,SiteSql,CheckInfo
- Dim RsSiteFolder
- Set RsSiteFolder = CollectConn.Execute("select * from FS_SiteFolder where 1=1 order by id DESC")
- Do While not RsSiteFolder.EOF
- %>
- <tr class="hback">
- <td height="26" nowrap><table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><img src="images/folder.gif" width="16" height="16"></td>
- <td nowrap><%= RsSiteFolder("SiteFolder")%></td>
- </tr>
- </table></td>
- <td nowrap><div align="center"> </div></td>
- <td nowrap><div align="center"> </div></td>
- <td nowrap><div align="center"><span style="cursor:hand;" onClick="if (confirm('确定要复制吗?')){location='Site.asp?vs=Copy&SiteFolderID=<% = RsSiteFolder("ID") %>';}">复制</span> <span style="cursor:hand;" onClick="if (confirm('确定要修改吗?')){location='?Action=Addsitefolder&SiteFolderID=<% = RsSiteFolder("ID") %>';}">属性</span> <span style="cursor:hand;" onClick="if (confirm('确定要删除吗?')){location='?action=Del&SiteFolderID=<% = RsSiteFolder("ID") %>';}">删除</span> <span style="cursor:hand;" onClick="location='site.asp?Action=SubFolder&FolderID=<% =RsSiteFolder("ID") %>'">进入</span></div></td>
- </tr>
- <%
- RsSiteFolder.MoveNext
- Loop
- Set RsSiteFolder = Nothing
- else
- %>
- <tr class="hback">
- <td height="26" colspan="4" nowrap><img src="images/folder.gif" width="16" height="16">
- <a href="Site.asp">返回上一级</a> </td>
- </tr>
- <%
- end if
- Dim IsCollect,RsTempObj,CollectPromptInfo
- Set RsSite = Server.CreateObject ("ADODB.RecordSet")
- SiteSql="Select * from FS_Site where folder=" & f_FolderID & " order by id desc"
- RsSite.Open SiteSql,CollectConn,1,1
- Do While not RsSite.eof
- if RsSite("LinkHeadSetting") <> "" And RsSite("LinkFootSetting") <> "" And RsSite("PagebodyHeadSetting") <> "" And RsSite("PagebodyFootSetting") <> "" And RsSite("PageTitleHeadSetting") <> "" And RsSite("PageTitleFootSetting") <> "" then
- if RsSite("IsLock") = True then
- IsCollect = False
- CollectPromptInfo = "站点已经被锁定,不能采集"
- else
- IsCollect = True
- CollectPromptInfo = "可以采集,请检查是否设置正确,否则不能进行采集"
- end if
- else
- IsCollect = False
- CollectPromptInfo = "不能采集,请把匹配规则设置完整"
- end if
- %>
- <tr title="<% = CollectPromptInfo %>" class="hback">
- <td height="26" nowrap><table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><img src="images/SiteSet.gif" width="23" height="22"></td>
- <td nowrap><% = RsSite("SiteName") %></td>
- </tr>
- </table></td>
- <td nowrap><div align="center">
- <%
- if RsSite("IsLock") = True then
- Response.Write("锁定")
- ElseIf IsCollect = False Then
- Response.Write("无效")
- else
- Response.Write("有效")
- end if
- %>
- </div></td>
- <td nowrap><div align="center"><a href="<% = RsSite("objURL") %>" target="_blank"><img src="Images/objpage.gif" alt="点击访问" width="20" height="20" border="0"></a></div></td>
- <td nowrap><div align="center"><span style="cursor:hand;" onClick="if (confirm('确定要复制吗?')){location='Site.asp?vs=Copy&SiteID=<% = RsSite("ID") %>';}">复制</span> <span style="cursor:hand;" onClick="location='Sitemodify.asp?SiteID=<% = RsSite("ID") %>'">属性</span> <span style="cursor:hand;" onClick="if (confirm('确定要删除吗?')){location='?action=Del&Id=<% = RsSite("ID") %>';}">删除</span> <span style="cursor:hand;" onClick="if (confirm('确定要修改吗?')){location='SitemodifyOne.asp?SiteID=<% = RsSite("ID") %>';}">向导</span><% if IsCollect = true then %> <span onClick="StartOneSiteCollect('<% = RsSite("Id") %>');" style="cursor:hand;">采集</span><% end if %></div></td>
- </tr>
- <%
- RsSite.MoveNext
- loop
- %>
- </table>
- <%
- RsSite.close
- Set RsSite = Nothing
- end Sub
- Sub Add()
- %>
- <form name="AddSiteForm" method="post" action="">
- <table width="98%" height="20" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
- <tr>
- <td width=35 align="center" alt="保存" style="cursor:hand" onClick="document.AddSiteForm.submit();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">保存</td>
- <td width=35 align="center" alt="后退" style="cursor:hand" onClick="history.back();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">后退</td>
- <td>
- <input name="vs" type="hidden" id="vs2" value="add"> </td>
- </tr>
- </table>
- <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1">
- <tr class="hback">
- <td width="100" height="26"><div align="center">采集站点名称</div></td>
- <td><input name="SiteName" style="width:100%;" type="text" id="SiteName2"></td>
- </tr>
- <tr class="hback">
- <td height="26"><div align="center">采集站点分类</div></td>
- <td><select name="SiteFolder" style="width:100%;" id="SiteFolder">
- <option value="0">根栏目</option>
- <% = FolderList() %>
- </select></td>
- </tr>
- <tr class="hback">
- <td height="26"><div align="center">采集对象页</div></td>
- <td><input style="width:100%;" name="objURL" type="text" id="objURL" value="http://"></td>
- </tr>
- <tr class="hback">
- <td height="26"><div align="center">采集参数</div></td>
- <td>锁定
- <input name="islock" type="checkbox" id="islock" value="1">
- 保存远程图片
- <input type="checkbox" name="SaveRemotePic" value="1">
- 新闻是否已经审核
- <input name="Audit" type="checkbox" value="1" checked>
- 是否倒序采集
- <input name="IsReverse" type="checkbox" id="IsReverse" value="1"></td>
- </tr>
- <tr class="hback">
- <td height="26"><div align="center">过滤选项</div></td>
- <td>HTML
- <input type="checkbox" name="TextTF" value="1">
- STYLE
- <input type="checkbox" name="IsStyle" value="1">
- DIV
- <input type="checkbox" name="IsDiv" value="1">
- A
- <input type="checkbox" name="IsA" value="1">
- CLASS
- <input type="checkbox" name="IsClass" value="1">
- FONT
- <input type="checkbox" name="IsFont" value="1">
- SPAN
- <input type="checkbox" name="IsSpan" value="1">
- OBJECT
- <input type="checkbox" name="IsObject" value="1">
- IFRAME
- <input type="checkbox" name="IsIFrame" value="1">
- SCRIPT
- <input type="checkbox" name="IsScript" value="1">
- </td>
- </tr>
- </table>
- </form>
- <% End Sub
- Sub AddFolder()
- %>
- <form name="AddSiteFolderForm" method="post" action="">
- <table width="98%" height="20" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
- <tr class="hback">
- <td width=35 style="cursor:hand" align="center" alt="保存" onClick="document.AddSiteFolderForm.submit();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">保存</td>
- <td width=35 style="cursor:hand" align="center" alt="后退" onClick="history.back();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">后退</td>
- <td>
- <input name="vs" type="hidden" id="vs2" value="addfolder">
- <input type="hidden" name="SiteFolderID" value="<% = SiteFolderID %>"> </td>
- </tr>
- </table>
- <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
- <%
- Dim SiteFolderID,RsSiteFolder
- SiteFolderID = Request("SiteFolderID")
- If SiteFolderID<>"" Then
- Set RsSiteFolder = CollectConn.Execute("select * from FS_SiteFolder where ID=" & SiteFolderID)
- If RsSiteFolder.EOF Then
- Response.write "<script>alert('该栏目不存在!');history.back();</script>"
- Response.End
- End If
- %>
- <tr class="hback">
- <td width="100" height="26"><div align="center">栏目名称:</div></td>
- <td><input style="width:100%" type="text" name="SiteFolder" value="<%=RsSiteFolder("SiteFolder")%>"></td>
- </tr>
- <tr class="hback">
- <td width="100" height="26"><div align="center">栏目说明:</div></td>
- <td><textarea style="width:100%" name="SiteFolderDetail" rows="10"><%=RsSiteFolder("SiteFolderDetail")%></textarea></td>
- </tr>
- <%
- Else
- %>
- <tr class="hback">
- <td width="100" height="26"><div align="center">栏目名称:</div></td>
- <td><input style="width:100%" type="text" name="SiteFolder"></td>
- </tr>
- <tr class="hback">
- <td width="100" height="26"><div align="center">栏目说明:</div></td>
- <td><textarea style="width:100%" name="SiteFolderDetail" rows="10"></textarea></td>
- </tr>
- <%
- End If
- %>
- </table>
- </form>
- <% End Sub %>
- </body>
- </html>
- <%
- Function FolderList()
- Dim FolderListObj,StrSelected
- Set FolderListObj = Collectconn.Execute("Select * from FS_SiteFolder where 1=1 order by ID desc")
- do while Not FolderListObj.Eof
- If CInt(Request("FolderID"))=FolderListObj("ID") Then
- StrSelected="selected"
- Else
- StrSelected=""
- End If
- FolderList = FolderList & "<option value="&FolderListObj("ID")&" " & StrSelected & "> |--" & FolderListObj("SiteFolder") & "</option><br>"
- FolderListObj.MoveNext
- loop
- FolderListObj.Close
- Set FolderListObj = Nothing
- End Function
- Set CollectConn = Nothing
- %>
- <script language="JavaScript">
- function InsertScript()
- {
- var ReturnValue='';
- ReturnValue=showModalDialog("NewsNum.asp",window,'dialogWidth:260pt;dialogHeight:120pt;status:no;help:no;scroll:no;');
- return ReturnValue;
- }
- function StartOneSiteCollect(ID)
- {
- Num = InsertScript();
- if (Num!='back'&& Num!='0')
- {
- if (Num==""||Num==null) Num="allNews"
- location='Collecting.asp?SiteID='+ID+'&Num='+Num;
- }
- }
- </script>