X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/022dfbbbe3215917d84708eb09acca93b21ae9e0..7688c6ba71852cd89123b62b2d57683535e4702a:/wp-content/plugins/akismet/akismet.php diff --git a/wp-content/plugins/akismet/akismet.php b/wp-content/plugins/akismet/akismet.php index 53e9a9ff..eac40559 100644 --- a/wp-content/plugins/akismet/akismet.php +++ b/wp-content/plugins/akismet/akismet.php @@ -2,8 +2,8 @@ /* Plugin Name: Akismet Plugin URI: http://akismet.com/ -Description: Akismet checks your comments against the Akismet web service to see if they look like spam or not. You need a WordPress.com API key to use it. You can review the spam it catches under "Comments." To show off your Akismet stats just put <?php akismet_counter(); ?> in your template. -Version: 2.0.2 +Description: Akismet checks your comments against the Akismet web service to see if they look like spam or not. You need a WordPress.com API key to use it. You can review the spam it catches under "Comments." To show off your Akismet stats just put <?php akismet_counter(); ?> in your template. See also: WP Stats plugin. +Version: 2.1.3 Author: Matt Mullenweg Author URI: http://photomatt.net/ */ @@ -35,6 +35,7 @@ if ( !function_exists('wp_nonce_field') ) { function akismet_config_page() { if ( function_exists('add_submenu_page') ) add_submenu_page('plugins.php', __('Akismet Configuration'), __('Akismet Configuration'), 'manage_options', 'akismet-key-config', 'akismet_conf'); + } function akismet_conf() { @@ -146,14 +147,10 @@ function akismet_verify_key( $key ) { if ( !get_option('wordpress_api_key') && !$wpcom_api_key && !isset($_POST['submit']) ) { function akismet_warning() { echo " -

".__('Akismet is not active.')." ".sprintf(__('You must enter your WordPress.com API key for it to work.'), "plugins.php?page=akismet-key-config")."

- +

".__('Akismet is almost ready.')." ".sprintf(__('You must enter your WordPress.com API key for it to work.'), "plugins.php?page=akismet-key-config")."

"; } - add_action('admin_footer', 'akismet_warning'); + add_action('admin_notices', 'akismet_warning'); return; } @@ -204,6 +201,8 @@ function akismet_auto_check_comment( $comment ) { add_filter('pre_comment_approved', create_function('$a', 'return \'spam\';')); update_option( 'akismet_spam_count', get_option('akismet_spam_count') + 1 ); + do_action( 'akismet_spam_caught' ); + $post = get_post( $comment['comment_post_ID'] ); $last_updated = strtotime( $post->post_modified_gmt ); $diff = time() - $last_updated; @@ -325,17 +324,60 @@ if ( isset( $GLOBALS['submenu']['edit-comments.php'] ) ) else $link = 'edit.php'; ?> +

%1$s spam for you since you first installed it.'), number_format($count) ); ?>

get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = 'spam'" ); + + +if ( 0 == $gotspam ) { echo '

'.__('You have no spam currently in the queue. Must be your lucky day. :)').'

'; echo '
'; } else { @@ -345,7 +387,7 @@ if (0 == $spam_count) {
-    +   
@@ -354,7 +396,6 @@ if (0 == $spam_count) {

-

'.__('These are the latest comments identified as spam by Akismet. If you see any mistakes, simply mark the comment as "not spam" and Akismet will learn from the submission. If you wish to recover a comment from spam, simply select the comment, and click Not Spam. After 15 days we clean out the junk for you.').'

'; ?> get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = 'spam' ORDER BY comment_date DESC LIMIT $start, $end"); - $total = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = 'spam'" ); + $where = ''; + if ( isset( $_GET['ctype'] ) ) { + $type = preg_replace( '|[^a-z]|', '', $_GET['ctype'] ); + if ( 'comments' == $type ) + $type = ''; + $where = " AND comment_type = '$type' "; + } + + $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = 'spam' $where ORDER BY comment_date DESC LIMIT $start, $end"); + $total = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = 'spam' $where" ); + + $totals = $wpdb->get_results( "SELECT comment_type, COUNT(*) AS cc FROM $wpdb->comments WHERE comment_approved = 'spam' GROUP BY comment_type" ); +?> + + - +
" id="akismetsearch"> +

+

+
50 ) { $total_pages = ceil( $total / 50 ); $r = ''; if ( 1 < $page ) { $args['apage'] = ( 1 == $page - 1 ) ? '' : $page - 1; - $r .= '' . "\n"; + $r .= '' . "\n"; } if ( ( $total_pages = ceil( $total / 50 ) ) > 1 ) { for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) : @@ -413,17 +482,13 @@ if ( ( $total_pages = ceil( $total / 50 ) ) > 1 ) { } if ( ( $page ) * 50 < $total || -1 == $total ) { $args['apage'] = $page + 1; - $r .= '' . "\n"; + $r .= '' . "\n"; } echo "

$r

"; ?> -
" id="akismetsearch"> -

-

-
-
+