You are here

function imagepicker_has_groups in Image Picker 7

Same name and namespace in other branches
  1. 6.2 imagepicker.functions.inc \imagepicker_has_groups()

File

./imagepicker.functions.inc, line 1331
@author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function imagepicker_has_groups($account = FALSE) {
  if ($account) {
    $user = $account;
  }
  else {
    global $user;
  }
  $query = db_select('imagepicker_user_groups', 'g');
  $query
    ->addExpression('COUNT(g.gid)', 'gidct');
  $query
    ->condition('g.uid', $user->uid);
  $row = $query
    ->execute()
    ->fetchObject();
  return $row->gidct;
}