<?


GLOBAL $cfg;
session_start();
$_REQUEST["config"] = true;
//dołączamy plik z konfiguracją
include("./config.php");
include("inc/functions.php");

echo <<<EOT
<?xml version="1.0" encoding="ISO-8859-2"?>
<rss version="2.0">
  <channel>
    <title>Pomerania.tv newsy</title>
    <link>http://pomerania.tv</link>
    <description>Newsy wideo pomerania.tv</description>
    <language>pl</language>
    <managingEditor>redakcja@pomerania.tv</managingEditor>
    <webMaster>redakcja@pomerania.tv</webMaster>
    <copyright>Telewizja Pomerania</copyright>
EOT;
$link = mysql_connect("localhost", "pomer_michal", "Mich@lmedi@!")
or die("Could not connect : " . mysql_error());
mysql_select_db("pomer_tv") or die("Could not select database");

$query = mysql_query("SELECT video_id,video_title,video_date,video_title_id,video_description,image_id FROM pomerania_videos WHERE show_id = 0 ORDER BY video_date DESC LIMIT 0 , 20");

while ($result = mysql_fetch_row($query))
{
$query2 = mysql_query("SELECT image_name FROM pomerania_images WHERE image_id = $result[5]");
$result2 = mysql_fetch_row($query2);
echo <<<EOT
   <item>
      <title>$result[1]</title>
      <pubDate>$result[2]</pubDate>
	  <link>http://www.pomerania.tv/relacje/$result[0]/</link>
      <author>redakcja@pomerania.tv</author>
      <category>Materiał Video</category>
      <description><![CDATA[<img src="http://www.pomerania.tv/img/content/relacje/$result2[0]" alt="" align='left' hspace='4' vspace='2' />$result[4]]]></description>
    </item>
EOT;
}
echo <<<EOT
  </channel>
</rss>
EOT;
?>

