You are here

function imagepicker_get_grouped_images in Image Picker 5.2

Same name and namespace in other branches
  1. 5 imagepicker.module \imagepicker_get_grouped_images()

File

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

Code

function imagepicker_get_grouped_images($account = FALSE) {
  if ($account) {
    $user = $account;
  }
  else {
    global $user;
  }
  $groupedlist = array();

  // now the enabled ones
  $result = db_query("\n  SELECT i.img_id\n  FROM {imagepicker_user_groups} g, {imagepicker_group_images} i\n  WHERE g.uid=%d AND g.gid = i.gid AND g.state=1", array(
    $user->uid,
  ));
  while ($row = db_fetch_array($result)) {
    $groupedlist[] = $row['img_id'];
  }
  return $groupedlist;
}