adrian-mid/humhub-reactions 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

adrian-mid/humhub-reactions

Composer 安装命令:

composer require adrian-mid/humhub-reactions

包简介

Add Facebook-style emoji reactions to HumHub posts and comments.

README 文档

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
  • 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.0
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.

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.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2026-07-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固