<!--#include file="inc/config.asp"-->
<!--#include file="inc/conn.asp"-->
<% 
Response.Charset = "gb2312" 
Response.ContentType="text/xml" 
Dim sql 
sql = "select top 20 title,linkurl,moditime,demons,author,classid from news order by id desc" 
Set rs = conn.Execute(sql) 
Response.Write("<?xml version=""1.0"" encoding=""gb2312"" ?>") 
Response.Write("<rss version=""2.0"">") 
Response.Write("<channel>") 
Response.Write("<title>"&rs(0)&"</title>") 
Response.Write("<link>"&SiteUrl&rs(1)&"</link>") 
Response.Write("<description>"&rs(3)&"</description>") 
Do While not rs.eof
	Response.Write("<item>") 
	Response.Write("<title><![CDATA["&rs("title")&"]]></title>") 
	Response.Write("<link><![CDATA["&SiteUrl&rs("linkurl")&"]]></link>") 
	Response.Write("<description><![CDATA["&left(rs("demons"),150)&"]]></description>") 
	Response.Write("<author><![CDATA["&rs("author")&"]]></author>") 
	Response.Write("<category><![CDATA["&rs("classid")&"]]></category>") 
	Response.Write("<pubDate>" & return_RFC822_Date(rs("moditime"),"GMT") & "</pubDate>") 
	Response.Write("</item>") 
	rs.MoveNext() 
Loop 
rs.close
set rs=nothing
Response.Write("</channel>") 
Response.Write("</rss>") 
Function return_RFC822_Date(byVal myDate, byVal TimeZone) 
Dim myDay, myDays, myMonth, myYear 
Dim myHours, myMinutes, mySeconds 
myDate = CDate(myDate) 
myDay = EnWeekDayName(myDate) 
myDays = Right("00" & Day(myDate),2) 
myMonth = EnMonthName(myDate) 
myYear = Year(myDate) 
myHours = Right("00" & Hour(myDate),2) 
myMinutes = Right("00" & Minute(myDate),2) 
mySeconds = Right("00" & Second(myDate),2) 
return_RFC822_Date = myDay&", "& _ 
myDays&" "& _ 
myMonth&" "& _ 
myYear&" "& _ 
myHours&":"& _ 
myMinutes&":"& _ 
mySeconds&" "& _ 
" " & TimeZone 
End Function 
''星期转换函数 
Function EnWeekDayName(InputDate) 
Dim Result 
Select Case WeekDay(InputDate,1) 
Case 1:Result="Sun" 
Case 2:Result="Mon" 
Case 3:Result="Tue" 
Case 4:Result="Wed" 
Case 5:Result="Thu" 
Case 6:Result="Fri" 
Case 7:Result="Sat" 
End Select 
EnWeekDayName = Result 
End Function 
''月份转换函数 
Function EnMonthName(InputDate) 
Dim Result 
Select Case Month(InputDate) 
Case 1:Result="Jan" 
Case 2:Result="Feb" 
Case 3:Result="Mar" 
Case 4:Result="Apr" 
Case 5:Result="May" 
Case 6:Result="Jun" 
Case 7:Result="Jul" 
Case 8:Result="Aug" 
Case 9:Result="Sep" 
Case 10:Result="Oct" 
Case 11:Result="Nov" 
Case 12:Result="Dec" 
End Select 
EnMonthName = Result 
End Function 

call connclose
%>