Changeset 4432
- Timestamp:
- 10/30/06 19:27:24 (2 years ago)
- Files:
-
- trunk/wp-admin/comment.php (modified) (11 diffs)
- trunk/wp-admin/edit-comments.php (modified) (1 diff)
- trunk/wp-admin/edit.php (modified) (1 diff)
- trunk/wp-includes/pluggable.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/comment.php
r4424 r4432 16 16 require_once ('admin-header.php'); 17 17 18 $comment = (int) $_GET['c omment'];18 $comment = (int) $_GET['c']; 19 19 20 20 if ( ! $comment = get_comment($comment) ) … … 30 30 break; 31 31 32 case 'c onfirmdeletecomment':33 case 'ma ilapprovecomment':32 case 'cdc': 33 case 'mac': 34 34 35 35 require_once('./admin-header.php'); 36 36 37 $comment = (int) $_GET['comment']; 38 $p = (int) $_GET['p']; 39 $formaction = 'confirmdeletecomment' == $action ? 'deletecomment' : 'approvecomment'; 40 $nonce_action = 'confirmdeletecomment' == $action ? 'delete-comment_' : 'approve-comment_'; 37 $comment = (int) $_GET['c']; 38 $formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment'; 39 $nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_'; 41 40 $nonce_action .= $comment; 42 41 … … 45 44 46 45 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 47 wp_die( 'c onfirmdeletecomment' == $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.') );46 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.') ); 48 47 ?> 49 48 <div class='wrap'> 50 49 51 50 <div class="narrow"> 52 <?php if ( 'spam' == $_GET['d elete_type'] ) { ?>51 <?php if ( 'spam' == $_GET['dt'] ) { ?> 53 52 <p><?php _e('<strong>Caution:</strong> You are about to mark the following comment as spam:'); ?></p> 54 <?php } elseif ( 'c onfirmdeletecomment' == $action ) { ?>53 <?php } elseif ( 'cdc' == $action ) { ?> 55 54 <p><?php _e('<strong>Caution:</strong> You are about to delete the following comment:'); ?></p> 56 55 <?php } else { ?> … … 71 70 <?php wp_nonce_field($nonce_action); ?> 72 71 <input type='hidden' name='action' value='<?php echo $formaction; ?>' /> 73 <?php if ( 'spam' == $_GET['d elete_type'] ) { ?>74 <input type='hidden' name='d elete_type' value='spam' />72 <?php if ( 'spam' == $_GET['dt'] ) { ?> 73 <input type='hidden' name='dt' value='spam' /> 75 74 <?php } ?> 76 75 <input type='hidden' name='p' value='<?php echo $comment->comment_post_ID; ?>' /> … … 108 107 109 108 case 'deletecomment': 110 $comment = (int) $_REQUEST['c omment'];109 $comment = (int) $_REQUEST['c']; 111 110 check_admin_referer('delete-comment_' . $comment); 112 111 113 $p = (int) $_REQUEST['p'];114 112 if ( isset($_REQUEST['noredir']) ) { 115 113 $noredir = true; … … 118 116 } 119 117 120 $postdata = get_post($p) or121 wp_die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php'));122 123 118 if ( ! $comment = get_comment($comment) ) 124 119 wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit-comments.php')); … … 127 122 wp_die( __('You are not allowed to edit comments on this post.') ); 128 123 129 if ( 'spam' == $_REQUEST['d elete_type'] )124 if ( 'spam' == $_REQUEST['dt'] ) 130 125 wp_set_comment_status($comment->comment_ID, 'spam'); 131 126 else … … 141 136 142 137 case 'unapprovecomment': 143 $comment = (int) $_GET['c omment'];138 $comment = (int) $_GET['c']; 144 139 check_admin_referer('unapprove-comment_' . $comment); 145 146 $p = (int) $_GET['p']; 140 147 141 if (isset($_GET['noredir'])) { 148 142 $noredir = true; … … 162 156 wp_redirect(wp_get_referer()); 163 157 } else { 164 wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$ p.'&c=1#comments');158 wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments'); 165 159 } 166 160 exit(); … … 168 162 169 163 case 'approvecomment': 170 $comment = (int) $_GET['c omment'];164 $comment = (int) $_GET['c']; 171 165 check_admin_referer('approve-comment_' . $comment); 172 166 173 $p = (int) $_GET['p'];174 167 if (isset($_GET['noredir'])) { 175 168 $noredir = true; … … 193 186 wp_redirect(wp_get_referer()); 194 187 } else { 195 wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$ p.'&c=1#comments');188 wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments'); 196 189 } 197 190 exit(); trunk/wp-admin/edit-comments.php
r4267 r4432 125 125 echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $comment->comment_post_ID . '&comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; 126 126 } 127 echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&d elete_type=spam&p=" . $comment->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') . "</a> ";127 echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&dt=spam&p=" . $comment->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') . "</a> "; 128 128 } 129 129 $post = get_post($comment->comment_post_ID); trunk/wp-admin/edit.php
r4349 r4432 289 289 echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; 290 290 } 291 echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&d elete_type=spam&p=".$comment->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') . "</a> ]";291 echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&dt=spam&p=".$comment->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') . "</a> ]"; 292 292 } // end if any comments to show 293 293 ?> trunk/wp-includes/pluggable.php
r4407 r4432 370 370 } 371 371 $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n"; 372 $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";373 $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";372 $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n"; 373 $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"; 374 374 375 375 $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); … … 427 427 $notify_message .= sprintf( __('Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n"; 428 428 $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; 429 $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";430 $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";431 $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";429 $notify_message .= sprintf( __('To approve this comment, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n"; 430 $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n"; 431 $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"; 432 432 $notify_message .= sprintf( __('Currently %s comments are waiting for approval. Please visit the moderation panel:'), $comments_waiting ) . "\r\n"; 433 433 $notify_message .= get_option('siteurl') . "/wp-admin/moderation.php\r\n";
