From d48e85e0ac5e675ca33fac173f30c75403d1033f Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 22 Jun 2006 18:31:50 +0000 Subject: Moved everything in wp-inst down a directory. Uses's Ryan Boren's htaccess rules and mods If you're upgrading, try this on a test server first! git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@591 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/edit-comments.php | 211 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 wp-admin/edit-comments.php (limited to 'wp-admin/edit-comments.php') diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php new file mode 100644 index 0000000..db8ad12 --- /dev/null +++ b/wp-admin/edit-comments.php @@ -0,0 +1,211 @@ + + + +
+

+
+
+ + + + + +
+
+

|

+get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); + // $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); + if ( current_user_can('edit_post', $post_id) ) { + if ( !empty( $_POST['spam_button'] ) ) + wp_set_comment_status($comment, 'spam'); + else + wp_set_comment_status($comment, 'delete'); + ++$i; + } + endforeach; + echo '

'; + if ( !empty( $_POST['spam_button'] ) ) + printf(__('%s comments marked as spam.'), $i); + else + printf(__('%s comments deleted.'), $i); + echo '

'; +endif; + +if (isset($_GET['s'])) { + $s = $wpdb->escape($_GET['s']); + $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE + (comment_author LIKE '%$s%' OR + comment_author_email LIKE '%$s%' OR + comment_author_url LIKE ('%$s%') OR + comment_author_IP LIKE ('%$s%') OR + comment_content LIKE ('%$s%') ) AND + comment_approved != 'spam' + ORDER BY comment_date DESC"); +} else { + if ( isset($_GET['offset']) ) + $offset = (int) $_GET['offset'] * 20; + else + $offset = 0; + + $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '0' OR comment_approved = '1' ORDER BY comment_date DESC LIMIT $offset,20"); +} +if ('view' == $mode) { + if ($comments) { + if ($offset) + $start = " start='$offset'"; + else + $start = ''; + + echo "
    "; + $i = 0; + foreach ($comments as $comment) { + ++$i; $class = ''; + $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); + $comment_status = wp_get_comment_status($comment->comment_ID); + if ('unapproved' == $comment_status) + $class .= ' unapproved'; + if ($i % 2) + $class .= ' alternate'; + echo "
  1. "; +?> +

    comment_author_email) { ?>| comment_author_url && 'http://' != $comment->comment_author_url) { ?> | |

    + + + +

    — [ +comment_post_ID) ) { + echo " " . __('Edit') . ''; + echo ' | comment_author)) . "', theCommentList );\">" . __('Delete') . ' '; + if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { + 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') . " "; +} +$post = get_post($comment->comment_post_ID); +$post_title = wp_specialchars( $post->post_title, 'double' ); +$post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; +?> + | ]

    +
  2. + + +
+ +
+ + +

+

+ + '; + wp_nonce_field('bulk-comments'); + echo ' + + + + + + + + + +'; + foreach ($comments as $comment) { + $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); + $comment_status = wp_get_comment_status($comment->comment_ID); + $class = ('alternate' == $class) ? '' : 'alternate'; + $class .= ('unapproved' == $comment_status) ? ' unapproved' : ''; +?> + + + + + + + + + + +
' . __('Name') . '' . __('E-mail') . '' . __('IP') . '' . __('Comment Excerpt') . '' . __('Actions') . '
comment_post_ID) ) { ?> + + (Unapproved) + + + + comment_post_ID) ) { + echo "" . __('Edit') . ""; } ?>comment_post_ID) ) { + echo "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."), js_escape( $comment->comment_author )) . "', theCommentList );\" class='delete'>" . __('Delete') . " "; + } ?>
+

'); return false } return confirm('')" /> + ')" />

+ +
+ +

+ +

+ + +
+ + -- cgit