You are here

function visitors_block_registered_users in Visitors 7.2

Same name and namespace in other branches
  1. 7 visitors.block.inc \visitors_block_registered_users()

Display registered users count to visitors block.

Parameters

$list_items: array associative array of variables, use for theme function

1 call to visitors_block_registered_users()
theme_visitors_block_view in ./visitors.block.inc
Implement a theme function for block output.

File

./visitors.block.inc, line 84
Display current visitor block.

Code

function visitors_block_registered_users(&$list_items) {
  if (variable_get('visitors_registered_user', 1)) {
    $query = 'SELECT COUNT(*) FROM {users} WHERE uid <> 0';
    $registered_users = db_query($query)
      ->fetchField();
    $list_items[] = sprintf('%s: %u', t('Registered Users'), $registered_users);
  }
}