示例#1
0
 function page_general_stats($content)
 {
     $stats_display = get_option('stats_display');
     $str = _n('<strong>%s</strong> user online now.', '<strong>%s</strong> users online now.', get_users_online_count(), 'wp-useronline');
     if ($stats_display['useronline'] == 1) {
         $content .= html('p', html('strong', __('WP-UserOnline', 'wp-useronline'))) . html('ul', html('li', sprintf($str, number_format_i18n(get_users_online_count()))) . html('li', UserOnline_Template::format_most_users()));
     }
     return $content;
 }
示例#2
0
 function rightnow()
 {
     if (!current_user_can('manage_options')) {
         return;
     }
     $total_users = get_users_online_count();
     $str = _n("There is <strong><a href='%s'>%s user</a></strong> online now.", "There are a total of <strong><a href='%s'>%s users</a></strong> online now.", $total_users, 'wp-useronline');
     $out = sprintf($str, add_query_arg('page', $this->args['page_slug'], admin_url('index.php')), number_format_i18n($total_users));
     $out .= '<br>';
     if ($tmp = get_users_browsing_site()) {
         $out .= $tmp . '<br>';
     }
     $out .= UserOnline_Template::format_most_users();
     echo html('p', $out);
 }
示例#3
0
function get_useronline_($output, $type = 'site')
{
    return UserOnline_Template::compact_list($type, $output);
}