<%@ language="vbscript" codepage="936" %>
<%

'========================================================================================
' 文 件 名: XML.asp
' 版    本: 岭峰网行业专用留言系统3.10.0 (LFMessS 2020 - 3.10.0.F Build 200604)
' 说    明: RSS 2.0 生成文件 | 请勿自行修改该处文件，以确保程序正确的执行
' 文件日期: 2020-06-04
' 设 计 者: 疾风之狼
'========================================================================================
' 郑州文达岭峰网络科技有限公司.
'========================================================================================
' Copyright (C) 2001-2020 岭峰网. All rights reserved.
' 网    站: http://www.lfmesss.com
' 电子邮件: support@lfmesss.com
' 联系ＱＱ: 85112407
'========================================================================================
%>
<!-- #include file="../common/contencrypt.asp" -->
<!-- #include file="../language/Lang_Base.asp" -->
<!-- #include file="../common/commfun.asp" -->
<!-- #include file="../common/ip_purview.asp" -->
<!-- #include file="../common/purview_default.asp" -->
<!-- #include file="../common/connect.asp" -->
<!-- #include file="../common/checkru.asp" -->
<%
Dim SQL,Tag,ForumID,TopCount,XmlRs,rssTitle
TopCount = 30
maxLen = 10 

Path = "http://"& Request.ServerVariables("server_name") & ":" & Request.ServerVariables("SERVER_PORT") & Replace(Request.ServerVariables("script_name"), "XML.asp", "")
SQL = " id, content, username, addtime, re, encrypt, enpass"
IF Session("LingFengNet_MS_admin") = "ok" Then
	SQL = "SELECT Top "& TopCount & " "& SQL &" FROM lfmessb ORDER BY addtime Desc"
Else
	SQL = "SELECT Top "& TopCount & " "& SQL &" FROM lfmessb where Auditing=2 and enpass='0' ORDER BY addtime Desc"
End IF
rssTitle = LingFengNet_MS_web_name & LingFengNet_MS_language_xml_05

Response.contentType = "application/xml;charset=gbk"
Response.Expires = 0
With Response
	.Write"<?xml version=""1.0"" encoding=""gbk""?> " 
	.Write"<rss version=""2.0"">" 
	.Write"<channel> "
	.Write"<title>"& rssTitle &"</title> "
	.Write"<link>"& Path &"XML.asp</link>" 
	.Write"<description>"& LingFengNet_MS_language_xml_01 &"</description> "
	.Write"<copyright>"& LingFengNet_MS_language_xml_02 &"</copyright>"
	.Write"<generator>"& LingFengNet_MS_language_xml_03 &"</generator> "
	Set rs = Conn.Execute(SQL)
	IF (rs.Eof And rs.Bof) Then
		'Response.Write("<item />")
	Else
		XmlRs = rs.GetRows(-1)
		rs.Close
		Set Rs = Nothing
	End IF
	IF IsArray(XmlRs) Then
		For i = 0 To Ubound(XmlRs,2)
			IF XmlRs(5, i) = 1 Then
				content = DeCrypt(XmlRs(1, i))
				username = DeCrypt(XmlRs(2, i))
				re = DeCrypt(XmlRs(4, i))
			Else
				content = XmlRs(1, i)
				username = XmlRs(2, i)
				re = XmlRs(4, i)
			End IF
				topic = Left(clebr(content), 6)&"***" 	
				topid = XmlRs(0, i)
				times =	XmlRs(3, i)		
			IF LingFengNet_MS_ss = 0 Then
				username = Left(username, 1)&"****" 
			End IF 
			.Write("<item>")
			.Write("<link>"& Path &"default"& Get_Suffix() &"?topid="& topid &" </link>")
			.Write("<title><![CDATA["&topic&"]]></title>")
			.Write("<author>"&username&"</author>")
			.Write("<pubDate>"&DateTimeToGMT(times)&"</pubDate>")
			.Write("<description><![CDATA["&content&"]]></description>")
			.Write("</item>")
		Next
	End IF
	.Write("</channel></rss>")
End With
Conn.Close
Set Conn = Nothing

Function DateTimeToGMT(sDate)
	  Dim dWeek,dMonth
	  Dim strZero,strZone
	  strZero = "00"
	  strZone = "+0800"
	  dWeek = Array("Sun","Mon","Tue","Wes","Thu","Fri","Sat")
	  dMonth = Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
	  DateTimeToGMT = dWeek(WeekDay(sDate) - 1)&", "&Right(strZero & Day(sDate), 2)&" "&dMonth(Month(sDate) - 1)&" "&Year(sDate)&" "&Right(strZero & Hour(sDate), 2)&":"&Right(strZero & Minute(sDate), 2)&":"&Right(strZero & Second(sDate), 2)&" "& strZone
End Function
%>