Ejemplo n.º 1
0
 public static function onActionLegacy($core, dcCommentsActionsPage $as, $Comment)
 {
     $core->callBehavior('adminCommentsActions', $core, $as->getRS(), $as->getAction(), $as->getRedirection());
     $as->beginPage('', dcPage::jsLoad('js/jquery/jquery.autocomplete.js') . dcPage::jsMetaEditor() . $core->callBehavior('adminCommentsActionsHeaders'), '');
     ob_start();
     $core->callBehavior('adminCommentsActionsContent', $core, $as->getAction(), $as->getHiddenFields(true));
     $res = ob_get_contents();
     ob_end_clean();
     $res = str_replace("comments_actions.php", $as->getURI(), $res);
     echo $res;
     $as->endPage();
 }
Ejemplo n.º 2
0
        $order = 'desc';
    }
    if ($sortby != 'comment_dt' || $order != 'desc') {
        $show_filters = true;
    }
} else {
    $sortby = 'comment_dt';
    $order = 'desc';
}
# Actions combo box
$combo_action = array();
$default = '';
if ($core->auth->check('delete,contentadmin', $core->blog->id) && $status == -2) {
    $default = 'delete';
}
$comments_actions_page = new dcCommentsActionsPage($core, $core->adminurl->get("admin.comments"));
if ($comments_actions_page->process()) {
    return;
}
/* Get comments
-------------------------------------------------------- */
try {
    $comments = $core->blog->getComments($params);
    $counter = $core->blog->getComments($params, true);
    $comment_list = new adminCommentList($core, $comments, $counter->f(0));
} catch (Exception $e) {
    $core->error->add($e->getMessage());
}
/* DISPLAY
-------------------------------------------------------- */
$form_filter_title = __('Show filters and display options');
Ejemplo n.º 3
0
        try {
            $comments = $core->blog->getComments($params);
            $counter = $core->blog->getComments($params, true);
            $comment_list = new adminCommentList($core, $comments, $counter->f(0));
        } catch (Exception $e) {
            $core->error->add($e->getMessage());
        }
    }
}
if ($qtype == 'p') {
    $posts_actions_page = new dcPostsActionsPage($core, $core->adminurl->get("admin.search"), array('q' => $q, 'qtype' => $qtype));
    if ($posts_actions_page->process()) {
        return;
    }
} else {
    $comments_actions_page = new dcCommentsActionsPage($core, $core->adminurl->get("admin.search"), array('q' => $q, 'qtype' => $qtype));
    if ($comments_actions_page->process()) {
        return;
    }
}
dcPage::open(__('Search'), $starting_scripts, dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Search') => '')));
echo '<form action="' . $core->adminurl->get("admin.search") . '" method="get" role="search">' . '<div class="fieldset"><h3>' . __('Search options') . '</h3>' . '<p><label for="q">' . __('Query:') . ' </label>' . form::field('q', 30, 255, $q) . '</p>' . '<p><label for="qtype1" class="classic">' . form::radio(array('qtype', 'qtype1'), 'p', $qtype == 'p') . ' ' . __('Search in entries') . '</label> ' . '<label for="qtype2" class="classic">' . form::radio(array('qtype', 'qtype2'), 'c', $qtype == 'c') . ' ' . __('Search in comments') . '</label></p>' . '<p><input type="submit" value="' . __('Search') . '" /></p>' . '</div>' . '</form>';
if ($q && !$core->error->flag()) {
    $redir = html::escapeHTML($_SERVER['REQUEST_URI']);
    # Show posts
    if ($qtype == 'p') {
        if ($counter->f(0) > 0) {
            printf('<h3>' . ($counter->f(0) == 1 ? __('%d entry found') : __('%d entries found')) . '</h3>', $counter->f(0));
        }
        $post_list->display($page, $nb_per_page, '<form action="' . $core->adminurl->get("admin.search") . '" method="post" id="form-entries">' . '%s' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right"><label for="action1" class="classic">' . __('Selected entries action:') . '</label> ' . form::combo(array('action', 'action1'), $posts_actions_page->getCombo()) . '<input type="submit" value="' . __('ok') . '" /></p>' . $core->formNonce() . $posts_actions_page->getHiddenFields() . '</div>' . '</form>');
    } elseif ($qtype == 'c') {
Ejemplo n.º 4
0
<?php

# -- BEGIN LICENSE BLOCK ---------------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK -----------------------------------------
/* ### THIS FILE IS DEPRECATED 					### */
/* ### IT IS ONLY USED FOR PLUGINS COMPATIBILITY ### */
require dirname(__FILE__) . '/../inc/admin/prepend.php';
if (isset($_REQUEST['redir'])) {
    $u = explode('?', $_REQUEST['redir']);
    $uri = $u[0];
    if (isset($u[1])) {
        parse_str($u[1], $args);
    }
    $args['redir'] = $_REQUEST['redir'];
} else {
    $uri = $core->adminurl->get("admin.comments");
    $args = array();
}
dcPage::check('usage,contentadmin');
$comments_actions_page = new dcCommentsActionsPage($core, $uri, $args);
$comments_actions_page->setEnableRedirSelection(false);
$comments_actions_page->process();
Ejemplo n.º 5
0
 public static function doBlacklistIP($core, dcCommentsActionsPage $ap, $post)
 {
     $action = $ap->getAction();
     $co_ids = $ap->getIDs();
     if (empty($co_ids)) {
         throw new Exception(__('No comment selected'));
     }
     $global = !empty($action) && $action == 'blacklist_global' && $core->auth->isSuperAdmin();
     $ip_filter = new dcFilterIP($core);
     $rs = $ap->getRS();
     while ($rs->fetch()) {
         $ip_filter->addIP('black', $rs->comment_ip, $global);
     }
     dcPage::addSuccessNotice(__('IP addresses for selected comments have been blacklisted.'));
     $ap->redirect(true);
 }
Ejemplo n.º 6
0
        } catch (Exception $e) {
            $core->error->add($e->getMessage());
        }
        # Sanitize trackbacks excerpt
        $tb_excerpt = empty($_POST['tb_excerpt']) ? $post_excerpt_xhtml . ' ' . $post_content_xhtml : $_POST['tb_excerpt'];
        $tb_excerpt = html::decodeEntities(html::clean($tb_excerpt));
        $tb_excerpt = text::cutString(html::escapeHTML($tb_excerpt), 255);
        $tb_excerpt = preg_replace('/\\s+/ms', ' ', $tb_excerpt);
    }
}
if (isset($_REQUEST['section']) && $_REQUEST['section'] == 'trackbacks') {
    $anchor = 'trackbacks';
} else {
    $anchor = 'comments';
}
$comments_actions_page = new dcCommentsActionsPage($core, $core->adminurl->get('admin.post'), array('id' => $post_id, '_ANCHOR' => $anchor, 'section' => $anchor));
if ($comments_actions_page->process()) {
    return;
}
# Ping blogs
if (!empty($_POST['ping'])) {
    if (!empty($_POST['tb_urls']) && $post_id && $post_status == 1 && $can_edit_post) {
        $tb_urls = $_POST['tb_urls'];
        $tb_urls = str_replace("\r", '', $tb_urls);
        $tb_post_title = html::escapeHTML(trim(html::clean($post_title)));
        $tb_post_url = $post->getURL();
        foreach (explode("\n", $tb_urls) as $tb_url) {
            try {
                $TB->ping($tb_url, $post_id, $tb_post_title, $tb_excerpt, $tb_post_url);
            } catch (Exception $e) {
                $core->error->add($e->getMessage());