Commit a5f76cd5 authored by Dries's avatar Dries

- Patch 180 by Jeremy: made the "Who is online" block respect the "user list length"
  settings.
parent a1227f69
......@@ -400,16 +400,19 @@ function user_block($op = "list", $delta = 0) {
}
if (user_access("access user list") && $total_users) {
/* Display a list of currently online users */
// Display a list of currently online users
$max_users = variable_get("user_block_max_list_count", 10);
$items = array();
while ($uid = db_fetch_object($users)) {
while (($max_users--) && $uid = db_fetch_object($users)) {
$items[] = format_name(user_load(array("uid" => $uid->uid)));
}
if ($items) {
$output .= "<br /><br />";
$output .= theme("item_list", $items, t("Online users:"));
if(db_fetch_object($users)) {
$output .= "<br />...";
}
}
}
}
......
......@@ -400,16 +400,19 @@ function user_block($op = "list", $delta = 0) {
}
if (user_access("access user list") && $total_users) {
/* Display a list of currently online users */
// Display a list of currently online users
$max_users = variable_get("user_block_max_list_count", 10);
$items = array();
while ($uid = db_fetch_object($users)) {
while (($max_users--) && $uid = db_fetch_object($users)) {
$items[] = format_name(user_load(array("uid" => $uid->uid)));
}
if ($items) {
$output .= "<br /><br />";
$output .= theme("item_list", $items, t("Online users:"));
if(db_fetch_object($users)) {
$output .= "<br />...";
}
}
}
}
......
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