You are here

function featured_content_get_users in Featured Content 7.2

Same name and namespace in other branches
  1. 6.2 featured_content.module \featured_content_get_users()
  2. 6 featured_content.module \featured_content_get_users()
  3. 7 featured_content.module \featured_content_get_users()

Gets the oldest users limited by the $limit parameter.

@todo Change to handle lookup of users.

3 calls to featured_content_get_users()
featured_content_block_configure in ./featured_content.module
Implements hook_block_configure().
featured_content_block_save in ./featured_content.module
Implements hook_block_save().
featured_content_get_filtered_nids in ./featured_content.module
Get filtered node nids. Filter base on content types, users (authors) and taxonomy terms.

File

./featured_content.module, line 1563
Featured Content module for created related & featured content blocks.

Code

function featured_content_get_users($limit = 20) {
  $users = array();
  $query = db_select('users', 'u');
  $query
    ->fields('u', array(
    'uid',
    'name',
    'mail',
  ));
  $query
    ->condition('uid', '0', '<>');
  $query
    ->orderBy('uid', 'ASC');
  $query
    ->range(0, $limit);
  $results = $query
    ->execute();
  foreach ($results as $user) {
    $users[$user->uid] = check_plain($user->name) . ' - ' . check_plain($user->mail);
  }
  natcasesort($users);
  $users = array(
    'CURRENT' => t('Use the user (author) of the page being shown.'),
  ) + $users;
  return $users;
}