You are here

function imagepicker_get_all_bytes in Image Picker 6.2

Same name and namespace in other branches
  1. 5.2 imagepicker.module \imagepicker_get_all_bytes()
  2. 7 imagepicker.functions.inc \imagepicker_get_all_bytes()
4 calls to imagepicker_get_all_bytes()
imagepicker_admin_images in ./imagepicker.admin.inc
imagepicker_admin_users_list in ./imagepicker.admin.inc
Administration functions
imagepicker_group_stats in ./imagepicker.functions.inc
statistics
_imagepicker_quota_check in ./imagepicker.functions.inc

File

./imagepicker.functions.inc, line 2090
Imagepicker functions

Code

function imagepicker_get_all_bytes($account = FALSE) {
  $tot = 0;
  $olduid = 0;
  $sql = 'SELECT img_id, uid FROM {imagepicker} ';
  if (is_object($account)) {
    $sql .= 'WHERE uid = ' . $account->uid;
    $user = $account;
  }
  elseif ($account == -1) {
    global $user;
    $sql .= 'WHERE uid = ' . $user->uid;
  }
  $result = db_query($sql);
  while ($row = db_fetch_array($result)) {
    if (!$account && $olduid != $row['uid']) {
      $user = user_load(array(
        'uid' => $row['uid'],
      ));
    }
    $tot += _imagepicker_get_bytes($row['img_id'], $user);
    $olduid = $row['uid'];
  }
  return $tot;
}