Example #1
0
    }
    if ($_POST['comments_allow'] <= 0) {
        $ca_y = '';
        $ca_n = 'checked="checked"';
    }
    if ($_POST['published'] < 0) {
        $p_y = '';
        $p_n = 'checked="checked"';
    }
    if (isset($_POST['now'])) {
        $date_disabled = 'disabled="disabled"';
        $date_now = 'checked="checked"';
    }
} else {
    $current_cat_id = array(1);
    $ft->assign('NOTE_PREVIEW', false);
}
$ft->define('form_noteadd', 'form_noteadd.tpl');
$ft->assign(array('ONLY_IN_CAT_Y' => $oic_y, 'ONLY_IN_CAT_N' => $oic_n, 'COMMENTS_ALLOW_Y' => $ca_y, 'COMMENTS_ALLOW_N' => $ca_n, 'PUBLISHED_Y' => $p_y, 'PUBLISHED_N' => $p_n, 'DATE' => $date, 'AUTHOR' => isset($_POST['author']) ? str_entit($_POST['author']) : $_SESSION['login'], 'DATE_DISABLED' => $date_disabled, 'DATE_NOW' => $date_now));
unset($oic_y, $oic_n, $ca_y, $ca_n, $p_y, $p_n);
//wyswietlamy jakis komunikat ?
if (isset($_GET['msg']) && is_numeric($_GET['msg'])) {
    $monit[] = $i18n['add_note'][$_GET['msg']];
}
if (count($monit)) {
    tpl_message($monit);
}
//lista kategorii
$cats = db_get_categories();
tpl_categories('CATEGORIES', $cats, 0, $current_cat_id);
$ft->parse('ROWS', '.form_noteadd');
Example #2
0
        $monit[] = $i18n['list_note'][2];
    }
}
//wyswietlamy jakis komunikat ?
if (isset($_GET['msg']) && is_numeric($_GET['msg'])) {
    $monit[] = $i18n['list_note'][$_GET['msg']];
}
$mainposts_per_page = get_config('editposts_per_page');
$num_items = count($CoreNews->news);
// inicjowanie funkcji stronnicuj±cej wpisy
$pagination = pagination('main.php?p=2&amp;start=', $mainposts_per_page, $num_items);
if (count($monit)) {
    tpl_message($monit);
}
// Sprawdzamy, czy w bazie danych s± ju¿ jakie¶ wpisy
if ($num_items > 0) {
    $ft->define('editlist_notes', 'editlist_notes.tpl');
    $ft->define_dynamic('row', 'editlist_notes');
    // Pêtla wyswietlaj¹ca wszystkie wpisy + stronnicowanie ich
    $idx1 = 0;
    while (list($id, $news) = each($CoreNews->news)) {
        $ft->assign(array('ID' => $id, 'TITLE' => $news->get_title(), 'DATE' => $news->get_date(), 'AUTHOR' => $news->get_author(), 'PUBLISHED' => $news->get_published() ? $i18n['confirm'][0] : $i18n['confirm'][1], 'PAGINATED' => !empty($pagination['page_string']), 'STRING' => $pagination['page_string']));
        $idx1++;
        // naprzemienne kolorowanie wierszy tabeli
        $ft->assign('ID_CLASS', $idx1 % 2 ? 'mainList' : 'mainListAlter');
        $ft->parse('ROW', '.row');
    }
    $ft->parse('ROWS', 'editlist_notes');
} else {
    tpl_message($i18n['list_note'][3], '', 'ROWS');
}