gusucode.com > 爱美尔女性商城源码 1.0源码程序 > wen/Rss/Rss.asp

    <!--#include file="../Inc/conn.asp"-->
<%
Dim id
id=LaoYRequest(Trim(request("id")))
If ID=9999 then
Response.Write("<?xml version=""1.0"" encoding=""gb2312""?>") & VbCrLf
Response.Write("<rss version=""2.0"" xmlns:content=""http://purl.org/rss/1.0/modules/content/"" xmlns:wfw=""http://wellformedweb.org/CommentAPI/"" xmlns:dc=""http://purl.org/dc/elements/1.1/"">") & VbCrLf
Response.Write("<channel>") & VbCrLf
Response.Write("<title><![CDATA["&SiteTitle&"]]></title>") & VbCrLf
Response.Write("<link>http://"&SiteUrl&"/</link>") & VbCrLf
Response.Write("<description><![CDATA["&Sitedescription&"]]></description>") & VbCrLf
Response.Write("<webMaster><![CDATA["&Sitelx&"]]></webMaster>") & VbCrLf
Response.Write("<language>zh-cn</language>") & VbCrLf
Response.Write("<copyright>Powered by 8586.com.cn. Copyright c 2010 乐享网络文章管理系统</copyright>") & VbCrLf
Response.Write("<generator><![CDATA[Powered by 8586.com.cn. Copyright ? 2010 乐享网络文章管理系统]]></generator>") & VbCrLf
Response.Write("<lastBuildDate>"&FormatEnTime(""&Now&"")&"</lastBuildDate>") & VbCrLf
Response.Write("<ttl>60</ttl>") & VbCrLf
set rs1=server.createobject("ADODB.Recordset")
sql1="select Top 50 ID,Title,Author,Artdescription,ClassID,DateAndTime from "&tbname&"_Article where yn = 0"
SQL1=SQL1&" order by DateAndTime desc,ID desc"
rs1.open sql1,conn,1,3
If Not rs1.Eof Then 
do while not (rs1.eof or err) 
Response.Write("<item>")
Response.Write("<guid>http://"&SiteUrl&SitePath&"html/?"&rs1("ID")&".html</guid>") & VbCrLf
Response.Write("<title><![CDATA["&LoseHtml(rs1("Title"))&"]]></title>") & VbCrLf
Response.Write("<author><![CDATA["&rs1("Author")&"]]></author>") & VbCrLf
Response.Write("<description><![CDATA["&left(LoseHtml(rs1("Artdescription")),250)&"...]]></description>") & VbCrLf
Response.Write("<link>http://"&SiteUrl&SitePath&"html/?"&rs1("ID")&".html</link>") & VbCrLf
Response.Write("<category domain=""http://"&SiteUrl&SitePath&"Class.asp?ID="&rs1("ClassID")&"""><![CDATA["&classlist(rs1("ClassID"))&"]]></category>") & VbCrLf
Response.Write("<pubDate>"&FormatEnTime(""&rs1("DateAndTime")&"")&"</pubDate>") & VbCrLf
Response.Write("</item>") & VbCrLf
  rs1.movenext
  loop
  end if
  rs1.close
  set rs1=nothing
Response.Write("</channel>") & VbCrLf
Response.Write("</rss>")

Else

set rsclass=server.createobject("adodb.recordset")
sql="select * from "&tbname&"_Class where link=0 And id="&id
rsclass.open sql,conn,1,1
if rsclass.eof and rsclass.bof then
Call Alert ("Error","-1")
else
Response.Write("<?xml version=""1.0"" encoding=""gb2312""?>") & VbCrLf
Response.Write("<rss version=""2.0"" xmlns:content=""http://purl.org/rss/1.0/modules/content/"" xmlns:wfw=""http://wellformedweb.org/CommentAPI/"" xmlns:dc=""http://purl.org/dc/elements/1.1/"">") & VbCrLf
Response.Write("<channel>") & VbCrLf
Response.Write("<title><![CDATA["&rsclass("ClassName")&"-"&SiteTitle&"]]></title>") & VbCrLf
Response.Write("<link>http://"&SiteUrl&"/</link>") & VbCrLf
Response.Write("<description><![CDATA["&Sitedescription&"]]></description>") & VbCrLf
Response.Write("<webMaster><![CDATA["&Sitelx&"]]></webMaster>") & VbCrLf
Response.Write("<language>zh-cn</language>") & VbCrLf
Response.Write("<copyright>Powered by 8586.com.cn. Copyright c 2010 乐享网络文章管理系统</copyright>") & VbCrLf
Response.Write("<generator><![CDATA[Powered by 8586.com.cn. Copyright ? 2010 乐享网络文章管理系统]]></generator>") & VbCrLf
Response.Write("<lastBuildDate>"&FormatEnTime(""&Now&"")&"</lastBuildDate>") & VbCrLf
Response.Write("<ttl>60</ttl>") & VbCrLf
set rs1=server.createobject("ADODB.Recordset")
sql1="select Top 10 ID,Title,Author,Artdescription,ClassID,DateAndTime from "&tbname&"_Article where yn = 0"
	If Yao_MyID(ID)="0" then
		SQL1=SQL1&" and ClassID="&ID&""
	else
		MyID = Replace(""&Yao_MyID(ID)&"","|",",")
		SQL1=SQL1&" and ClassID in ("&MyID&")"
	End if
SQL1=SQL1&" order by DateAndTime desc,ID desc"
rs1.open sql1,conn,1,3
If Not rs1.Eof Then 
do while not (rs1.eof or err) 
Response.Write("<item>")
Response.Write("<guid>http://"&SiteUrl&SitePath&"html/?"&rs1("ID")&".html</guid>") & VbCrLf
Response.Write("<title><![CDATA["&LoseHtml(rs1("Title"))&"]]></title>") & VbCrLf
Response.Write("<author><![CDATA["&rs1("Author")&"]]></author>") & VbCrLf
Response.Write("<description><![CDATA["&left(LoseHtml(rs1("Artdescription")),250)&"...]]></description>") & VbCrLf
Response.Write("<link>http://"&SiteUrl&SitePath&"html/?"&rs1("ID")&".html</link>") & VbCrLf
Response.Write("<category domain=""http://"&SiteUrl&SitePath&"Class.asp?ID="&rs1("ClassID")&"""><![CDATA["&classlist(rs1("ClassID"))&"]]></category>") & VbCrLf
Response.Write("<pubDate>"&FormatEnTime(""&rs1("DateAndTime")&"")&"</pubDate>") & VbCrLf
Response.Write("</item>") & VbCrLf
  rs1.movenext
  loop
  end if
  rs1.close
  set rs1=nothing
Response.Write("</channel>") & VbCrLf
Response.Write("</rss>")
rsclass.close
set rsclass=nothing
end if

End if
function FormatEnTime(theTime)
dim myArray1,myArray2,years,months,days,mytime
FormatEnTime=""
myArray1=split(theTime," ")
theTime=myArray1(0)
myArray2=split(theTime,"-")
years=myArray2(0)
months=myArray2(1)
days=myArray2(2)
mytime=myArray1(1)
select case months
case "1"
months="January"
case "2"
months="February"
case "3"
months="March"
case "4"
months="April"
case "5"
months="May"
case "6"
months="June"
case "7"
months="July"
case "8"
months="August"
case "9"
months="September"
case "10"
months="October"
case "11"
months="November"
case else
months="December"
end select
theTime=days&" "&months&" "&years&" "&mytime&" "&"+0800"
FormatEnTime=theTime
End Function
%>