Composr Supplementary: Adding a Member Reputation System

Written by Patrick Schmalstig
Image

Karma

Karma

(Click to enlarge)

The Karma non-bundled addon (maintenance status) enables site admins to introduce a member reputation system to their Conversr-powered site. Similar to other forum software which have a reputation system, karma is a publicly visible and crowdsourced 'score' of how reputable a member is within the community. Other members can then make a judgment call as to how they will interact with said member based on their karma. The Karma addon, however, goes way beyond that and has many configurable features.


Difference between Karma and Points

Composr's Points bundled addon can be thought of as a virtual currency system; the more points someone has, the more wealthy they are in the community. Karma, on the other hand, is a reputation system. The more karma a member has, the more reputable they are and the more established they are in the community.

Typically, a member will also have more points the more reputable they are. But this is often not always the case. For example, depending on the site, points can be spent on things, given to other members, or earned in ways not pertaining to behaviour (e.g. making a donation to the site).

Installing the karma addon

Before proceeding, be aware that the karma addon requires that you are running the Conversr forum software. This is by design as other forum software may have their own reputation systems. This requirement prevents confusion with the reputation systems of other forum software.

The first thing you will need to do to utilise karma is to install the addon. To do this:
  1. Go to the Admin Zone
  2. Navigate to the Structure section of the Admin Zone menu
  3. Choose the Addons icon
  4. Scroll down and choose "Import non-bundled addon(s)"
  5. Click Download and choose the New Features category
  6. Choose Karma
  7. Scroll down and click the "Import non-bundled addon(s)" button
  8. The next screen shows all of the files which will be edited or installed. Check this list carefully if you have manually edited files to make sure nothing is being overwritten which will break your site. Special care was considered with the karma addon to prevent this scenario as much as possible. If you are happy you can click Proceed.

Once installed, the karma addon will begin working immediately. Members will now have a karma bar below their avatar on their profile and forum posts indicating how much karma they have. Reasonable defaults have been set for the configuration and privileges. However, you may still wish to review and customise them according to your needs and desires.

You can configure the karma addon under Admin Zone > Setup > Configuration > Feature options. There is a section for karma and a section for karmic influence. You can also configure privileges for the karma addon under Admin Zone > Security > Global privileges > Karma.

Basic principles

Every member has good karma and bad karma. Actions considered positive will assign good karma. And actions considered negative will assign bad karma. The difference between a member's good karma and bad karma makes up their total karma score. While good karma and bad karma cannot individually be negative, a member's karma score can be negative if they have more bad karma than good karma. The following are general assumptions about a member's reputation based on the karma they have:
  • If you sum both the good and bad karma scores together, then this is a general representation of how much influence the member had on the community whether good or bad.
  • If a member has more good karma than bad karma (karma score is positive), then they are reputable. The greater the difference between the good karma and bad karma, the more reputable the member is considered.
  • If a member has more bad karma than good karma (karma score is negative), then they are not reputable. The greater the difference between the bad karma and good karma, the more troublesome the member is considered.

Members also have karmic influence. This is how much a member can influence another member's karma based on the actions they take on their content. Generally, you would want more trustworthy and vetted members to have more karmic influence because their opinions / actions are considered more likely to be honest. There are multiple configurable options you can use to decide how karmic influence is calculated.

Karma bar

The karma of every member is represented as a bar below their avatar on their profile and forum posts. This is accomplished through the main_karma_graph block. This bar will fill up according to the member's karma. The bar will behave differently depending on which privileges the viewing member has, according to the following:
  • If they have the “View good and bad karma values separately” privilege:
    • The bar will contain a combination of green, red, and yellow. The sum of their good karma and bad karma, compared with the Karma bar threshold configuration option, determines how full the bar will be.
    • Green represents good karma, and that the member has more good karma than bad karma.
    • Red represents bad karma, and that the member has more bad karma than good karma.
    • Yellow represents a negation. For instance, where the bar is filled with green (good karma), the portion that is filled with yellow indicates how much bad karma they have relative to good karma. So if 1/2 of the bar is yellow and 1/2 is green, that means they have 1/2 as much bad karma as good karma. If you see nothing but yellow, then they have an equal amount of bad karma and good karma.
  • If they do not have the “View good and bad karma values separately” privilege:
    • The bar will contain only red or green.
    • Green indicates the member has more good karma than bad karma. The bar will be filled according to their karma score and the Karma bar threshold configuration option.
    • Red indicates the member has more bad karma than good karma. Since ideally we would not want members without this privilege knowing how much bad karma a member has, the bar will always be 100% filled with red regardless of karma so long as they have more bad karma than good.

You can hover over a bar to see the raw karma values in a tooltip.

Compatibility with other addons

