3 $wgFeedClasses = array(
5 # "atom" => "AtomFeed",
10 var $Description = "";
14 function FeedItem( $Title, $Description, $Url, $Date = "" ) {
15 $this->Title
= $Title;
16 $this->Description
= $Description;
22 function xmlEncode( $string ) {
23 global $wgInputEncoding, $wgLang;
24 $string = str_replace( "\r\n", "\n", $string );
25 if( strcasecmp( $wgInputEncoding, "utf-8" ) != 0 ) {
26 $string = $wgLang->iconv( $wgInputEncoding, "utf-8" );
28 return htmlspecialchars( $string );
31 return $this->xmlEncode( $this->Title
);
34 return $this->xmlEncode( $this->Url
);
36 function getDescription() {
37 return $this->xmlEncode( $this->Description
);
39 function getLanguage() {
40 global $wgLanguageCode;
41 return $wgLanguageCode;
48 class ChannelFeed
extends FeedItem
{
49 /* Abstract functions, override! */
50 function outHeader() {
53 function outItem( $item ) {
54 # print "<item>...</item>";
56 function outFooter() {
61 class RSSFeed
extends ChannelFeed
{
62 function formatTime( $ts ) {
63 return gmdate( "D, d M Y H:i:s T", wfTimestamp2Unix( $ts ) );
66 function outHeader() {
69 print '<' . '?xml version="1.0" encoding="utf-8"?' . ">\n";
72 <title
><?php
print $this->getTitle() ?
></title
>
73 <link
><?php
print $this->getUrl() ?
></link
>
74 <description
><?php
print $this->getDescription() ?
></description
>
75 <language
><?php
print $this->getLanguage() ?
></language
>
76 <generator
>MediaWiki
<?php
print $wgVersion ?
></generator
>
77 <lastBuildDate
><?php
print $this->formatTime( wfTimestampNow() ) ?
></lastBuildDate
>
81 function outItem( $item ) {
84 <title
><?php
print $item->getTitle() ?
></title
>
85 <link
><?php
print $item->getUrl() ?
></link
>
86 <description
><?php
print $item->getDescription() ?
></description
>
87 <?php
if( $item->getDate() ) { ?
><pubDate
><?php
print $this->formatTime( $item->getDate() ) ?
></pubDate
><?php
} ?
>
93 function outFooter() {