$valid = true; $pattern .= '|' . $_REQUEST['y']; if ($_REQUEST['m'] >= 1 && $_REQUEST['m'] <= 12) { $pattern .= '|' . $_REQUEST['m']; } else { $pattern .= '|all'; } } else { $valid = false; } # Contenido, cache c/30 mins $smarty->cache_lifetime = 1800; # Cache de 1 dia if (!$smarty->is_cached($tpl, $pattern)) { # Paginas $pagina = new ab_pageTable(); $rows = $pagina->readDataSQL("SELECT idab_page,ab_page FROM ab_page WHERE menu IS TRUE ORDER BY orden"); $smarty->assign('paginas', $rows); unset($pagina); unset($rows); # Entradas $entrada = new ab_entryTable(); $entrada->readEnv(); #$entrada->limit = ENTRY; #$entrada->offset = (($pg>1)?(($pg-1)*$entrada->limit):0); if ($_REQUEST['m']) { $period = strftime("%B/%Y", strtotime($_REQUEST['y'] . '-' . $_REQUEST['m'] . '-01')); $range_filter = "extract(month from ab_entry.creation) = " . $_REQUEST['m'] . " AND extract(year from ab_entry.creation) = " . $_REQUEST['y']; } else { $period = $_REQUEST['y']; $range_filter = "extract(year from ab_entry.creation) = " . $_REQUEST['y'];
# Comments include_once 'comments.php'; # Formulario, 1 semana $smarty->cache_lifetime = 604800; $tpl = AB_TPL_DIR . 'comments.frm.tpl'; $pattern = "blog|form|comentario"; if (!$smarty->is_cached($tpl, $pattern)) { } $smarty->display($tpl, $pattern); # Bottom $tpl = AB_TPL_DIR . 'bottom.tpl'; # Cache de 1 dia if (!$smarty->is_cached($tpl, $pattern)) { # Paginas if (!isset($ab_page)) { $ab_page = new ab_pageTable(); $entrada = new ab_entryTable(); } $rows = $ab_page->readDataSQL("SELECT idab_page,ab_page FROM ab_page ORDER BY orden"); $smarty->assign('ab_pages', $rows); unset($rows); # Ultimas Entradas $entrada->readEnv(); $entrada->limit = 10; $rows = $entrada->readDataFilter("public IS TRUE"); $smarty->assign('ult_entradas', $rows); unset($rows); # Meses $smarty->assign('periodos', getArchive($entrada)); unset($rows); }