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

数据库编程

开发平台:

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="../../FS_Inc/Func_page.asp" -->
  8. <!--#include file="NF_News_Function.asp"-->
  9. <%
  10. response.buffer=true
  11. Response.CacheControl = "no-cache"
  12. Dim Conn,User_Conn
  13. MF_Default_Conn
  14. MF_User_Conn
  15. 'session判断
  16. MF_Session_TF
  17. '权限判断
  18. 'Call MF_Check_Pop_TF("NS_Class_000001")
  19. '得到会员组列表
  20. dim Fs_news
  21. set Fs_news = new Cls_News
  22. Dim CharIndexStr
  23. CharIndexStr=all_substring
  24. %>
  25. <html>
  26. <head>
  27. <title>不规则新闻</title>
  28. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  29. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  30. <script language="JavaScript" src="js/Public.js"></script>
  31. <script language="javascript" src="../../Fs_inc/CheckJs.js"></script>
  32. <script language="javascript" src="../../FS_INC/prototype.js"></script>
  33. </head>
  34. <body onselectstart="return false;">
  35. <%
  36. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
  37. int_RPP=10 '设置每页显示数目
  38. int_showNumberLink_=8 '数字导航显示数目
  39. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  40. str_nonLinkColor_="#999999" '非热链接颜色
  41. toF_="<font face=webdings>9</font>"   '首页 
  42. toP10_=" <font face=webdings>7</font>" '上十
  43. toP1_=" <font face=webdings>3</font>" '上一
  44. toN1_=" <font face=webdings>4</font>" '下一
  45. toN10_=" <font face=webdings>8</font>" '下十
  46. toL_="<font face=webdings>:</font>" '尾页
  47. %>
  48. <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  49. <tr>
  50. <td>
  51. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  52. <tr class="xingmu">
  53. <td width="50%" align="center" class="xingmu">新闻标题</td>
  54. <td width="20%" align="center" class="xingmu">新闻栏目</td>
  55. <td width="*%" align=center class="xingmu">加入不规则</td>
  56. </tr>
  57. <%
  58. Dim temp,UnAll
  59. Dim IDList : IDList = "," '列出不重复的新闻ID
  60. Dim ListObj,ListSql
  61. Dim TempClassID,KeyWord
  62. TempClassID = Cstr(Request("ClassID"))
  63. KeyWord = NoCSSHackAdmin(Request("SearchKey"),"关键字")
  64. KeyWord = Replace(KeyWord,",","%")
  65. KeyWord = Replace(KeyWord," ","%")
  66. KeyWord = Replace(KeyWord,";","%")
  67. set ListObj = server.CreateObject(G_FS_RS)
  68. '全部新闻
  69. Dim StrSearch
  70. UnAll = Request("UnAll")
  71. StrSearch = ""
  72. If UnAll<>"" then
  73. StrSearch=StrSearch & " and "&CharIndexStr&"(NewsProperty,17,1)=1"
  74. End If
  75. If KeyWord<>"" Then
  76. StrSearch=StrSearch & " and (KeyWords like '%"&KeyWord&"%' or NewsTitle like '%"&KeyWord&"%')"
  77. End If
  78. If TempClassID<>"" Then
  79. StrSearch=StrSearch & " and FS_NS_News.ClassID='"&TempClassID&"'"
  80. End If
  81. ListSQL="select FS_NS_News.ID,NewsID,FS_NS_NewsClass.ClassID,FS_NS_NewsClass.ClassName,NewsTitle,CurtTitle From FS_NS_News,FS_NS_NewsClass where FS_NS_News.ClassID=FS_NS_NewsClass.ClassID and isLock<>1 and isRecyle=0"&StrSearch&" Order By PopId Desc "
  82. ListObj.open ListSQL,Conn,1,1
  83. if Not ListObj.eof Then
  84. ListObj.PageSize=int_RPP
  85. cPageNo=NoSqlHack(Request.QueryString("Page"))
  86. If cPageNo="" Then cPageNo = 1
  87. If not isnumeric(cPageNo) Then cPageNo = 1
  88. cPageNo = Clng(cPageNo)
  89. If cPageNo<=0 Then cPageNo=1
  90. If cPageNo>ListObj.PageCount Then cPageNo=ListObj.PageCount 
  91. ListObj.AbsolutePage=cPageNo
  92. FOR int_Start=1 TO int_RPP 
  93. If Instr(IDList,","&ListObj("ID")&",")=0 Then
  94. 'Response.write "<tr><td colspan=5 class=""hback""></td></tr>"
  95. if trim(ListObj("CurtTitle"))<>"" then
  96. temp=ListObj("CurtTitle")
  97. else
  98. temp=ListObj("NewsTitle")
  99. end if
  100. Response.write "<tr><td class=""hback""><a href='News_edit.asp?NewsID="&(ListObj("NewsID"))&"&ClassID="&(ListObj("ClassID"))&"' title=点击查看本条新闻>"&left(ListObj("NewsTitle"),36)&"</a></td><td align=center class=""hback"">"&ListObj("ClassName")&"</td><td align=center class=""hback""><button id=""New"&ListObj("NewsID")&""" onclick=""AddUnNewList('"&ListObj("NewsID")&"','"&Replace(Replace(ListObj("NewsTitle"),"""",""),"'","")&"');"">加入不规则新闻</button></td></tr>"&vbcrlf
  101. End If
  102. IDList = IDList & ListObj("ID") & ","
  103. ListObj.MoveNext
  104. If ListObj.eof or ListObj.bof then exit for
  105.   NEXT
  106. Else
  107. Response.write "<tr><td colspan=""3"" class=""hback""></td></tr><tr><td colspan=""3"" height=""23"">没有与关键字相关的新闻</td></tr>"
  108. End If
  109. Response.Write("<tr><td class=""hback"" colspan=""3"" align=""right"">"&fPageCount(ListObj,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)  & vbcrlf&"</td></tr>")
  110. ListObj.Close
  111. Set ListObj=nothing
  112. %>
  113. </table>
  114. </td>
  115. </tr>
  116. </table>
  117. <script language="javascript">
  118. <!--
  119. function AddUnNewList(NewId,NewTitle){
  120. var ListLen=parent.UnNewArray.length;
  121. var FindFlag=-1;
  122. for (var i=0;i<ListLen;i++){
  123. if (parent.UnNewArray[i][0]==NewId){
  124. FindFlag=i;
  125. break;
  126. }
  127. }
  128. if (FindFlag>-1){
  129. if (confirm("确定移除吗?")){
  130. parent.UnNewArray.remove(FindFlag,1);
  131. parent.DisplayUnNews();
  132. CheckUnNews();
  133. parent.UnNewPreviewCh();
  134. }
  135. }else{
  136. parent.UnNewArray[ListLen]=[NewId,NewTitle,NewTitle,(ListLen+1)];
  137. parent.DisplayUnNews();
  138. CheckUnNews();
  139. parent.UnNewPreviewCh();
  140. }
  141. }
  142. function CheckUnNews(){
  143. var ListLen=parent.UnNewArray.length;
  144. var FindFlag=-1;
  145. var buttons=document.getElementsByTagName("button");
  146. for (var j=0;j<buttons.length;j++){
  147. FindFlag=-1
  148. for (var i=0;i<ListLen;i++){
  149. if (("New"+parent.UnNewArray[i][0])==buttons[j].id){
  150. FindFlag=j;
  151. break;
  152. }
  153. }
  154. if (FindFlag>-1){
  155. buttons[j].innerText="从不规则新闻中删除";
  156. }else{
  157. buttons[j].innerText="加入不规则新闻";
  158. }
  159. }
  160. }
  161. CheckUnNews();
  162. -->
  163. </script>
  164. </body>
  165. <%
  166. Set Conn=nothing
  167. %>
  168. </html>