From d510632e9f07cec9ac3de3b5dafc56bd58c81b8a Mon Sep 17 00:00:00 2001 From: donncha Date: Tue, 7 Nov 2006 12:37:04 +0000 Subject: WP Merge git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@804 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/comment.php | 127 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 74 insertions(+), 53 deletions(-) (limited to 'wp-admin/comment.php') diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 6589d8b..065bd39 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -12,11 +12,10 @@ if ( isset( $_POST['deletecomment'] ) ) switch($action) { case 'editcomment': $title = __('Edit Comment'); - if ( user_can_richedit() ) - wp_enqueue_script( 'wp_tiny_mce' ); + require_once ('admin-header.php'); - $comment = (int) $_GET['comment']; + $comment = (int) $_GET['c']; if ( ! $comment = get_comment($comment) ) wp_die(sprintf(__('Oops, no comment with this ID. Go back!'), 'javascript:history.go(-1)')); @@ -30,75 +29,99 @@ case 'editcomment': break; -case 'confirmdeletecomment': -case 'mailapprovecomment': +case 'cdc': +case 'mac': require_once('./admin-header.php'); - $comment = (int) $_GET['comment']; - $p = (int) $_GET['p']; - $formaction = 'confirmdeletecomment' == $action ? 'deletecomment' : 'approvecomment'; - $nonce_action = 'confirmdeletecomment' == $action ? 'delete-comment_' : 'approve-comment_'; + $comment = (int) $_GET['c']; + $formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment'; + $nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_'; $nonce_action .= $comment; if ( ! $comment = get_comment($comment) ) wp_die(sprintf(__('Oops, no comment with this ID. Go back!'), 'edit.php')); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) - wp_die( 'confirmdeletecomment' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); - - echo "
\n"; - if ( 'spam' == $_GET['delete_type'] ) - echo "

" . __('Caution: You are about to mark the following comment as spam:') . "

\n"; - elseif ( 'confirmdeletecomment' == $action ) - echo "

" . __('Caution: You are about to delete the following comment:') . "

\n"; - else - echo "

" . __('Caution: You are about to approve the following comment:') . "

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
" . __('Author:') . "$comment->comment_author
" . __('E-mail:') . "$comment->comment_author_email
". __('URL:') . "$comment->comment_author_url
". __('Comment:') . "$comment->comment_content
\n"; - echo "

" . __('Are you sure you want to do that?') . "

\n"; - - echo "
\n"; - wp_nonce_field($nonce_action); - echo "\n"; - if ( 'spam' == $_GET['delete_type'] ) - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "  "; - echo "\n"; - echo "
\n"; - echo "
\n"; - + wp_die( 'cdc' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); +?> +
+ +
+ +

Caution: You are about to mark the following comment as spam:'); ?>

+ +

Caution: You are about to delete the following comment:'); ?>

+ +

Caution: You are about to approve the following comment:'); ?>

+ + +

+ +
/wp-admin/comment.php' method='get'> + + + + + + +
' onclick="self.location='/wp-admin/edit-comments.php';" />' />
+ + + + + + + + + +
+ + + + + + +comment_author_email ) { ?> + + + + + +comment_author_url ) { ?> + + + + + + + + + +
comment_author; ?>
comment_author_email; ?>
comment_author_url; ?>

comment_content ); ?>
+ +
+
+Go back!'), 'edit.php')); - if ( ! $comment = get_comment($comment) ) wp_die(sprintf(__('Oops, no comment with this ID. Go back!'), 'edit-comments.php')); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) wp_die( __('You are not allowed to edit comments on this post.') ); - if ( 'spam' == $_REQUEST['delete_type'] ) + if ( 'spam' == $_REQUEST['dt'] ) wp_set_comment_status($comment->comment_ID, 'spam'); else wp_delete_comment($comment->comment_ID); @@ -112,10 +135,9 @@ case 'deletecomment': break; case 'unapprovecomment': - $comment = (int) $_GET['comment']; + $comment = (int) $_GET['c']; check_admin_referer('unapprove-comment_' . $comment); - - $p = (int) $_GET['p']; + if (isset($_GET['noredir'])) { $noredir = true; } else { @@ -133,16 +155,15 @@ case 'unapprovecomment': if ((wp_get_referer() != "") && (false == $noredir)) { wp_redirect(wp_get_referer()); } else { - wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); + wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments'); } exit(); break; case 'approvecomment': - $comment = (int) $_GET['comment']; + $comment = (int) $_GET['c']; check_admin_referer('approve-comment_' . $comment); - $p = (int) $_GET['p']; if (isset($_GET['noredir'])) { $noredir = true; } else { @@ -164,7 +185,7 @@ case 'approvecomment': if ((wp_get_referer() != "") && (false == $noredir)) { wp_redirect(wp_get_referer()); } else { - wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); + wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments'); } exit(); break; -- cgit