e5c7c18bc161a402fd28d933ccda74b492c038d6
3 $wgFeedClasses = array(
5 # "atom" => "AtomFeed",
10 var $Description = "";
13 function FeedItem( $Title, $Description, $Url ) {
14 $this->Title
= $Title;
15 $this->Description
= $Description;
20 function xmlEncode( $string ) {
21 global $wgInputEncoding, $wgLang;
22 $string = str_replace( "\r\n", "\n", $string );
23 if( strcasecmp( $wgInputEncoding, "utf-8" ) != 0 ) {
24 $string = $wgLang->iconv( $wgInputEncoding, "utf-8" );
26 return htmlspecialchars( $string );
29 return $this->xmlEncode( $this->Title
);
32 return $this->xmlEncode( $this->Url
);
34 function getDescription() {
35 return $this->xmlEncode( $this->Description
);
37 function getLanguage() {
38 global $wgLanguageCode;
39 return $wgLanguageCode;
43 class ChannelFeed
extends FeedItem
{
44 /* Abstract functions, override! */
45 function outHeader() {
48 function outItem( $item ) {
49 # print "<item>...</item>";
51 function outFooter() {
56 class RSSFeed
extends ChannelFeed
{
57 function outHeader() {
58 print '<' . '?xml version="1.0" encoding="utf-8"?' . ">\n";
59 ?
><!DOCTYPE rss
PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">
62 <title
><?php
print $this->getTitle() ?
></title
>
63 <link
><?php
print $this->getUrl() ?
></link
>
64 <description
><?php
print $this->getDescription() ?
></description
>
65 <language
><?php
print $this->getLanguage() ?
></language
>
69 function outItem( $item ) {
72 <title
><?php
print $item->getTitle() ?
></title
>
73 <link
><?php
print $item->getUrl() ?
></link
>
74 <description
><?php
print $item->getDescription() ?
></description
>
79 function outFooter() {