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

<rss version="2.0">
<channel>
<title>Film Blather</title>
<description>More film than you can shake a stick at!</description>
<link>http://www.filmblather.com/</link>
<copyright>Copyright <?print date("Y"); ?> Eugene Novikov</copyright>

<?
function datetime($YYYYMMDDHHMMSS) 
{
	list($year,$month,$day,$hour,$minute,$seconds) = sscanf($YYYYMMDDHHMMSS,'%4s%2s%2s%2s%2s%2s');
	return date(mktime($hour,$minute,$seconds,$month,$day,$year));
}
?>

<?
	$dbcon=mysql_connect("localhost", "filmblather", "sororityboys") or die(mysql_error());
	$blurb_qstr="SELECT blurb, title, shortname, grade, date, poster FROM filmblather.reviews ORDER BY released DESC LIMIT 10";
	$blurb_result=mysql_query($blurb_qstr, $dbcon) or die(mysql_error());
	
	while ($item=mysql_fetch_array($blurb_result))
	{
		$title = $item['title'];
		$grade = $item['grade'];
		$blurb = $item['blurb'];
		$shortname = $item['shortname'];
		$date = datetime($item['date']);
		$poster = $item['poster'];
?>
	
	<item>
		<title><?print $title . " (" . $grade . ")"; ?></title>
		<author>Eugene Novikov</author>
		<description>
		<?print $blurb;?>
		<? if ($poster == "1")
   		
   			echo "<br /><br /><img src=\"http://www.filmblather.com/posters/" . $shortname . ".jpg\" alt=\"" . $title ."\"></img>";
   		?>
		</description>
		<link>http://www.filmblather.com/review.php?n=<?print $shortname; ?></link>
		<pubDate><?print strftime("%a, %d %b %Y %T %Z",$date); ?></pubDate>
		
	</item>
	
	<?
		}
	?>




</channel>
</rss>
