tsys _rss程序

2018-09-06 12:45

阅读:383

  示例地址:



站点:

该程序放根目录

或者其他目录,地址自己改,读出最新的20条资源.(可以修改成读取get叁数的形式)

自动判断网站地址端口,无需要人工干预.
复制代码 代码如下:
<%Optionexplicit%>
<!--#includefile=Manage/Include/Config.do-->
<%
DimsSQL,rs,sCrLf,sXmlClear,sRssHead,sRssEnd,Url
sCrLf=chr(13)&chr(10)回车+换行
IfRequest.ServerVariables(HTTPS)=onThen
URL=
Else
URL=
EndIf
Url=Url&Request.ServerVariables(SERVER_NAME)&:&Request.ServerVariables(SERVER_PORT)
sXmlClear=<?xmlversion=1.0encoding=gb2312?>&sCrLf
sRssHead=<rdf:RDFxmlns:rdf=
sRssHead=<rssversion=2.0>&sCrLf
sRssHead=sRssHead&<channel>&sCrLf
sRssHead=sRssHead&<title>&Def_MySiteTitle&</title>&sCrLf
sRssHead=sRssHead&<description>&Def_SysTitle&</description>&sCrLf
sRssHead=sRssHead&<link>&url&</link>&sCrLf
sRssHead=sRssHead&<language>zh-cn</language>&sCrLf
sRssHead=sRssHead&<docs>NewsCenter</docs>&sCrLf
sRssHead=sRssHead&<generator>RssGenerator</generator><items>&sCrLf

sRssEnd=</items></channel></rss>

Response.CharSet=gb2312数据集
Response.ContentType=application/xml
Response.Expires=0
Response.writesXmlClear
Response.writesRssHead
DimConn
SetConn=Server.CreateObject(Adodb.Connection)
Conn.OpenConnStr
Dimsql
Sql=selectTop&RssNewsList_PageSize&Title,FilePath,AddTime,KeyWord,Content,Classtitle,EditorTitleFromview_NewsInfowhereDel=0OrderByaddTimeDESC
SetRs=Server.CreateObject(ADODB.RecordSet)
Rs.opensql,conn,1,2
IFRS.EOFANDRS.BOFThen
Response.Write(<item></item>)
Else
dowhilenotrs.eof
Response.Write(<item>)&RS(Title)
Response.Write(<title><![CDATA[&Rs(Title)&]]></title>)
Response.Write(<description><![CDATA[&RS(KeyWord)&]]>)
Response.Write(<content><![CDATA[&RS(Content)&]]></content>)
Response.Write(<link>&url&RS(FilePath)&</link>)
Response.Write(<subject>&RS(Classtitle)&</subject>)
Response.Write(<creator>&RS(EditorTitle)&</creator>)
Response.Write(<date>&RS(addtime)&</date>)
Response.Write(</description></item>)
RS.MoveNext
loop
endif
rs.close
setrs=nothing
Response.writesRssEnd
%>
陆续放出少年不在修改版tsys修改办法```


评论


亲,登录后才可以留言!