Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Languages/en_US/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,18 @@
one {in the past # minute}
other {in the past # minutes}
}: {list}';
$txt['users_active_hours'] = 'Users active {hours, plural,
one {in the past # hour}
other {in the past # hours}
}: {list}';
$txt['users_active_days'] = 'Users active {days, plural,
one {in the past # day}
other {in the past # days}
}: {list}';
$txt['users_active_weeks'] = 'Users active {weeks, plural,
one {in the past # week}
other {in the past # weeks}
}: {list}';
$txt['personal_messages'] = 'Personal Messages';
$txt['reply_quote'] = 'Reply with quote';
$txt['reply'] = 'Reply';
Expand Down
15 changes: 14 additions & 1 deletion Themes/default/BoardIndex.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,21 @@ function template_ic_block_online()

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty(Utils::$context['users_online'])) {
$active_minutes = (int) Config::$modSettings['lastActive'];
$active_unit = 'minutes';
$active_value = $active_minutes;

// Use the largest exact unit so that the displayed time remains accurate.
foreach (['weeks' => 10080, 'days' => 1440, 'hours' => 60] as $unit => $minutes_per_unit) {
if ($active_minutes > 0 && $active_minutes % $minutes_per_unit === 0) {
$active_unit = $unit;
$active_value = intdiv($active_minutes, $minutes_per_unit);
break;
}
}

echo '
', Lang::getTxt('users_active', ['minutes' => Config::$modSettings['lastActive'], 'list' => Lang::sentenceList(Utils::$context['list_users_online'])], file: 'General');
', Lang::getTxt('users_active' . ($active_unit === 'minutes' ? '' : '_' . $active_unit), [$active_unit => $active_value, 'list' => Lang::sentenceList(Utils::$context['list_users_online'])], file: 'General');

// Showing membergroups?
if (!empty(Theme::$current->settings['show_group_key']) && !empty(Utils::$context['membergroups'])) {
Expand Down