<?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';

$limit  =15;

$query 			= "SELECT * FROM `{$CONFIG['MODULES'][$moduleName]['TABLES']['offers']}` ORDER BY {$orderBy} LIMIT {$limit}";
?>
<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 str_replace('&Acirc;&pound;','&#xA3;',htmlentities($result['description']) . '&lt;p&gt;' . htmlentities($result['price_text'])) . '&lt;/p&gt;';?></description>
        <link><?php echo $CONFIG['URL']['root']; ?>offers/offer_details.php?id=<?php echo $result['offer_id'];?></link>
        <pubDate><?php echo strftime( "%a, %d %b %Y %T %Z" , strtotime($result['date'])); ?></pubDate>
     </item> 
<? } ?>  

</channel>
</rss>