<th scope="col" class="check-column"><input type="checkbox" /></th>
    <th scope="col"><?php _e('Comment') ?></th>
    <th scope="col"><?php _e('Date') ?></th>
    <th scope="col" class="action-links"><?php _e('Actions') ?></th>
  </tr>
</thead>
<tbody id="the-comment-list" class="list:comment">
<?php
	foreach ($comments as $comment)
		_wp_comment_row( $comment->comment_ID, $mode, $comment_status );
?>
</tbody>
<tbody id="the-extra-comment-list" class="list:comment" style="display: none;">
<?php
	foreach ($extra_comments as $comment)
		_wp_comment_row( $comment->comment_ID, $mode, $comment_status );
?>
</tbody>
</table>

</form>

<form id="get-extra-comments" method="post" action="" class="add:the-extra-comment-list:" style="display: none;">
	<input type="hidden" name="s" value="<?php echo $search; ?>" />
	<input type="hidden" name="mode" value="<?php echo $mode; ?>" />
	<input type="hidden" name="comment_status" value="<?php echo $comment_status; ?>" />
	<input type="hidden" name="page" value="<?php echo isset($_REQUEST['page']) ? absint( $_REQUEST['page'] ) : 1; ?>" />
	<?php wp_nonce_field( 'add-comment', '_ajax_nonce', false ); ?>
</form>

<div id="ajax-response"></div>
        ?>
</th>
    <th scope="col" class="column-author"><?php 
        _e('Author');
        ?>
</th>
    <th scope="col" class="column-date"><?php 
        _e('Submitted');
        ?>
</th>
  </tr>
</thead>
<tbody id="the-comment-list" class="list:comment">
<?php 
        foreach ($comments as $comment) {
            _wp_comment_row($comment->comment_ID, 'single', false, false);
        }
        ?>
</tbody>
</table>

<?php 
        wp_comment_reply();
    }
    // comments
}
// posts;
?>

</div>
Esempio n. 3
0
     if ('' == $_POST['content']) {
         die(__('Error: please type a comment.'));
     }
     $comment_id = (int) $_POST['comment_ID'];
     $_POST['comment_status'] = $_POST['status'];
     edit_comment();
     $mode = isset($_POST['mode']) && 'single' == $_POST['mode'] ? 'single' : 'detail';
     $position = isset($_POST['position']) && (int) $_POST['position'] ? (int) $_POST['position'] : '-1';
     $checkbox = isset($_POST['checkbox']) && true == $_POST['checkbox'] ? 1 : 0;
     $comments_listing = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';
     if (get_option('show_avatars') && 'single' != $mode) {
         add_filter('comment_author', 'floated_admin_avatar');
     }
     $x = new WP_Ajax_Response();
     ob_start();
     _wp_comment_row($comment_id, $mode, $comments_listing, $checkbox);
     $comment_list_item = ob_get_contents();
     ob_end_clean();
     $x->add(array('what' => 'edit_comment', 'id' => $comment->comment_ID, 'data' => $comment_list_item, 'position' => $position));
     $x->send();
     break;
 case 'add-meta':
     check_ajax_referer('add-meta');
     $c = 0;
     $pid = (int) $_POST['post_id'];
     if (isset($_POST['metakeyselect']) || isset($_POST['metakeyinput'])) {
         if (!current_user_can('edit_post', $pid)) {
             die('-1');
         }
         if (isset($_POST['metakeyselect']) && '#NONE#' == $_POST['metakeyselect'] && empty($_POST['metakeyinput'])) {
             die('1');
Esempio n. 4
0
     }
     if ('' == $_POST['content']) {
         die(__('Error: please type a comment.'));
     }
     $comment_id = (int) $_POST['comment_ID'];
     $_POST['comment_status'] = $_POST['status'];
     edit_comment();
     $mode = isset($_POST['mode']) && 'single' == $_POST['mode'] ? 'single' : 'detail';
     $position = isset($_POST['position']) && (int) $_POST['position'] ? (int) $_POST['position'] : '-1';
     $checkbox = isset($_POST['checkbox']) && true == $_POST['checkbox'] ? 1 : 0;
     if (get_option('show_avatars') && 'single' != $mode) {
         add_filter('comment_author', 'floated_admin_avatar');
     }
     $x = new WP_Ajax_Response();
     ob_start();
     _wp_comment_row($comment_id, $mode, true, $checkbox);
     $comment_list_item = ob_get_contents();
     ob_end_clean();
     $x->add(array('what' => 'edit_comment', 'id' => $comment->comment_ID, 'data' => $comment_list_item, 'position' => $position));
     $x->send();
     break;
 case 'add-meta':
     check_ajax_referer('add-meta');
     $c = 0;
     $pid = (int) $_POST['post_id'];
     if (isset($_POST['metakeyselect']) || isset($_POST['metakeyinput'])) {
         if (!current_user_can('edit_post', $pid)) {
             die('-1');
         }
         if ('#NONE#' == $_POST['metakeyselect'] && empty($_POST['metakeyinput'])) {
             die('1');
	?>

<br class="clear" />

<table class="widefat" style="margin-top: .5em">
<thead>
  <tr>
    <th scope="col"><?php _e('Comment') ?></th>
    <th scope="col"><?php _e('Date') ?></th>
    <th scope="col"><?php _e('Actions') ?></th>
  </tr>
</thead>
<tbody id="the-comment-list" class="list:comment">
<?php
        foreach ($comments as $comment)
                _wp_comment_row( $comment->comment_ID, 'detail', false, false );
?>
</tbody>
</table>

<?php

endif; // comments
endif; // posts;

?>

</div>

<?php include('admin-footer.php'); ?>
     if (!current_user_can('edit_post', $id)) {
         die('-1');
     }
     $search = isset($_POST['s']) ? $_POST['s'] : false;
     $start = isset($_POST['page']) ? intval($_POST['page']) * 25 - 1 : 24;
     $status = isset($_POST['comment_status']) ? $_POST['comment_status'] : false;
     $mode = isset($_POST['mode']) ? $_POST['mode'] : 'detail';
     list($comments, $total) = _wp_get_comment_list($status, $search, $start, 1);
     if (!$comments) {
         die('1');
     }
     $x = new WP_Ajax_Response();
     foreach ((array) $comments as $comment) {
         get_comment($comment);
         ob_start();
         _wp_comment_row($comment->comment_ID, $mode, false);
         $comment_list_item = ob_get_contents();
         ob_end_clean();
         $x->add(array('what' => 'comment', 'id' => $comment->comment_ID, 'data' => $comment_list_item));
     }
     $x->send();
     break;
 case 'add-meta':
     check_ajax_referer('add-meta');
     $c = 0;
     $pid = (int) $_POST['post_id'];
     if (isset($_POST['metakeyselect']) || isset($_POST['metakeyinput'])) {
         if (!current_user_can('edit_post', $pid)) {
             die('-1');
         }
         if ('#NONE#' == $_POST['metakeyselect'] && empty($_POST['metakeyinput'])) {