Commit b9d3b47e authored by Gerhard Killesreiter's avatar Gerhard Killesreiter

#55096, don't show online users in block if nobody online, patch by tenrapid

parent 61b9b358
......@@ -601,13 +601,15 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
// Display a list of currently online users.
$max_users = variable_get('user_block_max_list_count', 10);
$items = array();
if ($total_users && $max_users) {
$items = array();
while ($max_users-- && $account = db_fetch_object($users)) {
$items[] = $account;
}
while ($max_users-- && $account = db_fetch_object($users)) {
$items[] = $account;
}
$output .= theme('user_list', $items, t('Online users'));
$output .= theme('user_list', $items, t('Online users'));
}
$block['subject'] = t('Who\'s online');
$block['content'] = $output;
......
......@@ -601,13 +601,15 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
// Display a list of currently online users.
$max_users = variable_get('user_block_max_list_count', 10);
$items = array();
if ($total_users && $max_users) {
$items = array();
while ($max_users-- && $account = db_fetch_object($users)) {
$items[] = $account;
}
while ($max_users-- && $account = db_fetch_object($users)) {
$items[] = $account;
}
$output .= theme('user_list', $items, t('Online users'));
$output .= theme('user_list', $items, t('Online users'));
}
$block['subject'] = t('Who\'s online');
$block['content'] = $output;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment