'.sprintf( _n( 'Akismet has protected your site from %3$s spam comments.', 'Akismet has protected your site from %3$s spam comments.', $count ), 'http://akismet.com/', clean_url("$link?page=akismet-admin"), number_format_i18n($count) ).'
';
}
add_action('activity_box_end', 'akismet_stats');
function akismet_admin_warnings() {
global $wpcom_api_key;
if ( !get_option('wordpress_api_key') && !$wpcom_api_key && !isset($_POST['submit']) ) {
function akismet_warning() {
echo "
".__('Akismet is almost ready.')." ".sprintf(__('You must enter your Akismet API key for it to work.'), "plugins.php?page=akismet-key-config")."
".__('Akismet has detected a problem.')." ".sprintf(_n('A server or network problem prevented Akismet from checking %d comment. It has been temporarily held for moderation and will be automatically re-checked in %s.', 'A server or network problem prevented Akismet from checking %d comments. They have been temporarily held for moderation and will be automatically re-checked in %s.', $waiting), number_format_i18n( $waiting ), $next_check)."
";
}
add_action('admin_notices', 'akismet_warning');
return;
}
}
// FIXME placeholder
function akismet_comment_row_action( $a, $comment ) {
// failsafe for old WP versions
if ( !function_exists('add_comment_meta') )
return $a;
$akismet_result = get_comment_meta( $comment->comment_ID, 'akismet_result', true );
$user_result = get_comment_meta( $comment->comment_ID, 'akismet_user_result', true);
$comment_status = wp_get_comment_status( $comment->comment_ID );
$desc = null;
if ( !$user_result || $user_result == $akismet_result ) {
// Show the original Akismet result if the user hasn't overridden it, or if their decision was the same
if ( $akismet_result == 'true' && $comment_status != 'spam' && $comment_status != 'trash' )
$desc = __( 'Flagged as spam by Akismet' );
elseif ( $akismet_result == 'false' && $comment_status == 'spam' )
$desc = __( 'Cleared by Akismet' );
} else {
$who = get_comment_meta( $comment->comment_ID, 'akismet_user', true );
if ( $user_result == 'true' )
$desc = sprintf( __('Flagged as spam by %s'), $who );
else
$desc = sprintf( __('Un-spammed by %s'), $who );
}
// add a History item to the hover links, just after Edit
if ( $akismet_result ) {
$b = array();
foreach ( $a as $k => $item ) {
$b[ $k ] = $item;
if ( $k == 'edit' )
$b['history'] = ' '. __('History') . '';
}
$a = $b;
}
if ( $desc )
echo ''.htmlspecialchars($desc).'';
if ( apply_filters( 'akismet_show_user_comments_approved', get_option('akismet_show_user_comments_approved') ) == 'true' ) {
$comment_count = akismet_get_user_comments_approved( $comment->user_id, $comment->comment_author_email, $comment->comment_author, $comment->comment_author_url );
$comment_count = intval( $comment_count );
echo ' '.sprintf( _n( '%s approved', '%s approved', $comment_count ), number_format_i18n( $comment_count ) ) . '';
}
return $a;
}
add_filter( 'comment_row_actions', 'akismet_comment_row_action', 10, 2 );
function akismet_comment_status_meta_box($comment) {
$history = akismet_get_comment_history( $comment->comment_ID );
if ( $history ) {
echo '
';
foreach ( $history as $row ) {
$time = date( 'D d M Y @ h:i:m a', $row['time'] ) . ' GMT';
echo '