You are here

function photos_get_count in Album Photos 6.2

Same name and namespace in other branches
  1. 7.3 photos.module \photos_get_count()
4 calls to photos_get_count()
photos_page_image in inc/photos.page.inc
photos_upload_form in inc/photos.edit.inc
photos_user in ./photos.module
photos_user_count in ./photos.module

File

./photos.module, line 1110

Code

function photos_get_count($type, $id = 0) {
  switch ($type) {
    case 'user_album':
    case 'user_image':
    case 'site_album':
    case 'site_image':
    case 'node_node':
      return db_result(db_query("SELECT value FROM {x_count} WHERE cid = %d AND type = '%s'", $id, $type));
    case 'node_album':
      return db_result(db_query("SELECT count FROM {x_album} WHERE pid = %d", $id));
  }
}