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

数据库编程

开发平台:

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. Dim Conn,User_Conn
  10. Dim CharIndexStr
  11. 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
  12. Dim obj_newslist_rs,newslist_sql,strpage,str_showTF,str_ClassID_1,str_Editor,str_Keyword,str_GetKeyword,str_ktype
  13. Dim select_count,select_pagecount,i,Str_GetPopID,Str_PopID,str_check,str_UrlTitle,icNum,str_addType,str_addType_1
  14. Dim str_Rec,str_isTop,str_hot,str_pic,str_highlight,str_bignews,str_filt,str_Constr,str_Top,tmp_pictf
  15. 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
  16. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
  17. int_RPP=15 '设置每页显示数目
  18. int_showNumberLink_=8 '数字导航显示数目
  19. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  20. str_nonLinkColor_="#999999" '非热链接颜色
  21. toF_="<font face=webdings title=""首页"">9</font>"   '首页 
  22. toP10_=" <font face=webdings title=""上十页"">7</font>" '上十
  23. toP1_=" <font face=webdings title=""上一页"">3</font>" '上一
  24. toN1_=" <font face=webdings title=""下一页"">4</font>" '下一
  25. toN10_=" <font face=webdings title=""下十页"">8</font>" '下十
  26. toL_="<font face=webdings title=""最后一页"">:</font>"
  27. MF_Default_Conn
  28. MF_User_Conn
  29. MF_Session_TF 
  30. '权限判断
  31. 'Call MF_Check_Pop_TF("NS_Class_000001") 
  32. '得到会员组列表 
  33. set Fs_news = new Cls_News
  34. Fs_News.GetSysParam()
  35. If Not Fs_news.IsSelfRefer Then response.write "非法提交数据":Response.end
  36. str_ClassID = NoSqlHack(Request.QueryString("ClassID"))
  37. %>
  38. <html xmlns="http://www.w3.org/1999/xhtml">
  39. <head>
  40. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  41. <title>RSS___Powered by foosun Inc.</title>
  42. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  43. </head>
  44. <body>
  45. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  46.   <tr class="hback"> 
  47.     <td class="xingmu"> <strong>XML</strong><a href="../../help?Lable=NS_Class_RSS" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a>               
  48.       <%
  49. if Trim(Request.QueryString("ClassID")) <>"" Then
  50. Response.Write "位置:<a href=""Class_Rss.asp"" class=""sd""><b>XML</b></a>&nbsp;>>&nbsp;"&Fs_news.GetAdd_ClassName(Request.QueryString("ClassID"))
  51. Else
  52. Response.Write"位置:所有XML"
  53. End if
  54. if str_ClassID<>"" then
  55. news_SQL = "Select Orderid,id,ClassID,ClassName,ClassEName,IsUrl,AddNewsType from FS_DS_Class where Parentid  = '"& str_ClassID &"' and ReycleTF=0 Order by Orderid desc,ID desc"
  56. Else
  57. news_SQL = "Select Orderid,id,ClassID,ClassName,ClassEName,IsUrl,AddNewsType from FS_DS_Class where Parentid  = '0'  and ReycleTF=0  Order by Orderid desc,ID desc"
  58. End if
  59. Set obj_news_rs = server.CreateObject(G_FS_RS)
  60. obj_news_rs.Open news_SQL,Conn,1,3
  61. if fs_news.addNewsType = 1 then str_addType_1 ="News_add.asp":else:str_addType_1 ="News_add_Conc.asp":end if
  62. %> </td>
  63.   </tr>
  64.   <tr> 
  65.     <form name="form1" method="post" action="">
  66.       <td width="94%" height="18" class="hback"> <div align="left"><a href="Class_rss.asp">首页</a> 
  67.           | <a href="Class_Rss.asp?ClassID=<%=Request.QueryString("ClassID")%>">所有<% =  Fs_news.allInfotitle %>
  68.           </a> |&nbsp; <a href="Class_Rss.asp?ClassID=<%=Request.QueryString("ClassID")%>&isCheck=1&Keyword=<%=Request("keyword")%>&ktype=<%=Request("ktype")%>">已审核</a> 
  69.           &nbsp;|&nbsp; <a href="Class_Rss.asp?ClassID=<%=Request.QueryString("ClassID")%>&isCheck=0&Keyword=<%=Request("keyword")%>&ktype=<%=Request("ktype")%>">未审核</a> 
  70.           | <a href="Class_Rss.asp?ClassID=<%=Request.QueryString("ClassID")%>&NewsTyp=Constr&Keyword=<%=Request("keyword")%>&ktype=<%=Request("ktype")%>">投稿</a> 
  71.           | <a href="Class_Rss.asp?ClassID=<%=Request.QueryString("ClassID")%>&NewsTyp=Constr&Keyword=<%=Request("keyword")%>&ktype=<%=Request("ktype")%>"></a><a href="Class_Rss.asp?ClassID=<%=Request.QueryString("ClassID")%>&NewsTyp=recTF">推荐 
  72.           </a> | <a href="Class_Rss.asp?ClassID=<%=Request.QueryString("ClassID")%>&NewsTyp=isTop&Keyword=<%=Request("keyword")%>&ktype=<%=Request("ktype")%>">置顶 
  73.           </a> | <a href="Class_Rss.asp?ClassID=<%=Request.QueryString("ClassID")%>&NewsTyp=hot&Keyword=<%=Request("keyword")%>&ktype=<%=Request("ktype")%>">热点 
  74.           </a> | <a href="Class_Rss.asp?ClassID=<%=Request.QueryString("ClassID")%>&NewsTyp=pic&Keyword=<%=Request("keyword")%>&ktype=<%=Request("ktype")%>">图片 
  75.           </a> | <a href="Class_Rss.asp?ClassID=<%=Request.QueryString("ClassID")%>&NewsTyp=highlight&Keyword=<%=Request("keyword")%>&ktype=<%=Request("ktype")%>">精彩 
  76.           </a> | <a href="Class_Rss.asp?ClassID=<%=Request.QueryString("ClassID")%>&NewsTyp=bignews&Keyword=<%=Request("keyword")%>&ktype=<%=Request("ktype")%>">头条 
  77.           </a> | <a href="Class_Rss.asp?ClassID=<%=Request.QueryString("ClassID")%>&NewsTyp=filt&Keyword=<%=Request("keyword")%>&ktype=<%=Request("ktype")%>">幻灯片</a>  </div></td>
  78.     </form>
  79.   </tr>
  80. </table>
  81.   <%
  82.   if Not obj_news_rs.eof then
  83. Response.Write("<table width=""98%"" border=""0"" align=""center"" cellpadding=""2"" cellspacing=""1"" class=""table""> <tr class=""hback""><td>")
  84. Response.Write("<table width=""100%"" border=""0"" align=""center"" cellpadding=""3"" cellspacing=""1"" >")
  85. Response.Write("<tr>")
  86. icNum = 0
  87. Do while Not obj_news_rs.eof 
  88. if obj_news_rs("AddNewsType") =1 then
  89. str_addType = "News_add.asp"
  90. Else
  91. str_addType ="News_add_Conc.asp"
  92. End if
  93. if obj_news_rs("IsUrl") = 1 then
  94. isUrlStr = "(<span class=""tx"">外</span>)"
  95. str_Href = ""
  96. str_Href_title = ""& obj_news_rs("ClassName") &""
  97. Else
  98. isUrlStr = ""
  99. str_Href = "<a href=""Class_Rss.asp?ClassID="&obj_news_rs("ClassID")&"""><img src=""../Images/rss.gif"" border=""0"" alt=""查看RSS""></a>"
  100. str_Href_title = "<a href=""Class_Rss.asp?ClassID="& obj_news_rs("ClassID") &""" title=""点击进入下一级栏目"">"& obj_news_rs("ClassName") &"</a>"
  101. End if
  102. Set obj_news_rs_1 = server.CreateObject(G_FS_RS)
  103. obj_news_rs_1.Open "Select Count(ID) from FS_DS_Class where ParentID='"& obj_news_rs("ClassID") &"'",Conn,1,1
  104. if obj_news_rs_1(0)>0 then
  105. str_action=  "<img src=""images/+.gif""></img>"& str_Href_title &""
  106. Else
  107. str_action=  "<img src=""images/-.gif""></img>"& str_Href_title &""
  108. End if
  109. obj_news_rs_1.close:set obj_news_rs_1 =nothing
  110. '得到下载数量
  111. if obj_news_rs("IsUrl") = 0 then
  112. Set obj_cnews_rs = server.CreateObject(G_FS_RS)
  113. obj_cnews_rs.Open "Select ID from FS_DS_List where ClassID='"& obj_news_rs("ClassID") &"'",Conn,1,1
  114. news_count = "("&obj_cnews_rs.recordcount&"/"&fs_news.GetTodayNewsCount(obj_news_rs("ClassID"))
  115. obj_cnews_rs.close:set obj_cnews_rs = nothing
  116. Else
  117. news_count = ""
  118. End if
  119. Response.Write"<td height=""22"">"
  120. Response.Write str_action&isUrlStr&news_count&str_Href
  121. Response.Write "</td>"
  122. obj_news_rs.MoveNext
  123. icNum = icNum + 1
  124. if icNum mod 4 = 0 then
  125. Response.Write("</tr><tr>")
  126. End if
  127. loop
  128. Response.Write("</tr></table></td></tr></table>")
  129. End if
  130. %>
  131.   
  132. <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="table">
  133.   <form name="form2" method="post" action="">
  134.     <tr> 
  135.       <td><div align="center"> 
  136.           <%
  137. Dim Rss_List,sCrLf
  138. Rss_List = ""
  139. sCrLf = chr(13) & chr(10)
  140. Rss_List = Rss_List &"gb2312"
  141. Rss_List = Rss_List &"text/xml"
  142. Rss_List = "<?xml version='1.0' encoding='gb2312'?>" & sCrLf
  143. Rss_List = Rss_List & "<rss version='2.0'>"&sCrLf
  144. Rss_List = Rss_List &  "<channel>"&sCrLf
  145. Rss_List = Rss_List &  " <title>风讯</title>"&sCrLf
  146. Rss_List = Rss_List &  " <description>风讯公司</description>"&sCrLf
  147. Rss_List = Rss_List &  " <link>http://www.foosun.cn</link>"&sCrLf
  148. Rss_List = Rss_List &  " <language>zh-cn</language>"&sCrLf
  149. Rss_List = Rss_List &  " <docs>foosun Article Center</docs>"&sCrLf
  150. Rss_List = Rss_List &  " <generator>Rss Generator By Foosun Inc.</generator>"&sCrLf
  151. Rss_List = Rss_List &  " <image>"&sCrLf
  152. Rss_List = Rss_List &  " <title>风讯</title>"&sCrLf
  153. Rss_List = Rss_List &  " <link>http://www.foosun.cn</link>"&sCrLf
  154. Rss_List = Rss_List &  " <url>http://vutoo.com/html/images/grzz.gif</url>"&sCrLf
  155. Rss_List = Rss_List &  " </image>"&sCrLf
  156. Call GetFunctionstr
  157. if Request("NewsTyp") = "recTF" Then:str_Rec=" and "& CharIndexStr &"(NewsProperty,1,1)='1'":Else:str_Rec="":End if
  158. if Request("NewsTyp") = "isTop" Then:str_isTop=" and PopID=4 or PoPID=5":Else:str_isTop="":End if
  159. if Request("NewsTyp") = "hot" Then:str_hot=" and "& CharIndexStr &"(NewsProperty,13,1)='1'":Else:str_hot="":End if
  160. if Request("NewsTyp") = "pic" Then:str_pic=" and  isPicNews=1":Else:str_pic="":End if
  161. if Request("NewsTyp") = "highlight" Then:str_highlight=" and "& CharIndexStr &"(NewsProperty,15,1)='1'":Else:str_highlight="":End if
  162. if Request("NewsTyp") = "bignews" Then:str_bignews="  and "& CharIndexStr &"(NewsProperty,11,1)='1'":Else:str_bignews="":End if
  163. if Request("NewsTyp") = "filt" Then:str_filt=" and "& CharIndexStr &"(NewsProperty,21,1)='1'":Else:str_filt="":End if
  164. if Request("NewsTyp") = "Constr" Then:str_Constr=" and "& CharIndexStr &"(NewsProperty,7,1)='1'":Else:str_Constr="":End if
  165. if Trim(Request("Editor")) <>"" then:str_Editor = " and Editor = '"& Request("Editor")&"'":Else:str_Editor = "":End if
  166. if str_ClassID<>"" and len(str_ClassID)=15 then str_ClassID_1 = " and ClassID='"& str_ClassID &"'":Else:str_ClassID_1 = "":End if
  167. if Request("isCheck") = "1" then
  168. str_check = " and islock=0"
  169. elseif Request("isCheck") = "0" then
  170. str_check = " and islock=1"
  171. Else
  172. str_Check = ""
  173. End if
  174. newslist_sql = "Select top 50 ID,NewsID,PopID,ClassID,Content,NewsTitle,IsURL,isPicNews,URLAddress,Editor,Hits,NewsProperty,isLock,isRecyle,addtime,author,source from FS_NS_News where isRecyle=0 and isdraft=0 "& str_Editor & str_Rec & str_isTop & str_hot & str_pic & str_highlight & str_bignews & str_filt & str_Constr & str_ClassID_1 & str_check  &" Order by PopID desc,addtime desc,ID desc"
  175. Set obj_newslist_rs = Server.CreateObject(G_FS_RS)
  176. obj_newslist_rs.Open newslist_sql,Conn,1,3
  177. if not obj_newslist_rs.eof then
  178. do while not obj_newslist_rs.eof 
  179. Rss_List = Rss_List & "<item>"&sCrLf 
  180. Rss_List = Rss_List & " <title>"& obj_newslist_rs("NewsTitle") &"</title>"&sCrLf 
  181. if obj_newslist_rs("isUrl")=1 then
  182. Rss_List = Rss_List & " <link>"&obj_newslist_rs("URLAddress")&"</link>"&sCrLf 
  183. 'Rss_List = Rss_List & "<description><![CDATA[标题下载,无内容]></description>"&sCrLf 
  184. Else
  185. Rss_List = Rss_List & " <link>""1.html"&"</link>"&sCrLf 
  186. Rss_List = Rss_List & " <description><![CDATA["&obj_newslist_rs("Content")&"]]></description>"&sCrLf 
  187. end if
  188. if len(trim(obj_newslist_rs("author")))=0 then
  189. Rss_List = Rss_List & " <author>"&obj_newslist_rs("Source")&"</author>"&sCrLf 
  190. Else
  191. Rss_List = Rss_List &  " <author>"&obj_newslist_rs("author")&"</author>"&sCrLf 
  192. End if
  193. Rss_List = Rss_List &  " <pubDate>"&obj_newslist_rs("AddTime")&"</pubDate>"&sCrLf 
  194. Rss_List = Rss_List & "</item>"&sCrLf&sCrLf
  195. obj_newslist_rs.movenext
  196. Loop
  197. obj_newslist_rs.close:set obj_newslist_rs = nothing
  198. else
  199. Rss_List = Rss_List &""
  200. End if
  201. Rss_List = Rss_List & "</channel>"
  202. Rss_List = Rss_List & "</rss>"
  203.   %>
  204.           <textarea name="RssShow" rows="30" style="width:100%"><% = Rss_List%></textarea>
  205.         </div></td>
  206.     </tr>
  207.   </form>
  208. </table>
  209. </body>
  210. </html>
  211. <%
  212. set obj_newslist_rs = nothing
  213. obj_news_rs.close
  214. set obj_news_rs =nothing
  215. set Fs_news = nothing
  216. %>
  217. <script language="JavaScript" type="text/JavaScript">
  218. </script>
  219. <!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->