📄 rss.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Option explicit
Response.Buffer=True
'修改显示的链接留言本index.asp
const weburl="index.asp"
dim db%>
<!--#include file="CONN.ASP"-->
<%
sub connurl(DBName)
On Error Resume Next
set conn=Server.CreateObject("ADODB.Connection")
dim DBHost,DBstr
if instr(DBName,",")>0 then DBHost="sql"
Select Case (DBHost)
Case "sql"
DBstr=split(DBName,",")
conn.Open "provider=sqloledb;uid=" & DBstr(2) & ";pwd=" & DBstr(3) & ";server=" & DBstr(1) & ";database="& DBstr(0)
Case Else
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBName
End Select
If Err Then
err.Clear
Set conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
end sub
dim conn,rs
'------------------------------------
dim forumid
dim action
forumid=int(Request.QueryString("forumid"))
if not isNumeric(forumid) then
response.write("参数错误")
response.end
end if
call connurl(db)
Set rs=conn.Execute("select top 30 a.id,a.jd_title,a.jd_date,a.jd_rdate,a.jd_name,a.jd_reid,b.jd_name from topics a,forum b where a.jd_forumid=b.id and (b.jd_cls in (0,1,2,10)) and a.jd_cls<3 and a.jd_forumid="&forumid&" order by jd_rdate desc",0,1)
dim xmlString
response.ContentType = "text/xml"
xmlString="<?xml version=""1.0"" encoding=""gb2312""?>"
xmlString=xmlString&"<rss version=""2.0""><channel>"
xmlString=xmlString&"<title>多多校园"
If not rs.eof then xmlString=xmlString&"--『"&rs(6)&"』"
xmlString=xmlString&"最新30篇主题</title>"
xmlString=xmlString&"<link>http://www.ddtaobao.com</link>"
xmlString=xmlString&"<language>zh-cn</language>"
xmlString=xmlString&"<description>多多校园</description>"
xmlString=xmlString&"<copyright>http://www.jd100.net/</copyright>"
xmlString=xmlString&"<generator>Rss Generator By ddtaobao.com</generator>"
xmlString=xmlString&"<webMaster>kayvin@sohu.com</webMaster>"
If not rs.eof then
do while not rs.eof
xmlString=xmlString&"<item>"
xmlString=xmlString&"<title><![CDATA["&rs(1)&"]]></title>"
xmlString=xmlString&"<link><![CDATA["&weburl&"?action=view_topics&forumid="&forumid&"&id="&rs(0)&"]]></link>"
xmlString=xmlString&"<author>"&rs(4)&"</author>"
xmlString=xmlString&"<pubDate><![CDATA["&rs(2)&"]]></pubDate>"
xmlString=xmlString&"<description><![CDATA["
if rs(5)<>"0" then
xmlString=xmlString& "最后回复:"&rs(5)& " 时间:"&rs(3)&" 详细内容请点击标题"
end if
xmlString=xmlString&"]]></description>"
xmlString=xmlString&"</item>"
rs.movenext
loop
Else
rs.close:set rs=nothing
conn.close:Set conn=nothing
xmlString=xmlString&"<item>"
xmlString=xmlString&"<title><![CDATA[NO Topic]]></title>"
xmlString=xmlString&"</item>"
End If
xmlString=xmlString&"</channel></rss>"
rs.close:set rs=nothing
conn.close:Set conn=nothing
RESPONSE.WRITE xmlString
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -