<?php
include("functions/db.php");
include("functions/pr.php");
include("functions/string_functions.php");
$today = mktime((date("H")+7),(date("i")),(date("s")),(date("m")),(date("d")),(date("Y")));
$tdy = date("D, d M Y H:m:s \G\M\T",$today);
function get_time($time) {
    //2009-01-16 00:00:00
    $tt = explode(" ",$time);
    $td = explode("-",$tt[0]);
    $tt = explode(":",$tt[1]);

    $nt = mktime((date($tt[0])),(date($tt[1])),(date($tt[2])),(date($td[1])),(date($td[2])),(date($td[0])));
    $nt = date("D, d M Y H:m:s \G\M\T",$nt);
    return $nt;
}
$url = "http://aheavenlybanner.com/index.php?page=documents&amp;did=";
header('Content-type: text/xml');?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<atom:link href="http://aheavenlybanner.com/feed.xml" rel="self" type="application/rss+xml" />
<channel>
    <title>A Heavenly Banner</title>
    <link>http://aheavenlybanner.com/</link>
    <description>Because the Constitution of the United States is a glorious standard!</description>
    <lastBuildDate><?php echo $tdy?></lastBuildDate>
    <language>en-us</language>
<?php
$db = open_db();
$q1 = "select did,documents.aid,authors.aid as aaid,aname,aimage,dtitle,dorigin,dmon,dday,dyear,dtext,doc_added from authors,documents where authors.aid = documents.aid  order by doc_added desc";
$r1 = $db->GetArray($q1);

foreach($r1 as $k1=>$v1) {?>
    <item>
    <title><?php echo $v1['dtitle']." &#187; [".$v1['aname']." &#187; ".$v1['dmon']." ".$v1['dyear']?></title>
    <link><?php echo $url.$v1['did']?></link>
    <pubDate><?php echo get_time($v1['doc_added'])?></pubDate>
    <guid><?php echo $url.$v1['did']?></guid>
    <description><?php echo myTruncate($v1['dtext'],600)?></description>
    </item>
<?php }?>

</channel>
</rss>

