X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7688c6ba71852cd89123b62b2d57683535e4702a..refs/tags/wordpress-2.9:/wp-admin/edit-comments.php?ds=sidebyside diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index ab1bdbce..ee23b3e3 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -1,203 +1,461 @@ +wp_enqueue_script('admin-comments'); +enqueue_comment_hotkeys_js(); - + +if ( $post_id ) + $title = sprintf(__('Edit Comments on “%s”'), wp_html_excerpt(_draft_or_post_title($post_id), 50)); +else + $title = __('Edit Comments'); + +require_once('admin-header.php'); + +$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : esc_attr($_GET['mode']); + +$comment_status = isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all'; +if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam', 'trash')) ) + $comment_status = 'all'; + +$comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : ''; + +$search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : ''; +$search = esc_attr( $search_dirty ); ?> +
-

-
-
- - - - - -
-
-

|

+ +

' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( stripslashes( $_GET['s'] ) ), 50 ) ) . '' ); ?> +

+ get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); - // $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); - if ( current_user_can('edit_post', $post_id) ) { - if ( !empty( $_POST['spam_button'] ) ) - wp_set_comment_status($comment, 'spam'); - else - wp_set_comment_status($comment, 'delete'); - ++$i; + if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 ) { + echo '

'; + + if ( $approved > 0 ) { + printf( _n( '%s comment approved', '%s comments approved', $approved ), $approved ); + echo '
'; } - endforeach; - echo '

'; - if ( !empty( $_POST['spam_button'] ) ) { - printf(__ngettext('%s comment marked as spam', '%s comments marked as spam.', $i), $i); - } else { - printf(__ngettext('%s comment deleted.', '%s comments deleted.', $i), $i); + if ( $spammed > 0 ) { + printf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ); + $ids = isset($_GET['ids']) ? $_GET['ids'] : 0; + echo ' ' . __('Undo') . '
'; + } + if ( $unspammed > 0 ) { + printf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed ); + echo '
'; + } + if ( $trashed > 0 ) { + printf( _n( '%s comment moved to the trash.', '%s comments moved to the trash.', $trashed ), $trashed ); + $ids = isset($_GET['ids']) ? $_GET['ids'] : 0; + echo ' ' . __('Undo') . '
'; + } + if ( $untrashed > 0 ) { + printf( _n( '%s comment restored from the trash', '%s comments restored from the trash', $untrashed ), $untrashed ); + echo '
'; + } + if ( $deleted > 0 ) { + printf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted ); + echo '
'; + } + + echo '

'; } - echo '

'; -endif; +} +?> + +
+ + + + +comment_post_ID; +} +$_comment_pending_count_temp = (array) get_pending_comments_num($_comment_post_ids); +foreach ( (array) $_comment_post_ids as $_cpid ) + $_comment_pending_count[$_cpid] = isset( $_comment_pending_count_temp[$_cpid] ) ? $_comment_pending_count_temp[$_cpid] : 0; +if ( empty($_comment_pending_count) ) + $_comment_pending_count = array(); -$comments = array_slice($_comments, 0, 20); -$extra_comments = array_slice($_comments, 20); +$comments = array_slice($_comments, 0, $comments_per_page); +$extra_comments = array_slice($_comments, $comments_per_page); $page_links = paginate_links( array( 'base' => add_query_arg( 'apage', '%#%' ), 'format' => '', - 'total' => ceil($total / 20), + 'prev_text' => __('«'), + 'next_text' => __('»'), + 'total' => ceil($total / $comments_per_page), 'current' => $page )); -if ( $page_links ) - echo ""; - -if ('view' == $mode) { - if ($comments) { - $offset = $offset + 1; - $start = " start='$offset'"; - - echo "
    \n"; - $i = 0; - foreach ( $comments as $comment ) { - get_comment( $comment ); // Cache it - _wp_comment_list_item( $comment->comment_ID, ++$i ); - } - echo "
\n\n"; +?> + + + + + + + + +
+ + +
' . __( 'Displaying %s–%s of %s' ) . '%s', + number_format_i18n( $start + 1 ), + number_format_i18n( min( $page * $comments_per_page, $total ) ), + '' . number_format_i18n( $total ) . '', + $page_links +); echo $page_links_text; ?>
+ + + + -if ( $extra_comments ) : ?> - -
- if ($comments) { - echo ' '; - wp_nonce_field('bulk-comments'); - echo ' + +
- - - - - - - - -'; - foreach ($comments as $comment) { - $post = get_post($comment->comment_post_ID); - $authordata = get_userdata($post->post_author); - $comment_status = wp_get_comment_status($comment->comment_ID); - $class = ('alternate' == $class) ? '' : 'alternate'; - $class .= ('unapproved' == $comment_status) ? ' unapproved' : ''; -?> - - - - - - - - - - -
' . __('Name') . '' . __('E-mail') . '' . __('IP') . '' . __('Comment Excerpt') . '' . __('Actions') . '
comment_post_ID) ) { ?> - - - - comment_post_ID) ) { - echo "" . __('Edit') . ""; } ?>comment_post_ID) ) { - echo "comment_post_ID."&c=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to delete this comment by '%s'. \n 'Cancel' to stop, 'OK' to delete."), $comment->comment_author )) . "', theCommentList );\" class='delete'>" . __('Delete') . " "; - } ?>
-

'); return false } return confirm('')" /> - '); return false } return confirm('')" />

-
-
+ + + + + + + + + + + + comment_ID, $mode, $comment_status ); ?> -

- -

+ + comment_ID, $mode, $comment_status ); +?> + + +
+$page_links

"; - + echo "
$page_links_text
"; ?> +
+ + + + + + + + + +
+ +
- + + + + +
+ + +

+ + + +

+ + + +
+ +