# http://www.gnu.org/copyleft/gpl.html
$wgFeedClasses = array(
- "rss" => "RSSFeed",
- "atom" => "AtomFeed",
+ 'rss' => 'RSSFeed',
+ 'atom' => 'AtomFeed',
);
class FeedItem {
- var $Title = "Wiki";
- var $Description = "";
- var $Url = "";
- var $Date = "";
- var $Author = "";
+ var $Title = 'Wiki';
+ var $Description = '';
+ var $Url = '';
+ var $Date = '';
+ var $Author = '';
- function FeedItem( $Title, $Description, $Url, $Date = "", $Author = "", $Comments = "" ) {
+ function FeedItem( $Title, $Description, $Url, $Date = '', $Author = '', $Comments = '' ) {
$this->Title = $Title;
$this->Description = $Description;
$this->Url = $Url;
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", $string );
+ if( strcasecmp( $wgInputEncoding, 'utf-8' ) != 0 ) {
+ $string = $wgLang->iconv( $wgInputEncoding, 'utf-8', $string );
}
return htmlspecialchars( $string );
}
# print "</feed>";
}
- function outXmlHeader( $mimetype="application/xml" ) {
+ function outXmlHeader( $mimetype='application/xml' ) {
global $wgServer, $wgStylePath, $wgOut;
# We take over from $wgOut, excepting its cache header info
class RSSFeed extends ChannelFeed {
function formatTime( $ts ) {
- return gmdate( "D, d M Y H:i:s \G\M\T", wfTimestamp2Unix( $ts ) );
+ return gmdate( 'D, d M Y H:i:s \G\M\T', wfTimestamp2Unix( $ts ) );
}
function outHeader() {
global $wgVersion;
$this->outXmlHeader();
- ?><rss version="2.0">
+ ?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title><?php print $this->getTitle() ?></title>
<link><?php print $this->getUrl() ?></link>
<link><?php print $item->getUrl() ?></link>
<description><?php print $item->getDescription() ?></description>
<?php if( $item->getDate() ) { ?><pubDate><?php print $this->formatTime( $item->getDate() ) ?></pubDate><?php } ?>
- <?php if( $item->getAuthor() ) { ?><author><?php print $item->getAuthor() ?></author><?php }?>
+ <?php if( $item->getAuthor() ) { ?><dc:creator><?php print $item->getAuthor() ?></dc:creator><?php }?>
<?php if( $item->getComments() ) { ?><comments><?php print $item->getComments() ?></comments><?php }?>
</item>
<?php
class AtomFeed extends ChannelFeed {
function formatTime( $ts ) {
// need to use RFC 822 time format at least for rss2.0
- return gmdate( "Y-m-d\TH:i:s", wfTimestamp2Unix( $ts ) );
+ return gmdate( 'Y-m-d\TH:i:s', wfTimestamp2Unix( $ts ) );
}
function outHeader() {
}
}
-?>
\ No newline at end of file
+?>