<?php
  require_once("kellybase.php");
  require_once("common.php");
  header('Content-type: text/xml');

echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
';
echo '<channel>
<atom:link href="http://kellyhs.org/clarion/rss.xml" rel="self" type="application/rss+xml" />
<title>Kelly High School Clarion</title>
<description>Spanish edition of the 
  student newspaper of Kelly High School, Chicago</description>
<link>http://kellyhs.org/clarion</link>
';

$query = "select item.* from item, tag where
  item.id = tag.itemId and
  tag.tag like 'Clarion%'";

$items = KDBselectMany($query);

while ($item = KDBnext($items))
{
  if ($item[id] == 1992)
    continue;

  echo '<item>
';
  echo "<title>" . rssGood($item[label]) . "</title>
";
  echo "<link>http://kellyhs.org/clarion/index.php?itemId=$item[id]</link>
";
  echo "<description>" . rssGood($item[content]);
  echo "</description>
";
  echo "<guid isPermaLink=\"true\">";
  echo "http://kellyhs.org/clarion/index.php?itemId=$item[id]</guid>
";
  $pubDate = date("D, d M Y H:i:s", strtotime($item[uploadedDate])) . ' CST';
  echo "<pubDate>$pubDate</pubDate>
";
  echo '</item>
';
}
echo '</channel>
 </rss>';
?>

