<?php
header("Content-Type: text/xml");

include_once('../global.php');
include_once('rss_generator.php');

$NewsCount = 15;

// Get news from database by selected categories
$Items = array();
$DbResult = $Database->query('SELECT wow.gm_news.*, UNIX_TIMESTAMP(wow.gm_news.time) as unit_time, realmd.account.username as username FROM wow.gm_news JOIN realmd.account ON wow.gm_news.author = realmd.account.Id ORDER BY time DESC LIMIT 0,'.$NewsCount);
while($Row = $DbResult->fetch_array())
{
  $Items[] = array(
    'Title' => $Row['username'].': '.substr($Row['text'], 0, 50).'...',
    'Link' => 'http://wow.zdechov.net/',
    'Description' => $Row['text']." (".$Row['username'].")",
    'Time' => $Row['unit_time'],
  );
}

echo(GenerateRSS(array(
  'Title' => 'WoW GM aktuality',
  'Link' => 'http://wow.zdechov.net/',
  'Description' => 'GM aktuality WoW serveru Heroes of Fantasy',
  'WebmasterEmail' => 'wow@zdechov.net',
  'Items' => $Items)));
?>
