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

数据库编程

开发平台:

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 RsEditObj,EditSql,SiteID
  11. Dim LinkHeadSetting,LinkFootSetting
  12. Dim ObjUrl,ListHeadSetting,ListFootSetting,NewsLinkStr
  13. Dim HandSetAuthor,HandSetSource,HandSetAddDate
  14. Set RsEditObj = Server.CreateObject ("ADODB.RecordSet")
  15. SiteID = Request("SiteID")
  16. if SiteID <> "" then
  17. EditSql="Select * from FS_Site where ID=" & SiteID
  18. RsEditObj.Open EditSql,CollectConn,1,3
  19. if RsEditObj.Eof then
  20. Response.write("没有修改的站点")
  21. else
  22. ObjUrl = RsEditObj("ObjUrl")
  23. ListHeadSetting = RsEditObj("ListHeadSetting")
  24. ListFootSetting = RsEditObj("ListFootSetting")
  25. HandSetAuthor = RsEditObj("HandSetAuthor")
  26. HandSetSource = RsEditObj("HandSetSource")
  27. HandSetAddDate = RsEditObj("HandSetAddDate")
  28. end if
  29. else
  30. Response.write("没有修改的站点")
  31. end if
  32. Dim ListSetting
  33. If InStr(Request.Form("LinkSetting"),"[列表URL]") = 0 Then
  34. Response.Write "<script>alert('列表URL没有设置或设置不正确!');history.back();</script>"
  35. Response.End 
  36. End if
  37. ListSetting = Split(Request.Form("LinkSetting"),"[列表URL]",-1,1)
  38. LinkHeadSetting = ListSetting(0)
  39. LinkFootSetting = ListSetting(1)
  40. if Request.Form("Result") = "Edit" then
  41.     Dim RsAddObj,sql
  42. Set RsAddObj = Server.CreateObject ("ADODB.RecordSet")
  43. Sql = "select * from FS_Site where id=" & Request.Form("SiteID")
  44. RsAddObj.Open Sql,CollectConn,1,3
  45. RsAddObj("LinkHeadSetting") = LinkHeadSetting
  46. RsAddObj("LinkFootSetting") = LinkFootSetting
  47. RsAddObj.update
  48. RsAddObj.close
  49. Set RsAddObj = Nothing
  50. end if
  51. Dim ResponseAllStr,NewsListStr
  52. ResponseAllStr = GetPageContent(ObjURL)
  53. NewsListStr = GetOtherContent(ResponseAllStr,ListHeadSetting,ListFootSetting)
  54. NewsLinkStr = FormatUrl(GetOtherContent(NewsListStr,LinkHeadSetting,LinkFootSetting),ObjUrl)
  55. %>
  56. <html>
  57. <head>
  58. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  59. <title>自动新闻采集—站点设置</title>
  60. </head>
  61. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  62. <script language="JavaScript" src="js/PublicJS.js"></script>
  63. <body leftmargin="2" topmargin="2">
  64. <form name="form1" method="post" action="SiteFiveStep.asp" id="Form1">
  65. <table width="100%" border="0" cellpadding="5" cellspacing="1" class="table">
  66.   <tr class="hback"> 
  67.     <td height="26" colspan="5" valign="middle">
  68.       <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
  69.         <tr  class="hback">
  70.             <td width="50" style="cursor:hand" align="center" alt="第四步" onClick="window.location.href='javascript:history.go(-1)';" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">上一步</td>
  71. <td width=2 class="Gray">|</td>
  72.             <td width="50" style="cursor:hand" align="center" alt="第五步" onClick="document.form1.submit();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">下一步</td>
  73. <td width=2 class="Gray">|</td>
  74.     <td width="35" style="cursor:hand" align="center" alt="后退" onClick="history.back();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">后退</td>
  75.             <td>&nbsp; <input name="SiteID" type="hidden" id="SiteID2" value="<% = SiteID %>"> 
  76.               <input name="Result" type="hidden" id="Result2" value="Edit"> <input type="hidden" name="NewsLinkStr" value="<% = NewsLinkStr %>"></td>
  77.         </tr>
  78.       </table>
  79.   </td>
  80.   </tr>
  81. </table>
  82.   <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  83.     <tr class="hback"> 
  84.       <td width="20%"> <div align="center">标题</div></td>
  85.       <td> &nbsp;&nbsp;输入区域:
  86. <span onClick="if(document.Form1.PageTitleSetting.rows>2)document.Form1.PageTitleSetting.rows-=1" style='cursor:hand'><b>缩小</b></span>
  87. <span onClick="document.Form1.PageTitleSetting.rows+=1" style='cursor:hand'><b>扩大</b></span>
  88.   &nbsp;&nbsp;可用标签:<font onmouseover="getActiveText(document.form1.PageTitleSetting);" onClick="addTag('[标题]')" style="CURSOR: hand"><b>[标题]</b></font>&nbsp;&nbsp;&nbsp;<font onmouseover="getActiveText(document.form1.PageTitleSetting);" onClick="addTag('[变量]')" style="CURSOR: hand"><b>[变量]</b></font>
  89.         <table width="95%" border="0" cellspacing="0" cellpadding="0">
  90.           <tr> 
  91.             <td height="5"></td>
  92.           </tr>
  93.         </table>
  94.         <textarea onDblClick="getActiveText(this)" onClick="getActiveText(this)"  onchange="getActiveText(this)" name="PageTitleSetting" cols="50" rows="3" id="textarea4" style="width:100%;"><%=RsEditObj("PageTitleHeadSetting")%>[标题]<%=RsEditObj("PageTitleFootSetting")%></textarea></td>
  95.     </tr>
  96.     <tr class="hback"> 
  97.       <td> <div align="center">内容</div></td>
  98.       <td> &nbsp;&nbsp;输入区域: <span onClick="if(document.Form1.PagebodySetting.rows>2)document.Form1.PagebodySetting.rows-=1" style='cursor:hand'><b>缩小</b></span> 
  99.         <span onClick="document.Form1.PagebodySetting.rows+=1" style='cursor:hand'><b>扩大</b></span> 
  100.         &nbsp;&nbsp;可用标签:<font onmouseover="getActiveText(document.form1.PagebodySetting);" onClick="addTag('[内容]')" style="CURSOR: hand"><b>[内容]</b></font>&nbsp;&nbsp;&nbsp;<font onmouseover="getActiveText(document.form1.PagebodySetting);" onClick="addTag('[变量]')" style="CURSOR: hand"><b>[变量]</b></font>
  101.         <textarea onDblClick="getActiveText(this)" onClick="getActiveText(this)"  onChange="getActiveText(this)" name="PagebodySetting" cols="50" rows="6" id="textarea" style="width:100%;"><%=RsEditObj("PagebodyHeadSetting")%>[内容]<%=RsEditObj("PagebodyFootSetting")%></textarea></td>
  102.     </tr>
  103.     <tr class="hback"> 
  104.       <td height="26" colspan="4"> <div align="left">                  
  105. <input name="OtherSetType" type="radio" onClick="ChangeSetOption(0);" value="0" checked>
  106.           设置作者 
  107.           <input type="radio" name="OtherSetType" onClick="ChangeSetOption(1);" value="1">
  108.           设置来源 
  109.           <input type="radio" name="OtherSetType" onClick="ChangeSetOption(2);" value="2">
  110.           设置时间 
  111.         </div></td>
  112.     </tr>
  113.     <tr class="hback" id="SetAuthor" style="display:;"> 
  114.       <td colspan="4"><table width="100%" border="0" cellspacing="0" cellpadding="3">
  115.           <tr>
  116.             <td height="26">
  117. <div align="center">手动设置</div></td>
  118.             <td colspan="3"><input style="width:100%;" type="text" name="HandSetAuthor" value="<% = HandSetAuthor %>"></td>
  119.           </tr>
  120.           <tr> 
  121.             <td width="20%"> <div align="center">作者</div></td>
  122.             <td colspan="3">&nbsp;&nbsp;输入区域:
  123. <span onClick="if(document.Form1.AuthorSetting.rows>2)document.Form1.AuthorSetting.rows-=1" style='cursor:hand'><b>缩小</b></span>
  124. <span onClick="document.Form1.AuthorSetting.rows+=1" style='cursor:hand'><b>扩大</b></span>
  125.  &nbsp;&nbsp;可用标签:<font onmouseover="getActiveText(document.form1.AuthorSetting);" onClick="addTag('[作者]')" style="CURSOR: hand"><b>[作者]</b></font>&nbsp;&nbsp;&nbsp;<font onmouseover="getActiveText(document.form1.AuthorSetting);" onClick="addTag('[变量]')" style="CURSOR: hand"><b>[变量]</b></font>
  126.               <table width="95%" border="0" cellspacing="0" cellpadding="0">
  127.                 <tr> 
  128.                   <td height="5"></td>
  129.                 </tr>
  130.               </table>
  131.               <textarea onDblClick="getActiveText(this)" onClick="getActiveText(this)"  onchange="getActiveText(this)" name="AuthorSetting" cols="50" rows="3" id="textarea9" style="width:100%;"><%=RsEditObj("AuthorHeadSetting")%>[作者]<%=RsEditObj("AuthorFootSetting")%></textarea></td>
  132.           </tr>
  133.         </table></td>
  134.     </tr>
  135.     <tr class="hback" id="SetSource" style="display:none;"> 
  136.       <td colspan="4"><table width="100%" border="0" cellspacing="0" cellpadding="3">
  137.           <tr>
  138.             <td height="26">
  139. <div align="center">手动设置</div></td>
  140.             <td colspan="3"><input style="width:100%;" type="text" name="HandSetSource" value="<% = HandSetSource %>"></td>
  141.           </tr>
  142.   <tr> 
  143.             <td width="20%"> <div align="center">来源</div></td>
  144.             <td colspan="3">&nbsp;&nbsp;输入区域:
  145. <span onClick="if(document.Form1.SourceSetting.rows>2)document.Form1.SourceSetting.rows-=1" style='cursor:hand'><b>缩小</b></span>
  146. <span onClick="document.Form1.SourceSetting.rows+=1" style='cursor:hand'><b>扩大</b></span>
  147. &nbsp;&nbsp;可用标签:<font onmouseover="getActiveText(document.form1.SourceSetting);" onClick="addTag('[来源]')" style="CURSOR: hand"><b>[来源]</b></font>&nbsp;&nbsp;&nbsp;<font onmouseover="getActiveText(document.form1.SourceSetting);" onClick="addTag('[变量]')" style="CURSOR: hand"><b>[变量]</b></font>
  148.               <table width="95%" border="0" cellspacing="0" cellpadding="0">
  149.                 <tr> 
  150.                   <td height="5"></td>
  151.                 </tr>
  152.               </table>
  153.               <textarea onDblClick="getActiveText(this)" onClick="getActiveText(this)"  onchange="getActiveText(this)" name="SourceSetting" cols="50" rows="3" id="textarea9a" style="width:100%;"><%=RsEditObj("SourceHeadSetting")%>[来源]<%=RsEditObj("SourceFootSetting")%></textarea></td>
  154.           </tr>
  155.         </table></td>
  156.     </tr>
  157.     <tr class="hback" id="SetAddTime" style="display:none;"> 
  158.       <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="3">
  159.           <tr>
  160.             <td height="26">
  161. <div align="center">手动设置</div></td>
  162.             <td colspan="3"><input style="width:100%;" type="text" name="HandSetAddDate" value="<% = HandSetAddDate %>"></td>
  163.           </tr>
  164.   <tr> 
  165.             <td width="20%"> <div align="center">加入时间</div></td>
  166.             <td>&nbsp;&nbsp;输入区域:
  167. <span onClick="if(document.Form1.AddDateSetting.rows>2)document.Form1.AddDateSetting.rows-=1" style='cursor:hand'><b>缩小</b></span>
  168. <span onClick="document.Form1.AddDateSetting.rows+=1" style='cursor:hand'><b>扩大</b></span>
  169. &nbsp;&nbsp;可用标签:<font onmouseover="getActiveText(document.form1.AddDateSetting);" onClick="addTag('[加入时间]')" style="CURSOR: hand"><b>[加入时间]</b></font>&nbsp;&nbsp;&nbsp;<font onmouseover="getActiveText(document.form1.AddDateSetting);" onClick="addTag('[变量]')" style="CURSOR: hand"><b>[变量]</b></font>
  170.               <table width="95%" border="0" cellspacing="0" cellpadding="0">
  171.                 <tr> 
  172.                   <td height="5"></td>
  173.                 </tr>
  174.               </table>
  175.               <textarea onDblClick="getActiveText(this)" onClick="getActiveText(this)"  onchange="getActiveText(this)" name="AddDateSetting" cols="50" rows="3" id="textarea9" style="width:100%;"><%=RsEditObj("AddDateHeadSetting")%>[加入时间]<%=RsEditObj("AddDateFootSetting")%></textarea></td>
  176.           </tr>
  177.         </table></td>
  178.     </tr>
  179.     <tr class="hback" > 
  180.       <td height="26" colspan="4"> <div align="center">
  181.           <input name="OtherNewsType" <% if RsEditObj("OtherNewsType") = 0 then Response.Write("checked") %> type="radio" onClick="ChangeNewsSetOption(0);" value="0" checked>
  182.           不设置新闻分页 
  183.           <input type="radio" <% if RsEditObj("OtherNewsType") = 1 then Response.Write("checked") %> name="OtherNewsType" onClick="ChangeNewsSetOption(1);" value="1">
  184.           新闻标记分页
  185.           <input type="radio" <% if RsEditObj("OtherNewsType") = 2 then Response.Write("checked") %> name="OtherNewsType" onClick="ChangeNewsSetOption(2);" value="2">
  186.           新闻索引分页
  187.           <input type="radio" <% if RsEditObj("OtherNewsType") = 3 then Response.Write("checked") %> name="OtherNewsType" onClick="ChangeNewsSetOption(3);" value="3">
  188.           新闻手动分页
  189.   </div></td>
  190.     </tr>
  191.     <tr class="hback" id="SetCutPage" style="display:none;"> 
  192.       <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="3">
  193.           <tr> 
  194.             <td width="20%"> 
  195.               <div align="center">分页新闻<br>(下一页)</div></td>
  196.       <td>&nbsp;&nbsp;输入区域:
  197. <span onClick="if(document.Form1.OtherNewsPageSetting.rows>2)document.Form1.OtherNewsPageSetting.rows-=1" style='cursor:hand'><b>缩小</b></span>
  198. <span onClick="document.Form1.OtherNewsPageSetting.rows+=1" style='cursor:hand'><b>扩大</b></span>
  199.   &nbsp;&nbsp;可用标签:<font onmouseover="getActiveText(document.form1.OtherNewsPageSetting);" onClick="addTag('[分页新闻]')" style="CURSOR: hand"><b>[分页新闻]</b></font>&nbsp;&nbsp;&nbsp;<font onmouseover="getActiveText(document.form1.OtherNewsPageSetting);" onClick="addTag('[变量]')" style="CURSOR: hand"><b>[变量]</b></font>
  200.               <table width="95%" border="0" cellspacing="0" cellpadding="0">
  201.                 <tr> 
  202.                   <td height="5"></td>
  203.                 </tr>
  204.               </table>
  205.               <textarea onDblClick="getActiveText(this)" onClick="getActiveText(this)"  onchange="getActiveText(this)" name="OtherNewsPageSetting" cols="50" rows="3" id="textarea5" style="width:100%;"><%=RsEditObj("OtherNewsPageHeadSetting")%>[分页新闻]<%=RsEditObj("OtherNewsPageFootSetting")%></textarea></td>
  206.     </tr>
  207.         </table></td>
  208.     </tr>
  209.     <tr class="hback"  id="SetIndexCutPage" style="display:none;"> 
  210.       <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  211.           <tr class="hback" > 
  212.             <td width="15%"> 
  213.               <div align="center">索引规则 </div></td>
  214.             <td>
  215. &nbsp;&nbsp;输入区域:
  216. <span onClick="if(document.Form.IndexRule.rows>2)document.Form.IndexRule.rows-=1" style='cursor:hand'><b>缩小</b></span>
  217. <span onClick="document.Form.IndexRule.rows+=1" style='cursor:hand'><b>扩大</b></span><br>
  218. <textarea name="OtherNewsPageIndexSetting" rows="2" id="OtherNewsPageIndexSetting" style="width:100%;"><% = RsEditObj("OtherNewsPageIndexSetting") %></textarea></td>
  219.           </tr>
  220.           <tr class="hback" > 
  221.             <td height="26"> <div align="center">页码</div></td>
  222.             <td>页码开始: 
  223.               <input name="OtherNewsPageIndexSettingStartPageNum" type="text" id="OtherNewsPageIndexSettingStartPageNum" size="3" maxlength="8" value="<% = RsEditObj("OtherNewsPageIndexSettingStartPageNum") %>">
  224.               页码结束 
  225.               <input name="OtherNewsPageIndexSettingEndPageNum" type="text" id="OtherNewsPageIndexSettingEndPageNum" size="3" maxlength="8" value="<% = RsEditObj("OtherNewsPageIndexSettingEndPageNum") %>">
  226.               &nbsp&nbsp 例:在索引规则中写http://.../20060203345_^$^.htm,其中^$^代表设定的页码</td>
  227.           </tr>
  228.         </table></td>
  229.     </tr>
  230. <tr class="hback"  id="SetHandCutPage" style="display:none;"> 
  231.       <td width="10%"> <div align="center">分页内容</div></td>
  232.       <td height="26">&nbsp;&nbsp;输入区域:<span onClick="if(document.Form.HandPageContent.rows>2)document.Form.HandPageContent.rows-=1" style='cursor:hand'><b>缩小</b></span><span onClick="document.Form.HandPageContent.rows+=1" style='cursor:hand'><b>扩大</b></span><textarea  name="OtherNewsPageIndexSettingHandPageContent" rows="6" id="OtherNewsPageIndexSettingHandPageContent" style="width:100%;"><% = RsEditObj("OtherNewsPageIndexSettingHandPageContent") %></textarea>
  233.   </td>
  234. </tr>
  235. </table>
  236. </form>
  237. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  238.   <tr class="hback">
  239.     <td colspan="2" height="28" class="xingmu"> <div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;预览结果:<a href="<% = NewsLinkStr %>" target="_blank"> 
  240.         <% = NewsLinkStr %>
  241.         </a></div></td>
  242.   </tr>
  243. </table>
  244. </body>
  245. </html>
  246. <%
  247. Set RsEditObj = Nothing
  248. Set CollectConn = Nothing
  249. %>
  250. <script language="JavaScript">
  251. function ChangeSetOption(Flag)
  252. {
  253. switch (Flag)
  254. {
  255. case 0 :
  256. document.all.SetAuthor.style.display='';
  257. document.all.SetSource.style.display='none';
  258. document.all.SetAddTime.style.display='none';
  259. break;
  260. case 1 :
  261. document.all.SetAuthor.style.display='none';
  262. document.all.SetSource.style.display='';
  263. document.all.SetAddTime.style.display='none';
  264. break;
  265. case 2 :
  266. document.all.SetAuthor.style.display='none';
  267. document.all.SetSource.style.display='none';
  268. document.all.SetAddTime.style.display='';
  269. break;
  270. case 999 :
  271. document.all.SetAuthor.style.display='none';
  272. document.all.SetSource.style.display='none';
  273. document.all.SetAddTime.style.display='none';
  274. break;
  275. default :
  276. document.all.SetAuthor.style.display='none';
  277. document.all.SetSource.style.display='none';
  278. document.all.SetAddTime.style.display='none';
  279. break;
  280. }
  281. }
  282. function ChangeNewsSetOption(f_Flag)
  283. {
  284. switch (f_Flag)
  285. {
  286. case 0 :
  287. document.all.SetCutPage.style.display='none';
  288. document.all.SetIndexCutPage.style.display='none';
  289. document.all.SetHandCutPage.style.display='none';
  290. break;
  291. case 1 :
  292. document.all.SetCutPage.style.display='';
  293. document.all.SetIndexCutPage.style.display='none';
  294. document.all.SetHandCutPage.style.display='none';
  295. break;
  296. case 2 :
  297. document.all.SetCutPage.style.display='none';
  298. document.all.SetIndexCutPage.style.display='';
  299. document.all.SetHandCutPage.style.display='none';
  300. break;
  301. case 3 :
  302. document.all.SetCutPage.style.display='none';
  303. document.all.SetIndexCutPage.style.display='none';
  304. document.all.SetHandCutPage.style.display='';
  305. break;
  306. default :
  307. document.all.SetCutPage.style.display='none';
  308. document.all.SetIndexCutPage.style.display='none';
  309. document.all.SetHandCutPage.style.display='none';
  310. break;
  311. }
  312. }   
  313. currObj = "uuuu";
  314. function getActiveText(obj)
  315. {
  316. obj.focus();
  317. currObj = obj;
  318. }
  319. function addTag(code)
  320. {
  321. addText(code);
  322. }
  323. function addText(ibTag)
  324. {
  325. var isClose = false;
  326. var obj_ta = currObj;
  327. if (obj_ta.isTextEdit)
  328. {
  329. obj_ta.focus();
  330. var sel = document.selection;
  331. var rng = sel.createRange();
  332. rng.colapse;
  333. if((sel.type == "Text" || sel.type == "None") && rng != null)
  334. {
  335. rng.text = ibTag;
  336. }
  337. obj_ta.focus();
  338. return isClose;
  339. }
  340. else return false;
  341. }
  342. </script>