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

<rss version="2.0">
<channel>
<title>Project Steph</title>
<description>A charity organisation that aims to help in the development of Malawi, a central African country.</description>
<link>http://goblinews.org/shoes/</link>
<copyright>Copyright (C) Coradjeous Design</copyright>

<?php

$dbhost = "localhost";
$dbuser = "goblinew";
$dbpassword = "canc32ous";
$dbdatabase = "goblinew_malawi";

$db = mysql_connect($dbhost, $dbuser, $dbpassword);
mysql_select_db($dbdatabase, $db);

$q="SELECT news.title, news.summary, news.id, UNIX_TIMESTAMP(news.dateposted) AS dateposted FROM news ORDER BY dateposted DESC LIMIT 0,15";
$doGet=mysql_query($q);

while($result = mysql_fetch_array($doGet)){
?>
     <item>
        <title> <?=htmlentities(strip_tags($result['title'])); ?></title>
        <description> <?=htmlentities(strip_tags($result['summary'],'ENT_QUOTES'));?></description>
        <link>http://goblinews.org/shoes/</link>
        <pubDate> <?=strftime( "%a, %d %b %Y %T %Z" , $result['dateposted']-7200); ?></pubDate>
     </item>  
<?php } ?>  

</channel>
</rss>

