huseyinfiliz/leaderboard 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

huseyinfiliz/leaderboard

Composer 安装命令:

composer require huseyinfiliz/leaderboard

包简介

A points-based leaderboard extension for Flarum with configurable point sources, period filtering, and podium display.

README 文档

README

Leaderboard

License Latest Stable Version Total Downloads

Leaderboard

A points-based leaderboard extension for Flarum forums. Award points for community activity, display rankings with a beautiful podium, and motivate engagement through configurable point sources and time-based filters.

🏆 Podium & Rankings

Podium Demo

📊 Top Contenders & Honorable Mentions

Contenders Demo

⚙️ Admin General Settings

Admin Demo

⚙️ Admin Points Settings

Admin Demo

⚙️ Admin Exclusions Settings

Admin Demo

⚙️ Admin Maintenance Settings

Admin Demo

⚙️ Admin Recalculate Modal

Admin Demo

Features

  • 🏆 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
  • Configurable Points: Set point values for each activity type independently
  • 🎯 11 Point Sources: Discussions, posts, daily login, likes (given/received), reactions (given/received), best answers, badges, and votes
  • 🏷️ Tag Exclusions: Exclude discussions with specific tags from earning points
  • 👥 Group Exclusions: Hide users in selected groups from the leaderboard
  • 🔄 Maintenance Tools: Full recalculation and lightweight sync for point adjustments
  • 🦴 Skeleton Loading: Smooth loading experience with animated placeholders
  • 📱 Responsive Design: Optimized layout for mobile, tablet, and desktop
  • 🃏 User Card Integration: Show leaderboard points on user cards throughout the forum

Installation

composer require huseyinfiliz/leaderboard:"*"

You can also install with Extension Manager: huseyinfiliz/leaderboard

Updating

composer update huseyinfiliz/leaderboard
php flarum migrate
php flarum cache:clear

To remove simply run composer remove huseyinfiliz/leaderboard.

Quick Start

For Users

  1. Navigate to the Leaderboard page from the sidebar
  2. Use period pills to filter rankings (Daily, Weekly, Monthly, etc.)
  3. Click on any user card to visit their profile
  4. Your points are visible on your user card across the forum

For Admins

Navigate to Admin → Leaderboard to configure the extension. The admin panel is organized into four tabs:

General Tab

  • Leaderboard Name: Customize the page title displayed in the sidebar and header
  • Points Label: Set the label shown next to point values (e.g., "Points", "XP", "Karma")

Points Tab

Configure point values for each activity type. Points are organized into collapsible sections:

Section Activities Default
Core Discussion started, Post created, Daily login 1 each
Likes Like received, Like given 1, 0
Reactions Reaction received, Reaction given 1, 0
Best Answer Best answer selected 2
Badges Badge earned 3
Gamification Upvote received, Downvote received 1, -1

Tip: Set a point value to 0 to 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)

Maintenance Tab

Action Description
Recalculate All Activity Full rescan of all source data. Re-creates point records from scratch. Use after changing tag exclusions or if data seems out of sync.
Sync Points Lightweight recalculation of totals using current point values. Use after changing point values.

Note: Do not close the page during a full recalculation — the operation will fail if interrupted.

Optional Integrations

The leaderboard automatically integrates with these extensions when they are enabled:

Extension Point Sources
flarum/likes Like received, Like given
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
flarum/approval Content restored event support

No configuration is needed — install the extension and points will be awarded automatically based on your point settings.

🔧 Advanced Details

Point Lifecycle

Points are awarded and revoked automatically based on user activity:

Action performed → Points awarded → Totals updated
Action undone    → Points revoked → Totals updated
Event Awards Revokes
New discussion discussion_started On hide/delete
New reply post_created On hide/delete
User login daily_login (once per day)
Like/unlike like_received + like_given On unlike or post hide/delete
React/unreact reaction_received + reaction_given On unreact or post hide/delete
Best answer set/unset best_answer On unset
Badge earned badge_earned
Upvote/downvote upvote_received / downvote_received On vote change

Data Integrity

  • Atomic operations: Point revocations use database transactions with row locking
  • Cascade handling: Discussion deletion properly revokes all post-level points (likes, reactions, votes)
  • Content moderation: Hidden posts/discussions have their points revoked; restored content re-awards points
  • Idempotent awards: Duplicate point records are prevented with existence checks
  • Daily login protection: Database fallback prevents double-awarding after cache clear

Period Filtering

Rankings are filtered by the created_at timestamp of each point record:

Period Range
Daily Last 24 hours
Weekly Last 7 days
Monthly Last 30 days
Quarterly Last 90 days
Yearly Last 365 days
All Time No filter

🌍 Translations

This extension comes with English translations. Community translations are welcome!

Translate: Leaderboard at Weblate

💖 Support & Contributing

If you find this extension useful, consider:

  • ⭐ Starring the repository on GitHub
  • 🌐 Contributing translations

Links

License

MIT License - see LICENSE.md

Developed with ❤️ by Hüseyin Filiz

huseyinfiliz/leaderboard 适用场景与选型建议

huseyinfiliz/leaderboard 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.65k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「leaderboard」 「Gamification」 「ranking」 「points」 「flarum」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 huseyinfiliz/leaderboard 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 huseyinfiliz/leaderboard 我们能提供哪些服务?
定制开发 / 二次开发

基于 huseyinfiliz/leaderboard 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.65k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 12
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-02