<?php
	$topdir = '.';
	require $topdir."/dacode.php3";
	$news = LoadClass('News');
	$session= LoadClass('Session');

	header("Content-Type: text/plain");
	echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
?>

<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">
<rss version="0.91">
   <channel>
      <title><?php echo $config->titledefault; ?></title>
      <link><?php echo $config->basehref; ?></link>
      <description><?php echo $config->description; ?></description>
      <language><?php echo $config->defaultlang; ?></language>

<?php
	$newstempo = $news->get_news(20,0,0,1,1,0,0);

	if (gettype($newstempo) == "array") {
		reset($newstempo);
		while (list($key, $cur) = each($newstempo)) {
			ereg("^([0-9]{4})([0-9]{2})([0-9]{2})", $cur['timestamp'], $res);
			echo "		<item>\n";
			echo "			<title>".htmlentities($cur['title'])."</title>\n";
			echo " 			<link>".
				$session->newsurls($cur['id'],0,0,$res[1],$res[2],$res[3]).
				"</link>\n\n";
			echo "		</item>\n";
		}
	}
?>

	</channel>
</rss>
