You are here

class views_handler_sort_user_ip_count in User Stats 6

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

IP addresses by user count handler.

Hierarchy

Expanded class hierarchy of views_handler_sort_user_ip_count

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

File

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

View source
class views_handler_sort_user_ip_count extends views_handler_sort {
  function query() {
    $this
      ->ensure_my_table();

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

}

Members