<?php
include_once ("../include/config.inc.php");
include_once ("../include/common.inc.php");
do_db_connect($CONFIG["DBHOST"], $CONFIG["DBNAME"], $CONFIG["DBUSER"], $CONFIG["DBPWD"]);
header('Content-type: text/xml'); ?>
<rss version="2.0">
<channel>
<title>TIFF 2007 Latest Reviews</title>
<description>Latest reviews for films at the 2007 Toronto International Film Festival</description>
<link>http://www.tiffreviews.com/</link>

<?php
$query = "SELECT a.title, b.title, b.link, date_format(b.dateadded, '%a, %e %b %Y %H:%i:%s') FROM tiff_films2007 a, tiff_films2007_links b WHERE a.fid=b.fid ORDER BY dateadded desc LIMIT 20";
$rs = do_query($query);

while($item = result2row($rs)) {
?>
<item>
<title><?php echo $item[0] . " - " . $item[1];?></title>
<description></description>
<link><?php echo htmlentities($item[2]);?></link>
<pubDate><?php echo $item[3];?></pubDate>
</item>

<?php }
mysql_close();
?>
</channel>
</rss>
