useCached(); $rss->title = "LAD new reports"; $rss->description = "Latest reports from the Lao Agricultural Database"; $rss->link = $website."/news"; $rss->syndicationURL = $website."/".$_SERVER['PHP_SELF']; $db = connect_tid(); $sql = "select distinct(report.mfn) as mfn, action_dt from report join report_actions on report.mfn=report_actions.mfn where report.public=1 order by report_actions.action_dt desc limit 20"; $result = $db->query($sql); while ($val = $result->fetch()) { $r = loadReport($val['mfn']); $item = new FeedItem(); $item->title = $r->short_title(1); $item->description = $r->short_title(1,0); $item->link = "http://lad.nafri.org.la/show_record.php?mfn=".$val['mfn']; $item->date = date(DATE_ATOM, strtotime($val['action_dt'])); $item->source = $website; $rss->addItem($item); } $rss->saveFeed("RSS1.0", "news/feed.xml"); close_tid($db); ?>