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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_Inc/Function.asp"-->
  4. <!--#include file="inc/Function.asp"-->
  5. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  6. <%
  7. Dim Conn,CollectConn
  8. MF_Default_Conn
  9. MF_Collect_Conn
  10. MF_Session_TF
  11. Dim RsEditObj,EditSql,SiteID,ObjUrl
  12. Set RsEditObj = Server.CreateObject ("ADODB.RecordSet")
  13. SiteID = Request("SiteID")
  14. if SiteID <> "" then
  15. EditSql="Select * from FS_Site where ID=" & SiteID
  16. RsEditObj.Open EditSql,CollectConn,1,3
  17. if RsEditObj.Eof then
  18. Response.write"<script>alert(""没有修改的站点"");location.href=""javascript:history.back()"";</script>"
  19. Response.end
  20. else
  21. ObjUrl = RsEditObj("ObjUrl")
  22. end if
  23. else
  24. Response.write"<script>alert(""没有修改的站点"");location.href=""javascript:history.back()"";</script>"
  25. Response.end
  26. end if
  27. Dim ListHeadSetting,ListFootSetting,OtherPageHeadSetting,OtherPageFootSetting
  28. Dim IndexRule,StartPageNum,EndPageNum,HandPageContent,OtherType
  29. Dim ListSetting,OtherPageSetting
  30. ListSetting = split(Request.Form("ListSetting"),"[列表内容]",-1,1)
  31. ListHeadSetting = ListSetting(0)
  32. ListFootSetting = ListSetting(1)
  33. If Err Or ListHeadSetting="" Or ListFootSetting="" Then
  34. ListHeadSetting = "<body"
  35. ListFootSetting = "</body>"
  36. Err.clear
  37. End If
  38. If InStr(Request.Form("OtherPageSetting"),"[其他页面]")<>0 then
  39. OtherPageSetting = split(Request.Form("OtherPageSetting"),"[其他页面]",-1,1)
  40. OtherPageHeadSetting = OtherPageSetting(0)
  41. OtherPageFootSetting = OtherPageSetting(1)
  42. End if
  43. OtherType = Request.Form("OtherType")
  44. IndexRule = Request.Form("IndexRule")
  45. StartPageNum = Request.Form("StartPageNum")
  46. EndPageNum = Request.Form("EndPageNum")
  47. HandPageContent = Request.Form("HandPageContent")
  48. if Request.Form("Result") = "Edit" then
  49.     Dim RsAddObj,sql
  50. Set RsAddObj = Server.CreateObject ("ADODB.RecordSet")
  51. Sql = "select * from FS_Site where id=" & Request.Form("SiteID")
  52. RsAddObj.Open Sql,CollectConn,1,3
  53. RsAddObj("ListHeadSetting") = ListHeadSetting
  54. RsAddObj("ListFootSetting") = ListFootSetting
  55. Select Case OtherType
  56. Case "0"
  57. RsAddObj("OtherType") = OtherType
  58. RsAddObj("IndexRule") = ""
  59. RsAddObj("StartPageNum") = ""
  60. RsAddObj("EndPageNum") = ""
  61. RsAddObj("HandPageContent") = ""
  62. RsAddObj("OtherPageHeadSetting") = ""
  63. RsAddObj("OtherPageFootSetting") = ""
  64. Case "1"
  65. RsAddObj("OtherType") = OtherType
  66. RsAddObj("IndexRule") = ""
  67. RsAddObj("StartPageNum") = ""
  68. RsAddObj("EndPageNum") = ""
  69. RsAddObj("HandPageContent") = ""
  70. RsAddObj("OtherPageHeadSetting") = OtherPageHeadSetting
  71. RsAddObj("OtherPageFootSetting") = OtherPageFootSetting
  72. Case "2"
  73. RsAddObj("OtherType") = OtherType
  74. RsAddObj("IndexRule") = IndexRule
  75. RsAddObj("StartPageNum") = StartPageNum
  76. RsAddObj("EndPageNum") = EndPageNum
  77. RsAddObj("HandPageContent") = ""
  78. RsAddObj("OtherPageHeadSetting") = ""
  79. RsAddObj("OtherPageFootSetting") = ""
  80. Case "3"
  81. RsAddObj("OtherType") = OtherType
  82. RsAddObj("IndexRule") = ""
  83. RsAddObj("StartPageNum") = ""
  84. RsAddObj("EndPageNum") = ""
  85. RsAddObj("HandPageContent") = HandPageContent
  86. RsAddObj("OtherPageHeadSetting") = ""
  87. RsAddObj("OtherPageFootSetting") = ""
  88. Case Else
  89. RsAddObj("OtherType") = 0
  90. RsAddObj("IndexRule") = ""
  91. RsAddObj("StartPageNum") = ""
  92. RsAddObj("EndPageNum") = ""
  93. RsAddObj("HandPageContent") = ""
  94. RsAddObj("OtherPageHeadSetting") = ""
  95. RsAddObj("OtherPageFootSetting") = ""
  96. End Select
  97. RsAddObj.update
  98. RsAddObj.close
  99. Set RsAddObj = Nothing
  100. end if
  101. Dim ResponseAllStr,NewsListStr
  102. ResponseAllStr = GetPageContent(ObjURL)
  103. NewsListStr = GetOtherContent(ResponseAllStr,ListHeadSetting,ListFootSetting)
  104. NewsListStr = Replace(Replace(NewsListStr,"""","%22"),"'","%27")
  105. %>
  106. <html>
  107. <head>
  108. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  109. <title>自动新闻采集—站点设置</title>
  110. </head>
  111. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  112. <script language="JavaScript" src="js/PublicJS.js"></script>
  113. <body leftmargin="2" topmargin="2">
  114. <form name="form1" method="post" action="SiteFourStep.asp" id="Form1">
  115. <table width="98%" height="20" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  116.         <tr class="hback" >
  117.   <td style="cursor:hand" width="50" align="center" alt="第三步" onClick="window.location.href='javascript:history.go(-1)';" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">上一步</td>
  118.   <td width=2 class="Gray">|</td>
  119.   <td style="cursor:hand" width="50" align="center" alt="第四步" onClick="document.form1.submit();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">下一步</td>
  120.   <td width=2 class="Gray">|</td>
  121.       <td style="cursor:hand" width="35" align="center" alt="后退" onClick="history.back();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">后退</td>
  122.   <td>&nbsp; <input name="SiteID" type="hidden" id="SiteID2" value="<% = SiteID %>"> 
  123. <input name="Result" type="hidden" id="Result2" value="Edit">
  124.               <input type="hidden" name="NewsListStr" value="<% = NewsListStr %>"></td>
  125.         </tr>
  126.   </table><table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  127.   <tr class="hback" > 
  128.       <td width="20%"> 
  129.         <div align="center">列表URL</div></td>
  130. <td> &nbsp;&nbsp;输入区域:
  131. <span onClick="if(document.Form1.LinkSetting.rows>2)document.Form1.LinkSetting.rows-=1" style='cursor:hand'><b>缩小</b></span>
  132. <span onClick="document.Form1.LinkSetting.rows+=1" style='cursor:hand'><b>扩大</b></span>
  133. &nbsp;&nbsp;可用标签:<font onClick="addTag('[列表URL]')" style="CURSOR: hand"><b>[列表URL]</b></font>&nbsp;&nbsp;&nbsp;<font onClick="addTag('[变量]')" style="CURSOR: hand"><b>[变量]</b></font><br>
  134.  <textarea onFocus="getActiveText(this)" onClick="getActiveText(this)"  onchange="getActiveText(this)" name="LinkSetting" cols="50" rows="6" id="textarea2" style="width:100%;"><%=RsEditObj("LinkHeadSetting")%>[列表URL]<%=RsEditObj("LinkFootSetting")%></textarea></td>
  135.   </tr>
  136. </table>
  137. </form>
  138. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="0" class="table">
  139.   <tr class="hback" >
  140.     <td height="28" class="xingmu"> 
  141.       <div align="center">代码</div></td>
  142.   </tr>
  143.   <tr class="hback" >
  144.     <td height="20"><textarea name="CodeArea" rows="18" style="width:100%;"></textarea></td>
  145.   </tr>
  146.   <tr class="hback" > 
  147.     <td height="28" class="xingmu"> 
  148.       <div align="center">结果</div></td>
  149.   </tr>
  150.   <tr class="hback" > 
  151.     <td><iframe frameborder="1" name="PreviewArea" src="about:blank" ID="PreviewArea" MARGINHEIGHT="1" MARGINWIDTH="1" height="300" width="100%" scrolling="yes"></iframe></td>
  152.   </tr>
  153. </table>
  154. <p><p><p>
  155. </body>
  156. </html>
  157. <%
  158. Set CollectConn = Nothing
  159. Set Conn = Nothing
  160. Set RsEditObj = Nothing
  161. %>
  162. <script language="JavaScript">
  163. function document.onreadystatechange()
  164. {
  165. document.all.CodeArea.value=unescape(document.form1.NewsListStr.value);
  166. frames["PreviewArea"].document.write(unescape(document.form1.NewsListStr.value));
  167. }
  168. currObj = "uuuu";
  169. function getActiveText(obj)
  170. {
  171. currObj = obj;
  172. }
  173. function addTag(code)
  174. {
  175. addText(code);
  176. }
  177. function addText(ibTag)
  178. {
  179. var isClose = false;
  180. var obj_ta = currObj;
  181. if (obj_ta.isTextEdit)
  182. {
  183. obj_ta.focus();
  184. var sel = document.selection;
  185. var rng = sel.createRange();
  186. rng.colapse;
  187. if((sel.type == "Text" || sel.type == "None") && rng != null)
  188. {
  189. rng.text = ibTag;
  190. }
  191. obj_ta.focus();
  192. return isClose;
  193. }
  194. else return false;
  195. }
  196. </script>