<?php header('Content-Type: text/xml');
echo "<?xml version=\"1.0\"?>\n";
echo "<?xml-stylesheet title=\"XSL_formatting\" type=\"text/xsl\" href=\"reonews.xml\"?>\n";
?>



<rss version="2.0">

<channel>

<title>News from the world of RE</title>
<description>The latest news in Religious Education</description>
<link>http://news.reonline.org.uk/</link>
<copyright>REOnline Project - Culham Institute</copyright>



<?php
#feed headlines direct from database

include ("inc/user_functions.inc");

openme();

$sql="SELECT ID, headline, sortdate, livestatus FROM mag_news WHERE livestatus=1 OR livestatus=3 ORDER BY sortdate DESC, rank;"; #provide single feed for both streams here, in date order

if($result = mysql_query($sql, $dblink)) {
 while ($irow=mysql_fetch_array($result)) {
  echo "<item>\n";
  echo "<title>".stripslashes($irow["headline"])."</title>\n";
  echo "<description>".$irow["sortdate"]."</description>\n";
  if ($irow["livestatus"]==1)
   echo "<link>http://news.reonline.org.uk/headline.php?".$irow["ID"]."</link>\n";
  else #it's 3
   echo "<link>http://news.reonline.org.uk/inthenews.php?".$irow["ID"]."</link>\n";
  echo "</item>\n\n";
  }
 }

closeme();


?>


<item>
<title>Archive - older headlines</title>
<description>[------]</description>
<link>http://news.reonline.org.uk/headlines_archive.php</link>
</item>

<item>
<title>Archive - older news stories</title>
<description>[------]</description>
<link>http://news.reonline.org.uk/inthenews_archive.php</link>
</item>

</channel>
</rss>
