Changeset 3529
- Timestamp:
- 02/14/2006 08:09:13 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-comments.php
r3517 r3529 44 44 $comment = (int) $comment; 45 45 $post_id = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); 46 $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); 47 if ( current_user_can('edit_post', $post_id) ) : 48 wp_set_comment_status($comment, "delete"); 46 // $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); 47 if ( current_user_can('edit_post', $post_id) ) { 48 if ( !empty( $_POST['spam_button'] ) ) 49 wp_set_comment_status($comment, 'spam'); 50 else 51 wp_set_comment_status($comment, 'delete'); 49 52 ++$i; 50 endif;53 } 51 54 endforeach; 52 echo "<div class='wrap'><p>" . sprintf(__('%s comments deleted.'), $i) . "</p></div>"; 55 echo '<div style="background-color: rgb(207, 235, 247);" id="message" class="updated fade"><p>'; 56 if ( !empty( $_POST['spam_button'] ) ) 57 printf(__('%s comments marked as spam.'), $i); 58 else 59 printf(__('%s comments deleted.'), $i); 60 echo '</p></div>'; 53 61 endif; 54 62 … … 97 105 if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 98 106 echo " | <a href=\"post.php?action=editcomment&comment=".$comment->comment_ID."\">" . __('Edit Comment') . "</a>"; 99 echo " | <a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), wp_specialchars( $comment->comment_author, 1 )) . "' );\">" . __('Delete Comment') . "</a> — "; 107 echo " | <a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), wp_specialchars( $comment->comment_author, 1 )) . "' );\">" . __('Delete Comment') . "</a> "; 108 echo " | <a href=\"post.php?action=deletecomment&delete_type=spam&p=".$comment->comment_post_ID."&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."), wp_specialchars( $comment->comment_author, 1 )) . "' );\">" . __('Mark Comment as Spam') . "</a> "; 100 109 } // end if any comments to show 101 110 // Get post title … … 103 112 $post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"); 104 113 $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; 105 ?> <a href="post.php?action=edit&post=<?php echo $comment->comment_post_ID; ?>"><?php printf(__('Edit Post “%s”'), stripslashes($post_title)); ?></a>114 ?> | <a href="post.php?action=edit&post=<?php echo $comment->comment_post_ID; ?>"><?php printf(__('Edit Post “%s”'), stripslashes($post_title)); ?></a> 106 115 <?php } ?> 107 116 | <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php _e('View Post') ?></a></p> … … 155 164 ?></table> 156 165 <p><a href="javascript:;" onclick="checkAll(document.getElementById('deletecomments')); return false; "><?php _e('Invert Checkbox Selection') ?></a></p> 157 <p class="submit"><input type="submit" name="Submit" value="<?php _e('Delete Checked Comments') ?> »" onclick="return confirm('<?php _e("You are about to delete these comments permanently \\n \'Cancel\' to stop, \'OK\' to delete.") ?>')" /> </p> 166 <p class="submit"><input type="submit" name="delete_button" value="<?php _e('Delete Checked Comments') ?> »" onclick="return confirm('<?php _e("You are about to delete these comments permanently \\n \'Cancel\' to stop, \'OK\' to delete.") ?>')" /> 167 <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam') ?> »" onclick="return confirm('<?php _e("You are about to mark these comments as spam \\n \'Cancel\' to stop, \'OK\' to mark as spam.") ?>')" /></p> 158 168 </form> 159 169 <?php -
trunk/wp-admin/list-manipulation.js
r3517 r3529 33 33 ajaxDel.onLoaded = function() { ajaxDel.myResponseElement.innerHTML = 'Data Sent...'; }; 34 34 ajaxDel.onInteractive = function() { ajaxDel.myResponseElement.innerHTML = 'Processing Data...'; }; 35 ajaxDel.onCompletion = function() { removeThisItem( what + '-' + id ); };35 ajaxDel.onCompletion = function() { removeThisItem( what.replace('-as-spam', '') + '-' + id ); }; 36 36 ajaxDel.runAJAX('action=delete-' + what + '&id=' + id); 37 37 return false; -
trunk/wp-admin/list-manipulation.php
r3517 r3529 64 64 } 65 65 break; 66 case 'delete-comment-as-spam' : 67 $id = (int) $_POST['id']; 68 69 if ( !$comment = get_comment($id) ) 70 die('0'); 71 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 72 die('-1'); 73 74 if ( wp_set_comment_status($comment->comment_ID, 'spam') ) { 75 die('1'); 76 } else { 77 die('0'); 78 } 79 break; 66 80 case 'delete-link-category' : 67 81 $id = (int) $_POST['id']; -
trunk/wp-admin/post.php
r3517 r3529 185 185 186 186 echo "<div class='wrap'>\n"; 187 echo "<p>" . __('<strong>Caution:</strong> You are about to delete the following comment:') . "</p>\n"; 187 if ( 'spam' == $_GET['delete_type'] ) 188 echo "<p>" . __('<strong>Caution:</strong> You are about to mark the following comment as spam:') . "</p>\n"; 189 else 190 echo "<p>" . __('<strong>Caution:</strong> You are about to delete the following comment:') . "</p>\n"; 188 191 echo "<table border='0'>\n"; 189 192 echo "<tr><td>" . __('Author:') . "</td><td>$comment->comment_author</td></tr>\n"; … … 196 199 echo "<form action='".get_settings('siteurl')."/wp-admin/post.php' method='get'>\n"; 197 200 echo "<input type='hidden' name='action' value='deletecomment' />\n"; 201 if ( 'spam' == $_GET['delete_type'] ) 202 echo "<input type='hidden' name='delete_type' value='spam' />\n"; 198 203 echo "<input type='hidden' name='p' value='$p' />\n"; 199 204 echo "<input type='hidden' name='comment' value='{$comment->comment_ID}' />\n"; … … 227 232 die( __('You are not allowed to edit comments on this post.') ); 228 233 229 wp_set_comment_status($comment->comment_ID, "delete"); 230 do_action('delete_comment', $comment->comment_ID); 234 if ( 'spam' == $_GET['delete_type'] ) 235 wp_set_comment_status($comment->comment_ID, 'spam'); 236 else 237 wp_delete_comment($comment->comment_ID); 231 238 232 239 if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) { -
trunk/wp-includes/pluggable-functions.php
r3517 r3529 333 333 $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n"; 334 334 $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; 335 $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=confirmdeletecomment&delete_type=spam&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; 335 336 336 337 $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); … … 390 391 $notify_message .= sprintf( __('To approve this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=mailapprovecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; 391 392 $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; 393 $notify_message .= sprintf( __('To mark this comment as spam, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=confirmdeletecomment&delete_type=spam&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; 392 394 $notify_message .= sprintf( __('Currently %s comments are waiting for approval. Please visit the moderation panel:'), $comments_waiting ) . "\r\n"; 393 395 $notify_message .= get_settings('siteurl') . "/wp-admin/moderation.php\r\n";
Note: See TracChangeset
for help on using the changeset viewer.