Index: akismet.php
===================================================================
--- akismet.php	(revision 6277)
+++ akismet.php	(working copy)
@@ -331,4 +331,56 @@
 
 add_action('activity_box_end', 'akismet_stats');
 
+function widget_akismet_register() {
+	if ( function_exists('register_sidebar_widget') ) :
+	function widget_akismet($args) {
+		extract($args);
+		$options = get_option('widget_akismet');
+		$count = number_format(get_option('akismet_spam_count'));
+		$text = __('%d spam comments have been blocked by <a href="http://akismet.com">Akismet</a>.');
+		?>
+			<?php echo $before_widget; ?>
+				<?php echo $before_title . $options['title'] . $after_title; ?>
+				<a id="akismetstats" href="http://akismet.com" title=""><span id="akismetcount"><?php echo $count; ?></span><span id="akismettext"> spam comments blocked by Akismet</span></a>
+			<?php echo $after_widget; ?>
+	<?php
+	}
+	
+	function widget_akismet_style() {
+		?>
+		<style type="text/css">
+		#akismetstats{border:none;display:block;background:url(<?php echo get_settings('siteurl'); ?>/wp-content/plugins/akismet/ak.jpg) top;text-align:center;width:160px;height:40px;color:#fff;margin:5px auto;}
+		#akismetstats:hover{border:none;background-position:bottom;}
+		#akismetcount{position:relative;top:3px;font:14px Verdana,Arial,Sans-Serif;text-decoration:none;font-weight:bold;}
+		#akismetstats:hover #akismetcount{display:none;}
+		#akismettext{display:none;}
+		</style>
+		<?php
+	}
+
+	function widget_akismet_control() {
+		$options = $newoptions = get_option('widget_akismet');
+		if ( $_POST["akismet-submit"] ) {
+			$newoptions['title'] = strip_tags(stripslashes($_POST["akismet-title"]));
+			if ( empty($newoptions['title']) ) $newoptions['title'] = 'Spam Blocked';
+		}
+		if ( $options != $newoptions ) {
+			$options = $newoptions;
+			update_option('widget_akismet', $options);
+		}
+		$title = htmlspecialchars($options['title'], ENT_QUOTES);
+	?>
+				<p><label for="akismet-title"><?php _e('Title:'); ?> <input style="width: 250px;" id="akismet-title" name="akismet-title" type="text" value="<?php echo $title; ?>" /></label></p>
+				<input type="hidden" id="akismet-submit" name="akismet-submit" value="1" />
+	<?php
+	}
+
+	register_sidebar_widget('Akismet', 'widget_akismet');
+	register_widget_control('Akismet', 'widget_akismet_control', 300, 75);
+	if ( is_active_widget('widget_akismet') )
+		add_action('wp_head', 'widget_akismet_style');
+	endif;
+}
+add_action('init', 'widget_akismet_register');
+
 ?>
