|
|
@ -76,10 +76,28 @@ class UserController extends AbstractController |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get room stats |
|
|
|
|
|
|
|
$total = 0; |
|
|
|
|
|
|
|
$rooms = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($this->_rooms($client) as $room => $name) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$posts = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ((array) $client->kevaFilter($room, sprintf('^[\d]+@%s$', $user['key'])) as $post) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$total++; |
|
|
|
|
|
|
|
$posts++; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$rooms[$room] = $posts; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$list[] = |
|
|
|
$list[] = |
|
|
|
[ |
|
|
|
[ |
|
|
|
'name' => $user['key'], |
|
|
|
'name' => $user['key'], |
|
|
|
'height' => $user['height'], |
|
|
|
'total' => $total, |
|
|
|
|
|
|
|
'rooms' => $rooms, |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -89,9 +107,9 @@ class UserController extends AbstractController |
|
|
|
array_multisort( |
|
|
|
array_multisort( |
|
|
|
array_column( |
|
|
|
array_column( |
|
|
|
$list, |
|
|
|
$list, |
|
|
|
'height' |
|
|
|
'total' |
|
|
|
), |
|
|
|
), |
|
|
|
SORT_ASC, |
|
|
|
SORT_DESC, |
|
|
|
$list |
|
|
|
$list |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -716,6 +734,35 @@ class UserController extends AbstractController |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private function _rooms( |
|
|
|
|
|
|
|
\Kevachat\Kevacoin\Client $client |
|
|
|
|
|
|
|
): array |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$rooms = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ((array) $client->kevaListNamespaces() as $value) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (empty($value['namespaceId'])) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (empty($value['displayName'])) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (str_starts_with($value['displayName'], '_')) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$rooms[$value['namespaceId']] = $value['displayName']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $rooms; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private function _hash( |
|
|
|
private function _hash( |
|
|
|
\Kevachat\Kevacoin\Client $client, |
|
|
|
\Kevachat\Kevacoin\Client $client, |
|
|
|
string $namespace, |
|
|
|
string $namespace, |
|
|
|