<?php header('Content-type: text/xml'); 

include_once ('config.php'); 
if (! isset($CONFIG) ) {
	die('CONFIG Array not found - Check siteConfig.php is in the root directory.');
}

include_once $CONFIG['PATHS']['lib'] . 'magicQuotes.php';
include_once $CONFIG['PATHS']['lib'] . 'dbconnect.php';
include_once $CONFIG['PATHS']['lib'] . 'functions.php';
include_once $CONFIG['PATHS']['classes'] . 'User.php';
include_once $CONFIG['PATHS']['classes'] . 'Object.php';

$oUser	= new User($CONFIG['TABLES']['user'], $CONFIG['SESSION']['name'], $CONFIG['COOKIE']);


$orderBy 		= '`date` DESC, title ASC';

$query 			= "SELECT news_id, title, article, date  FROM `{$CONFIG['MODULES'][$moduleName]['TABLES']['NEWS']}` ORDER BY {$orderBy} LIMIT 0,15";
?>
<rss version="2.0">
<channel>
<title><?php echo $CONFIG['SITE']['name']; ?></title>
<description><?php echo $CONFIG['SITE']['description']; ?></description>
<link><?php echo $CONFIG['URL']['root']; ?></link>
<copyright>Your copyright information</copyright>

<?
$doGet=mysql_query($query);

while($result = mysql_fetch_array($doGet)){
?>
     <item>
        <title> <?php echo htmlentities(strip_tags($result['title'])); ?></title>
        <description><?php echo htmlentities(strip_tags($result['article'],'ENT_QUOTES'));?></description>
        <link><?php echo $CONFIG['URL']['root']; ?>news/news_article.php?id=<?php echo $result['news_id'];?></link>
        <pubDate> <?php echo strftime( "%a, %d %b %Y %T %Z" , strtotime($result['date'])); ?></pubDate>
     </item> 
<? } ?>  

</channel>
</rss>
