You are here

function ip_tracker_ip_user_count in IP address manager 7

Same name and namespace in other branches
  1. 8.2 ip.module \ip_tracker_ip_user_count()
  2. 6 ip.module \ip_tracker_ip_user_count()
  3. 7.2 ip.module \ip_tracker_ip_user_count()

Count how many users have been tracked against an IP.

1 call to ip_tracker_ip_user_count()
theme_ip_tracker_user_records in ./ip.module
Theme the IP tracker records for a user.

File

./ip.module, line 204
IP address manager module.

Code

function ip_tracker_ip_user_count($ip) {
  $sql = "SELECT COUNT(uid) FROM {ip_tracker} WHERE ip = :ip";
  $args = array(
    ':ip' => ip2long($ip),
  );
  $count = db_query($sql, $args)
    ->fetchField();
  return $count;
}