Help:Extension:SocialProfile/User stats
User statistics in SocialProfile mainly deal with user levels, which is a somewhat "gamified" way to keep your users engaged and contributing to the wiki. In practise this means that through the user levels system, users can be awarded a set amount of points for performing certain actions on-wiki.
A user's points and their corresponding "rank" are shown on their structured social user profile page as well as on various ranking pages like Special:TopUsers
, which shows the users who have the most points on the wiki. The user rank and points shown on social profiles links to a help page; the help page name is controlled by the interface message [[MediaWiki:User-profile-userlevels-link]]
, but this page is always assumed to exist in the help namespace. Disabling this link is currently not possible.
Additionally the rank and points may be shown in other extensions/locations, like comments on blog pages and user box pages as well as elsewhere, for example.
Configuring user levels
editA wiki system administrator needs to define the value of $wgUserLevels
in the wiki's LocalSettings.php
file. The variable is an array of 'Level name' => required points
mappings. For example:
$wgUserLevels = [
'Recruit' => 0,
'Apprentice' => 1200,
'Private' => 1750,
'Corporal' => 2500,
'Sergeant' => 5000,
'Gunnery Sergeant' => 10000,
'Lieutenant' => 20000,
'Captain' => 35000,
'Major' => 50000,
'Lieutenant Commander' => 75000,
'Commander' => 100000,
'Colonel' => 150000,
'Brigadier' => 250000,
'Brigadier General' => 350000,
'Major General' => 500000,
'Lieutenant General' => 650000,
'General' => 800000,
'General of the Army' => 1000000,
];
To determine which namespaces earn the user social points, set the $wgNamespacesForEditPoints
variable to an array of one or more namespaces; usually at least the main namespace is what most sites will want to include, but it's possible a site has other namespaces they also want to include in the calculations.
The $wgUserStatsPointsValues
variable also needs to be properly defined (see below) to hand out points automatically for actions.
Supported actions for which points can be awarded
editThe key
after the human-readable statistic name refers to the value for $wgUserStatsPointsValues
, so to give out five (5) points for sending out a gift to another user, a system administrator would set $wgUserStatsPointsValues['gift_sent'] = 5;
in the wiki's LocalSettings.php
file.
- Making an edit (
edit
) - Voting (
vote
) - Commenting (
comment
) - Having your comment receive an upvote (
comment_plus
) - Having your comment receive a downvote (
comment_neg
) - Giving someone else's comment an upvote (
comment_give_plus
) - Giving someone else's comment a downvote (
comment_give_neg
) - Having someone else add you to their comment ignore list (
comment_ignored
) - Creating a blog post (
opinions_created
) - Referring another user to the wiki so that they sign up using your referral link (
referral_complete
) - Friending another user (
friend
) - Foeing another user (
foe
) - Receiving a gift (
gift_rec
- Sending out a gift (
gift_sent
) - Challenging someone or being challenged (
challenges
) - Winning a challenge (
challenges_won
) - Receiving a positive challenge rating (
challenges_rating_positive
) - Receiving a negative challenge rating (
challenges_rating_negative
) - Having the most points in a week (
points_winner_weekly
) - Having the most points in a month (
points_winner_monthly
) - Having the most points in total (
total_points
) - Uploading your first custom avatar image (
user_image
) - Creating a new picture game (
picturegame_created
) - Voting in an existing picture game (
picturegame_vote
) - Voting in a poll (
poll_vote
) - Answering a quiz question correctly (
quiz_correct
) - Answering a quiz question (
quiz_answered
) - Creating a new quiz (
quiz_created
) - Submitting a link (
links_submitted
) - Having a submitted link approved (
links_approved
)
Handing out points for edits made before SocialProfile was installed
editTo give users points for all the edits they made before the SocialProfile extension was installed, someone with the updatepoints
user right should visit the Special:UpdateEditCounts
page. There's also a maintenance script that will perform the update from the command line: UserStats/maintenance/updateUserStats.php
.
Weekly and monthly winners
editIt's possible to hand out a certain amount of points to users who have the most points in a week or in a month. However, this process cannot be fully automated just yet (see T212174) and it requires some manual interaction from a privileged user.
Assuming $wgUserStatsPointValues['points_winner_weekly']
and/or $wgUserStatsPointValues['points_winner_monthly']
are properly set in the wiki's LocalSettings.php
file, someone with the generatetopusersreport
user right needs to visit the Special:GenerateTopUsersReport
page.
Visiting this page allows the privileged user to generate the weekly or monthly point report; it will be a page in the project namespaces and the page name is controlled by the interface messages [[MediaWiki:User-stats-report-weekly-page-title]]
and [[MediaWiki:User-stats-report-monthly-page-title]]
. The report will list a certain amount of users who've gained the most points in the period specified, and the user ranking #1 will be marked as the "winner" and awarded the amount of points specified in $wgUserStatsPointValues['points_winner_weekly']
or $wgUserStatsPointValues['points_winner_monthly']
.