Take a look into this widget .. It's one I wrote to implement the blogoscoop.net statistic button into the sidebar of my blog.
<?php
/*
Plugin Name: Blog Buttons
Description: Adds a sidebar widget to show the blogoscoop.net statistic button
Author: Chris Goßmann
Version: 1.0
Author URI: http://www.wupperpiraten.de
*/
function widget_blog_buttons($args) {
extract($args);
$options = get_option('widget_blog_buttons');
echo $before_widget;
echo $before_title . $options['title'] . $after_title; ?>
<img src="http://stats.blogoscoop.net/xxx/x.gif"
alt="blogoscoop" border="0" width="80" height="15" />
<?php echo $after_widget;
}
// Admin section
function widget_control_blog_buttons() {
global $wpdb;
$options = get_option('widget_blog_buttons');
if ( $_POST['blog_buttons-submit'] ) {
$options['title'] = strip_tags(stripslashes($_POST['dkret-blog_buttons-title']));
update_option('widget_blog_buttons', $options);
}
$title = htmlspecialchars($options['title'], ENT_QUOTES);
// The Box content
echo '<p style="text-align:right;"><label for="dkret-search-title" />' . __('Title:', 'dkret') . ' <input style="width: 200px;" id="dkret-blog_buttons-title" name="dkret-blog_buttons-title" type="text" value="'.$title.'" /></p>';
echo '<input type="hidden" id="dkret-submit" name="blog_buttons-submit" value="1" />';
}
$options = get_option('widget_blog_buttons');
if ( !is_array($options) )
$options = array('title'=>''. __('Blog Buttons', 'thematic') .'',);
update_option('widget_blog_buttons', $options);
register_sidebar_widget(__('Blog Buttons','thematic'), 'widget_blog_buttons');
register_widget_control(__('Blog Buttons','thematic'), 'widget_control_blog_buttons', 300, 200);
?>
Let me know if you need more help.
Cheers,
Chris