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

        <rss version="2.0">
        <channel>
        <title>The Beacon School, NYC News</title>
        <description>The Beacon School is a
        college-preparatory program located on the
        Upper West Side of New York City</description>
        <link>http://www.beaconschool.org</link>
        <copyright>Copyright - The Beacon School, NYC</copyright>

<?

  $db=mysql_connect("localhost","root","sevenup");
  mysql_select_db("homepage",$db);
  $sql = "SELECT *, DATE_FORMAT(date, '%a, %d %b %Y %T EST') as formatdate FROM articles WHERE type NOT LIKE 'bmun' AND approved='y' ORDER BY id DESC LIMIT 15";
  $result=mysql_query($sql);
  while($rss = mysql_fetch_array($result)){
  $id = $rss["id"];
  $leader = $rss["leader"];

  $description = explode(".", $leader);
  $headline = $rss["headline"];
  $date = $rss["formatdate"];
  $link = 'http://www.beaconschool.org/newsarticle.php3?id=$id';

?>
     <item>
        <title> <?=htmlentities(strip_tags($headline))?></title>
        <description> <?=htmlentities(strip_tags($description[0]))?>.</description>
        <link>http://www.beaconschool.org/newsarticle.php3?id=<?=$id?></link>
	<pubDate><?=$date?></pubDate>
	<guid isPermaLink="true">http://www.beaconschool.org/newsarticle.php3?id=<?=$id?></guid>
     </item>
<? } ?>

</channel>
</rss>

