You are here

function _imagepicker_has_groups in Image Picker 5.2

Same name and namespace in other branches
  1. 6.2 imagepicker.functions.inc \_imagepicker_has_groups()
  2. 7 imagepicker.functions.inc \_imagepicker_has_groups()
5 calls to _imagepicker_has_groups()
imagepicker_admin_view in ./imagepicker.module
imagepicker_image_select in ./imagepicker.module
imagepicker_user_view in ./imagepicker.module
_imagepicker_browse in ./imagepicker.module
_imagepicker_browse_admin in ./imagepicker.module

File

./imagepicker.module, line 2536
Enables permitted roles to upload images for insertion into configured nodes.

Code

function _imagepicker_has_groups($account = FALSE) {
  if ($account) {
    $user = $account;
  }
  else {
    global $user;
  }
  $result = db_query("SELECT COUNT(gid) AS ct FROM {imagepicker_user_groups} WHERE uid = %d", array(
    $user->uid,
  ));
  $row = db_fetch_array($result);
  return $row['ct'];
}