<? header("Content-type: text/xml"); ?>
<?= '<?xml version="1.0" encoding="UTF-8"?>'."\r\n" ?>
<rss version="2.0">
	<channel>
		<title>uDCX</title>
		<description>Unofficial Dark Century: X</description>
		<link>http://www.udcx.com/</link>
<?

define('INFILE',true);
require "./classes/db.php";

$res = $db->sql("SELECT news.nid, news.txtTitle, news.txtBody, news.intTime, news.intPoster, admins.varName FROM DCX_news AS news, DCX_admins AS admins WHERE admins.aid=news.intPoster GROUP BY news.nid ORDER BY news.intTime DESC LIMIT 5");
while($row = mysql_fetch_assoc($res)) {
?>
		<item>
			<title><?= htmlentities($row['txtTitle'],ENT_QUOTES) ?></title>
			<link>http://www.udcx.com/?page=Y29tbWVudHMkLnBocA%3D%3D&amp;nid=<?= $row['nid'] ?></link>
			<pubDate><?= gmdate("D, d M Y H:i:s", $row['intTime']) ?> GMT</pubDate>
			<guid><?= md5($row['nid']) ?></guid>
			<author><?= htmlentities($row['varName'],ENT_QUOTES) ?></author>
			<description><![CDATA[<?= (strip_tags((strlen($row['txtBody']) > 256) ? substr($row['txtBody'],0,256).'...' : $row['txtBody'],ENT_QUOTES)) ?>]]></description>
		</item>
<?
}
?>
	</channel>
</rss>
