定制 datlechin/flarum-posted-on 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

datlechin/flarum-posted-on

Composer 安装命令:

composer require datlechin/flarum-posted-on

包简介

Display the operating system of the who posted the post.

README 文档

README

License Latest Stable Version Total Downloads

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-Agent for 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 report Windows NT 10.0) and the real macOS version (Apple froze the UA at 10.15.7 since 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_guests to ignore guest posts entirely.
  • Let users hide their own metadata via the privacy switch in their settings.
  • Drop the posted_on_meta column 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 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-09