<? header('Content-type: text/xml'); ?>
<?php 
include('../Connections/threemon.php');

$category=$HTTP_GET_VARS['category'];
$title=str_replace("_"," ",$category);
if($category=='Current_Affairs'){$category='Politics';}
if($category=='Literature_Books'){$category='Literature/Books';}
if($category=='Travel_Sport'){$category='Travel/Sport';}
if($category=='Food_and_Drink'){$category='Food and Drink';}

mysql_select_db($database_threemon, $threemon);
$cat_query1="SELECT title,article,id,author,description,approved,category from articles WHERE category='$category' and approved='yes' ORDER by id DESC LIMIT 5";
$cat1=mysql_query($cat_query1,$threemon) or die(mysql_error());
$row_cat1=mysql_fetch_assoc($cat1); 
 
 
?>
 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
 <channel>
  <title><?php echo $title;?> rss Three Monkeys Online magazine</title> 
  <link>http://www.threemonkeysonline.com/categories/<?php echo $HTTP_GET_VARS['category'];?>/</link> 
  <description>Newsfeed for the latest <?php echo $title;?> articles and reviews published in Three Monkeys Online. Three Monkeys Online is a current affairs and arts magazine published in three different languages - English, Italian, and Spanish</description> 
  <language>en</language> 
  <webMaster>information@threemonkeysonline.com</webMaster> 
  <atom:link href="http://www.threemonkeysonline.com/rss_feeds/categories/<?php echo $HTTP_GET_VARS['category'];?>.xml" rel="self" type="application/rss+xml" />
  <?php do {?>
  <item>
  <title><?php echo strip_tags($row_cat1['title']);?> </title>
  <description><?php echo strip_tags($row_cat1['description']);?></description>
  <guid>http://www.threemonkeysonline.com/als/<?php echo $row_cat1['article'];?>.html</guid>
  </item> 
  <?php } while ($row_cat1=mysql_fetch_assoc($cat1));?>
</channel>
</rss>
