Make WordPress Core

Ticket #4986: notify_trackspings.diff

File notify_trackspings.diff, 3.6 KB (added by Otto42, 16 years ago)

Adds pingback/trackback identifier to moderation emails

  • wp-includes/pluggable.php

     
    541541        $comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
    542542        $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
    543543
    544         $notify_message  = sprintf( __('A new comment on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n";
    545         $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
    546         $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
    547         $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
    548         $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";
    549         $notify_message .= sprintf( __('Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
    550         $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
     544        switch ($comment->comment_type)
     545        {
     546        case 'trackback' :
     547                $notify_message  = sprintf( __('A new trackback on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n";
     548                $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
     549                $notify_message .= sprintf( __('Website : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
     550                $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";
     551                $notify_message .= __('Excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
     552                break;
     553        case 'pingback' :
     554                $notify_message  = sprintf( __('A new pingback on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n";
     555                $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
     556                $notify_message .= sprintf( __('Website : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
     557                $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";
     558                $notify_message .= __('Excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
     559                break;
     560        default : // 'comment'
     561                $notify_message  = sprintf( __('A new comment on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n";
     562                $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
     563                $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
     564                $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
     565                $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";
     566                $notify_message .= sprintf( __('Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
     567                $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
     568        }
     569       
    551570        $notify_message .= sprintf( __('Approve it: %s'),  get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n";
    552571        $notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
    553572        $notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";