function users_online_page() { global $wpdb; $usersonline = $wpdb->get_results("SELECT * FROM {$wpdb->useronline} ORDER BY timestamp DESC"); $user_buckets = array(); foreach ($usersonline as $useronline) { $user_buckets[$useronline->user_type][] = $useronline; } $user_buckets = apply_filters('useronline_buckets', $user_buckets); $counts = UserOnline_Template::get_counts($user_buckets); $nicetexts = array(); foreach (array('user', 'member', 'guest', 'bot') as $user_type) { $nicetexts[$user_type] = UserOnline_Template::format_count($counts[$user_type], $user_type); } $text = _n('There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>.', 'There are a total of <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>.', $counts['user'], 'wp-useronline'); $output = html('div id="useronline-details"', html('p', vsprintf($text, $nicetexts)) . html('p', UserOnline_Template::format_most_users()) . UserOnline_Template::detailed_list($counts, $user_buckets, $nicetexts)); return apply_filters('useronline_page', $output); }