Пример #1
0
        if ($chk && $articles->setWorkContainer($c) && $articles->deleteArticle($b, $id)) {
            rcms_showAdminMessage(__('Article removed') . ': ' . $c . '/' . $b . '/' . $id);
        } else {
            rcms_showAdminMessage($articles->last_error . ': ' . $c . '/' . $b . '/' . $id);
        }
    }
}
/******************************************************************************
* Perform changing of article                                                 *
******************************************************************************/
if (!empty($_POST['save']) && !empty($c) && (!empty($b) || $c == '#hidden' || $c == '#root') && !empty($a) && $articles->setWorkContainer($c) && ($article = $articles->getArticle($b, $a, false, true, true, false)) !== false) {
    $time = sql_to_unix_time($_POST['time']);
    if ($_POST['mode'] == 'php' && !$system->checkForRight('GENERAL')) {
        return rcms_showAdminMessage(__('Error occurred') . ': ' . __('You are not administrator of this site'));
    }
    if (!@$articles->saveArticle($b, $a, $_POST['title'], $_POST['source'], $_POST['keywords'], $_POST['sef_desc'], $_POST['description'], $_POST['text'], $_POST['mode'], $_POST['comments'], $time)) {
        rcms_showAdminMessage($articles->last_error);
    } else {
        rcms_showAdminMessage(__('Article saved'));
        sleep(1);
        if (!empty($nb) && $nb != $b) {
            if (!$articles->moveArticle($b, $a, $nb)) {
                rcms_showAdminMessage($articles->last_error);
            } else {
                rcms_showAdminMessage(__('Article moved'));
            }
        } else {
            rcms_redirect(RCMS_ROOT_PATH . '?module=articles&c=' . $c . '&b=' . $b . '&a=' . $a);
        }
    }
}
Пример #2
0
//   Copyright (C) ReloadCMS Development Team                                 //
//   http://reloadcms.com                                                     //
//   This product released under GNU General Public License v2                //
////////////////////////////////////////////////////////////////////////////////
if (!LOGGED_IN) {
    show_error(__('Guests cannot post articles'));
} else {
    $articles = new articles();
    if (!$system->checkForRight('ARTICLES-EDITOR')) {
        $c = '#hidden';
    } else {
        $c = empty($_POST['c']) ? null : $_POST['c'];
    }
    $b = empty($_POST['b']) ? null : $_POST['b'];
    if (!empty($_POST['save'])) {
        if (!$articles->setWorkContainer($c) || !$articles->saveArticle($b, 0, $_POST['title'], $_POST['source'], $_POST['keywords'], $_POST['sef_desc'], $_POST['description'], $_POST['text'], $_POST['mode'], $_POST['comments'])) {
            show_error($articles->last_error);
        } elseif ($system->checkForRight('ARTICLES-EDITOR')) {
            $frm = new InputForm(ADMIN_FILE . '?show=module&id=articles.articles', 'post', __('Edit it'));
            $frm->hidden('c', $c);
            $frm->hidden('b', $b);
            $frm->hidden('a', $_SESSION['art_id']);
            $frm->addrow(__('Article added'));
            show_window('', $frm->show(true));
        } else {
            show_error(__('Article added'));
        }
    }
    if (!empty($c)) {
        if ($articles->setWorkContainer($c)) {
            if ($c !== '#root' && $c !== '#hidden' && ($categories_list = $articles->getCategories(true, false)) === false) {