'.GetEvents()"); function GetEvents() { $days = 30; if (isset($_POST['days'])) { $days = intval($_POST['days']); } $dsn = 'sqlite:////home/crux/public_html/local/timeline.db'; $db =& DB::connect($dsn); if (DB::isError($db)) die("Cannot connect to database"); $db->setFetchMode(DB_FETCHMODE_ASSOC); $from = time() - ($days * 24 * 60 * 60); $sql = "select * from events where event_tstamp >= $from order by event_tstamp desc"; $res =& $db->Query($sql); if (DB::isError($res)) die("Query error"); $timeline .= '
'.$evt['event_date']." | ||
'.$evt['event_time'].' | '.$img.' | '.$event_description.' |