loadRow($sql); $article = new Article($rs['articleid']); $article->loadEvents(true); // Load live date-based event list $article->data['events'] = $article->events; //print_r($article); if ($_GET['mode'] == 'pdf') { require_once("includes/html2fpdf/html2fpdf.php"); $pdf = new HTML2FPDF(); $html = $article->getTableHTML(true, true, false, true); //die($html); //header("content-type: application/pdf"); $pdf->AddPage(); $pdf->WriteHTML($html); //print("
");
//print_r($pdf);
//die("
"); $pdf->Output('cotd.pdf', 'I'); } else { if (empty($_GET['d'])) { if (empty($_GET['articleid'])) { $time = time(); } else { $time = $rs['timestamp']; } } else { $time = strtotime($_GET['d']); } $sql = "SELECT *, DATE_FORMAT(startdate, '%e') AS dayofmonth, DATE_FORMAT(startdate, '%b %d') AS daystring FROM #_articles "; $sql .= " WHERE status = '" . STATUS_VISIBLE . "' AND startdate >= '" . date('Y-m-01', $time) . "' AND startdate <= '" . date('Y-m-', $time) . "31'"; $sql .= " ORDER BY startdate"; $articles = $db->loadRows($sql); include "includes/calendar.inc.php"; $smarty->assign("cheese", $article->data); $smarty->assign("body", "index.tpl"); $smarty->display('main.tpl'); } ?>