You are here

function photos_user_count in Album Photos 7.3

Same name and namespace in other branches
  1. 6.2 photos.module \photos_user_count()

Tracks number of albums created and number of albums allowed.

2 calls to photos_user_count()
photos_node_validate in ./photos.module
Implements hook_node_validate().
_photos_form in inc/photos.form.inc
Node album settings form.

File

./photos.module, line 2349
Implementation of photos.module.

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;
}