tryhackx/flarum-homepage-blocks
Composer 安装命令:
composer require tryhackx/flarum-homepage-blocks
包简介
Customizable homepage blocks for tracker-style Flarum forums featuring dual statistics (internal & OpenTracker), advanced filters, and rate-limiting protection.
关键字:
README 文档
README
A Flarum extension that adds powerful customisable homepage blocks: tracker information panels, dual statistics (internal database + external OpenTracker), advanced discussion filters, content-validation overrides, and a per-IP rate limiter.
Designed to plug cleanly into a tracker-style Flarum forum. Works hand in hand with the rest of the TryHackX extension family —
tryhackx/flarum-topic-ratingunlocks rating filters and sorts,tryhackx/flarum-magnet-linkunlocks magnet click stats and sorts,fof/discussion-viewsunlocks view counters / view-based sort.
Note: Recent updates target the 2.x line only. The 1.x branch (Flarum 1.8+) is no longer actively developed — it stays available for legacy installs but won't receive new features.
Screenshots
Mobile view — discussion list rendered with different combinations of TryHackX extensions (thumbnails + ratings + views, thumbnails + views, thumbnails only, ratings only, views only, vanilla Flarum).
TryHackX Homepage Blocks admin panel — section toggles, theme mode, custom filter labels, tracker info / announce URLs, internal & external (OpenTracker) statistics, content title / length overrides and rate-limit settings.
Desktop discussion list with the full TryHackX stack — thumbnail sliders on the left, star ratings on the right, magnet button next to each topic.
Desktop discussion list — hover state showing the magnet tooltip loading inline (powered by tryhackx/flarum-magnet-link).
Support Development
If you find this extension useful, consider supporting its development:
- Monero (XMR):
45hvee4Jv7qeAm6SrBzXb9YVjb8DkHtFtFh7qkDMxS9zYX3NRi1dV27MtSdVC5X8T1YVoiG8XFiJkh4p9UncqWGxHi4tiwk - Bitcoin (BTC):
bc1qncavcek4kknpvykedxas8kxash9kdng990qed2 - Ethereum (ETH):
0xa3d38d5Cf202598dd782C611e9F43f342C967cF5
You can also find the donation option in the extension's admin settings panel.
Features
- Tracker info panel — display BitTorrent tracker announce URLs with copy-to-clipboard support, a custom heading and sub-heading.
- Dual statistics system — show internal forum stats (from the
database) and external OpenTracker stats side by side:
- Internal stats — torrents, users, magnets, downloads, views, average rating (pulled from the forum database).
- External stats (OpenTracker) — seeds, leechers, peers, completed
downloads, uptime, fetched directly from the OpenTracker XML endpoint
(
/stats?mode=everything). Leechers are derived aspeers − seeds(OpenTracker'speerscount is the whole swarm). - Shared cache + single-flight — the backend fetches the tracker at most once per cache lifetime, globally, and serves everyone from one shared cache; when a fetch is already running, other requests are never triggered and get the cached/stale value instead. Configurable cache lifetime, max fetch time (large trackers can take ~a minute to compute stats) and client refresh interval.
- Advanced discussion filters — filter bar for the discussion list
with 7 filter types:
- Title search
- User search
- Rating interval (requires
tryhackx/flarum-topic-rating) - Date interval (Today, 1 day, 1 week, 2 weeks, 1 month, 3 / 6 months, 1 year)
- Category (tag) selection
- Sort by — creation date (always available), plus a Steam-DB-style
confidence rating, average rating, rating count and recently rated
(with
tryhackx/flarum-topic-rating), views (withfof/discussion-views), and magnet clicks total / top magnet / recently clicked (withtryhackx/flarum-magnet-link). Options whose extension isn't installed are hidden automatically. - Sort direction (ascending / descending)
- Content-validation overrides — override Flarum's built-in title
and content length limits without patching core:
- Title length: 1–200 characters (
varchar(200)column max). - Content length: 0–16,000,000 characters (
mediumtextcolumn max). - Each toggle is independent.
- Title length: 1–200 characters (
- Rate limiting — a built-in per-IP points limiter on the search /
filters action. Each visitor has a budget that refills over time; when it
runs out the IP is temporarily blocked for a configurable duration and
the visitor sees a friendly countdown. Client IPs are resolved from Flarum
core (proxy-aware), so the limit can't be bypassed with a spoofed
X-Forwarded-Forheader. The per-IP budget is kept on the local filesystem with per-IP locking — ideal for a single server; if you run several app servers behind a load balancer, front them with a shared store (Redis).- Enforced server-side. The authoritative charge is a middleware on
core's
GET /api/discussionsthat meters requests carrying the heavyfilter[title]/filter[user](LIKE%…%) parameters — so bots, scrapers and flooders hitting the API directly are throttled and blocked before the query touches the database, not just users of the on-page filter bar. The client-side pre-flight is kept purely for UX (instant countdown before a query fires); to avoid double-billing, a successful pre-flight grants a short-lived per-IP grace that the middleware consumes for the follow-up real request. Only heavy title/user searches are metered — ordinary browsing and short (<3-char) filters are never charged. (A shared cache such as Redis is still recommended if you run several app servers, so the per-IP bucket is consistent across nodes.)
- Enforced server-side. The authoritative charge is a middleware on
core's
- Collapsible sections — Section 1 (tracker + stats) can be collapsed by default to save space.
- Hide hero banner — optional toggle to hide Flarum's default hero banner.
- Tag filtering — show only tags that actually have discussions, optionally with discussion counts next to tag names.
- Polish & English locales — fully translated UI.
Requirements
- Flarum
^2.0.0-rc.1 - PHP
^8.3(matches Flarum 2.x's own minimum) flarum/tags(required)
Recommended companions
These aren't strictly required but unlock additional functionality:
- fof/discussion-views — view count statistics and view-based sorting.
- tryhackx/flarum-topic-rating — rating-based filtering and sorting (Steam-DB-style, average rating, etc.).
- tryhackx/flarum-magnet-link — magnet click statistics (tracker stats block) and topic-scoped magnet-click sorts (clicks total / top magnet / recently clicked).
Installation
composer require tryhackx/flarum-homepage-blocks php flarum cache:clear
Updating
composer update tryhackx/flarum-homepage-blocks php flarum cache:clear
Configuration
- Navigate to the Administration panel.
- Find TryHackX Homepage Blocks in the extensions list and enable it.
- Click the extension to access the configuration sections:
| Section | Description |
|---|---|
| General | Section titles, default-collapsed state, hero banner toggle, tag display options. |
| Tracker Info | Tracker heading, sub-heading, announce URLs. |
| Tracker Statistics | Toggle internal stats, set the OpenTracker XML URL, cache lifetime, max fetch time and client refresh interval. |
| Content Settings | Override title and content length limits. |
| Rate limiting | Per-IP points limiter on search/filters. When a visitor runs out of points the IP is temporarily blocked (configurable duration and post-block budget reset). Guests pay an extra per-action cost. |
API endpoints
| Method | Path | Purpose |
|---|---|---|
GET |
/api/tryhackx/homepage/stats |
Forum / tracker statistics (served from a shared server-side cache). |
GET |
/api/tryhackx/homepage/points/check |
User points / rating helper used by the filter bar. |
Links
License
MIT License. See LICENSE for details.
tryhackx/flarum-homepage-blocks 适用场景与选型建议
tryhackx/flarum-homepage-blocks 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 29 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「search」 「validation」 「extension」 「statistics」 「widgets」 「antispam」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tryhackx/flarum-homepage-blocks 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tryhackx/flarum-homepage-blocks 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tryhackx/flarum-homepage-blocks 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel package to retrieve data from Google Search Console
A custom URL rule class for Yii 2 which allows to create translated URL rules
Indexed Search Autocomplete - Extends the TYPO3 Core Extension Indexed_Search searchform with an autocomplete feature.
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
Abstraction Layer to index and search entities
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 43
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-23



