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

Run all pending migrations from the HumHub root directory:

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

After any migration that adds a new scoring column, run a full recalculation to populate it for existing users:

php yii reputation/recalculate

v1.1.5 — friends_count column (corrected)

Version 1.1.3 documented a friends_count column, but the value was stored as a virtual PHP property only and was never persisted. Version 1.1.5 delivers the correct migration via m260403_000003_add_friends_count.

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`;

After applying this migration, run php yii reputation/recalculate to populate friends_count for all existing users.

v1.1.3 — friends_count column (superseded by v1.1.5)

The v1.1.3 release notes referenced this column. No separate migration was shipped for that release — the fix is delivered by the v1.1.5 migration above.


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 alongside all six tracked metrics: Content, Likes, Comments, Followers, and Friends. Prints a summary of total processed, updated, and any errors at the end.

Run this after changing point values, exclusion settings, or applying a new migration to apply changes to all 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

Clears the following keys if present: leaderboardLimit, pointsPerContent, pointsPerLike, pointsPerComment, followersCount, pointsPerFriend, enableReputationLevels, showOnProfile, enableHistory, historyRetentionDays. Only reputation-related settings are affected — nothing else is touched.


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.

php yii reputation/show-config

The friendship scoring row shows one of three contextual statuses:

  • Active — Friendship module is installed and pointsPerFriend > 0
  • Disabled (pointsPerFriend = 0) — Friendship module is present but scoring is turned off
  • Module not installed — the Friendship module is not available

If admin panel settings are detected, a warning is shown explaining which keys are present and how to clear them with reset-settings.


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, and compares everything against the stored reputation record.

php yii reputation/check-user 1

Replace 1 with the numeric user ID.

The friendship section at the end of the output shows one of three states:

  • Inactive — Friendship module is not installed
  • DisabledpointsPerFriend is 0
  • Active — shows the live friend count, the configured points-per-friend value, and a resync warning if the stored friends_count differs from the live count

If any stored count differs from the live count, the command will prompt 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.5 - April 3, 2026
Publisher:
Author(s):
Compatibility:
HumHub 1.18 - 1.18