adrian-mid / humhub-reactions
Add Facebook-style emoji reactions to HumHub posts and comments.
Package info
github.com/Adrian-MID/humhub-reactions
Type:humhub-module
pkg:composer/adrian-mid/humhub-reactions
Requires
- php: >=8.0
- composer/installers: ^2.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.75
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.6
This package is auto-updated.
Last update: 2026-07-21 02:40:22 UTC
README
Add emoji reactions to HumHub posts and comments.
Features
- Hover-to-pick emoji reactions on posts and comments (Like, Love, Haha, Wow, Sad, Angry by default)
- Reaction summary with stacked emoji icons and total count
- One reaction per user. Clicking the same emoji again removes it
- Web and email notifications when someone reacts to your post or comment
- Reactions in HumHub mail summary digests (daily, weekly, etc.)
- Optional replacement of HumHub's default Like button
- Admin settings to enable reactions and choose which emoji are available
- Works with HumHub stream entries and nested comments
Requirements
- HumHub 1.14 or later
- PHP 8.0 or later
Installation
Use a separate Composer project in protected/modules/. The module installs to protected/modules/humhub-reactions/ and its dependencies go to protected/modules/vendor/, leaving HumHub's protected/vendor/ tree untouched.
Do not run composer init or composer require at the HumHub web root.
One-time setup - copy the Composer scaffold (once per HumHub instance):
cd /path/to/humhub/protected/modules
curl -fsSL https://raw.githubusercontent.com/Adrian-MID/humhub-reactions/main/modules.composer.json -o composer.json
Install or update:
cd /path/to/humhub/protected/modules
composer require adrian-mid/humhub-reactions:^1.1
php ../yii migrate/up --includeModuleModules=1
php ../yii cache/flush-all
Enable HumHub Reactions under Administration → Modules.
Configure the module under Administration → Settings → HumHub Reactions.
For a developer-oriented walkthrough of the architecture, see HOW_IT_WORKS.md.
Configuration
| Setting | Description |
|---|---|
| Enable emoji reactions | Activates reactions on posts and comments |
| Replace the default Like button | Hides HumHub's built-in Like control when reactions are active |
| Available reactions | Choose which emoji users can pick from |
How it works
The module hooks into HumHub's wall entry and comment link areas. When a user hovers the React button, a floating emoji bar appears (Facebook-style). Selecting an emoji stores one reaction per user per post or comment.
Reaction counts are shown above the action links as overlapping emoji badges with a total count. Clicking the summary opens a modal listing everyone who reacted.
When someone adds a new reaction to a post or comment, HumHub sends notifications the same way it does for comments: an in-app alert and an optional email to followers who have reaction notifications enabled. Users can manage this under Account Settings → Notifications → Reactions. Changing an existing reaction to a different emoji does not send another notification.
Reactions also appear in HumHub's mail summary digest (hourly, daily, weekly, or monthly), alongside comments and likes. Users can include or exclude them under the Activities checkboxes in their mail summary settings.
Why this module has its own emoji catalog
Reactions on the wall are plain Unicode characters - no image library is needed to display them. The catalog exists for the admin settings picker (search, groups, stable keys like thumbs_up) and to validate saved reactions.
HumHub 1.16+ ships a similar dataset via unicode-emoji-json and EmojiMap, but this module supports HumHub 1.14+ and cannot require a newer core version. On many installs the full JSON file is missing or core only exposes name-to-emoji lookup, not the grouped reverse index the admin UI needs.
So the module implements EmojiCatalog: it uses HumHub’s copy of the data when available, and falls back to a built-in list when not. That keeps behaviour consistent across supported HumHub versions without raising the minimum version.
Development
This module is maintained with strict static analysis, coding standards, and unit tests:
- PHPStan level 10 -
composer phpstan - PHP CS Fixer (PER-CS + PHP 8.2 migration rules) -
composer cs:check/composer cs:fix - PHPUnit 9 -
composer test
Run all checks:
composer install composer lint
CI runs the same checks on push and pull requests via GitHub Actions.
License
GPL-3.0-or-later - see LICENSE.
Changelog
See CHANGELOG.md.