<?php
require_once ('Connections/Magyar_Korfball_Szovetseg.php');
mysql_select_db ($database_Magyar_Korfball_Szovetseg);
$sql = "SELECT * FROM cikkek WHERE nyelv='hu' ORDER BY datum DESC LIMIT 0, 10";
$result = mysql_query($sql);
$row = mysql_fetch_assoc ($result);
header('Content-type: application/rss+xml');
print	"<?xml version=\"1.0\" encoding=\"iso-8859-2\" ?>" . 
		"<rss version=\"2.0\">" . 
		"<channel>" . 
		"<title>Magyar Korfball Szövetség - Cikkek</title>" . 
		"<link>http://korfball.hu</link>" . 
		"<description>Magyar Korfball Szövetség RSS Cikkek</description>" . 
		"<language>hu</language>" . 
		"<pubDate>" . 
		date ("r") . 
		"</pubDate>" . 
		"<docs>http://korfball.hu/index.php?page=rss</docs>" . 
		"<generator>PHP</generator>" . 
		"<managingEditor>admin@korfball.hu</managingEditor>" . 
		"<webMaster>admin@korfball.hu</webMaster>";
do {
	print	"<item>" . 
			"<link>" . 
			htmlspecialchars("http://korfball.hu/index.php?page=cikkek&id=") . $row["id"] . 
			"</link>" . 
			"<title>" . 
			$row["cim"] . 
			"</title>" . 
			"<description>" . 
			htmlspecialchars(nl2br($row["bevezeto"]) . " &raquo;") .  
			"</description>" . 
			"<pubDate>" . 
			date ("r", $row["datum"]) . 
			"</pubDate>" . 
			"</item>";
} while ($row = mysql_fetch_assoc ($result));
print	"</channel>" . 
		"</rss>";
?>