You are here

function photos_user_count in Album Photos 6.2

Same name and namespace in other branches
  1. 7.3 photos.module \photos_user_count()
2 calls to photos_user_count()
photos_nodeapi in ./photos.module
_photos_form in inc/photos.form.inc

File

./photos.module, line 1453

Code

function photos_user_count() {
  global $user;
  $array = array_keys($user->roles);
  $t['create'] = photos_get_count('user_album', $user->uid);
  $t['total'] = variable_get('photos_pnum_' . $array[0], 20);
  $t['remain'] = $t['total'] - $t['create'];
  if ($user->uid != 1 && $t['remain'] <= 0) {
    $t['rest'] = 1;
  }
  return $t;
}