<?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 = '`exp_date` DESC, `title` ASC';
$aresult 	= mysql_query("SELECT * FROM `coupons` WHERE active = 1 LIMIT 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>

<?

while($result = mysql_fetch_array($aresult)){
?>
     <item>
        <title><?php echo htmlentities(strip_tags($result['title'])); ?></title>
        <description><?php echo htmlentities(strip_tags($result['description'],'ENT_QUOTES'));?></description>
        <link><?php echo $CONFIG['URL']['root']; ?>coupons.php</link>
        <pubDate> <?php echo strftime( "%a, %d %b %Y %T %Z" , strtotime($result['date'])); ?></pubDate>
     </item> 
<? } ?>  

</channel>
</rss>