コード例 #1
0
} 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'];
    }
    $rows = $entrada->readDataFilter("ab_entry.public IS TRUE AND {$range_filter}");
    for ($i = 0; $i < count($rows); $i++) {
        $rows[$i]['seo_title'] = generate_seo_link($rows[$i]['ab_entry']);
        $rows[$i]['texto'] = strip_code($rows[$i]['texto']);
    }
    $smarty->assign('entradas', $rows);
コード例 #2
0
ファイル: send.php プロジェクト: ReneVallecillo/almidon-blog
        error_log("Error: Campo *Tu Nombre* es requerido.");
        $msg = '<div class="error">Error: Campo *Tu Nombre* es requerido.</div>';
        $smarty->assign('msg', $msg);
        $smarty->assign('data', $_POST);
    } elseif (empty($_POST['email'])) {
        error_log("Error: Campo *Tu Correo Electrónico* es requerido.");
        $msg = '<div class="error">Error: Campo *Tu Correo Electrónico* es requerido.</div>';
        $smarty->assign('msg', $msg);
        $smarty->assign('data', $_POST);
        # Todo bien
    } else {
        $_REQUEST['ip'] = getip();
        $message = strip_tags($_REQUEST['ab_comment']);
        $tos = explode(',', trim($_REQUEST['tos']));
        $ab_entry = new ab_entryTable();
        $ab_entry->readEnv();
        $row = $ab_entry->readRecord();
        $subject = 'Recomendación: ' . $row['ab_entry'];
        $message = $_REQUEST['name'] . ' te ha enviado el siguiente articulo. Sus Comentarios son los siguientes:
----
' . $_REQUEST['ab_comment'] . '
----

<b>' . $row['ab_entry'] . '</b>
' . substr(trim(strip_tags(strip_code($row['body']))), 0, 125);
        $message = nl2br($message);
        # Headers
        $headers = 'From: ' . AB_NAME_NOREPLAY . '<' . AB_EMAIL_NOREPLAY . ">\r\n";
        $headers .= 'MIME-Version: 1.0' . "\r\n";
        //$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";