Use the "abandon days" for the user language detection
This commit is contained in:
parent
9e47cde90c
commit
f5091110c2
1 changed files with 8 additions and 1 deletions
|
@ -586,7 +586,14 @@ class User
|
||||||
$languages = [];
|
$languages = [];
|
||||||
$uids = [];
|
$uids = [];
|
||||||
|
|
||||||
$users = DBA::select('user', ['uid', 'language'], ["`verified` AND NOT `blocked` AND NOT `account_removed` AND NOT `account_expired` AND `uid` > ?", 0]);
|
$condition = ["`verified` AND NOT `blocked` AND NOT `account_removed` AND NOT `account_expired` AND `uid` > ?", 0];
|
||||||
|
|
||||||
|
$abandon_days = intval(DI::config()->get('system', 'account_abandon_days'));
|
||||||
|
if (!empty($abandon_days)) {
|
||||||
|
$condition = DBA::mergeConditions($condition, ["`last-activity` > ?", DateTimeFormat::utc('now - ' . $abandon_days . ' days')]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$users = DBA::select('user', ['uid', 'language'], $condition);
|
||||||
while ($user = DBA::fetch($users)) {
|
while ($user = DBA::fetch($users)) {
|
||||||
$uids[] = $user['uid'];
|
$uids[] = $user['uid'];
|
||||||
$code = DI::l10n()->toISO6391($user['language']);
|
$code = DI::l10n()->toISO6391($user['language']);
|
||||||
|
|
Loading…
Reference in a new issue