datlechin/flarum-posted-on
Composer 安装命令:
composer require datlechin/flarum-posted-on
包简介
Display the operating system of the who posted the post.
关键字:
README 文档
README
Show the operating system, browser, and device next to each post. Backed by matomo/device-detector and User-Agent Client Hints.
What it does
Each post records who it was authored from. The post header gets a small chip with an OS icon and a one-line label. Hover for a tooltip that splits OS, browser, and device on three lines.
The detection combines two signals:
- Legacy
User-Agentfor everything that has historically worked: iOS / iPadOS / Android / Linux versions, browser families, mobile device brands. - User-Agent Client Hints (
Sec-CH-UA-*) for the things the legacy UA cannot tell us, namely Windows 10 vs Windows 11 (both reportWindows NT 10.0) and the real macOS version (Apple froze the UA at10.15.7since macOS 11).
When Client Hints are not available (Firefox, Safari, Tor, older browsers), the version is dropped rather than guessed. A user on Windows 11 in Firefox will see "Windows", not "Windows 10".
Installation
composer require datlechin/flarum-posted-on
Enable from Admin → Extensions, then run:
php flarum migrate php flarum cache:clear
Configuration
Admin → Extensions → Posted On.
| Setting | Default | What it does |
|---|---|---|
display_mode |
os_only |
What renders next to the post. os_only shows "Windows 11"; os_browser shows "Windows 11 · Chrome 121". The full breakdown is always in the tooltip. |
skip_guests |
false |
When on, posts authored by guests get no platform metadata. |
Each user can also opt out from their own posts being labelled, under their account settings.
Privacy
The extension stores a coarse fingerprint of the poster's environment: OS family + version, browser family + version, device type + brand + model. This is derived from the request's User-Agent and Client Hints headers; no IP address is recorded by this extension.
You can:
- Toggle
skip_gueststo ignore guest posts entirely. - Let users hide their own metadata via the privacy switch in their settings.
- Drop the
posted_on_metacolumn or null it out to wipe historical metadata.
Updating from earlier versions
Posts authored before this version keep their existing posted_on string and render unchanged. Only posts created after the upgrade pick up the rich metadata.
The first POST a user makes after install may still miss the platform version: the browser needs to see the Accept-CH advertisement once before it starts attaching high-entropy hints. After the first page load the policy is cached and subsequent posts include the version.
Development
composer test:unit cd js && npm install && npm run build
Links
datlechin/flarum-posted-on 适用场景与选型建议
datlechin/flarum-posted-on 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.82k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 02 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「flarum」 「flarum-extension」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 datlechin/flarum-posted-on 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 datlechin/flarum-posted-on 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 datlechin/flarum-posted-on 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Allows to create a customizable landing page that non-logged in users will see.
Adds more BBCode
Output of discussions lists in form of cards
Customize discussion title length.
Allow users to log in with QQ
Remove the IndexPage's sidenav
统计信息
- 总下载量: 3.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-09