<!--#include file="../fy_inc/fy.User.asp"-->
<%
Dim ModeID,ClassID,sql,rs,rs2,sql2,j,classtitle
classid=Rsql(fycms.s("classid"))
ModeID=fycms.act_l(ClassID,10)
 If modeid=0 Then  
 	classtitle="最近更新新闻列表"
	 Call  rsstop()
 	echo  listclass
 Else 
 	classtitle=fycms.ACT_L(ClassID,2)
	 Call  rsstop()
 	echo  listarticle(ClassID)
End If 
echo "</channel>"&vbcrlf &"</rss>"&vbcrlf
Sub rsstop()
     response.ContentType="text/xml"
    echo "<?xml version=""1.0"" encoding=""gb2312""?>" & _
        vbcrlf&"<?xml-stylesheet type=""text/xsl"" href=""rss.xslt"" version=""1.0""?>" & _
        vbcrlf&"<rss version=""2.0"">" & _
        vbcrlf&"<channel>" & _
        vbcrlf&"  <title><![CDATA["&fycms.fycms_Sys(0)&"-"&classtitle&""&date()&"Rss Generator www.fycms.com]]></title>" & _
		vbcrlf&"  <description><![CDATA["&fycms.fycms_Sys(0)&"_"&classtitle&""&"]]></description>" & _
        vbcrlf&"  <link>"&fycms.acturl&"</link>" & _
        vbcrlf&"  <language>zh-cn</language>" & _
         vbcrlf&"  <Currentlink><![CDATA["&fycms.acturl&"]]></Currentlink>" & _
        vbcrlf&"  <docs><![CDATA["&fycms.fycms_Sys(0)&"]]></docs>" & _
        vbcrlf&"  <generator><![CDATA[Rss Generator By fycms.com]]></generator>" & _
        vbcrlf&"  <image>" & _
        vbcrlf&"    <title><![CDATA["&fycms.fycms_Sys(0)&"]]></title>" & _
         vbcrlf&"    <url>"&fycms.acturl&fycms.fycms_Sys(5)&"</url>" & _
         vbcrlf&"    <link>"&fycms.acturl&"</link>" & _
        vbcrlf&"  </image>"& vbcrlf


End Sub 


Function listclass()
  Dim i
  Set Rs = fycms.actexe( "Select ClassID From Class_fy Where  actlink=1 Order by Orderid asc,ID asc")
	If rs.eof then rs.close:set rs=nothing:Exit  Function 
	sql=rs.getrows(-1)
	rs.close:set rs=Nothing
	for i=0 to ubound(sql,2)
		listclass=listclass&listarticle(sql(0,i))
    next
 End Function 
Function listarticle(cid)
	Dim listrsstop,strdescription
	
	Set Rs2 = fycms.actexe("SELECT top 50 ID,classid,Title,addtime,ActLink,FileName,InfoPurview,ReadPoint,PicUrl,Intro,Content,CopyFrom,Author,KeyWords,pinyin  FROM "&fycms.ACT_C(fycms.ACT_L(cid,10),2)&"   Where classid=" & cid & " AND isAccept=0 AND delif=0   order by IsTop Desc,ID desc" )
	If rs2.eof then rs2.close:set rs2=nothing:Exit  Function 
	sql2=rs2.getrows(-1)
	rs2.close:set rs2=Nothing
	for j=0 to ubound(sql2,2)
		listarticle=listarticle& "<item>" &vbcrlf
		listarticle=listarticle& "<title><![CDATA["&sql2(2,j)&"]]></title>" & vbcrlf
 		If Trim(sql2(9,j))<>"" Then 
		   strdescription=GetStrValue(Replace(Replace(Replace(delhtml(sql2(9,j)), vbCrLf, ""), "[NextPage]", ""), "&nbsp;", ""), 200,"")
		Else
		   strdescription=GetStrValue(Replace(Replace(Replace(delhtml(sql2(10,j)), vbCrLf, ""), "[NextPage]", ""), "&nbsp;", ""), 200,"")
		End If 
 		Dim strlinkurl,strUserName,strtim,strcategory
 		listarticle=listarticle&"<description><![CDATA["&strdescription&"]]></description>" & vbcrlf
 		listarticle=listarticle&"<link><![CDATA["&fycms.GetInfoUrlall(fycms.ACT_L(cid,10),sql2(1,j),sql2(0,j),sql2(4,j),sql2(5,j),sql2(6,j),sql2(7,j),sql2(14,j))&"]]></link>" & vbcrlf
		If sql2(12,j)<>"" Then 
		listarticle=listarticle&"<author><![CDATA["&sql2(12,j)&"]]></author>" & vbcrlf
		Else 
		listarticle=listarticle&"<author><![CDATA[佚名]]></author>" & vbcrlf
		End If 
		listarticle=listarticle&"<pubDate><![CDATA["&sql2(3,j)&"]]></pubDate>" & vbcrlf
		listarticle=listarticle&"<category><![CDATA["&fycms.ACT_L(sql2(1,j),2)&"]]></category>" & vbcrlf
		listarticle=listarticle&"<comments><![CDATA["&fycms.GetInfoUrlall(fycms.ACT_L(cid,10),sql2(1,j),sql2(0,j),sql2(4,j),sql2(5,j),sql2(6,j),sql2(7,j),sql2(14,j))&"]]></comments>" & vbcrlf
		listarticle=listarticle&"</item>"&vbcrlf&vbcrlf
     Next 
 
End Function 
%>