<?
  header("Content-Type: application/xml; charset=ISO-8859-1");
  include "newtemplate/v2/db.php";

    //CONSTRUCT RSS FEED HEADERS
    $output = '<rss version="2.0">';
    $output .= '<channel>';
    $output .= '<title>Camp Ramaquois</title>';
    $output .= '<description>A Day Camp as Complete as Sleep-Away...</description>';
    $output .= '<link>http://www.ramaquois.com/</link>';
    $output .= '<copyright>Copyright Camp Ramaquois 2010</copyright>';
 
	 $sql="select pageid, pagename, pagetext,edt from page where edt > '0000-00-00' order by edt desc limit 15";
 	$result=mysql_query($sql);
 	while ($row=mysql_fetch_array($result)){ 
    	//BODY OF RSS FEED
    	$link="http://www.ramaquois.com/summer-day-camp-".urlencode($row[pagename]).".html";
		$text=strip_tags($row[pagetext]);
		$text=stripslashes($text);
		$description=substr($text,0,150);
  		 $output .= '<item>';
        	$output .= '<title>'.$row[pagename].'</title>';
        	$output .= '<description>'.$description.'</description>';
        	$output .= '<link>'.$link.'</link>';
        	$output .= '<pubDate>'.$row[edt].'</pubDate>';
   		$output .= '</item> ';
 	}
    //CLOSE RSS FEED
   $output .= '</channel>';
   $output .= '</rss>';
 
    //SEND COMPLETE RSS FEED TO BROWSER
    echo($output);
 ?>