mirror of
https://github.com/friendica/friendica
synced 2025-04-23 00:30:11 +00:00
Support Nodeinfo2
This commit is contained in:
parent
5fefe7e96f
commit
2a1e6e1a74
4 changed files with 91 additions and 5 deletions
|
@ -1272,6 +1272,7 @@ class User
|
|||
'total_users' => 0,
|
||||
'active_users_halfyear' => 0,
|
||||
'active_users_monthly' => 0,
|
||||
'active_users_weekly' => 0,
|
||||
];
|
||||
|
||||
$userStmt = DBA::select('owner-view', ['uid', 'login_date', 'last-item'],
|
||||
|
@ -1284,6 +1285,7 @@ class User
|
|||
|
||||
$halfyear = time() - (180 * 24 * 60 * 60);
|
||||
$month = time() - (30 * 24 * 60 * 60);
|
||||
$week = time() - (7 * 24 * 60 * 60);
|
||||
|
||||
while ($user = DBA::fetch($userStmt)) {
|
||||
$statistics['total_users']++;
|
||||
|
@ -1297,6 +1299,11 @@ class User
|
|||
) {
|
||||
$statistics['active_users_monthly']++;
|
||||
}
|
||||
|
||||
if ((strtotime($user['login_date']) > $week) || (strtotime($user['last-item']) > $week)
|
||||
) {
|
||||
$statistics['active_users_weekly']++;
|
||||
}
|
||||
}
|
||||
DBA::close($userStmt);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue