Example #1
0
 * 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.
 * 
 */
//domyslnie niech sobie bedzie puste
$ft->assign('MESSAGE', '');
$monit = array();
$CoreNews = new CoreNews();
if (isset($_POST['sub_commit'])) {
    //ktos probuje dodac wpis...
    if (!$CoreNews->news_add()) {
        $monit = $CoreNews->error_get();
    } else {
        header('Location: main.php?p=1&msg=6');
        exit;
    }
}
//jesli nie ma $date, to ja ustawiamy
if (!isset($_POST['now']) && isset($_POST['date'])) {
    $date = $_POST['date'];
} else {
    $date = date('Y-m-d H:i:s');
}
Example #2
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.
 * 
 */
$mainposts_per_page = get_config('mainposts_per_page');
$CoreNews = new CoreNews();
$num_items = $CoreNews->news_count();
// inicjowanie funkcji stronnicuj�cej wpisy
$pagination = pagination($CoreRewrite->pagination($rewrite), $mainposts_per_page, $num_items);
// definiujemy blok dynamiczny szablonu
$ft->define_dynamic('note_row', 'rows');
$ft->define_dynamic('cat_row', 'rows');
$CoreNews->news_list(null);
if (count($CoreNews->news)) {
    foreach ($CoreNews->news as $news) {
        $id = $news->get_id();
        list_assigned_categories($id);
        $text = show_me_more($news->get_text());
        $text = preg_replace("/\\[code:\"?([a-zA-Z0-9\\-_\\+\\#\$\\%]+)\"?\\](.*?)\\[\\/code\\]/sie", "highlighter('\\2', '\\1')", $text);
        $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' => $id, 'NEWS_CATEGORY' => '', 'PERMA_LINK' => $CoreRewrite->permanent_news($id, $rewrite), 'PAGINATED' => !empty($pagination['page_string']) ? true : false, 'STRING' => $pagination['page_string']));
        get_comments_link($news->get_comments_allow(), 0, $id);
Example #3
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
Example #4
0
<?php

// $Id: list_note.php 1128 2005-08-03 22:16:55Z mysz $
$CoreNews = new CoreNews();
$CoreNews->news_list(null, null, null, null);
$monit = array();
if (isset($_GET['delete'])) {
    if ($permarr['moderator']) {
        if (isset($CoreNews->news[$_GET['delete']])) {
            $CoreNews->news_remove($_GET['delete']);
            if (!$CoreNews->is_error()) {
                unset($CoreNews->news[$_GET['delete']]);
                $monit[] = $i18n['list_note'][0];
            } else {
                $monit = $CoreNews->error_get();
            }
        } else {
            $monit[] = 'Brak tekstu w i18n: nie ma takiego newsa';
        }
    } else {
        $monit[] = $i18n['list_note'][2];
    }
} elseif (isset($_POST['sub_delete']) && isset($_POST['selected_notes']) && is_array($_POST['selected_notes'])) {
    $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();
Example #5
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');