Make WordPress Core

Changeset 6873


Ignore:
Timestamp:
02/16/2008 05:03:05 PM (17 years ago)
Author:
westi
Message:

More specific moderation emails for {ping|track}backs. Fixes #4986 props Otto42.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r6777 r6873  
    870870    $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
    871871
    872     $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";
    873     $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
    874     $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
    875     $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
    876     $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";
    877     $notify_message .= sprintf( __('Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
    878     $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
     872    switch ($comment->comment_type)
     873    {
     874        case 'trackback':
     875            $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";
     876            $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
     877            $notify_message .= sprintf( __('Website : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
     878            $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";
     879            $notify_message .= __('Tracback excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
     880            break;
     881        case 'pingback':
     882            $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";
     883            $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
     884            $notify_message .= sprintf( __('Website : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
     885            $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";
     886            $notify_message .= __('Pingback excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
     887            break;
     888        default: //Comments
     889            $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";
     890            $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
     891            $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
     892            $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
     893            $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";
     894            $notify_message .= sprintf( __('Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
     895            $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
     896            break;
     897    }
     898   
    879899    $notify_message .= sprintf( __('Approve it: %s'),  get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n";
    880900    $notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
    881901    $notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";
     902   
    882903    $strCommentsPending = sprintf( __ngettext('%s comment', '%s comments', $comments_waiting), $comments_waiting );
    883904    $notify_message .= sprintf( __('Currently %s are waiting for approval. Please visit the moderation panel:'), $strCommentsPending ) . "\r\n";
Note: See TracChangeset for help on using the changeset viewer.