Location: PHPKode > projects > chillyCMS > chillyCMS/modules/rssfeed/feed.php
<?php
header("Content-Type: application/xml; charset=ISO-8859-1");
define('DOIT',true);

require_once("../../config.php");
require_once(PATH."/core/settings.include.php");

$db = new Database();

//show only items which are real content, accessible to everybody, no menu and, if necessary from a certain menu
if (isset($_GET["category"])) {
	$category = intval($_GET["category"]);
	$db->query("select * from site_content where access=0 and modid=1 and depth>0 and treeid=$category order by date_new desc limit 10");
	$items = $db->getdata_array();
} else {
	$db->query("select * from site_content where access=0 and modid=1 and depth>0 order by date_new desc limit 10");
	$items = $db->getdata_array();
}
$db->query("select settings from site_modules where id=".intval($_GET["id"]));
$feedtitle = $db->getdata_array();
$db->close();
$feedtitle = $feedtitle["settings"];
$feedtitle = explode(",",$feedtitle);
$feedtitle = $feedtitle[2];
if ($feedtitle=="") {
	$feedtitle=$settings["description"];
}
$newest=$items[0];
$pubdate=date("D, j M Y G:i:s O",strtotime($newest["date_new"]));

echo "<?xml version='1.0'?>
<rss version='2.0' xmlns:atom='http://www.w3.org/2005/Atom'>
<channel>
<title>".$settings["sitename"]."</title>
<link>".URL."/</link>
<description>$feedtitle</description>
<language>".$settings["language"]."</language>
<pubDate>$pubdate</pubDate>
<lastBuildDate>".date("D, j M Y G:i:s O")."</lastBuildDate>
<generator>chillyCMS</generator>
<managingEditor>".$settings["siteemail"]." (".$settings["author"].")</managingEditor>
<webMaster>".$settings["siteemail"]." (".$settings["author"].")</webMaster>
<atom:link href='".URL."/modules/rssfeed/feed.php' rel='self' type='application/rss+xml' />";

foreach ($items as $i) {
	echo "
	<item>
		<title>".$i["name"]."</title>
		<link>".URL."/index.php?id=".$i["id"]."</link>
		<guid>".URL."/index.php?id=".$i["id"]."</guid>
		<description>".substr(html_entity_decode(strip_tags($i["content"])),0,200)."</description>
		<pubDate>".date("D, j M Y G:i:s O",strtotime($i["date_new"]))."</pubDate>
	</item>";
}

echo "
</channel>
</rss>";
?>
Return current item: chillyCMS