Comment notification fixes

git-svn-id: https://develop.svn.wordpress.org/trunk@1970 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2004-12-17 10:25:00 +00:00
parent 413186855c
commit 455abe8ff1
2 changed files with 6 additions and 6 deletions

View File

@ -725,7 +725,6 @@ function wp_notify_postauthor($comment_id, $comment_type='comment') {
*/ */
function wp_notify_moderator($comment_id) { function wp_notify_moderator($comment_id) {
global $wpdb; global $wpdb;
global $querystring_start, $querystring_equal, $querystring_separator;
if( get_settings( "moderation_notify" ) == 0 ) if( get_settings( "moderation_notify" ) == 0 )
return true; return true;
@ -737,8 +736,9 @@ function wp_notify_moderator($comment_id) {
$comment_author_domain = gethostbyaddr($comment->comment_author_IP); $comment_author_domain = gethostbyaddr($comment->comment_author_IP);
$comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'"); $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
$notify_message = "A new comment on the post #$comment->comment_post_ID \"".$post->post_title."\" is waiting for your approval\r\n\r\n"; $notify_message = "A new comment on the post #$comment->comment_post_ID \"".$post->post_title."\" is waiting for your approval\n";
$notify_message .= "Author : $comment->comment_author (IP: $comment->comment_author_IP , $comment_author_domain)\r\n"; $notify_message .= get_permalink($comment->comment_post_ID);
$notify_message .= "\n\nAuthor : $comment->comment_author (IP: $comment->comment_author_IP , $comment_author_domain)\r\n";
$notify_message .= "E-mail : $comment->comment_author_email\r\n"; $notify_message .= "E-mail : $comment->comment_author_email\r\n";
$notify_message .= "URL : $comment->comment_author_url\r\n"; $notify_message .= "URL : $comment->comment_author_url\r\n";
$notify_message .= "Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=$comment->comment_author_IP\r\n"; $notify_message .= "Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=$comment->comment_author_IP\r\n";
@ -748,7 +748,7 @@ function wp_notify_moderator($comment_id) {
$notify_message .= "Currently $comments_waiting comments are waiting for approval. Please visit the moderation panel:\r\n"; $notify_message .= "Currently $comments_waiting comments are waiting for approval. Please visit the moderation panel:\r\n";
$notify_message .= get_settings('siteurl') . "/wp-admin/moderation.php\r\n"; $notify_message .= get_settings('siteurl') . "/wp-admin/moderation.php\r\n";
$subject = '[' . get_settings('blogname') . '] Please approve: "' .$post->post_title.'"'; $subject = '[' . get_settings('blogname') . '] Please moderate: "' .$post->post_title.'"';
$admin_email = get_settings("admin_email"); $admin_email = get_settings("admin_email");
$from = "From: $admin_email"; $from = "From: $admin_email";

View File

@ -426,10 +426,10 @@ function wp_new_comment( $commentdata ) {
do_action('comment_post', $comment_id); do_action('comment_post', $comment_id);
if ( !$approved ) if ( !$approved )
wp_notify_moderator($comment_ID); wp_notify_moderator($comment_id);
if ( get_settings('comments_notify') && $approved ) if ( get_settings('comments_notify') && $approved )
wp_notify_postauthor($comment_ID, 'comment'); wp_notify_postauthor($comment_id, 'comment');
return $result; return $result;
} }