ffans / activity-title-count
Adds highlighted notification and moderation counts to Flarum Realtime's browser-title count.
Package info
github.com/FFans/activity-title-count
Language:TypeScript
Type:flarum-extension
pkg:composer/ffans/activity-title-count
Fund package maintenance!
Requires
- php: ^8.3
- flarum/core: ^2.0.0-rc.8
- flarum/realtime: ^2.0.0-rc.8
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-01 16:46:49 UTC
README
Adds highlighted notification and moderation-queue counts to Realtime's browser-title count.
Preview
Realtime pending activity: 3
Unread notifications: 2 (notification button highlighted)
Pending moderation posts: 4 (moderation button highlighted)
Browser title: (9) Discussions - My Forum
Each count contributes only while its corresponding button is highlighted. With the example above, clearing the notification highlight changes the title to (7) Discussions - My Forum; clearing both highlights leaves Realtime's (3) count.
The moderation number comes from Flarum Flags' badge. It counts distinct posts visible in the moderation queue, including posts awaiting Approval and user-reported posts.
Features
- Adds the unread notification count to the browser title only while Flarum's notification button is highlighted.
- Adds the pending moderation-post count only while Flarum's moderation button is highlighted.
- Updates immediately when Core, Flags, or Realtime changes the corresponding count.
- Keeps the correct count across Flarum's single-page navigation.
- Preserves real page titles that begin with a number in parentheses.
- No backend.
Requirements
| Extension line | Flarum | flarum/realtime | flarum/flags | Branch |
|---|---|---|---|---|
| 2.x | 2.x | 2.x | 2.x (optional) | 2.x |
Installation
Install with Composer:
composer require ffans/activity-title-count php flarum cache:clear
Then enable FFans Activity Title Count in the Flarum administration dashboard. Flarum Realtime must also be installed, configured, and enabled. Moderation counting is enabled automatically when Flarum Flags (directly or through Flarum Approval) is enabled.
Updating
composer update ffans/activity-title-count php flarum cache:clear
Configuration
No configuration is required. The extension combines Realtime's pending activity with the signed-in user's notification and moderation badge totals. Each badge total is included only while Flarum marks that button as highlighted.
Translations
The extension currently has no user-visible interface strings. Repository contributions are welcome if future versions add translatable UI.
Links
License
Released under the MIT License.