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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_Inc/Function.asp"-->
  4. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  5. <!--#include file="../../FS_InterFace/NS_Function.asp" -->
  6. <!--#include file="lib/cls_main.asp" -->
  7. <!--#include file="../PublicSite/Public_Function.asp" -->
  8. <!--#include file="../../FS_InterFace/NS_Public.asp" -->
  9. <!--#include file="../../FS_InterFace/MS_Public.asp" -->
  10. <!--#include file="../../FS_InterFace/Other_Public.asp" -->
  11. <!--#include file="../../FS_InterFace/ME_Public.asp" -->
  12. <!--#include file="../../FS_InterFace/MF_Public.asp" -->
  13. <%'CopyRight (c) 2006 Fooun Inc. Code by Simpwind.Xie
  14. Dim Conn,User_Conn,strShowErr,Fs_news,obj_mf_sys_obj,MF_Domain,MF_Site_Name,tmp_c_path
  15. MF_Default_Conn
  16. MF_User_Conn
  17. MF_Session_TF 
  18. dim NewsId,ActType,NowNum
  19. NewsID = NoSqlHack(server.HTMLEncode(Request.QueryString("ID")))
  20. NewsID = Replace(NewsId," ","")
  21. ActType = Request.QueryString("type")
  22. NowNum = NoSqlHack(server.HTMLEncode(Request.QueryString("NowNum")))
  23. If Not NewsId<>"" Or Not ActType<>"" Then
  24. Response.Write "错误的参数"
  25. Response.End
  26. End If
  27. Select Case ActType
  28. Case "RefreshOne"
  29. RefreshOne NewsID,NowNum
  30. Case Else
  31. main(NewsID)
  32. End Select
  33. Sub RefreshOne(NewsID,NowNum)
  34. Dim varvalue
  35. Response.Expires = -1
  36. Response.ExpiresAbsolute = Now() - 1
  37. Response.Expires = 0
  38. Response.CacheControl = "no-cache"
  39. Response.Charset="GB2312"
  40. varvalue = Refresh("NS_news",NewsID)
  41. If Err Then
  42. Response.Write "Fail$"&Err.Description
  43. Else
  44. If varvalue =true then
  45. Response.Write "Next$"&NowNum
  46. Else
  47. Response.Write "Err$"&NowNum
  48. End If
  49. End If
  50. End Sub
  51. Sub main(NewsID)
  52. %> 
  53. <html>
  54. <head>
  55. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  56. <title>栏目管理___Powered by foosun Inc.</title>
  57. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  58. <style>
  59. .RefreshLen{
  60. height: 20px;
  61. width: 400px;
  62. border: 1px solid #104a7b;
  63. text-align: left;
  64. MARGIN-top:50px;
  65. margin-bottom: 5px;
  66. }
  67. </style>
  68. <script language="JavaScript" src="../../FS_Inc/Prototype.js" type="text/JavaScript"></script>
  69. </head>
  70. <body>
  71. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  72.   <tr class="hback"> 
  73.     <td class="xingmu">生成管理<a href="../../help?Lable=NS_MakHtml" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a></td>
  74.   </tr>
  75.   <tr> 
  76.     <td height="18" class="hback"><div align="left"><a href="News_Manage.asp">返回新闻管理</a>┆</div></td>
  77.   </tr>
  78. </table>
  79. <div id="RefreshSchedule" style="display:none;" align="center"></div>
  80. <script language="JavaScript" type="text/JavaScript">
  81. var Errar=new Array();
  82. $('RefreshSchedule').style.display="";
  83. $('RefreshSchedule').innerHTML="<div class="RefreshLen"><div class="xingmu" id="RefreshLen"></div></div>
  84. <span id="result_str"></span><br><br>";
  85. $("RefreshLen").style.width ="0%";
  86. $("RefreshLen").innerHTML="&nbsp;<span class="xingmu">0%</span>";
  87. $('Result_str').innerHTML="正在准备...&nbsp;&nbsp;";
  88. function Refresh_GO(act,Nownum)
  89. {
  90. var G_REFRESH_NUM_TIME=<%= G_REFRESH_NUM_TIME %>;
  91. var NewsID = <%= "[["&Replace(NewsId,",","],[")&"]]" %>;
  92. var countnum=NewsID.length;
  93. var Action='';
  94. var StrTemp='';
  95. var percent;
  96. var goback="<a href="News_Manage.asp">返回</a>";
  97. if (act=="Err"){
  98. Errar[Errar.length]=NewsID[Nownum-1];
  99. }
  100. if ((Nownum+1)>countnum){
  101. percent=100;
  102. }else{
  103. percent=((Nownum+1)/countnum)*100;
  104. }
  105. percent=Math.round(percent);
  106. $("RefreshLen").style.width =percent+"%";
  107. $("RefreshLen").innerHTML="&nbsp;<span class="xingmu">"+percent+"%</span>";
  108. if ((Nownum+1)>countnum){
  109. for (i=0;i<Errar.length;i++){
  110. if (StrTemp==""){
  111. StrTemp=Errar[i].toString(10);
  112. }else{
  113. StrTemp+=";"+Errar[i].toString(10);
  114. }
  115. }
  116. $('result_str').innerHTML="总共要发布" + countnum + "条内容,发布成功" + (countnum-Errar.length) + "条。";
  117. if (Errar.length>0){
  118. $('result_str').innerHTML+="<br />发布失败的NewsID:"+StrTemp;
  119. }
  120. $('result_str').innerHTML=$('result_str').innerHTML+"<br />发布结束&nbsp;&nbsp;"+goback;
  121. Nownum=0;
  122. }else{
  123. $('result_str').innerHTML="总共要发布" + countnum + "条内容,正在发布" + (Nownum+1) + "条内容...";
  124. Action="Type=RefreshOne&ID="+NewsID[Nownum]+"&NowNum="+(Nownum+1);
  125. if (((Nownum+1) % G_REFRESH_NUM_TIME)==0){
  126. window.setTimeout("Start_Refresh('Get_NewsHtml.asp','"+Action+"');",1000);
  127. }else{
  128. Start_Refresh('Get_NewsHtml.asp',Action);
  129. }
  130. }
  131. }
  132. function Start_Refresh(url,Action){
  133. var myAjax = new Ajax.Request(
  134. url,
  135. {method:'get',
  136. parameters:Action,
  137. onComplete:Refresh_Receive
  138. }
  139. );
  140. }
  141. function Refresh_Receive(OriginalRequest){
  142. var check,goback;
  143. var percent=0;
  144. var goback="<a href="News_Manage.asp">返回</a>";
  145. if (OriginalRequest.responseText.indexOf("$")>-1){
  146. check=OriginalRequest.responseText.split("$");
  147. switch (check[0]) {
  148. case "Next" :
  149. Refresh_GO("Next",parseInt(check[1]));
  150. break;
  151. case "Err" :
  152. Refresh_GO("Err",parseInt(check[1]));
  153. break;
  154. default :
  155. $('result_str').innerHTML="发布失败,发布程序异常。&nbsp;&nbsp;"+goback+"<br>错误描述如下:"+check[1];
  156. }
  157. }
  158. else{
  159. $('result_str').innerHTML="发布失败,发布程序异常。&nbsp;&nbsp;"+goback+"<br>错误描述如下:"+OriginalRequest.responseText;
  160. }
  161. }
  162. Refresh_GO('Next',0);
  163. </script>
  164. </body>
  165. </html>
  166. <%
  167. End Sub
  168. %>