<?
header("Content-type: text/xml");
print '<?xml version="1.0" encoding="ISO-8859-1" ?>';
/*
print ' <?xml-stylesheet title="XSL_formatting" type="text/xsl" href="nolsol.xsl"?>';
*/

function DoParseDate($strDate,$strFormat = 'D jS M, Y') {
   if (ereg('([0-9]{4})-([0-9]{2})-([0-9]{2})',$strDate,$regex)) {
     return date($strFormat,gmmktime ($regex[4], $regex[5], $regex[6], $regex[2], $regex[3], $regex[1]) );
   } else if (ereg('([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})',$strDate,$regex)) {
     return date($strFormat,gmmktime ($regex[4], $regex[5], $regex[6], $regex[2], $regex[3], $regex[1]) );
   } else {
     return "?";
   }
}

?>
<rss version="2.0">
<channel>
	<title>NitroSell News &amp; Events</title>
	<link>http://www.nitrosell.com/news/</link>
	<description>Latest news &amp; events at NitroSell.</description>
	<language>en-us</language>
	<lastBuildDate>Wed, 29 Mar 2006 08:16:50 GMT</lastBuildDate>
<?
include($_SERVER['NSC_DOCUMENT_ROOT'].'/../.db.php');
$result = mysql_query("SELECT oneliner,storydate,headline,id,uniqueid FROM storys WHERE status=1 AND indexstory=1 AND category=\"News\" ORDER BY storydate DESC");
while ($row = mysql_fetch_array($result)) {
?>
  <item>
    <title><?=htmlspecialchars($row['headline'])?></title>
    <description><?=htmlspecialchars($row['oneliner'])?></description>
    <link>http://<?=$_SERVER['HTTP_HOST']?>/nitrogen/story.php?c=News&amp;id=<?=$row['id']?>&amp;uniqueid=<?=$row['uniqueid']?></link>  
    <pubDate><?=DoParseDate($row['storydate'],"D, j M Y h:i:s ")?> GMT</pubDate>
<?/*
    <guid isPermaLink="false">http://news.bbc.co.uk/1/hi/world/asia-pacific/4855594.stm</guid>
    <category>Asia-Pacific</category>
*/?>
</item>

<?
}
?>
				

	
</channel>
</rss>



