<?php
header('Content-type: text/xml');


echo '<?xml version="1.0"?>';


/*
   encoding="UTF-8"
<atom:link href="http://www.gotfi.pl/rss.xml" rel="self" type="application/rss+xml" />
   
  */  

$h='

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Analizy i komentarze</title>
		<link>http://www.gotfi.pl</link>
		<description>Najnowsze komentarze</description>
		<language>pl</language>
		<pubDate>Mon, 16 Jan 2012 11:30:04 +0100</pubDate>
		
		<lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
		<docs>http://www.gotfi.pl</docs>
		<generator>Web Editor 2.0</generator>
		<managingEditor>editor@example.com</managingEditor>
		<webMaster>webmaster@example.com</webMaster>
';
echo $h;
include_once("functions.php");
$data=selectTable("go_tfi_analizy_i_komentarze",NULL," ORDER BY 'kiedy' DESC LIMIT 0,10");

foreach($data as $d){
	$s.='		<item>
	
			<title>'.$d['title'].'</title>
			<link><![CDATA[ http://www.gotfi.pl/index.php?id=167&w=7&res='.$d['id'].' ]]></link>
			<description><![CDATA[ '.$d['msg'].' ]]></description>
			<pubDate>'.$d['kiedy'].'</pubDate>
			<guid>'.$d['id'].'</guid>

		</item>
	';
	//print_r($d);
	//echo "</br></br>";
	/*
	$d['id']
	$d['title']
	
	$d['kiedy']
	$d['msg']
	$d['video']
	*/
}

echo $s;

$f='
 </channel>
</rss>
';
	
echo $f;

?>