You are here

class views_handler_field_ip_user_count in User Stats 6

Same name and namespace in other branches
  1. 7 views/views_handler_field_ip_user_count.inc \views_handler_field_ip_user_count

Users by IP address count handler.

Hierarchy

Expanded class hierarchy of views_handler_field_ip_user_count

1 string reference to 'views_handler_field_ip_user_count'
user_stats_views_data in views/user_stats.views.inc
Implementation of hook_views_data().

File

views/views_handler_field_ip_user_count.inc, line 11
User Stats user count by IP address.

View source
class views_handler_field_ip_user_count extends views_handler_field_numeric {
  function query() {
    $this->table_alias = $this
      ->ensure_my_table();

    // We need another subquery here to extract DISTINCT values
    $sql = "SELECT COUNT(usi.uid)\n      FROM (SELECT DISTINCT(uid), ip_address FROM {user_stats_ips}) usi\n      WHERE usi.ip_address = " . check_plain($this->table_alias) . ".ip_address";
    $this->field_alias = $this->query
      ->add_field(NULL, "(" . $sql . ")", $this->table_alias . '_' . $this->field);
  }

}

Members