<?php header('Content-type: application/xml; charset=utf-8'); ?>
<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><?xml-stylesheet type=\"text/xsl\" href=\"includes/rss.xsl\" version=\"1.0\" ?>\r\n"; ?>
<rss version="2.0">
<channel>
<title>Band Cage News</title>
<description>RSS Feed of all news posted on Band Cage</description>
<language>en</language>
<link>http://BandCage.com/news.php</link>
<copyright>2007 BandCage and our contributors</copyright>
<pubDate><?php echo gmdate('r',time()); ?></pubDate>
<lastBuildDate><?php echo gmdate('r',time()); ?></lastBuildDate>
<managingEditor>NewsAdmin@BandCage.com</managingEditor>
<webMaster>Webmaster@BandCage.com</webMaster>
<image>
<title>BandCage.com</title>
<url>http://BandCage.com/includes/rss.gif</url>
<link>http://BandCage.com/news.php</link>
<width>32</width>
<height>32</height>
<description>BandCage Logo</description>
</image>
<?php
require_once("phpincludes/startsql.php");
$result = mysql_query("SELECT news.id, userid, title, content, UNIX_TIMESTAMP(time) AS time, users.email FROM news JOIN users on users.id = news.userid ORDER BY id DESC LIMIT 200");
while($row = mysql_fetch_array($result)) {
	$time = gmdate('r',$row['time']);
	?>
	<item>
		<title><?php echo utf8_encode(strip_tags($row['title'])); ?></title>
		<description><?php echo utf8_encode(ereg_replace("[^[:alnum:] ]","",strip_tags($row['content']))); ?></description>
		<author><?php echo utf8_encode($row['email']); ?></author>
		<link>http://bandcage.com/news/<?php echo urlencode(str_replace(' ','_',$row['title'])); ?>/</link>
		<comments>http://bandcage.com/news/<?php echo urlencode(str_replace(' ','_',$row['title'])); ?>/</comments>
		<pubDate><?php echo $time; ?></pubDate>
		<guid isPermaLink="true">http://bandcage.com/news/<?php echo urlencode(str_replace(' ','_',$row['title'])); ?>/</guid>
	</item>
	<?php
}
?>
</channel>
</rss>