ygpynet / leaderboard
A points-based leaderboard for Flarum powered by ygpynet/point-system, with period filtering and podium display.
Requires
- php: ^8.2
- flarum/core: ^2.0.0-beta
- ygpynet/point-system: ^1.0
Requires (Dev)
- flarum/phpstan: ^2.0.0-beta
- flarum/tags: *
- fof/best-answer: *
- fof/gamification: *
- fof/reactions: *
Suggests
- flarum/tags: Exclude discussions by tag from earning points
- fof/badges: Award points for earning badges
- fof/best-answer: Award points for best answers
- fof/gamification: Award points for votes
- fof/reactions: Award points for receiving reactions
Provides
None
Conflicts
None
Replaces
None
README
Leaderboard
A points-based leaderboard extension for Flarum forums, powered by ygpynet/point-system. All points live in point-system's ledger β this extension ranks users from it and adds a few extra point sources.
π Podium & Rankings
π Top Contenders & Honorable Mentions
βοΈ Admin Settings
Features
- π₯ Multiple Rankings: Separate boards for points, likes received, likes given, best answers, check-in streak, replies, and discussions started
- π Podium Display: Top 3 users shown in a gold/silver/bronze podium with avatars and stats
- π₯ Top Contenders: Ranks #4-#10 displayed in a responsive card grid
- π Honorable Mentions: Compact two-column list for remaining users with infinite scroll
- β° Period Filters: Daily, weekly, monthly, quarterly, yearly, and all-time rankings for every category
- β Single Source of Truth: Rankings come straight from point-system's ledger and the underlying Flarum tables
- β Extra Point Sources: Bridges reactions, best answers, badges, votes, and daily login into point-system
- π·οΈ Tag Exclusions: Exclude discussions with specific tags from rankings and earning points
- π₯ Group Exclusions: Hide users in selected groups from the leaderboard
- 𦴠Skeleton Loading: Smooth loading experience with animated placeholders
- π± Responsive Design: Optimized layout for mobile, tablet, and desktop
Installation
composer require ygpynet/leaderboard:"*"
Requires ygpynet/point-system β composer installs it automatically.
Updating
composer update ygpynet/leaderboard php flarum migrate php flarum cache:clear
To remove simply run composer remove ygpynet/leaderboard.
Quick Start
For Users
- Navigate to the Leaderboard page from the sidebar
- Use period pills to filter rankings (Daily, Weekly, Monthly, etc.)
- Click on any user card to visit their profile
For Admins
Navigate to Admin β Leaderboard to configure the extension. The admin panel is organized into three tabs:
General Tab
- Leaderboard Name: Customize the page title displayed in the sidebar and header
The points label shown next to each score reuses the currency name configured in point-system's settings.
Points Tab
Configure point values for the leaderboard's extra point sources:
| Section | Activities | Default |
|---|---|---|
| Core | Daily login | 1 |
| Reactions | Reaction received, Reaction given | 1, 0 |
| Best Answer | Best answer selected | 2 |
| Badges | Badge earned | 3 |
| Gamification | Upvote received, Downvote received | 1, -1 |
Core earning (discussions, posts, likes, check-in) is configured on point-system's own settings page.
Tip: Set a point value to
0to disable that source. Negative values (e.g., downvotes) deduct points.
Exclusions Tab
- Excluded Groups: Select user groups to hide from the leaderboard (e.g., Admins, Bots)
- Excluded Tags: Select tags whose discussions won't earn points (requires
flarum/tags)
How Points Flow
All point movements are recorded in point-system's transaction ledger:
Activity (post, like, check-inβ¦) β point-system awards points natively
Reaction / best answer / badge / vote / daily login β this extension bridges them into point-system
Ranking Categories
Switch categories with the pills at the top of the leaderboard page:
| Category | All-time metric | Period metric |
|---|---|---|
| Points | point-system lifetime total | Net credited points in period |
| Likes Received | Self-likes excluded | Likes received in period |
| Likes Given | Self-likes excluded | Likes given in period |
| Best Answers | Best-answer posts (requires fof/best-answer) |
Set within period |
| Check-in Streak | Current check-in streak (point-system) | Check-in days within period |
| Replies | Comment posts (excl. first post, hidden) | Posted within period |
| Discussions | Discussions started | Started within period |
Period Filtering
- All Time ranks by each category's cumulative metric
- Period rankings (daily/weekly/monthly/quarterly/yearly) only count activity since the period start
Optional Integrations
The leaderboard automatically integrates with these extensions when they are enabled:
| Extension | Point Sources |
|---|---|
flarum/tags |
Tag-based exclusions |
fof/reactions |
Reaction received, Reaction given |
fof/best-answer |
Best answer selected |
fof/badges |
Badge earned |
fof/gamification |
Upvote received, Downvote received |
No configuration is needed β install the extension and points will be awarded automatically based on your point settings.
π Translations
This extension comes with English translations. Community translations are welcome!
Translate: Leaderboard at Weblate
Links
License
MIT License - see LICENSE.md
Developed with β€οΈ by HΓΌseyin Filiz