Repository navigation
Fix 7354 readable active user threshold - #9910
Open
boredskull wants to merge 2 commits into
Open
boredskull wants to merge 2 commits into
boredskull wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[3.0] Display active-user threshold in hours, days or weeks
Summary
This pull request addresses issue #7354 by improving how the user online time threshold is displayed on the forum's board index.
Currently, SMF displays the configured threshold in minutes regardless of its duration. This can result in unnecessarily large values, such as:
Users active in the past 1440 minutesThe proposed enhancement automatically converts the threshold into hours, days or weeks where appropriate, making the information easier for members to read.
Changes Made
1. Human-readable time thresholds
The board index now uses the largest appropriate time unit when the configured threshold can be converted exactly.
Examples:
Thresholds that cannot be converted into whole hours, days or weeks continue to display in minutes, preserving accuracy.
2. Language and pluralisation support
Added three new language strings:
users_active_hoursusers_active_daysusers_active_weeksThese use SMF's existing ICU pluralisation format to support singular and plural wording.
The original
users_activelanguage string remains unchanged for backward compatibility.3. Minimal changes to existing functionality
The enhancement affects only how the online threshold is displayed.
It does not change how SMF tracks online users, calculates activity periods or stores the configured threshold.
Files Modified
Themes/default/BoardIndex.template.phpLanguages/en_US/General.phpNo database changes, additional dependencies or changes to the underlying online tracking system are required.
Testing
Completed:
All 12 conversion checks passed.
Further testing recommended:
Browser-based integration testing has not yet been completed.
Expected Result
The board index should display the configured online activity threshold using a more natural time unit wherever possible.
For example:
Before:
Users active in the past 1440 minutesAfter:
Users active in the past 1 dayThis improves readability without changing the behaviour of the existing online user tracking system.
Issues References (Fixes|Related|Closes)
Related #7354