📄 mrss.inc.php
字号:
<?php
class rssfeed
{
var $m_RSSversion = "1.0";
var $m_XMLversion = "1.0";
var $m_channel = NULL;
var $m_FeedItem = "";
var $m_channelItem = "";
function rssfeed( )
{
$this->m_channel = "<?xml version=\"".$this->m_XMLversion."\"?>\n";
$this->m_channel .= "<rdf:RDF \n xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n xmlns=\"http://purl.org/rss/1.0/\"\n >\n";
}
function addchannel( $ChannelTitle, $ChannelDescription, $ChannelLanguage, $ChannelURL )
{
$this->m_channel .= "\t<channel rdf:about=\"".$ChannelURL."\">\n";
$this->m_channel .= "\t\t<title>".$ChannelTitle."</title>\n";
$this->m_channel .= "\t\t<description>".$ChannelDescription."</description>\n";
$this->m_channel .= "\t\t<language>".$ChannelLanguage."</language>\n";
}
function addchannellink( $ChannelLink )
{
$this->m_channel .= "\t\t<link>".$ChannelLink."</link>\n";
}
function addchannelimage( $ImageURL, $ImageTitle, $ImageLink )
{
$this->m_channel .= "\t\t<image>\n";
$this->m_channel .= "\t\t\t<title>".$ImageTitle."</title>\n";
$this->m_channel .= "\t\t\t<url>".$ImageURL."</url>\n";
$this->m_channel .= "\t\t\t<link>".$ImageLink."</link>";
$this->m_channel .= "\t\t</image>\n";
}
function addchannelitem( $ChannelItem )
{
$this->m_channelItem .= "\t\t\t\t<rdf:li resource=\"".$ChannelItem."\" />\n";
}
function addfeeditem( $ItemTitle, $ItemURL, $ItemDescription )
{
$this->m_FeedItem .= "\t<item rdf:about=\"".$ItemURL."\">\n";
$this->m_FeedItem .= "\t\t<title>".$ItemTitle."</title>\n";
$this->m_FeedItem .= "\t\t<link>".$ItemURL."</link>\n";
$this->m_FeedItem .= "\t\t<description>".$ItemDescription."</description>\n";
$this->m_FeedItem .= "\t</item>\n";
}
function releasefeed( )
{
header( "Content-Type: text/xml" );
print $this->m_channel;
if ( 1 <= strlen( $this->m_channelItem ) )
{
print "\t\t<items>\n\r\n \t\t\t\t\t\t\t\t<rdf:Seq>\n".$this->m_channelItem."\t\t\t</rdf:Seq>\n\r\n \t\t\t\t \t\t</items>\n";
}
print "\t</channel>\n";
print $this->m_FeedItem;
print "</rdf:RDF>\n";
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -