You are here

function _imagepicker_has_groups in Image Picker 7

Same name and namespace in other branches
  1. 5.2 imagepicker.module \_imagepicker_has_groups()
  2. 6.2 imagepicker.functions.inc \_imagepicker_has_groups()
6 calls to _imagepicker_has_groups()
imagepicker_adminview in ./imagepicker.admin.inc
imagepicker_browse_admin_form in ./imagepicker.functions.inc
imagepicker_image_select in ./imagepicker.functions.inc
imagepicker_userview in ./imagepicker.user.inc
_imagepicker_browse in ./imagepicker.functions.inc

... See full list

File

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

Code

function _imagepicker_has_groups($account = FALSE) {
  if (!imagepicker_variable_get('imagepicker_groups_enabled', 0)) {
    return 0;
  }
  if ($account) {
    $user = $account;
  }
  else {
    global $user;
  }
  $query = db_select('imagepicker_user_groups', 'iug');
  $query
    ->addExpression('COUNT(iug.gid)', 'ct');
  $query
    ->condition('iug.uid', $user->uid);
  $row = $query
    ->execute()
    ->fetchObject();
  return $row->ct;
}