<?php
header('Content-type: application/rss+xml; charset=utf-8');
chdir('../');
include('includelist.php');
$query = multiQuery("SELECT * FROM games WHERE state != 'inactive' OR state != 'broken' ORDER BY id DESC LIMIT 10");

echo '<?xml version="1.0" encoding="utf-8"?>';
echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">';
echo '<channel>
<title>'.$site['name'].'</title>
<link>'.$site['url'].'</link>
<description>'.t('Play free online games').'</description>
<atom:link href="'.$site['url'].'/rss/new.xml" rel="self" type="application/rss+xml" />
';
while($row = mysql_fetch_array($query)){
	$gameUrl = $site['url'].makeUrl('game', $row[$site['gameUrl']]);
	$gameTitle = htmlentities($row['t_'.$site['language']]);
?>
<item>
	<title><?= $gameTitle ?></title>
	<link><?= $gameUrl ?></link>
	<guid><?= $gameUrl ?></guid>
	<description><?= htmlentities('<a href="'.$gameUrl.'"><img src="'.$site['url'].'/screenshots/'.$row['id'].'.jpg"><br />').str_replace('[GAME TITLE]', $gameTitle, t('Click to play the game [GAME TITLE] now. We offer the best free games and add 10 new games every day of the week.')).htmlentities('</a>') ?></description>
</item>
<?
}
?>
</channel>
</rss>