The karma addon will work together with various other addons you have installed. The karma addon currently works with the following other addons:
  • karma
    A member's karma score can be a factor in how much karmic influence they have.
  • core_cns
    A member's account age can be a factor in how much karmic influence they have. Additionally, you can assign additional karmic influence as a privilege to certain usergroups such as staff members (which is the default). And there are other privileges as well, such as completely turning off karmic influence for certain usergroups (on by default except for the probation usergroup), deciding who can view karma (on by default for all usergroups), and deciding who can specifically view good karma and bad karma separately (off by default except for staff).
  • cns_forum
    Members can receive good karma for voting in topic polls. Additionally, the number of forum posts a member made can be a factor in their karmic influence.
  • feedback
    Members can be assigned good or bad karma for every rating they receive depending on the rating. This also works when using likes / dislikes.
  • awards
    Good karma can be assigned when a member receives a Top Content (Award) for some content.
  • cns_warnings
    Bad karma can be assigned as a punitive action for getting warned. You can also reverse recent karma assignments in a warning (e.g. in the event the member was abusing the karma system). Additionally, you can decrease the amount of karmic influence a member has based on how many formal warnings they received in a given period of time.
  • polls
    Good karma can be assigned for voting in a poll.
  • points
    Members can be assigned good karma when another member sends them points. Additionally, a member's points balance, voting power, and/or life-time points can be factors as to how much karmic influence a member has.
  • giftr
    Members can be assigned good karma when other members send them virtual gifts.
  • idolisr
    You can configure that members only receive good karma for receiving points from others if they received them for an Idolisr role.
  • ecommerce
    Members can receive good karma based on how much they spend on your store. This can work for both points and currency.

Auditing karma

Image

Auditing Karma

Auditing Karma

(Click to enlarge)

You can audit the karma that is assigned under Admin Zone > Audit > Karma. There, you can view a master log of all the karma assignments that occurred on your site. You can also amend the reason text for any record, or you can reverse a karma assignment. It is recommended that if you are reversing a karma assignment because of member abuse that you use the interface for adding a warning instead.

Tips

The following are general tips and guidelines on how you can best utilise the karma system:
  • Generally, members will be receiving a lot more good karma than bad karma. This is because the only way members can assign bad karma to each other is through giving bad ratings on content or through warnings. Keep this in mind when warning members. You might decide to assign a high amount of bad karma for a warning so their good / bad karma ratio reflects their overall community impact. A good recommendation is to assign an amount of bad karma which reflects how impactful their actions were on the community; the more negative the impact, the more bad karma they get assigned.
  • You may need to adjust the Karma bar threshold option over time; as more members join your community and become active, members' karma will increase faster because more members will be performing actions that affect their karma. As such, this value may need to be increased so it takes more karma to fill up the karma bar completely.
  • Regularly check the audit logs for karma to monitor for abuse. There are several ways members could potentially abuse the system such as performing actions on each other to assign good karma for no good reason.
  • Be cautious about using points as a factor in a member's karmic influence. The number of points a member has might not be a true representation of how established they are in the community especially if you heavily use points as a virtual currency.
  • Also be cautious about using account age as a factor in a member's karmic influence. This setting does not differentiate between an active account and a stale account / lurker.

Advanced concepts

This section covers some additional advanced concepts or ideas regarding the karma addon which you can implement.

Commandr

The karma addon implements the following new commands (you can use –help to learn more about each command):
  • karma
    Returns your karma or the karma of a specified member
  • add_karma
    Assigns a specified amount of karma of a given type (good or bad) to a member
  • karmic_influence
    Returns your karmic influence or the karmic influence of another member

Tempcode

The karma addon implements the following new Tempcode directives:
  • $KARMA,member_id,type
    Returns the karma of the specified type for the specified member_id (or if member_id not specified, the current member).
    • type 0: karma score
    • type 1: good karma (or blank if member does not have the “View good and bad karma values separately” privilege)
    • type 2: bad karma (or blank if member does not have the “View good and bad karma values separately” privilege)

Example: karma as a permission

While the karma addon does not support permission integration out of the box, you can use the karma API to implement your own permissions. For example, you might not want someone who has less than 100 karma score or whose bad karma makes up 10% or more of their overall karma to fill out a catalogue applying for staff. Here is example code you can use to do that:

Code (PHP)

require_code('karma');
list($good_karma, $bad_karma) = get_karma($member_id);
if ((($good_karma - $bad_karma) < 100) || (($good_karma + $bad_karma) <= 0) || (($bad_karma / ($good_karma + $bad_karma)) >= 0.1)) {
    access_denied('I_ERROR');
}
 

In the 'if' condition, we first check if the member's karma score (good - bad karma) is below 100. In the second check, we see if the sum of their good and bad karma is <= 0 (to prevent division by zero in the third check). And in the third check, we see if bad karma makes up 10% or more of a member's overall karma. If any of these conditions are true, we throw an access denied error. This example uses the generic Internal Error, but you may want to make your own error.


Feedback

Please rate this tutorial:

Have a suggestion? Report an issue on the tracker.