Changeset 3529 for trunk/wp-admin/edit-comments.php
- Timestamp:
- 02/14/2006 08:09:13 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/edit-comments.php (modified) (4 diffs)
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
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)