<?PHP
 
    //SET XML HEADER
    header('Content-type: text/xml');
 
    //CONSTRUCT RSS FEED HEADERS
    $output = '<rss version="2.0">';
    $output .= '<channel>';
    $output .= '<title>Limerick Community Games</title>';
    $output .= '<description>News from LimerickCommunityGames.com</description>';
    $output .= '<link>http://www.limerickcommunitygames.com/</link>';
 
    //BODY OF RSS FEED
	include_once("Databasegetters/dbconn.php");
	$sql="SELECT * from News ORDER BY Id DESC";
//	echo($sql);
	$result=mysql_query($sql);
	while($news=mysql_fetch_array($result)){
		if($news["Area"]=="County") $news["Area"]="Limerick Community Games";
   		$output .= '<item>';
        $output .= '<title>News From '.$news["Area"].'</title>';
        $output .= '<description>'.$news["NewsItem"].'</description>';
		if($news["Area"]=="Limerick Community Games") $news["Area"]="County";
        $output .= '<link>http://www.limerickcommunitygames.com/displayarea.php?area='.$news["Area"].'</link>';
        $output .= '<pubDate>'.date('r',strtotime($news["Date"])).'</pubDate>';
   		$output .= '</item> ';
	} 
    //CLOSE RSS FEED
   $output .= '</channel>';
   $output .= '</rss>';
 
    //SEND COMPLETE RSS FEED TO BROWSER
    echo($output);
 
?>
