本站用的rss输出

时间:2021-05-18

用了getrows提高效率
复制代码 代码如下:
<%
Response.Charset="GB2312"
Response.ContentType="text/xml"
Response.Expires=60
Response.Write("<?xmlversion=""1.0""encoding=""GB2312""?>")
response.write("<?xml-stylesheettype=""text/css""href=""images/rss.css""?>")
dimRssId,sql,rs,tid,rs_type,sql_type,sqqq,rsshow,thetitle,themon,theday,thedate,theyear
RssId=CheckStr(Request.QueryString("RSSID"))
ifnotIsInteger(RssId)thenRssId=1
'得到子类别的所有id
setrsshow=conn.execute("selecttname,counts,tidfrominfotypewhereid="&RSSID&"")
ifnot(rsshow.eofandrsshow.bof)then
thetitle=split(rsshow("tname"),"|")(rsshow("counts")-1)
tid=rsshow("tid")
endif
rsshow.close
setrsshow=nothing
setrs_type=server.CreateObject("ADODB.RecordSet")
sql_type="selectidfrominfotypewheretidlike'"&tid&"%'"
rs_type.opensql_type,conn,1,1
dowhilenotrs_type.EOF
sqqq=sqqq&rs_type("id")&","
rs_type.MoveNext
loop
rs_type.close
setrs_type=nothing
ifsqqq=""thensqqq=tid
sql="selecttop20type_id,title,id,content,datetime,authorfromnewswheretype_idin("&sqqq&")andisshow=trueorderbydatetimedesc,iddesc"
setrs=conn.execute(sql)
ifrs.eoforrs.bofthen
redimfeedcat(0,0)
else
feedrows=rs.getrows()
endif
rs.close
setrs=nothing
conn.close
setconn=nothing
%>
<rssversion="2.0">
<channel>
<title><![CDATA[<%=thetitle%>--]]></webMaster>
<generator>jb512006</generator>
<%
ifubound(FeedRows,1)=0then
Response.Write("<item></item>")
else
fori=0toubound(FeedRows,2)
thedate=feedrows(4,i)
theyear=year(thedate)
themon=month(thedate)
iflen(themon)<2thenthemon="0"&themon
theday=theyear&themon
%>
<item>
<link><%=siteurl%>/html/<%=theday%>/<%=FeedRows(2,i)%>.htm</link>
<title><![CDATA[<%=FeedRows(1,i)%>]]></title>
<author><%=FeedRows(5,i)%></author>
<%
IFFeedRows(3,i)<>""andnotisnull(FeedRows(3,i))then
Response.Write("<description><![CDATA["&ubbcode(left(FeedRows(3,i),500))&"]]></description>")
endif
%>
<pubDate><%=FeedRows(4,i)%></pubDate>

</item>
<%
next
endif
%>
</channel>
</rss>

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章