Add unique_ips field to the API
This commit is contained in:
parent
13bebb70d0
commit
e7cc1649c8
|
@ -167,6 +167,13 @@ class Api {
|
|||
$apiPosts['posts'][] = $this->translatePost($p, $threadsPage);
|
||||
}
|
||||
|
||||
// Count unique IPs
|
||||
$ips = array($thread->ip);
|
||||
foreach ($thread->posts as $p) {
|
||||
$ips[] = $p->ip;
|
||||
}
|
||||
$apiPosts['posts'][0]['unique_ips'] = count(array_unique($ips));
|
||||
|
||||
return $apiPosts;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue