<? header('Content-type: text/xml'); ?>
<rss version="2.0">
<?
  include '/home/config/config_reliaserve.php';  
?>
<channel>
<title>National Radon Defense Articles</title>
<description>Nation Radon Defense helps stop radon issues in your home.</description>
<link>http://www.nationalradondefense.com</link>
<?php
$result = mysql_query("SELECT id, publisher, UNIX_TIMESTAMP(pub_date) AS pubDate, title, news, category_display FROM press WHERE association = '20' and validation = '1' order by pub_date DESC");
while ($row = mysql_fetch_array($result)){
$num_rows = mysql_num_rows($result);
$article_id = $row['id'];
$pubDate = $row['pubDate'];
$category_display = $row['category_display'];
$title = $row['title'];
    $new_string = preg_replace("/[^a-zA-Z0-9\s]/", "", $title);
    $clean_title = strtolower($new_string);
    $clean_title = str_replace(" ", "-", $clean_title);
$preview = substr($row['news'], 0, 250);
$news = $row['news']; 

if ($category_display > 0){
$result2 = mysql_query("SELECT name from category_parent WHERE id = $category_display");
$row2 = mysql_fetch_array($result2);
    $new_string = preg_replace("/[^a-zA-Z0-9\s]/", "", $row2[name]);
    $clean_category_parent = strtolower($new_string);
    $clean_category_parent = str_replace("  ", "-", $clean_category_parent);
    $clean_category_parent = str_replace(" ", "-", $clean_category_parent);
}
    
?>
     <item>
        <title><?=$title;?></title>
        <description><?=htmlspecialchars($news);?></description>
        <?
        if ($category_display > 0){
        ?>
        <link>http://www.nationalradondefense.com/articles/<?=$clean_title;?>.html</link>
        <?
        }else{
        ?>
        <link>http://www.nationalradondefense.com/articles/<?=$clean_title;?>.html</link>
        <?
        }
        ?>
        <guid><?=$article_id;?></guid>
        <pubDate><?php printf (strftime("%a, %d %b %Y %H:%M:%S %z",$pubDate)); ?></pubDate>
     </item>  
<?php
}
?> 
</channel>
</rss>
