Site.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:17k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <!--#include file="../../FS_Inc/Const.asp" -->
  2. <!--#include file="../../FS_Inc/Function.asp"-->
  3. <!--#include file="inc/Function.asp"-->
  4. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  5. <%
  6. Dim Conn,CollectConn
  7. MF_Default_Conn
  8. MF_Collect_Conn
  9. MF_Session_TF
  10. Dim Rs
  11. if Request("Action") = "Del" then
  12. if Request("id") <> "" then
  13. CollectConn.Execute("delete from FS_Site where ID in (" & Replace(Request("id"),"***",",") & ")")
  14. end If
  15. if Request("SiteFolderID") <> "" then
  16. CollectConn.Execute("delete from FS_SiteFolder where ID in (" & Replace(Request("SiteFolderID"),"***",",") & ")")
  17. end if
  18. Response.Redirect("site.asp")
  19. Response.End
  20. elseif Request("Action") = "Lock" then
  21. if Request("LockID") <> "" then
  22. CollectConn.Execute("Update FS_Site Set IsLock=1 where ID in (" & Replace(Request("LockID"),"***",",") & ")")
  23. Response.Redirect("site.asp")
  24. Response.End
  25. end if
  26. elseif Request("Action") = "UNLock" then
  27. if Request("LockID") <> "" then
  28. CollectConn.Execute("Update FS_Site Set IsLock=0 where ID in (" & Replace(Request("LockID"),"***",",") & ")")
  29. Response.Redirect("site.asp")
  30. Response.End
  31. end if
  32. end if
  33. if Request.Form("vs")="add" then
  34.     if Request.Form("SiteName")="" or Request.Form("objURL")="" then
  35. Response.write"<script>alert(""请填写完整!"");location.href=""javascript:history.back()"";</script>"
  36. Response.end
  37. end if
  38.     Dim Sql
  39. Set Rs = Server.CreateObject ("ADODB.RecordSet")
  40. Sql = "Select * from FS_Site where 1=0"
  41. Rs.Open Sql,CollectConn,1,3
  42. Rs.AddNew
  43. Rs("SiteName") = Request.Form("SiteName")
  44. Rs("objURL") = Request.Form("objURL")
  45. Rs("folder") = Request.Form("SiteFolder")
  46. if Request.Form("IsIFrame") = "1" then
  47. Rs("IsIFrame") = True
  48. else
  49. Rs("IsIFrame") = False
  50. end if
  51. if Request.Form("IsReverse") = "1" then
  52. Rs("IsReverse") = 1
  53. else
  54. Rs("IsReverse") = 0
  55. end if
  56. if Request.Form("IsScript") = "1" then
  57. Rs("IsScript") = True
  58. else
  59. Rs("IsScript") = False
  60. end if
  61. if Request.Form("IsClass") = "1" then
  62. Rs("IsClass") = True
  63. else
  64. Rs("IsClass") = False
  65. end if
  66. if Request.Form("IsFont") = "1" then
  67. Rs("IsFont") = True
  68. else
  69. Rs("IsFont") = False
  70. end if
  71. if Request.Form("IsSpan") = "1" then
  72. Rs("IsSpan") = True
  73. else
  74. Rs("IsSpan") = False
  75. end if
  76. if Request.Form("IsObject") = "1" then
  77. Rs("IsObject") = True
  78. else
  79. Rs("IsObject") = False
  80. end if
  81. if Request.Form("IsStyle") = "1" then
  82. Rs("IsStyle") = True
  83. else
  84. Rs("IsStyle") = False
  85. end if
  86. if Request.Form("IsDiv") = "1" then
  87. Rs("IsDiv") = True
  88. else
  89. Rs("IsDiv") = False
  90. end if
  91. if Request.Form("IsA") = "1" then
  92. Rs("IsA") = True
  93. else
  94. Rs("IsA") = False
  95. end if
  96. if Request.Form("Audit") = "1" then
  97. Rs("Audit") = True
  98. else
  99. Rs("Audit") = False
  100. end if
  101. if Request.Form("TextTF") = "1" then
  102. Rs("TextTF") = True
  103. else
  104. Rs("TextTF") = False
  105. end if
  106. if Request.Form("SaveRemotePic") = "1" then
  107. Rs("SaveRemotePic") = True
  108. else
  109. Rs("SaveRemotePic") = False
  110. end if
  111. if Request.Form("Islock") <> "" then
  112. Rs("Islock") = True
  113. else
  114. Rs("Islock") = False
  115. end if
  116. Rs.UpDate
  117. Rs.Close
  118. Set Rs = Nothing
  119. Set CollectConn = Nothing
  120. Response.Redirect("Site.asp")
  121. Response.End
  122. elseif Request("vs")="addfolder" then
  123. Dim SiteFolder,SiteFolderDetail,SqlStr
  124. SiteFolder = Request.Form("SiteFolder")
  125. SiteFolderDetail = Request.Form("SiteFolderDetail")
  126. If SiteFolder = "" or SiteFolderDetail = "" Then
  127. Response.write"<script>alert(""请填写完整!"");location.href=""javascript:history.back()"";</script>"
  128. Response.end
  129. End If
  130. Set Rs = Server.CreateObject ("ADODB.RecordSet")
  131. if Request("SiteFolderID") <> "" then
  132. SqlStr = "Select * from FS_SiteFolder where ID=" & Request("SiteFolderID")
  133. else
  134. SqlStr = "Select * from FS_SiteFolder where 1=0"
  135. end if
  136. Rs.Open SqlStr,CollectConn,1,3
  137. Rs.AddNew
  138. Rs("SiteFolder") = SiteFolder
  139. Rs("SiteFolderDetail") = SiteFolderDetail
  140. Rs.UpDate
  141. Rs.Close
  142. Set Rs = Nothing
  143. Set Conn = Nothing
  144. Set CollectConn = Nothing
  145. Response.Redirect("Site.asp")
  146. Response.end
  147. elseif Request("vs")="Copy" then
  148. Dim SiteID,SiteFolderID,RsCopySourceObj,RsCopyObjectObj,FiledObj
  149. SiteID = Request("SiteID")
  150. SiteFolderID = Request("SiteFolderID")
  151. if SiteID <> "" then
  152. Set RsCopySourceObj = CollectConn.Execute("Select * from FS_Site where ID in (" & Replace(SiteID,"***",",") & ")")
  153. do while Not RsCopySourceObj.Eof
  154. Set RsCopyObjectObj = Server.CreateObject("ADODB.RecordSet")
  155. RsCopyObjectObj.Open "Select * from FS_Site where 1=0",CollectConn,3,3
  156. RsCopyObjectObj.AddNew
  157. For Each FiledObj In RsCopyObjectObj.Fields
  158. if LCase(FiledObj.name) <> "id" then
  159. RsCopyObjectObj(FiledObj.name) = RsCopySourceObj(FiledObj.name)
  160. end if
  161. Next
  162. RsCopyObjectObj.Update
  163. RsCopySourceObj.MoveNext
  164. Loop
  165. Set RsCopySourceObj = Nothing
  166. Set RsCopyObjectObj = Nothing
  167. end If
  168. if SiteFolderID <> "" then
  169. Set RsCopySourceObj = CollectConn.Execute("Select * from FS_SiteFolder where ID in (" & Replace(SiteFolderID,"***",",") & ")")
  170. do while Not RsCopySourceObj.Eof
  171. Set RsCopyObjectObj = Server.CreateObject("ADODB.RecordSet")
  172. RsCopyObjectObj.Open "Select * from FS_SiteFolder where 1=0",CollectConn,3,3
  173. RsCopyObjectObj.AddNew
  174. For Each FiledObj In RsCopyObjectObj.Fields
  175. if LCase(FiledObj.name) <> "id" then
  176. RsCopyObjectObj(FiledObj.name) = RsCopySourceObj(FiledObj.name)
  177. end if
  178. Next
  179. RsCopyObjectObj.Update
  180. RsCopySourceObj.MoveNext
  181. Loop
  182. Set RsCopySourceObj = Nothing
  183. Set RsCopyObjectObj = Nothing
  184. end if
  185. Set CollectConn = Nothing
  186. Response.Redirect("Site.asp")
  187. Response.end
  188. end if
  189. %>
  190. <html>
  191. <head>
  192. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  193. <title>修改新闻</title>
  194. </head>
  195. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  196. <script language="JavaScript" src="js/PublicJS.js"></script>
  197. <body leftmargin="2" topmargin="2">
  198. <%
  199. if Request("Action") = "Addsite" then
  200. Call Add()
  201. ElseIf Request("Action") = "Addsitefolder" Then
  202. Call AddFolder()
  203. ElseIf Request("Action") = "SubFolder" Then
  204. Call Main(Request("FolderID"))
  205. Else
  206. Call Main("0")
  207. end if
  208. Sub Main(f_FolderID)
  209. if f_FolderID = "" then f_FolderID = "0"
  210. Session("SessionReturnValue") = ""
  211. %>
  212. <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  213. <tr class="hback">
  214. <td height="26" colspan="5" valign="middle">
  215. <table width="100%" height="20" border="0" cellpadding="5" cellspacing="1">
  216. <tr>
  217. <td width=55 align="center" alt="添加采集栏目" style="cursor:hand" onClick="location='?Action=Addsitefolder';" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">新建栏目</td>
  218. <td width=2 class="Gray">|</td>
  219. <td width=55 align="center" alt="添加采集站点" style="cursor:hand" onClick="location='?Action=Addsite';" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">新建站点</td>
  220. <td width=2 class="Gray">|</td>
  221. <td width=35 align="center" alt="后退" style="cursor:hand" onClick="history.back();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">后退</td>
  222. <td>&nbsp;</td>
  223. </tr>
  224.   </table>
  225. </td>
  226. </tr>
  227. </table>
  228. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  229.   <tr class="xingmu"> 
  230.     <td width="50%" height="26" nowrap bgcolor="#FFFFFF" class="xingmu"> 
  231.       <div align="center">名称</div></td>
  232.     <td width="6%" height="26" nowrap bgcolor="#FFFFFF" class="xingmu"> 
  233.       <div align="center">状态</div></td>
  234.     <td width="10%" height="26" bgcolor="#FFFFFF" class="xingmu" nowrap> 
  235.       <div align="center">采集对象页</div></td>
  236.     <td height="26" nowrap class="xingmu">
  237. <div align="center">操作</div></td>
  238.   </tr>
  239.   <%
  240. if f_FolderID = "0" then
  241. Dim RsSite,SiteSql,CheckInfo
  242. Dim RsSiteFolder
  243. Set RsSiteFolder = CollectConn.Execute("select * from FS_SiteFolder where 1=1 order by id DESC")
  244. Do While not RsSiteFolder.EOF
  245. %>
  246.   <tr class="hback"> 
  247.     <td height="26" nowrap><table border="0" cellspacing="0" cellpadding="0">
  248.         <tr> 
  249.           <td><img src="images/folder.gif" width="16" height="16"></td>
  250.           <td nowrap><%= RsSiteFolder("SiteFolder")%></td>
  251.         </tr>
  252.       </table></td>
  253.     <td nowrap><div align="center"> &nbsp; </div></td>
  254.     <td nowrap><div align="center"> &nbsp; </div></td>
  255.     <td nowrap><div align="center"><span style="cursor:hand;" onClick="if (confirm('确定要复制吗?')){location='Site.asp?vs=Copy&SiteFolderID=<% = RsSiteFolder("ID") %>';}">复制</span>&nbsp;&nbsp;<span style="cursor:hand;" onClick="if (confirm('确定要修改吗?')){location='?Action=Addsitefolder&SiteFolderID=<% = RsSiteFolder("ID") %>';}">属性</span>&nbsp;&nbsp;<span style="cursor:hand;" onClick="if (confirm('确定要删除吗?')){location='?action=Del&SiteFolderID=<% = RsSiteFolder("ID") %>';}">删除</span>&nbsp;&nbsp;<span style="cursor:hand;" onClick="location='site.asp?Action=SubFolder&FolderID=<% =RsSiteFolder("ID") %>'">进入</span></div></td>
  256.   </tr>
  257.   <%
  258. RsSiteFolder.MoveNext
  259. Loop
  260. Set RsSiteFolder = Nothing
  261. else
  262. %>
  263.   <tr class="hback"> 
  264.     <td height="26" colspan="4" nowrap><img src="images/folder.gif" width="16" height="16"> 
  265.       <a href="Site.asp">返回上一级</a> </td>
  266.   </tr>
  267. <%
  268. end if
  269. Dim IsCollect,RsTempObj,CollectPromptInfo
  270. Set RsSite = Server.CreateObject ("ADODB.RecordSet")
  271. SiteSql="Select * from FS_Site where folder=" & f_FolderID & " order by id desc"
  272. RsSite.Open SiteSql,CollectConn,1,1
  273. Do While not RsSite.eof
  274. if  RsSite("LinkHeadSetting") <> "" And  RsSite("LinkFootSetting") <> "" And RsSite("PagebodyHeadSetting") <> "" And  RsSite("PagebodyFootSetting") <> "" And  RsSite("PageTitleHeadSetting") <> "" And  RsSite("PageTitleFootSetting") <> "" then
  275. if RsSite("IsLock") = True then
  276. IsCollect = False
  277. CollectPromptInfo = "站点已经被锁定,不能采集"
  278. else
  279. IsCollect = True
  280. CollectPromptInfo = "可以采集,请检查是否设置正确,否则不能进行采集"
  281. end if
  282. else
  283. IsCollect = False
  284. CollectPromptInfo = "不能采集,请把匹配规则设置完整"
  285. end if
  286. %>
  287.   <tr title="<% = CollectPromptInfo %>" class="hback"> 
  288.     <td height="26" nowrap><table border="0" cellspacing="0" cellpadding="0">
  289.         <tr> 
  290.           <td><img src="images/SiteSet.gif" width="23" height="22"></td>
  291.           <td nowrap><% = RsSite("SiteName") %></td>
  292.         </tr>
  293.       </table></td>
  294.     <td nowrap><div align="center"> 
  295.         <%
  296. if RsSite("IsLock") = True then
  297. Response.Write("锁定")
  298. ElseIf IsCollect = False Then
  299. Response.Write("无效")
  300. else
  301. Response.Write("有效")
  302. end if
  303. %>
  304.       </div></td>
  305.     <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>
  306.     <td nowrap><div align="center"><span style="cursor:hand;" onClick="if (confirm('确定要复制吗?')){location='Site.asp?vs=Copy&SiteID=<% = RsSite("ID") %>';}">复制</span>&nbsp;&nbsp;<span style="cursor:hand;" onClick="location='Sitemodify.asp?SiteID=<% = RsSite("ID") %>'">属性</span>&nbsp;&nbsp;<span style="cursor:hand;" onClick="if (confirm('确定要删除吗?')){location='?action=Del&Id=<% = RsSite("ID") %>';}">删除</span>&nbsp;&nbsp;<span style="cursor:hand;" onClick="if (confirm('确定要修改吗?')){location='SitemodifyOne.asp?SiteID=<% = RsSite("ID") %>';}">向导</span><% if IsCollect = true then %>&nbsp;&nbsp;<span onClick="StartOneSiteCollect('<% = RsSite("Id") %>');" style="cursor:hand;">采集</span><% end if %></div></td>
  307.   </tr>
  308.   <%
  309. RsSite.MoveNext
  310. loop
  311. %>
  312. </table>
  313. <%
  314. RsSite.close
  315. Set RsSite = Nothing
  316. end Sub
  317. Sub Add()
  318. %>
  319. <form name="AddSiteForm" method="post" action="">
  320. <table width="98%" height="20" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  321. <tr>
  322. <td width=35 align="center" alt="保存"  style="cursor:hand" onClick="document.AddSiteForm.submit();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">保存</td>
  323. <td width=35 align="center" alt="后退"  style="cursor:hand" onClick="history.back();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">后退</td>
  324. <td>&nbsp;
  325. <input name="vs" type="hidden" id="vs2" value="add"> </td>
  326. </tr>
  327.   </table>
  328. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1">
  329. <tr class="hback">
  330. <td width="100" height="26"><div align="center">采集站点名称</div></td>
  331. <td><input name="SiteName" style="width:100%;" type="text" id="SiteName2"></td>
  332. </tr>
  333. <tr class="hback">
  334. <td height="26"><div align="center">采集站点分类</div></td>
  335. <td><select name="SiteFolder" style="width:100%;" id="SiteFolder">
  336. <option value="0">根栏目</option>
  337. <% = FolderList() %>
  338. </select></td>
  339. </tr>
  340. <tr class="hback">
  341. <td height="26"><div align="center">采集对象页</div></td>
  342. <td><input style="width:100%;" name="objURL" type="text" id="objURL" value="http://"></td>
  343. </tr>
  344. <tr class="hback">
  345. <td height="26"><div align="center">采集参数</div></td>
  346. <td>锁定
  347. <input name="islock" type="checkbox" id="islock" value="1">
  348. 保存远程图片
  349. <input type="checkbox" name="SaveRemotePic" value="1">
  350. 新闻是否已经审核
  351. <input name="Audit" type="checkbox" value="1" checked>
  352. 是否倒序采集
  353. <input name="IsReverse" type="checkbox" id="IsReverse" value="1"></td>
  354. </tr>
  355. <tr class="hback">
  356. <td height="26"><div align="center">过滤选项</div></td>
  357. <td>HTML
  358. <input type="checkbox" name="TextTF" value="1">
  359. STYLE
  360. <input type="checkbox" name="IsStyle" value="1">
  361. DIV
  362. <input type="checkbox" name="IsDiv" value="1">
  363. A
  364. <input type="checkbox" name="IsA" value="1">
  365. CLASS
  366. <input type="checkbox" name="IsClass" value="1">
  367. FONT
  368. <input type="checkbox" name="IsFont" value="1">
  369. SPAN
  370. <input type="checkbox" name="IsSpan" value="1">
  371. OBJECT
  372. <input type="checkbox" name="IsObject" value="1">
  373. IFRAME
  374. <input type="checkbox" name="IsIFrame" value="1">
  375. SCRIPT
  376. <input type="checkbox" name="IsScript" value="1">
  377. </td>
  378. </tr>
  379.   </table>
  380. </form>
  381. <% End Sub
  382. Sub AddFolder()
  383. %>
  384. <form name="AddSiteFolderForm" method="post" action="">
  385. <table width="98%" height="20" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  386. <tr class="hback">
  387. <td width=35 style="cursor:hand" align="center" alt="保存" onClick="document.AddSiteFolderForm.submit();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">保存</td>
  388. <td width=35 style="cursor:hand" align="center" alt="后退" onClick="history.back();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">后退</td>
  389. <td>&nbsp;
  390. <input name="vs" type="hidden" id="vs2" value="addfolder">
  391.               <input type="hidden" name="SiteFolderID" value="<% = SiteFolderID %>"> </td>
  392. </tr>
  393.   </table>
  394. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  395. <%
  396. Dim SiteFolderID,RsSiteFolder
  397. SiteFolderID = Request("SiteFolderID")
  398. If SiteFolderID<>"" Then
  399. Set RsSiteFolder = CollectConn.Execute("select * from FS_SiteFolder where ID=" & SiteFolderID)
  400. If RsSiteFolder.EOF Then
  401. Response.write "<script>alert('该栏目不存在!');history.back();</script>"
  402. Response.End
  403. End If
  404. %>
  405. <tr class="hback">
  406. <td width="100" height="26"><div align="center">栏目名称:</div></td>
  407. <td><input style="width:100%" type="text" name="SiteFolder" value="<%=RsSiteFolder("SiteFolder")%>"></td>
  408. </tr>
  409. <tr class="hback">
  410. <td width="100" height="26"><div align="center">栏目说明:</div></td>
  411. <td><textarea style="width:100%" name="SiteFolderDetail" rows="10"><%=RsSiteFolder("SiteFolderDetail")%></textarea></td>
  412. </tr>
  413. <%
  414. Else
  415. %>
  416. <tr class="hback">
  417. <td width="100" height="26"><div align="center">栏目名称:</div></td>
  418. <td><input style="width:100%" type="text" name="SiteFolder"></td>
  419. </tr>
  420. <tr class="hback">
  421. <td width="100" height="26"><div align="center">栏目说明:</div></td>
  422. <td><textarea style="width:100%" name="SiteFolderDetail" rows="10"></textarea></td>
  423. </tr>
  424. <%
  425. End If
  426. %>
  427.   </table>
  428. </form>
  429. <% End Sub %>
  430. </body>
  431. </html>
  432. <%
  433. Function FolderList()
  434. Dim FolderListObj,StrSelected
  435. Set FolderListObj = Collectconn.Execute("Select * from FS_SiteFolder where 1=1 order by ID desc")
  436. do while Not FolderListObj.Eof
  437. If CInt(Request("FolderID"))=FolderListObj("ID") Then
  438. StrSelected="selected"
  439. Else
  440. StrSelected=""
  441. End If
  442. FolderList = FolderList & "<option value="&FolderListObj("ID")&" " & StrSelected & ">&nbsp;&nbsp;|--" & FolderListObj("SiteFolder") & "</option><br>"
  443. FolderListObj.MoveNext
  444. loop
  445. FolderListObj.Close
  446. Set FolderListObj = Nothing
  447. End Function
  448. Set CollectConn = Nothing
  449. %>
  450. <script language="JavaScript">
  451. function InsertScript()
  452. {
  453. var ReturnValue='';
  454. ReturnValue=showModalDialog("NewsNum.asp",window,'dialogWidth:260pt;dialogHeight:120pt;status:no;help:no;scroll:no;');
  455. return ReturnValue;
  456. }
  457. function StartOneSiteCollect(ID)
  458. {
  459. Num = InsertScript();
  460. if (Num!='back'&& Num!='0')
  461. {
  462. if (Num==""||Num==null) Num="allNews"
  463. location='Collecting.asp?SiteID='+ID+'&Num='+Num;
  464. }
  465. }
  466. </script>