コード例 #1
0
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation; version 2 only.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 */
if (!isset($_REQUEST['id'])) {
    header('Location: main.php');
    exit;
}
$CoreNews = new CoreNews();
$CoreNews->news_get($_REQUEST['id']);
$news =& $CoreNews->news[$_REQUEST['id']];
$monit = array();
$ft->assign('NOTE_PREVIEW', false);
if (isset($_POST['sub_commit'])) {
    //modyfikujemy wpis
    if (!$CoreNews->news_update()) {
        $monit = $CoreNews->error_get();
    } else {
        header('Location: main.php?p=16&msg=5');
        exit;
    }
    $ft->assign('NOTE_PREVIEW', str_nl2br($_POST['text']));
} elseif (isset($_POST['sub_preview'])) {
    //podglad wpisanej tresci
    $ft->assign('NOTE_PREVIEW', str_nl2br($_POST['text']));
コード例 #2
0
    $CoreNews->news_remove($_POST['selected_notes']);
    if (!$CoreNews->is_error()) {
        while (list($k, $v) = each($_POST['selected_notes'])) {
            unset($CoreNews->news[$v]);
        }
        $monit[] = $i18n['list_note'][1];
    } else {
        $monit = $news->error_get();
    }
} elseif (isset($_POST['sub_status']) && isset($_POST['selected_notes']) && is_array($_POST['selected_notes'])) {
    if ($permarr['moderator']) {
        while (list(, $v) = each($_POST['selected_notes'])) {
            $news =& $CoreNews->news[$v];
            $news->switch_published();
            $news->commit();
            $CoreNews->news_get($v);
            if ($news->is_error()) {
                $monit = array_merge($monit, $news->error_get());
            }
            if ($CoreNews->is_error()) {
                $monit = array_merge($monit, $CoreNews->error_get());
            }
        }
        $monit[] = $i18n['list_note'][4];
    } else {
        $monit[] = $i18n['list_note'][2];
    }
}
//wyswietlamy jakis komunikat ?
if (isset($_GET['msg']) && is_numeric($_GET['msg'])) {
    $monit[] = $i18n['list_note'][$_GET['msg']];
コード例 #3
0
 * This file is internal part of Core CMS (http://core-cms.com/) engine.
 *
 * Copyright (C) 2004-2005 Core Dev Team (more info: docs/AUTHORS).
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation; version 2 only.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 */
$CoreNews = new CoreNews();
$CoreNews->news_get($_GET['id']);
if (count($CoreNews->news)) {
    $news =& end($CoreNews->news);
    $id = $news->get_id();
    $text = str_replace(array('[podziel]', '[more]'), '', $news->get_text());
    $text = preg_replace("/\\[code:\"?([a-zA-Z0-9\\-_\\+\\#\$\\%]+)\"?\\](.*?)\\[\\/code\\]/sie", "highlighter('\\2', '\\1')", $text);
    $ft->define_dynamic('cat_row', 'rows');
    list_assigned_categories($_GET['id']);
    $ft->assign(array('DATE' => date($date_format, $news->get_timestamp()), 'NEWS_TITLE' => $news->get_title(), 'NEWS_TEXT' => $text, 'NEWS_AUTHOR' => $news->get_author(), 'NEWS_ID' => $_GET['id'], 'STRING' => '', 'PERMA_LINK' => $CoreRewrite->permanent_news($id, $rewrite), 'PAGINATED' => false, 'MOVE_BACK' => false, 'MOVE_FORWARD' => false));
    $comments = 0;
    get_comments_link($news->get_comments_allow(), $comments, $_GET['id']);
    // definiujemy blok dynamiczny szablonu
    $ft->define_dynamic('note_row', 'rows');
    $ft->assign('RETURN', $i18n['alter_view'][0]);
    $ft->parse('MAIN', '.note_row');
} else {