"RSSFeed",
# "atom" => "AtomFeed",
);
class FeedItem {
var $Title = "Wiki";
var $Description = "";
var $Url = "";
function FeedItem( $Title, $Description, $Url ) {
$this->Title = $Title;
$this->Description = $Description;
$this->Url = $Url;
}
/* Static... */
function xmlEncode( $string ) {
global $wgInputEncoding, $wgLang;
$string = str_replace( "\r\n", "\n", $string );
if( strcasecmp( $wgInputEncoding, "utf-8" ) != 0 ) {
$string = $wgLang->iconv( $wgInputEncoding, "utf-8" );
}
return htmlspecialchars( $string );
}
function getTitle() {
return $this->xmlEncode( $this->Title );
}
function getUrl() {
return $this->xmlEncode( $this->Url );
}
function getDescription() {
return $this->xmlEncode( $this->Description );
}
function getLanguage() {
global $wgLanguageCode;
return $wgLanguageCode;
}
}
class ChannelFeed extends FeedItem {
/* Abstract functions, override! */
function outHeader() {
# print "";
}
function outItem( $item ) {
# print "- ...
";
}
function outFooter() {
# print "";
}
}
class RSSFeed extends ChannelFeed {
function outHeader() {
print '<' . '?xml version="1.0" encoding="utf-8"?' . ">\n";
?>
getTitle() ?>
getUrl() ?>
getDescription() ?>
getLanguage() ?>
-
getTitle() ?>
getUrl() ?>
getDescription() ?>