<? header('Content-type: text/xml'); 
include('../includes/dbcon.php');
$year = date("Y");
$month = date("n");
$day = date("j");
$sqlquery = "SELECT * FROM stories where active = 1 AND section='sports' ORDER BY ID DESC LIMIT 0,15";
$result = mysql_query($sqlquery,$dbcnx);
?>
<rss version="2.0">
<channel>
<title>Salem-News.com Sports</title>
<description>Salem-News.com Sports Feed</description>
<link>http://www.salem-news.com/tgsearch.php?tag=sports</link>
<copyright>2010</copyright>
<?
while($row = mysql_fetch_array($result)){
	if ($row['active']>0){
?> 

	<item> 
	        <title> <?=str_replace("&","And",strip_tags($row['title'])); ?></title> 
	        <description> <?=str_replace("&","And",strip_tags($row['summary']));?></description>
		<? if (isset($row['hardlink']) && strlen($row['hardlink'])>4){
		?>
			<link>http://salem-news.com/<?=$row['hardlink']?></link>
		<?
		  }else{
		?> 
	        <link>http://salem-news.com/view.php?storyid=<?=$row['ID'];?></link>
		<?
		  }
		$pubdate = $row['timestamp'];
		?>
	        <pubDate> <?=strftime( "%a, %d %b %Y %T %Z" , $pubdate); ?></pubDate>  
	     </item>    
<? }
} ?>  
</channel>
</rss>
