From b6a531917ea65ff22578d36399ef12b29cf8babc Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 30 Oct 2006 19:27:24 +0000 Subject: [PATCH] Make these links shorter and remove unneeded vars git-svn-id: http://svn.automattic.com/wordpress/trunk@4432 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/comment.php | 45 ++++++++++++++++---------------------- wp-admin/edit-comments.php | 2 +- wp-admin/edit.php | 2 +- wp-includes/pluggable.php | 10 ++++----- 4 files changed, 26 insertions(+), 33 deletions(-) diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 2ee54b28c..7d6a57d15 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -15,7 +15,7 @@ case 'editcomment': 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)')); @@ -29,29 +29,28 @@ 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.') ); + 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:'); ?>

@@ -70,8 +69,8 @@ case 'mailapprovecomment': - - + + @@ -107,26 +106,22 @@ case 'mailapprovecomment': break; case 'deletecomment': - $comment = (int) $_REQUEST['comment']; + $comment = (int) $_REQUEST['c']; check_admin_referer('delete-comment_' . $comment); - $p = (int) $_REQUEST['p']; if ( isset($_REQUEST['noredir']) ) { $noredir = true; } else { $noredir = false; } - $postdata = get_post($p) or - wp_die(sprintf(__('Oops, no post with this ID. 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); @@ -140,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 { @@ -161,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 { @@ -192,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; @@ -217,4 +210,4 @@ default: include('admin-footer.php'); -?> +?> \ No newline at end of file diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index ae23c633a..a2aad693f 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -124,7 +124,7 @@ if ( current_user_can('edit_post', $comment->comment_post_ID) ) { echo ' | ' . __('Unapprove') . ' '; echo ' | ' . __('Approve') . ' '; } - echo " | comment_post_ID . "&comment=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), js_escape( $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . " "; + echo " | comment_post_ID . "&comment=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), js_escape( $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . " "; } $post = get_post($comment->comment_post_ID); $post_title = wp_specialchars( $post->post_title, 'double' ); diff --git a/wp-admin/edit.php b/wp-admin/edit.php index bd570d01d..6f93e3a38 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -288,7 +288,7 @@ if ( current_user_can('edit_post', $comment->comment_post_ID) ) { echo ' | ' . __('Unapprove') . ' '; echo ' | ' . __('Approve') . ' '; } - echo " | comment_post_ID."&comment=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), js_escape( $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . " ]"; + echo " | comment_post_ID."&comment=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), js_escape( $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . " ]"; } // end if any comments to show ?>

diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index c81f575b6..5a6b7e410 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -369,8 +369,8 @@ function wp_notify_postauthor($comment_id, $comment_type='') { $subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title ); } $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n"; - $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl').'/wp-admin/comment.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; - $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_option('siteurl').'/wp-admin/comment.php?action=confirmdeletecomment&delete_type=spam&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; + $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n"; + $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n"; $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); @@ -426,9 +426,9 @@ function wp_notify_moderator($comment_id) { $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; $notify_message .= sprintf( __('Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n"; $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; - $notify_message .= sprintf( __('To approve this comment, visit: %s'), get_option('siteurl').'/wp-admin/comment.php?action=mailapprovecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; - $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl').'/wp-admin/comment.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; - $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_option('siteurl').'/wp-admin/comment.php?action=confirmdeletecomment&delete_type=spam&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; + $notify_message .= sprintf( __('To approve this comment, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n"; + $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n"; + $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n"; $notify_message .= sprintf( __('Currently %s comments are waiting for approval. Please visit the moderation panel:'), $comments_waiting ) . "\r\n"; $notify_message .= get_option('siteurl') . "/wp-admin/moderation.php\r\n";