You are here

function visitors_block_last_registered_user in Visitors 8

Same name and namespace in other branches
  1. 7.2 visitors.block.inc \visitors_block_last_registered_user()
  2. 7 visitors.block.inc \visitors_block_last_registered_user()
  3. 7.0 visitors.block.inc \visitors_block_last_registered_user()

Display last registered user to visitors block.

Parameters

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

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

File

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

Code

function visitors_block_last_registered_user(&$list_items) {
  if (variable_get('visitors_last_registered_user', 1)) {
    $last_user_uid = db_select('users', 'u')
      ->fields('u', array(
      'uid',
    ))
      ->orderBy('uid', 'DESC')
      ->range(0, 1)
      ->execute()
      ->fetchField();
    $user = user_load($last_user_uid, TRUE);
    $list_items[] = t('Last Registered User: !last_user', array(
      '!last_user' => theme('username', array(
        'account' => $user,
      )),
    ));
  }
}