"RSSFeed", # "atom" => "AtomFeed", ); class FeedItem { var $Title = "Wiki"; var $Description = ""; var $Url = ""; var $Date = ""; function FeedItem( $Title, $Description, $Url, $Date = "" ) { $this->Title = $Title; $this->Description = $Description; $this->Url = $Url; $this->Date = $Date; } /* 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; } function getDate() { return $this->Date; } } class ChannelFeed extends FeedItem { /* Abstract functions, override! */ function outHeader() { # print ""; } function outItem( $item ) { # print "..."; } function outFooter() { # print ""; } } class RSSFeed extends ChannelFeed { function formatTime( $ts ) { return gmdate( "D, d M Y H:i:s T", wfTimestamp2Unix( $ts ) ); } function outHeader() { global $wgVersion; print '<' . '?xml version="1.0" encoding="utf-8"?' . ">\n"; ?> <?php print $this->getTitle() ?> getUrl() ?> getDescription() ?> getLanguage() ?> MediaWiki formatTime( wfTimestampNow() ) ?> <?php print $item->getTitle() ?> getUrl() ?> getDescription() ?> getDate() ) { ?>formatTime( $item->getDate() ) ?>