Alex King's Popularity Contest plugin Version: 1.01 Author: Richard Rosalion Author URI: http://tech.sobriquet.net */ function popularity_widget($args) { extract($args); $options = get_option('popularityWidget'); $title = $options['title']; echo "\n"; echo $before_widget . $before_title . $title . $after_title . "\n"; if( !function_exists('akpc_most_popular') ) { echo "

You don't appear to have the Popularity Contest plugin installed.

\n"; } else { // Code to display in sidebar goes after here, // leave closing and opening php tags intact ?> "; } function popularity_widget_control() { $options = get_option('popularityWidget'); if ( !is_array($options) ) $options = array('title' => 'Most Popular Posts'); if ( $_POST['popularitySubmit'] ) { $options['title'] = htmlentities(stripslashes($_POST['popularityTitle'])); update_option('popularityWidget', $options); } $title = htmlspecialchars($options['title'], ENT_QUOTES); echo '

'; } function popularity_widget_init() { if ( !function_exists('register_sidebar_widget') ) return; register_sidebar_widget(__('Popularity Contest', NRTD), 'popularity_widget', null, 'popular-posts'); register_widget_control(__('Popularity Contest', NRTD), 'popularity_widget_control', 300, 100, 'popular-posts'); } add_action('plugins_loaded', 'popularity_widget_init'); ?>