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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="lib/cls_main.asp" -->
  4. <!--#include file="../../FS_Inc/Function.asp"-->
  5. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  6. <!--#include file="../../FS_InterFace/NS_Function.asp" -->
  7. <!--#include file="../../FS_Inc/Func_page.asp" -->
  8. <%'Copyright (c) 2006 Foosun Inc. Code by Simpwind.Xie
  9. Response.Buffer = True
  10. Response.Expires = -1
  11. Response.CacheControl = "no-cache"
  12. Dim Conn,User_Conn
  13. Dim CharIndexStr,strShowErr
  14. Dim Fs_news,obj_news_rs,obj_news_rs_1,isUrlStr,str_Href,obj_cnews_rs,news_count,str_Href_title,str_action,str_ClassID,news_SQL
  15. Dim obj_newslist_rs,newslist_sql,strpage,str_showTF,str_ClassID_1,str_Editor,str_Keyword,str_GetKeyword,str_ktype,tmp_draft
  16. Dim select_count,select_pagecount,i,Str_GetPopID,Str_PopID,str_check,str_UrlTitle,icNum,str_addType,str_addType_1
  17. Dim str_Rec,str_isTop,str_hot,str_pic,str_highlight,str_bignews,str_filt,str_Constr,str_Top,tmp_pictf,tmp_isRecyle
  18. Dim str_s_classIDarray,tmp_splitarrey_id,tmp_splitarrey_Classid,tmp_i,str_Move_type,str_t_classID,C_NewsIDarrey,Tmp_rs,Tmp_TF_Rs
  19. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
  20. int_RPP=20'设置每页显示数目
  21. int_showNumberLink_=8 '数字导航显示数目
  22. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  23. str_nonLinkColor_="#999999" '非热链接颜色
  24. toF_="<font face=webdings title=""首页"">9</font>"   '首页 
  25. toP10_=" <font face=webdings title=""上十页"">7</font>" '上十
  26. toP1_=" <font face=webdings title=""上一页"">3</font>" '上一
  27. toN1_=" <font face=webdings title=""下一页"">4</font>" '下一
  28. toN10_=" <font face=webdings title=""下十页"">8</font>" '下十
  29. toL_="<font face=webdings title=""最后一页"">:</font>"
  30. MF_Default_Conn
  31. MF_User_Conn
  32. MF_Session_TF 
  33. '权限判断
  34. 'Call MF_Check_Pop_TF("NS_Class_000001") 
  35. '得到会员组列表 
  36. set Fs_news = new Cls_News
  37. Fs_News.GetSysParam()
  38. If Not Fs_news.IsSelfRefer Then response.write "非法提交数据":Response.end
  39. if Request("Action") = "signDel" then
  40. if fs_news.ReycleTF = 1 then
  41. Conn.execute("Update FS_NS_News set isRecyle = 1 where NewsID='"& NoSqlHack(Request.QueryString("NewsID"))&"'")
  42. strShowErr = "<li>"& Fs_news.allInfotitle &"已经删除</li><li>"& Fs_news.allInfotitle &"已经临时放到回收站中</li>"
  43. Else
  44. strShowErr = "<li>"& Fs_news.allInfotitle &"已经彻底删除</li>"
  45. Conn.execute("Delete From FS_NS_News where NewsID='"& NoSqlHack(Request.QueryString("NewsID"))&"'")
  46. '删除浏览权限新闻,以防产生垃圾信息
  47. Conn.execute("Delete From  FS_MF_POP  where InfoID='"& NoSqlHack(Request.QueryString("NewsID"))&"' and PopType='NS'")
  48. End if
  49. '删除静态文件
  50. '******************保留
  51. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  52. Response.end
  53. End if
  54. if Request("Action") = "draftDel" then
  55. strShowErr = "<li>"& Fs_news.allInfotitle &"已经彻底删除</li>"
  56. Conn.execute("Delete From FS_NS_News where NewsID='"& NoSqlHack(Request.QueryString("NewsID"))&"'")
  57. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  58. Response.end
  59. End if
  60. %>
  61. <html xmlns="http://www.w3.org/1999/xhtml">
  62. <head>
  63. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  64. <title>新闻管理___Powered by foosun Inc.</title>
  65. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  66. </head>
  67. <body>
  68. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  69.   <tr class="hback"> 
  70.     <td width="100%" class="xingmu"><a href="#" onmouseover="this.T_BGCOLOR='#404040';this.T_FONTCOLOR='#FFFFFF';return escape('<div align='center'>FoosunCMS4.0<br> Code by Simpwind.Xie <BR>Copyright (c) 2006 Foosun Inc</div>')" class="sd"><strong>我的工作目录</strong></a><a href="../../help?Lable=NS_News_MyFolder" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a>               
  71.     </td>
  72.   </tr>
  73.   <tr> 
  74.     <td height="18" class="hback"><div align="left"><img src="../Images/all_article_icon.gif" width="11" height="10" border="0">&nbsp;<a href="News_MyFolder.asp" 您所有的文章都在这里>所有<% =  Fs_news.allInfotitle %>
  75.         </a>&nbsp;┆<img src="../Images/draft_icon.gif" width="10" height="9">&nbsp;<a href="News_MyFolder.asp?Action=draft" title="草稿箱里最多放20篇<% =  Fs_news.allInfotitle %>在这里">草稿夹</a>&nbsp;┆<img src="../Images/recycle_icon.gif" width="10" height="11">&nbsp;<a href="News_MyFolder.asp?Action=reycle">回收站</a>&nbsp;┆<a href="Class_add.asp?ClassID=<%=Request.QueryString("classid")%>&Action=add">创建栏目</a>&nbsp;┆<a href="News_add.asp?ClassID=<%=Request.QueryString("classid")%>">&nbsp;创建<% =  Fs_news.allInfotitle %>
  76.         </a> </div></td>
  77.   </tr>
  78. </table>
  79. <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
  80.   <tr class="hback"> 
  81.     <td>
  82. <%
  83. Set obj_news_rs = server.CreateObject(G_FS_RS)
  84. news_SQL = "Select Orderid,id,ClassID,ClassName,ClassEName,IsUrl,AddNewsType from FS_NS_NewsClass where Parentid  = '0'  and ReycleTF=0  Order by Orderid desc,ID desc"
  85. obj_news_rs.Open news_SQL,Conn,1,3
  86. if fs_news.addNewsType = 1 then str_addType_1 ="News_add.asp":else:str_addType_1 ="News_add_Conc.asp":end if
  87. %>
  88. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" >
  89.         <%
  90. Response.Write("<tr>")
  91. icNum = 0
  92. Do while Not obj_news_rs.eof 
  93. if obj_news_rs("AddNewsType") =1 then
  94. str_addType = "News_add.asp"
  95. Else
  96. str_addType ="News_add_Conc.asp"
  97. End if
  98. if obj_news_rs("IsUrl") = 1 then
  99. isUrlStr = "(<span class=""tx"">外</span>)"
  100. str_Href = ""
  101. str_Href_title = ""& obj_news_rs("ClassName") &""
  102. Else
  103. isUrlStr = ""
  104. str_Href = "<a href="& str_addType &"?ClassID="&obj_news_rs("ClassID")&"><img src=""../images/add.gif"" border=""0"" alt=""添加"& Fs_news.allInfotitle &"""></a>"
  105. str_Href_title = "<a href=""News_MyFolder.asp?ClassID="& obj_news_rs("ClassID") &"&Action="& Request.QueryString("Action")&""" title=""点击进入下一级栏目"">"& obj_news_rs("ClassName") &"</a>"
  106. End if
  107. Set obj_news_rs_1 = server.CreateObject(G_FS_RS)
  108. obj_news_rs_1.Open "Select Count(ID) from FS_NS_NewsClass where ParentID='"& obj_news_rs("ClassID") &"'",Conn,1,1
  109. if obj_news_rs_1(0)>0 then
  110. str_action=  "<img src=""images/+.gif""></img>"& str_Href_title &""
  111. Else
  112. str_action=  "<img src=""images/-.gif""></img>"& str_Href_title &""
  113. End if
  114. obj_news_rs_1.close:set obj_news_rs_1 =nothing
  115. '得到新闻数量
  116. if obj_news_rs("IsUrl") = 0 then
  117. Set obj_cnews_rs = server.CreateObject(G_FS_RS)
  118. obj_cnews_rs.Open "Select ID from FS_NS_News where ClassID='"& obj_news_rs("ClassID") &"' and  isRecyle=0 and Editor='"& session("Admin_Name") &"' ",Conn,1,1
  119. obj_cnews_rs.close:set obj_cnews_rs = nothing
  120. Else
  121. news_count = ""
  122. End if
  123. Response.Write"<td height=""22"">"
  124. Response.Write str_action&isUrlStr&"("&str_Href&")"
  125. Response.Write "</td>"
  126. obj_news_rs.MoveNext
  127. icNum = icNum + 1
  128. if icNum mod 5 = 0 then
  129. Response.Write("</tr><tr>")
  130. End if
  131. loop
  132. Response.Write("</tr>")
  133. %>
  134.       </table></td>
  135.   </tr>
  136. </table>
  137. <%
  138. strpage=request("page")
  139. if len(strpage)=0 Or strpage<1 or trim(strpage)=""Then:strpage="1":end if
  140. if Trim(Request.QueryString("Action")) = "draft" then:tmp_draft = " and isdraft=1 and  isRecyle=0":Else:tmp_draft = "":End if
  141. if Trim(Request.QueryString("Action")) = "reycle" then:tmp_isRecyle = " and isRecyle=1":Else:tmp_isRecyle = "":End if
  142. if Trim(Request.QueryString("ClassID")) <>"" then:str_ClassID = " and ClassID='"& Request.QueryString("Classid")&"'":Else:str_ClassID = "":End if
  143. newslist_sql = "Select ID,NewsID,PopID,ClassID,NewsTitle,IsURL,isPicNews,URLAddress,Editor,Hits,NewsProperty,isLock,isdraft,isRecyle,addtime,author,source from FS_NS_News where Editor='"& session("Admin_Name")&"' "& tmp_draft & tmp_isRecyle & str_ClassID &" Order by PopID desc,addtime desc,ID desc"
  144. Set obj_newslist_rs = Server.CreateObject(G_FS_RS)
  145. obj_newslist_rs.Open newslist_sql,Conn,1,1
  146. %>
  147. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  148.   <form name="myForm" method="post" action="News_Manage.asp">
  149.     <tr class="xingmu"> 
  150.       <td colspan="2" class="xingmu"> <div align="center"> </div>
  151.         <div align="center"> 
  152.           <% =  Fs_news.allInfotitle %>
  153.           标题</div></td>
  154.       <td width="12%" class="xingmu"><div align="center">状态</div></td>
  155.       <td width="7%" class="xingmu"><div align="center">审核</div></td>
  156.       <td width="30%" class="xingmu"><div align="center">操作</div></td>
  157.     </tr>
  158.     <%
  159. if obj_newslist_rs.eof then
  160.    obj_newslist_rs.close
  161.    set obj_newslist_rs=nothing
  162.    Response.Write"<TR  class=""hback""><TD colspan=""7""  class=""hback"" height=""40"">没有"& Fs_news.allInfotitle &"。</TD></TR>"
  163. else
  164.    str_showTF = 1
  165. obj_newslist_rs.PageSize=int_RPP
  166. cPageNo=NoSqlHack(Request.QueryString("Page"))
  167. If cPageNo="" Then cPageNo = 1
  168. If not isnumeric(cPageNo) Then cPageNo = 1
  169. cPageNo = Clng(cPageNo)
  170. If cPageNo<=0 Then cPageNo=1
  171. If cPageNo>obj_newslist_rs.PageCount Then cPageNo=obj_newslist_rs.PageCount 
  172. obj_newslist_rs.AbsolutePage=cPageNo
  173. for i=1 to obj_newslist_rs.pagesize
  174. if obj_newslist_rs.eof Then exit For 
  175. Str_GetPopID = obj_newslist_rs("PopID")
  176. if Str_GetPopID = 5 then
  177. Str_PopID = "<IMG Src=""images/newstype/5.gif"" border=""0"" alt=""总置顶"& Fs_news.allInfotitle &",点击查看简洁内容"">"
  178. str_Top = "<a href=News_Manage.asp?NewsID="& obj_newslist_rs("NewsID")&"&Action=signUnTop  onClick=""{if(confirm('确定解除总固顶吗?')){return true;}return false;}"">解固</a>"
  179. Elseif Str_GetPopID = 4 then
  180. Str_PopID = "<IMG Src=""images/newstype/4.gif"" border=""0"" alt=""栏目置顶"& Fs_news.allInfotitle &",点击查看简洁内容"">"
  181. str_Top = "<a href=News_Manage.asp?NewsID="& obj_newslist_rs("NewsID")&"&Action=signUnTop  onClick=""{if(confirm('确定解除栏目固顶吗?')){return true;}return false;}"">解固</a>"
  182. Elseif Str_GetPopID = 3 then
  183. Str_PopID = "<IMG Src=""images/newstype/3.gif"" border=""0"" alt=""总推荐"& Fs_news.allInfotitle &",点击查看简洁内容"">"
  184. str_Top = "<a href=News_Manage.asp?NewsID="& obj_newslist_rs("NewsID")&"&Action=signTop  onClick=""{if(confirm('确定固顶吗?')){return true;}return false;}"">固顶</a>"
  185. Elseif Str_GetPopID = 2 then
  186. Str_PopID = "<IMG Src=""images/newstype/2.gif"" border=""0"" alt=""栏目推荐"& Fs_news.allInfotitle &",点击查看简洁内容"">"
  187. str_Top = "<a href=News_Manage.asp?NewsID="& obj_newslist_rs("NewsID")&"&Action=signTop onClick=""{if(confirm('确定固顶吗?')){return true;}return false;}"">固顶</a>"
  188. Elseif Str_GetPopID = 0 then
  189. Str_PopID = "<IMG Src=""images/newstype/0.gif"" border=""0"" alt=""一般"& Fs_news.allInfotitle &",点击查看简洁内容"">"
  190. str_Top = "<a href=News_Manage.asp?NewsID="& obj_newslist_rs("NewsID")&"&Action=signTop onClick=""{if(confirm('确定固顶吗?')){return true;}return false;}"">固顶</a>"
  191. End if
  192. if obj_newslist_rs("isUrl") = 1 then
  193. str_UrlTitle = "<a href="""& obj_newslist_rs("URLAddress") &""" target=""_blank""><Img src=""../images/folder/url.gif"" border=""0"" alt=""标题新闻,点击转到标题地址""></img></a>"
  194. Else
  195. str_UrlTitle = ""
  196. if obj_newslist_rs("isPicNews") = 1 then
  197. tmp_pictf="<a href=""javascript:m_PicUrl('News_Pic_Modify.asp?NewsID="&obj_newslist_rs("NewsID")&"')""><Img src=""../images/folder/img.gif"" alt=""图片新闻,点击更改图片"" border=""0""></img></a>"
  198. else
  199. tmp_pictf="<Img src=""../images/folder/folder_1.gif"" alt=""文字新闻""></img>"
  200. end if
  201. end if
  202. %>
  203.     <tr> 
  204.       <td width="6%" height="18" class="hback" id=item$pval[CatID]) style="CURSOR: hand"  onmouseup="opencat(M_Newsid<% = obj_newslist_rs("ID")%>);"  language=javascript><% = Str_PopID %></td>
  205.       <td width="45%" class="hback"> <% = str_UrlTitle %> <% = tmp_pictf %> <a href="News_edit.asp?NewsID=<% = obj_newslist_rs("NewsID")%>&ClassID=<% = obj_newslist_rs("ClassID")%>" title="添加日期:<% = obj_newslist_rs("addtime")%>"> 
  206.         <% = GotTopic(obj_newslist_rs("Newstitle"),50)%>
  207.         </a></td>
  208.       <td class="hback"> <div align="center"><%
  209.   if obj_newslist_rs("isRecyle")=1 then
  210.    Response.Write("<span class=""tx"">回收站</span>")
  211.   Elseif obj_newslist_rs("isRecyle")=0 and obj_newslist_rs("isdraft")=1 then
  212.    Response.Write("草稿箱")
  213.   End if
  214.   if obj_newslist_rs("isRecyle")=0 and obj_newslist_rs("isdraft")=0 then
  215.    response.Write("正常"& Fs_news.allInfotitle &"")
  216.   End if
  217.   %></div></td>
  218.       <td class="hback"><div align="center"> 
  219.           <%if obj_newslist_rs("isLock")=1 then response.Write"<a href=""News_Manage.asp?NewsID="& obj_newslist_rs("NewsId") &"&Action=singleCheck"" onClick=""{if(confirm('确定通过审核吗?')){return true;}return false;}""><span class=""tx""><b>×</b></span></a>":else response.Write"<a href=""News_Manage.asp?NewsID="& obj_newslist_rs("NewsId") &"&Action=singleUnCheck"" onClick=""{if(confirm('确定锁定吗?')){return true;}return false;}""><b>√</b></a>"%>
  220.         </div></td>
  221.       <td class="hback"><div align="center"> 
  222.           <%if obj_newslist_rs("isRecyle")=1 then%>
  223.           <a href="News_Recyle.asp">回收站</a>
  224. <%Elseif obj_newslist_rs("isdraft")=1 then%>
  225.           <a href="News_edit.asp?NewsID=<% = obj_newslist_rs("NewsID")%>&ClassID=<% = obj_newslist_rs("ClassID")%>">修改</a>|<a href="News_MyFolder.asp?NewsID=<% = obj_newslist_rs("NewsID")%>&Action=draftDel"  onClick="{if(confirm('确定要删除吗?')){return true;}return false;}">删除</a> 
  226.   <%Else%>
  227.           <a href="News_edit.asp?NewsID=<% = obj_newslist_rs("NewsID")%>&ClassID=<% = obj_newslist_rs("ClassID")%>">修改</a>|<a href="News_MyFolder.asp?NewsID=<% = obj_newslist_rs("NewsID")%>&Action=signDel"  onClick="{if(confirm('确定要删除吗?nn如果你在系统参数设置中设置删除<% =  Fs_news.allInfotitle %>到回收站n<% =  Fs_news.allInfotitle %>将删除到回收站中!n必要时候可还原')){return true;}return false;}">删除</a> 
  228.           <%End if%>
  229.         </div></td>
  230.     </tr>
  231.     <tr id="M_Newsid<% = obj_newslist_rs("ID")%>" style="display:none"> 
  232.       <td height="35" colspan="5" class="hback"> <table width="100%" border="0" cellspacing="1" cellpadding="2" class="table">
  233.           <tr class="hback"> 
  234.             <td width="45%" height="20" class="hback"><font style="font-size:12px"> 
  235.               <% =  Fs_news.allInfotitle %>
  236.               类型: 
  237.               <%
  238. if  split(obj_newslist_rs("NewsProperty"),",")(0) then Response.Write("荐|")
  239. if  split(obj_newslist_rs("NewsProperty"),",")(1) then Response.Write("滚|")
  240. if  split(obj_newslist_rs("NewsProperty"),",")(2) then Response.Write("评|")
  241. if  split(obj_newslist_rs("NewsProperty"),",")(3) then Response.Write("稿|")
  242. if  split(obj_newslist_rs("NewsProperty"),",")(4) then Response.Write("远图|")
  243. if  split(obj_newslist_rs("NewsProperty"),",")(5) then Response.Write("头|")
  244. if  split(obj_newslist_rs("NewsProperty"),",")(6) then Response.Write("热|")
  245. if  split(obj_newslist_rs("NewsProperty"),",")(7) then Response.Write("精|")
  246. if  split(obj_newslist_rs("NewsProperty"),",")(8) then Response.Write("规|")
  247. if  split(obj_newslist_rs("NewsProperty"),",")(9) then Response.Write("公|")
  248. if  split(obj_newslist_rs("NewsProperty"),",")(10) then Response.Write("幻|")
  249. %>
  250.               </font></td>
  251.             <td width="22%" class="hback"><font style="font-size:12px">日期: 
  252.               <% = obj_newslist_rs("addtime")%>
  253.               </font></td>
  254.             <td width="14%" class="hback"><font style="font-size:12px">作者: 
  255.               <% = obj_newslist_rs("author")%>
  256.               </font></td>
  257.             <td width="19%" class="hback"><font style="font-size:12px">来源: 
  258.               <% = obj_newslist_rs("source")%>
  259.               </font></td>
  260.           </tr>
  261.         </table></td>
  262.     </tr>
  263.     <%
  264.   obj_newslist_rs.MoveNext
  265.   Next
  266. %>
  267.   </form>
  268.   <tr> 
  269.     <td height="18" colspan="5" class="hback"> <table width="98%" border="0" cellspacing="0" cellpadding="0">
  270.         <tr> 
  271.           <td width="79%" colspan="2" align="right"> <%
  272. response.Write "<p>"&  fPageCount(obj_newslist_rs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)
  273. End if
  274. %> </td>
  275.         </tr>
  276.       </table></td>
  277.   </tr>
  278. </table>
  279. <script language="javascript" type="text/javascript" src="../../FS_Inc/wz_tooltip.js"></script>
  280. </body>
  281. </html>
  282. <%
  283. set Fs_news = nothing
  284. %>
  285. <script language="JavaScript" type="text/JavaScript" src="js/Public.js"></script>
  286. <script language="JavaScript" type="text/JavaScript">
  287. function opencat(cat)
  288. {
  289.   if(cat.style.display=="none"){
  290.      cat.style.display="";
  291.   } else {
  292.      cat.style.display="none"; 
  293.   }
  294. }
  295. function SelectAllClass(){
  296.   for(var i=0;i<document.form_m.s_Classid.length;i++){
  297.     document.form_m.s_Classid.options[i].selected=true;}
  298. }
  299. function UnSelectAllClass(){
  300.   for(var i=0;i<document.form_m.s_Classid.length;i++){
  301.     document.form_m.s_Classid.options[i].selected=false;}
  302. }
  303. function CheckAll(form)  
  304.   {  
  305.   for (var i=0;i<form.elements.length;i++)  
  306.     {  
  307.     var e = myForm.elements[i];  
  308.     if (e.name != 'chkall')  
  309.        e.checked = myForm.chkall.checked;  
  310.     }  
  311. }
  312. function m_PicUrl(gotoURL) {
  313.    var open_url = gotoURL;
  314.    window.open(open_url,'','status=0,directories=0,resizable=0,toolbar=0,location=0,scrollbars=1,width=550,height=480');
  315. }
  316. </script>
  317. <!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->