Example #1
0
            }
        }
        header("Location: " . selfURL() . '?m=1');
        exit;
    }
} elseif ($_REQUEST['m'] == 1) {
    $msg = '<div class="succ">Muchas Gracias su recomendaciĆ³n ha sida enviada.</div>';
    $smarty->assign('msg', $msg);
}
$tpl = AB_TPL_DIR . 'send.tpl';
$pattern = 'blog|entry|' . ($tpl_id = $_REQUEST['idab_entry'] = trim(preg_replace('(\\.(.*))', '', $_REQUEST['idab_entry']), "/\t\n \r\v"));
$pattern = '|send';
$patron = "^[[:digit:]]+\$";
$table = new Table('ab_page');
if (eregi($patron, $tpl_id)) {
    $exist = (bool) $table->getVar("SELECT idab_entry FROM ab_entry WHERE idab_entry = " . (int) escape($table, $_REQUEST['idab_entry']));
} else {
    $exist = false;
}
if ($exist) {
    # Cache de 1 dia
    if (!$smarty->is_cached($tpl, $pattern)) {
        # Paginas
        $ab_page = new ab_pageTable();
        $rows = $ab_page->readDataSQL("SELECT idab_page,ab_page FROM ab_page WHERE menu IS TRUE ORDER BY orden");
        $smarty->assign('paginas', $rows);
        unset($rows);
        # Entradas
        $entrada = new ab_entryTable();
        $entrada->readEnv();
        list($row) = $entrada->readDataFilter("idab_entry = " . $entrada->request['idab_entry'] . " AND public IS TRUE");
Example #2
0
<?php

require './common.inc.php';
$tpl = AB_TPL_DIR . 'index.tpl';
$pattern = 'blog|portada';
$patron = "^[[:digit:]]+\$";
# Numero de ab_pages
$table = new Table('ab_page');
$var = (int) $table->getVar("SELECT count(idab_entry) FROM ab_entry WHERE public IS TRUE");
$pgs = ceil($var / AB_ENTRIES_PAGE);
$pg = (int) $_REQUEST['pg'];
unset($var);
if ($pg > $pgs) {
    require ROOTDIR . '/classes/include.d/404.inc.php';
    if ($tpl_id) {
        $grp_id = 'blog|404';
    } else {
        $tpl_id = 'notallowed';
    }
    $smarty->assign('title', 'PƔgina no disponible');
    $exist = false;
} elseif ($pg == 0) {
    $pg = 1;
}
unset($table);
$pattern .= "|{$pg}";
# Contenido, cache c/30 mins
$smarty->cache_lifetime = 1800;
if ($exist !== false) {
    # Cache de 1 dia
    if (!$smarty->is_cached($tpl, $pattern)) {