예제 #1
0
if (!empty($_GET['upd'])) {
    dcPage::success(__('Selected comments have been successfully updated.'));
} elseif (!empty($_GET['del'])) {
    dcPage::success(__('Selected comments have been successfully deleted.'));
}
if (!$core->error->flag()) {
    if (isset($_SESSION['comments_del_spam'])) {
        dcPage::message(__('Spam comments have been successfully deleted.'));
        unset($_SESSION['comments_del_spam']);
    }
    $spam_count = $core->blog->getComments(array('comment_status' => -2), true)->f(0);
    if ($spam_count > 0) {
        echo '<form action="' . $core->adminurl->get("admin.comments") . '" method="post" class="fieldset">';
        if (!$with_spam || $status != -2) {
            if ($spam_count == 1) {
                echo '<p>' . sprintf(__('You have one spam comment.'), '<strong>' . $spam_count . '</strong>') . ' ' . '<a href="' . $core->adminurl->get("admin.comments", array('status' => -2)) . '">' . __('Show it.') . '</a></p>';
            } elseif ($spam_count > 1) {
                echo '<p>' . sprintf(__('You have %s spam comments.'), '<strong>' . $spam_count . '</strong>') . ' ' . '<a href="' . $core->adminurl->get("admin.comments", array('status' => -2)) . '">' . __('Show them.') . '</a></p>';
            }
        }
        echo '<p>' . $core->formNonce() . '<input name="delete_all_spam" class="delete" type="submit" value="' . __('Delete all spams') . '" /></p>';
        # --BEHAVIOR-- adminCommentsSpamForm
        $core->callBehavior('adminCommentsSpamForm', $core);
        echo '</form>';
    }
    echo '<form action="' . $core->adminurl->get("admin.comments") . '" method="get" id="filters-form">' . '<h3 class="hidden">' . __('Filter comments and trackbacks list') . '</h3>' . '<div class="table">' . '<div class="cell">' . '<h4>' . __('Filters') . '</h4>' . '<p><label for="type" class="ib">' . __('Type:') . '</label> ' . form::combo('type', $type_combo, $type) . '</p> ' . '<p><label for="status" class="ib">' . __('Status:') . '</label> ' . form::combo('status', $status_combo, $status) . '</p>' . '</div>' . '<div class="cell filters-sibling-cell">' . '<p><label for="author" class="ib">' . __('Author:') . '</label> ' . form::field('author', 20, 255, html::escapeHTML($author)) . '</p>' . '<p><label for="ip" class="ib">' . __('IP address:') . '</label> ' . form::field('ip', 20, 39, html::escapeHTML($ip)) . '</p>' . '</div>' . '<div class="cell filters-options">' . '<h4>' . __('Display options') . '</h4>' . '<p><label for="sortby" class="ib">' . __('Order by:') . '</label> ' . form::combo('sortby', $sortby_combo, $sortby) . '</p>' . '<p><label for="order" class="ib">' . __('Sort:') . '</label> ' . form::combo('order', $order_combo, $order) . '</p>' . '<p><span class="label ib">' . __('Show') . '</span> <label for="nb" class="classic">' . form::field('nb', 3, 3, $nb_per_page) . ' ' . __('comments per page') . '</label></p>' . '</div>' . '</div>' . '<p><input type="submit" value="' . __('Apply filters and display options') . '" />' . '<br class="clear" /></p>' . '</form>';
    # Show comments
    $comment_list->display($page, $nb_per_page, '<form action="' . $core->adminurl->get("admin.comments") . '" method="post" id="form-comments">' . '%s' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right"><label for="action" class="classic">' . __('Selected comments action:') . '</label> ' . form::combo('action', $comments_actions_page->getCombo(), $default, '', '', '', 'title="' . __('Actions') . '"') . $core->formNonce() . '<input type="submit" value="' . __('ok') . '" /></p>' . form::hidden(array('type'), $type) . form::hidden(array('sortby'), $sortby) . form::hidden(array('order'), $order) . form::hidden(array('author'), html::escapeHTML(preg_replace('/%/', '%%', $author))) . form::hidden(array('status'), $status) . form::hidden(array('ip'), preg_replace('/%/', '%%', $ip)) . form::hidden(array('page'), $page) . form::hidden(array('nb'), $nb_per_page) . '</div>' . '</form>', $show_filters, $with_spam || $status == -2);
}
dcPage::helpBlock('core_comments');
dcPage::close();
예제 #2
0
파일: search.php 프로젝트: HackerMajor/root
        if ($core->auth->check('admin', $core->blog->id)) {
            $combo_action[__('change author')] = 'author';
        }
        if ($core->auth->check('delete,contentadmin', $core->blog->id)) {
            $combo_action[__('delete')] = 'delete';
        }
        # --BEHAVIOR-- adminPostsActionsCombo
        $core->callBehavior('adminPostsActionsCombo', array(&$combo_action));
        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="posts_actions.php" method="post" id="form-entries">' . '%s' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right">' . __('Selected entries action:') . form::combo('action', $combo_action) . '<input type="submit" value="' . __('ok') . '" /></p>' . form::hidden('redir', preg_replace('/%/', '%%', $redir)) . $core->formNonce() . '</div>' . '</form>');
    } elseif ($qtype == 'c') {
        # Actions combo box
        $combo_action = array();
        if ($core->auth->check('publish,contentadmin', $core->blog->id)) {
            $combo_action[__('publish')] = 'publish';
            $combo_action[__('unpublish')] = 'unpublish';
            $combo_action[__('mark as pending')] = 'pending';
            $combo_action[__('mark as junk')] = 'junk';
        }
        if ($core->auth->check('delete,contentadmin', $core->blog->id)) {
            $combo_action[__('delete')] = 'delete';
        }
        if ($counter->f(0) > 0) {
            printf('<h3>' . ($counter->f(0) == 1 ? __('%d comment found') : __('%d comments found')) . '</h3>', $counter->f(0));
        }
        $comment_list->display($page, $nb_per_page, '<form action="comments_actions.php" method="post" id="form-comments">' . '%s' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right">' . __('Selected comments action:') . ' ' . form::combo('action', $combo_action) . '<input type="submit" value="' . __('ok') . '" /></p>' . form::hidden('redir', preg_replace('/%/', '%%', $redir)) . $core->formNonce() . '</div>' . '</form>');
    }
}
dcPage::close();
예제 #3
0
파일: search.php 프로젝트: nikrou/dotclear
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') {
        # Actions combo box
        if ($counter->f(0) > 0) {
            printf('<h3>' . ($counter->f(0) == 1 ? __('%d comment found') : __('%d comments found')) . '</h3>', $counter->f(0));
        }
        $comment_list->display($page, $nb_per_page, '<form action="' . $core->adminurl->get("admin.search") . '" method="post" id="form-comments">' . '%s' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right"><label for="action2" class="classic">' . __('Selected comments action:') . '</label> ' . form::combo(array('action', 'action2'), $comments_actions_page->getCombo()) . '<input type="submit" value="' . __('ok') . '" /></p>' . $core->formNonce() . $comments_actions_page->getHiddenFields() . '</div>' . '</form>');
    }
}
dcPage::helpBlock('core_search');
dcPage::close();
예제 #4
0
    $core->error->add($e->getMessage());
}
/* DISPLAY
-------------------------------------------------------- */
$starting_script = dcPage::jsLoad('js/_comments.js');
if (!$show_filters) {
    $starting_script .= dcPage::jsLoad('js/filter-controls.js');
}
# --BEHAVIOR-- adminCommentsHeaders
$starting_script .= $core->callBehavior('adminCommentsHeaders');
dcPage::open(__('Comments'), $starting_script);
echo '<h2>' . html::escapeHTML($core->blog->name) . ' &rsaquo; ' . __('Comments') . '</h2>';
if (!$core->error->flag()) {
    # Filters
    if (!$show_filters) {
        echo '<p><a id="filter-control" class="form-control" href="#">' . __('Filters') . '</a></p>';
    }
    echo '<form action="comments.php" method="get" id="filters-form">' . '<fieldset><legend>' . __('Filters') . '</legend>' . '<div class="three-cols">' . '<div class="col">' . '<label>' . __('Type:') . ' ' . form::combo('type', $type_combo, $type) . '</label> ' . '<label>' . __('Status:') . ' ' . form::combo('status', $status_combo, $status) . '</label>' . '</div>' . '<div class="col">' . '<p><label>' . __('Order by:') . ' ' . form::combo('sortby', $sortby_combo, $sortby) . '</label> ' . '<label>' . __('Sort:') . ' ' . form::combo('order', $order_combo, $order) . '</label></p>' . '<p><label class="classic">' . form::field('nb', 3, 3, $nb_per_page) . ' ' . __('Comments per page') . '</label></p>' . '</div>' . '<div class="col">' . '<p><label>' . __('Comment author:') . ' ' . form::field('author', 20, 255, html::escapeHTML($author)) . '</label>' . '<label>' . __('IP address:') . ' ' . form::field('ip', 20, 39, html::escapeHTML($ip)) . '</label></p>' . '<p><input type="submit" value="' . __('filter') . '" /></p>' . '</div>' . '</div>' . '<br class="clear" />' . '</fieldset>' . '</form>';
    if (!$with_spam) {
        $spam_count = $core->blog->getComments(array('comment_status' => -2), true)->f(0);
        if ($spam_count == 1) {
            echo '<p>' . sprintf(__('You have one spam comments.'), '<strong>' . $spam_count . '</strong>') . ' ' . '<a href="comments.php?status=-2">' . __('Show it.') . '</a></p>';
        } elseif ($spam_count > 1) {
            echo '<p>' . sprintf(__('You have %s spam comments.'), '<strong>' . $spam_count . '</strong>') . ' ' . '<a href="comments.php?status=-2">' . __('Show them.') . '</a></p>';
        }
    }
    # Show comments
    $comment_list->display($page, $nb_per_page, '<form action="comments_actions.php" method="post" id="form-comments">' . '%s' . '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right">' . __('Selected comments action:') . ' ' . form::combo('action', $combo_action) . $core->formNonce() . '<input type="submit" value="' . __('ok') . '" /></p>' . form::hidden(array('type'), $type) . form::hidden(array('sortby'), $sortby) . form::hidden(array('order'), $order) . form::hidden(array('author'), preg_replace('/%/', '%%', $author)) . form::hidden(array('status'), $status) . form::hidden(array('ip'), preg_replace('/%/', '%%', $ip)) . form::hidden(array('page'), $page) . form::hidden(array('nb'), $nb_per_page) . '</div>' . '</form>');
}
dcPage::helpBlock('core_comments');
dcPage::close();