function admin_menu_get_user_count in Administration menu 6.3
Same name and namespace in other branches
- 8.3 admin_menu.module \admin_menu_get_user_count()
- 5.3 admin_menu.module \admin_menu_get_user_count()
- 7.3 admin_menu.module \admin_menu_get_user_count()
Return count of online anonymous/authenticated users.
See also
2 calls to admin_menu_get_user_count()
- admin_menu_admin_menu_replacements in ./
admin_menu.module - Implements hook_admin_menu_replacements().
- admin_menu_links_user in ./
admin_menu.inc - Build user/action links; mostly account information and links.
File
- ./
admin_menu.module, line 437 - Render an administrative menu as a dropdown menu at the top of the window.
Code
function admin_menu_get_user_count() {
$interval = time() - variable_get('user_block_seconds_online', 900);
$count_anon = sess_count($interval);
$count_auth = db_result(db_query("SELECT COUNT(DISTINCT uid) FROM {sessions} WHERE uid > 0 AND timestamp >= %d", $interval));
return t('@count-anon / @count-auth', array(
'@count-anon' => $count_anon,
'@count-auth' => $count_auth,
));
}