get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='" . $wpdb->prefix . "capabilities'");
} else {
$count['registered'] = $wpdb->get_var("SELECT COUNT(meta_key) FROM $wpdb->usermeta WHERE meta_key='s2_subscribed'");
}
$count['confirmed'] = $wpdb->get_var("SELECT COUNT(id) FROM " . $wpdb->prefix . "subscribe2 WHERE active='1'");
$count['all'] = ($count['registered'] + $count['confirmed']);
echo "
";
echo $count['all'];
echo "
";
echo $after_widget;
}
/**
Register the optional widget control form
*/
function widget_s2counter_control() {
$options = get_option('widget_s2counter');
if ( !is_array($options) )
$options = array('title'=>'Subscriber Count',
's2w_bg'=>'#E3DACF',
's2w_fg'=>'#345797',
's2w_width'=>'82',
's2w_height'=>'16',
's2w_font'=>'11');
if ( $_POST['s2counter'] ) {
// Remember to sanitize and format use input appropriately.
$options['title'] = strip_tags(stripslashes($_POST['title']));
$options['s2w_bg'] = strip_tags(stripslashes($_POST['s2w_bodyColor']));
$options['s2w_fg'] = strip_tags(stripslashes($_POST['s2w_textColor']));
$options['s2w_width'] = strip_tags(stripslashes($_POST['width']));
$options['s2w_height'] = strip_tags(stripslashes($_POST['height']));
$options['s2w_font'] = strip_tags(stripslashes($_POST['font']));
update_option('widget_s2counter', $options);
}
// Be sure you format your options to be valid HTML attributes.
$s2w_title = htmlspecialchars($options['title'], ENT_QUOTES);
$s2w_bg = htmlspecialchars($options['s2w_bg'], ENT_QUOTES);
$s2w_fg = htmlspecialchars($options['s2w_fg'], ENT_QUOTES);
$s2w_width = htmlspecialchars($options['s2w_width'], ENT_QUOTES);
$s2w_height = htmlspecialchars($options['s2w_height'], ENT_QUOTES);
$s2w_font = htmlspecialchars($options['s2w_font'], ENT_QUOTES);
?>