<?php
/*--------------------------------------------+
| PHP-Fusion 5 - Content Management System    |
|---------------------------------------------|
| author: Nick Jones (Digitanium) � 2002-2005 |
| web: http://www.php-fusion.co.uk            |
| email: nick@php-fusion.co.uk                |
|---------------------------------------------|
| Released under the terms and conditions of  |
| the GNU General Public License (Version 2)  |
+--------------------------------------------*/

header("Content-Type: text/xml");
require_once "../maincore.php";
require_once THEME."theme.php";

$result3=dbquery("SELECT * FROM ".$db_prefix."news ORDER BY news_datestamp DESC LIMIT 0,10");
$result2=dbquery("SELECT siteurl FROM ".$db_prefix."settings");
$base=dbresult($result2,0);

echo "<?xml version=\"1.0\" encoding=\"".$locale['charset']."\"?>\n\n
	<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n
	\"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n
	<rss version=\"0.91\">\n\n
	<channel>\n
	<title>".$settings['sitename']." - News</title>\n
	<link>".$base."</link>\n
	<description>".$settings['description']."</description>\n";

while ($row=dbarray($result3)) {
	$rsid = intval($row['news_id']);
	$rtitle = $row['news_subject'];
	$description = stripslashes(nl2br($row['news_news']));

// Add allowable HTML tags between quotes below, all others will be stripped
	$description = strip_tags($description, "<A><P><BR><BR /><HR>");

	echo "<item>\n
	<title>".htmlspecialchars($rtitle)."</title>\n
	<link>".$base."news.php#".$rsid."</link>\n
	<description>".htmlspecialchars($description)."</description>\n
	</item>\n\n";
}
echo "</channel>
	</rss>";

?>