<?

header("Content-Type: text/xml");

include_once('global.php');
include_once('rss_generator.php');

$NewsCount = 10;
$Items = array();

$DbResult = $Database->query('SELECT UNIX_TIMESTAMP(news.time), news.title, news.short_text, user.User FROM news JOIN user ON user.ID=news.user ORDER BY time DESC LIMIT '.$NewsCount);
while($Row = $DbResult->fetch_array())
{
  $Items[] = array(
    'Title' => $Row['title'],
    'Link' => $Config['Web']['BaseURL'],
    'Description' => $Row['short_text']." (".$Row['User'].")",
    'Time' => $Row['UNIX_TIMESTAMP(news.time)'],
  );
}

echo(GenerateRSS(array(
  'Title' => $Config['Web']['Title'],
  'Link' => $Config['Web']['BaseURL'],
  'Description' => $Config['Web']['Description'],
  'WebmasterEmail' => $Config['Web']['AdminEmail'],
  'Items' => $Items), $Config['Web']['Charset']));
?>
