Source for file rss.class.php
Documentation is available at rss.class.php
* @package Template Engine
* This method allows to create a Rss 2.0 feeds
public function rssWrite($rss, $items, $charset=
'iso-8859-1', $write =
true)
if(empty($charset))$charset =
'iso-8859-1';
@header("content-type: application/xml");
$rss['description'] =
str_replace(array("&","<",">"), array('&', "<", ">"), $rss['description']);
$xml =
'<?xml version="1.0" encoding="'.
$charset.
'"?>'.
"\n";
$xml .=
'<rss version="2.0">'.
"\n";
$xml .=
'<channel>'.
"\n";
$xml .=
'<title>'.
$rss['title'].
'</title>'.
"\n";
$xml .=
'<link>'.
$rss['link'].
'</link>'.
"\n";
$xml .=
'<description>'.
$rss['description'].
'</description>'.
"\n";
$xml .=
'<copyright>'.
$rss['copyright'].
'</copyright>'.
"\n";
$xml .=
'<generator>'.
'TPLN Php Template v'.
TPLN_VERSION.
'</generator>'.
"\n";
$xml .=
' <title>'.
$rss['title'].
'</title>'.
"\n";
$xml .=
' <url>'.
$rss['image_url'].
'</url>'.
"\n";
$xml .=
' <link>'.
$rss['link'].
'</link>'.
"\n";
$xml .=
' </image>'.
"\n";
$item['description'] =
str_replace(array("&","<",">"), array('&', "<", ">"), $item['description']);
$xml .=
' <title>'.
$item['title'].
'</title>'.
"\n";
$xml .=
' <link>'.
$item['link'].
'</link>'.
"\n";
$xml .=
' <pubDate>'.
$item['pubDate'].
'</pubDate>'.
"\n";
$xml .=
' <description>'.
$item['description'].
'</description>'.
"\n";
$xml .=
' </channel>'.
"\n";
Documentation generated on Sat, 06 Mar 2010 21:34:00 +0100 by phpDocumentor 1.4.3