Back to marketplace
174

Reputation

Buy now

User reputation system based on content creation activity.

Admin Manual

Table of Contents


common.php Configuration

Module settings can be configured directly in /protected/config/common.php under the modules key. Settings defined here take priority over the admin panel — if a property is set in common.php, the admin panel cannot override it.

'modules' => [
    'reputation' => [
        'class' => 'humhub\modules\reputation\Module',

        // Leaderboard settings
        'leaderboardLimit'       => 5,
        'pointsPerContent'       => 1,
        'pointsPerLike'          => 1,
        'pointsPerComment'       => 1,
        'followersCount'         => 5,
        'pointsPerFriend'        => 3,   // Requires Friendship module; 0 = disabled
        'enableHistory'          => false,
        'showOnProfile'          => true,
        'enableReputationLevels' => true,

        // Exclude system-generated content from reputation
        'excludedContentTypes' => [
            'humhub\modules\activity\models\Activity',
            'humhub\modules\notification\models\Notification',
            // Add more content types to exclude here if needed
        ],

        'reputationLevels' => [
            'Newcomer'  => 0,
            'Member'    => 1000,
            'Regular'   => 3000,
            'Veteran'   => 6000,
            'Expert'    => 10000,
            'Legend'    => 20000,
        ],
    ],
],

Available Options

OptionTypeDefaultDescription
leaderboardLimitint10Number of users shown in the dashboard leaderboard widget
pointsPerContentint1Points awarded per piece of content created
pointsPerLikeint2Points awarded per like received
pointsPerCommentint3Points awarded per comment received
followersCountint5Points awarded per follow received
pointsPerFriendint0Points awarded per mutual friendship (requires Friendship module; 0 = disabled)
enableHistorybooltrueTrack a history log of reputation changes
showOnProfilebooltrueShow the reputation panel on user profile pages
enableReputationLevelsbooltrueEnable the reputation level/badge system
historyRetentionDaysint365Days to keep history records (0 = forever)
excludedContentTypesarray[]Additional content type classes to exclude from scoring
reputationLevelsarraySee belowLevel names and their minimum point thresholds

Reputation Levels

Reputation levels are defined as an associative array of 'Label' => minimumPoints pairs in ascending point order:

'reputationLevels' => [
    'Newcomer'  => 0,
    'Member'    => 1000,
    'Regular'   => 3000,
    'Veteran'   => 6000,
    'Expert'    => 10000,
    'Legend'    => 20000,
],

⚠ Important — Level names are hardcoded and cannot be translated. The label strings defined here (e.g. 'Newcomer', 'Legend') are stored and displayed as-is throughout the module — in profile panels, leaderboards, and badges. They are not passed through HumHub's translation system, so changing the language in HumHub will not affect them. If you need localised level names, define them directly in this array in your desired language.

Excluded Content Types

By default the module always excludes the following types from all reputation calculations, regardless of configuration:

  • humhub\modules\activity\models\Activity
  • humhub\modules\notification\models\Notification
  • humhub\modules\comment\models\Comment
  • humhub\modules\like\models\Like

Any types listed in excludedContentTypes in common.php are merged on top of these. There is no need to re-list the defaults above — they are always excluded automatically.

Friendship Points

When HumHub's Friendship module is installed and enabled, you can award points for mutual friendships by setting pointsPerFriend to a positive integer. The module counts each accepted friendship once (using user_friendship.user_id = $userId), so the score reflects the number of distinct friends a user has.

Setting pointsPerFriend to 0 (the default) disables friendship scoring entirely, even if the Friendship module is installed. The field is hidden in the admin panel when the Friendship module is not present.

'pointsPerFriend' => 3,  // Award 3 points per mutual friend

After enabling or changing pointsPerFriend, run php yii reputation/recalculate to apply the new value to all existing users.


Database Migrations

v1.1.3 — friends_count column

Version 1.1.3 adds a friends_count column to the reputation_user_reputation table. Run the module migration to apply it before upgrading:

php yii migrate --migrationPath=@humhub/modules/reputation/migrations

If the migration runner is not available, apply it manually:

ALTER TABLE `reputation_user_reputation`
    ADD COLUMN `friends_count` INT NOT NULL DEFAULT 0
    AFTER `followers_count`;

CLI Commands

Console commands are available for maintenance, debugging, and bulk operations. Run them from your HumHub root directory.


reputation/recalculate

Recalculates reputation scores for all enabled users.

php yii reputation/recalculate

Outputs a line per user showing their updated score, content count, likes, comments, followers, and friends. Prints a summary of total processed, updated, and any errors at the end.

Run this after changing point values or exclusion settings to apply them to existing scores.


reputation/stats

Displays a quick overview of reputation data across all users.

php yii reputation/stats

Shows total users with a reputation record, the average score, and the highest score.


reputation/reset-settings

Clears all admin panel reputation settings from the database, forcing the module to fall back to common.php configuration.

php yii reputation/reset-settings

Useful if conflicting admin panel settings are interfering with your common.php values. Only deletes reputation-related settings — nothing else is affected.


reputation/full-reset

Runs reset-settings followed immediately by recalculate in a single command.

php yii reputation/full-reset

Use this when you want to wipe admin panel overrides and immediately resync all scores against the current common.php configuration.


reputation/show-config

Displays the currently active module configuration, including all point values, feature flags, reputation levels, excluded content types, and whether any admin panel settings are present in the database. Also shows the friendship scoring status (active / disabled / module not installed).

php yii reputation/show-config

If admin panel settings are detected, a warning is shown explaining which common.php properties will take precedence and how to clear them.


reputation/check-user [userId]

Diagnostic command for a single user. Shows all of their content records with per-record details (type, state, archived flag, whether excluded), the live calculated content count after all filters, friendship scoring status and live friend count, and compares everything against the stored reputation record.

php yii reputation/check-user 1

Replace 1 with the numeric user ID. If the stored count differs from the live count, the command will tell you to run recalculate.

Use this when a user's reputation score looks incorrect and you need to understand exactly what is and isn't being counted for them.

Module Information

Price:
13 €
Latest version release:
1.1.4 - March 2, 2026
Publisher:
Author(s):
Compatibility:
HumHub 1.18.0-beta.4 - 1.18.1