X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/bf5c68485ef07868ad0a91168ecd0092af7661ae..8f374b7233bc2815ccc387e448d208c5434eb961:/wp-content/plugins/akismet/widget.php diff --git a/wp-content/plugins/akismet/widget.php b/wp-content/plugins/akismet/widget.php index e9a3f626..8c5a120f 100644 --- a/wp-content/plugins/akismet/widget.php +++ b/wp-content/plugins/akismet/widget.php @@ -2,89 +2,107 @@ /** * @package Akismet */ -// Widget stuff -function widget_akismet_register() { - if ( function_exists('register_sidebar_widget') ) : - function widget_akismet($args) { - extract($args); - $options = get_option('widget_akismet'); - $count = get_option('akismet_spam_count'); - ?> - - -
%8$sAkismet%9$s', '%1$s%2$s%3$s %4$sspam comments%5$s %6$sblocked by%7$s
%8$sAkismet%9$s', $count ), '', number_format_i18n( $count ), '', '', '', '', '', '', '' ); ?>
- - __( 'Display the number of spam comments Akismet has caught' ) ) + ); + + if ( is_active_widget( false, false, $this->id_base ) ) { + add_action( 'wp_head', array( $this, 'css' ) ); + } } - function widget_akismet_style() { - $plugin_dir = '/wp-content/plugins'; - if ( defined( 'PLUGINDIR' ) ) - $plugin_dir = '/' . PLUGINDIR; + function css() { +?> - ?> - -

- - - if ( function_exists( 'wp_register_sidebar_widget' ) ) { - wp_register_sidebar_widget( 'akismet', 'Akismet', 'widget_akismet', null, 'akismet'); - wp_register_widget_control( 'akismet', 'Akismet', 'widget_akismet_control', null, 75, 'akismet'); - } else { - register_sidebar_widget('Akismet', 'widget_akismet', null, 'akismet'); - register_widget_control('Akismet', 'widget_akismet_control', null, 75, 'akismet'); +

+ + +

+ + - + +
+ %1$s spam blocked by Akismet', '%1$s spam blocked by Akismet', $count ), number_format_i18n( $count ) ); ?> +
+
%1$s spam comment
blocked by
Akismet
', '
%1$s spam comments
blocked by
Akismet
', $count ), number_format_i18n( $count ) ); + echo $args['after_widget']; + } } + +function akismet_register_widgets() { + register_widget( 'Akismet_Widget' ); +} + +add_action( 'widgets_init', 'akismet_register_widgets' );