<? header('Content-type: text/xml'); ?>
<?php echo "<"."?"."xml version="."\"1.0\""." encoding="."\"ISO-8859-1\""."?".">"; ?>

<rss version="2.0">
<channel>
<title>TennCare Advocacy Program: TennCare in the News</title>
<link>http://www.tenncareadvocacy.org/</link>
<description>The TennCare Advocacy Program works for TennCare enrollees, or those eligible for TennCare, who are experiencing difficulty accessing necessary medical care</description>
<language>en-us</language>
<image>
<title>TennCare Advocacy Program</title>
<width>88</width>
<height>30</height>
<link>http://www.tenncareadvocacy.org/</link>
<url>http://www.tenncareadvocacy.org/images/taprss.gif</url>
</image>
<copyright>Copyright <? echo date("Y"); ?> TennCareAdvocacy.org</copyright>
<?php
include("db.php");
$getlastdate=mysql_query("SELECT UNIX_TIMESTAMP(date) pubdate FROM taptcinthenews ORDER BY DATE_FORMAT(date, '%Y%m%d') DESC,id DESC LIMIT 1",$conn);
$lastdate=mysql_fetch_array($getlastdate);
$getnewnews=mysql_query("SELECT name,file,UNIX_TIMESTAMP(date) pubdate FROM taptcinthenews ORDER BY DATE_FORMAT(date, '%Y%m%d') DESC,id DESC LIMIT 10",$conn);
while($newnews=mysql_fetch_array($getnewnews)) {
$newnews["file"]=str_replace(' ','%20',$newnews["file"]);
?>
  <item>
  <title><?php echo htmlentities($newnews["name"],ENT_QUOTES); ?></title>
  <description>&lt;table border=0 cellpadding=3 cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;<?php echo htmlentities($newnews["name"],ENT_QUOTES); if(substr($newnews["file"],-3,3)=="pdf") { ?>&lt;/td&gt;&lt;td&gt;&lt;img src=http://www.tenncareadvocacy.org/images/PDF_icon_sm.gif title=PDF align=right&gt;<? } ?>&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</description>
  <link><?php if(substr($newnews["file"],0,4)=="http") { echo $newnews["file"]; } else { echo "http://www.tenncareadvocacy.org/".$newnews["file"]; } ?></link> 
  <pubDate><?php echo strftime("%a, %d %b %Y %T %Z",$newnews['pubdate']); ?></pubDate>
  </item>
<? } ?>
  <item>
  <title>See More New TennCare In The News</title>
  <description>See link for further details</description>
  <link>http://www.tenncareadvocacy.org/tenncare_in_the_news.php</link> 
  <pubDate><?php echo strftime("%a, %d %b %Y %T %Z",$lastdate['pubdate']); ?></pubDate>
  </item>
</channel>
</rss>