<?php
/*
Plugin Name: Update-Monitor
Plugin URI: http://blogshop.de/
Description: Stay informed about new WordPress releases. <em>Powered by <a href="http://wordpress-deutschland.org">WordPress Deutschland</a></em>.
Author: Olaf A. Schmitz
Version: 1.3
Author URI: http://blogshop.de/
*/ 

// Ein bisschen CSS muss sein...
function monitor_css() {
	echo "
			<style type='text/css'>
       #monitor { position: absolute; top: 35px; margin-right: 33px; padding: 0; right: 1.5em;  border: 1px solid #000000; font-size: 11px; }
			.info   { background: #a3a3a3; color: #ffffff; padding: 0;}
			.alarm, .alarm a  { background: #ce0000; color: #ffffff; padding: 0; text-decoration: none; }
			</style>
			";
}

// ...und der ganze Rest!
require_once (ABSPATH . WPINC . '/rss-functions.php');

function monitor_text() {
global $wp_version;
$rss = @fetch_rss('http://static.wordpress-deutschland.org/version.xml');


$rss->items = array_slice($rss->items, 0, 1);
foreach ($rss->items as $item ) {

$blogversion = ereg_replace("[.]", "", $wp_version);


if ($item['description'] <> $blogversion) {
echo "<p><div id='monitor'><span class='info'>&nbsp;".$wp_version."&nbsp;</span><span class='alarm'>&nbsp;<a href='".$item['link']."'>".$item['title']."</a>&nbsp;</span></div></p>";	
 } else {
echo "<p><div id='monitor' class='info'>&nbsp;".$wp_version."&nbsp;</div></p>";	
       }
 	}
}



add_action('admin_head', 'monitor_css');
add_action('admin_footer', 'monitor_text');
?>
