<?
header("Content-type: application/xml");
require("../db.php");
require("../functions.php");
echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?".">";
?>
<rss version="2.0">
<channel>
<title>Caught in the Crossfire - Articles</title>
<link>http://www.caughtinthecrossfire.com/</link>
<description>Caught in the Crossfire is an online UK magazine promoting Unadulterated Malarkey for drunken youth. We dedicate our time to bring you the best in Music, UK Skateboarding and anything else we can find to write about. Featuring interviews with the best bands, artists and pro skateboarders, all updated daily for your bored existence from London, UK</description>
<generator>nav...</generator>
<language>en</language>
<?
$query = "SELECT cf_posts.ID, cf_posts.post_title, cf_posts.post_excerpt, cf_posts.post_date_gmt, cf_categories.category_parent, cf_categories.category_dir, cf_categories.cat_name FROM `cf_posts` LEFT JOIN cf_post2cat ON cf_posts.ID = cf_post2cat.post_id LEFT JOIN cf_categories ON cf_categories.cat_ID = cf_post2cat.category_id WHERE cf_categories.cat_base = 2 ORDER BY `post_date_gmt` DESC LIMIT 0, 20";
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result)){
$url = $row['category_dir']."/".$row['ID'];
$category = $row['cat_name'];
if (0 != $row['category_parent']){
$innerquery = "SELECT cf_categories.category_dir FROM cf_categories WHERE cf_categories.cat_ID = ".$row['category_parent'];
$innerresult = mysql_query($innerquery) or die();
$dir = mysql_result($innerresult, 0, 'category_dir');
$url = $dir."/".$url;
}
$url = DOMAIN.$url;
?>
<item>
<title><![CDATA[<? echo make_xml_safe($row['post_title']); ?>]]></title>
<link><? echo make_xml_safe($url); ?></link>
<pubDate><? echo date('r', strtotime($row['post_date_gmt'])); ?></pubDate>
<author>[email protected]</author>
<category><? echo make_xml_safe($category); ?></category>
<guid><? echo make_xml_safe($url); ?></guid>
<description>
<![CDATA[<? if($row['post_excerpt']){ echo make_xml_safe($row['post_excerpt']);} else { echo "No Details"; } ?>]]>
</description>
</item>
<? } ?>
</channel>
</rss>