You are here

class node_gallery_views_handler_image_count in Node Gallery 6.2

@file node_gallery_handler_image_count.inc

Hierarchy

Expanded class hierarchy of node_gallery_views_handler_image_count

1 string reference to 'node_gallery_views_handler_image_count'
node_gallery_views_data in ./node_gallery.views.inc
@file node_gallery.views.inc

File

includes/node_gallery_views_handler_image_count.inc, line 9
node_gallery_handler_image_count.inc

View source
class node_gallery_views_handler_image_count extends views_handler_field_numeric {
  function query() {
    $table = $this
      ->ensure_my_table();
    $sql = "SELECT COUNT(*) FROM {node_galleries} ng JOIN {node} n on ng.nid = n.nid WHERE n.status = 1 AND ng.gid = %d";
    $sql = str_replace('%d', $this->table . '.gid', $sql);
    $this->query
      ->add_field('', "({$sql})", 'image_count');
    $this->field_alias = 'image_count';
  }

}

Members