📄 rss.asp
字号:
<!--#include file="conn.asp"--><%
if SiteConfig("EnableForumsRSS")=0 then
response.write "系统关闭了 RSS 订阅源功能"
Response.End
end if
ForumID=RequestInt("ForumID")
if ForumID > 0 then
Rs.Open "[Wo_ForumPermissions] where ForumID="&ForumID&" and RoleID=0",Conn,1
if Rs.Eof then
response.write "找不到指定的版块的权限表"
Response.End
end if
PermissionRead=Rs("PermissionRead")
PermissionView=Rs("PermissionView")
Rs.Close
if PermissionView=0 or PermissionRead=0 then
response.write "该版块没有开放游客浏览和阅读权限,无法使用 RSS 订阅源!"
Response.End
end if
ChannelTitle=Conn.Execute("select ForumName from [Wo_Forums] where ForumID="&ForumID&"")(0)
ChannelLink=""&SiteURL&"ShowForum.asp?ForumID="&ForumID&""
end if
Response.contentType="application/xml"
function FormatTime(value)
FormatTime=""&FormatDateTime(value, 2)&" "&FormatDateTime(value, 4)&""
FormatTime=""&Year(value)&"-"&Add0(Month(value))&"-"&Add0(Day(value))&" "&FormatDateTime(value, 4)&":"&Add0(Second(value))&""
end function
function Add0(value)
if Len(value)<2 then value="0"&value
Add0=value
end function
%><?xml version="1.0" encoding="gb2312"?>
<rss version="2.0">
<channel>
<title><%=ChannelTitle%></title>
<link><%=ChannelLink%></link>
<image>
<title><%=SiteConfig("SiteName")%></title>
<url><%=SiteURL%>images/logo.gif</url>
<link><%=SiteURL%>Default.asp</link>
</image>
<%
sql="select top "&SiteConfig("RSSDefaultThreadsPerFeed")&" * from [Wo_Threads] where IsDel=0 and IsApproved=1 and ForumID="&ForumID&" order by ThreadID desc"
Set Rs=Conn.Execute(sql)
do while Not Rs.Eof
%>
<item>
<title><%=Rs("Topic")%></title>
<link><%=SiteURL%>ShowPost.asp?ThreadID=<%=Rs("ThreadID")%></link>
<category><%=Rs("Category")%></category>
<author><%=Rs("PostAuthor")%></author>
<pubDate><%=FormatTime(Rs("PostTime"))%></pubDate>
<description><![CDATA[<%=Conn.Execute("Select Body From [Wo_Posts"&Rs("PostsTableName")&"] where ThreadID="&Rs("ThreadID")&" and ParentID=0")(0)%>]]></description>
</item>
<%
Rs.MoveNext
Loop
Set Rs = Nothing
%>
</channel>
</rss>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -