Extension:Contribution Scores

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
Contribution Scores

Release status: stable

ContributionScores.png
Implementation User activity, Special page, Parser function
Description Polls wiki database for highest user contribution volume.
Author(s) Tim Laquatalk
Latest version 1.17.0 (2014-03-27)
MediaWiki 1.18+
Database changes No
License No license specified
Download
log
Example mixesdb.com,
translatewiki.net
Parameters

$wgContribScoreIgnoreBots, $wgContribScoreIgnoreBlockedUsers, $wgContribScoresUseRealName, $wgContribScoreDisableCache, $wgContribScoreReports

Hooks used
ParserFirstCallInit

User

Translate the Contribution Scores extension if it is available at translatewiki.net

Check usage and version matrix; code metrics
Bugs: list open list all report

The Contribution Scores extension polls the wiki database to locate contributors with the highest contribution volume – it is also in stable use on a high-volume wiki such as translatewiki.net. The extension is intended to add a fun metric for contributors to see how much they are helping out.

The score is defined as (number of unique pages edited) + 2 * square root ((number of edits) - (number of unique pages edited)).

Installation[edit | edit source]

  1. Download the files from SVN or download a snapshot (select your version of MediaWiki) and place the files under $IP/extensions/ContributionScores
  2. Add to the end of LocalSettings.php:
    require_once("$IP/extensions/ContributionScores/ContributionScores.php");
    $wgContribScoreIgnoreBots = true;          // Exclude Bots from the reporting - Can be omitted.
    $wgContribScoreIgnoreBlockedUsers = true;  // Exclude Blocked Users from the reporting - Can be omitted.
    $wgContribScoresUseRealName = true;        // Use real user names when available - Can be omitted. Only for MediaWiki 1.19 and later.
    $wgContribScoreDisableCache = false;       // Set to true to disable cache for parser function and inclusion of table.

    //Each array defines a report - 7,50 is "past 7 days" and "LIMIT 50" - Can be omitted.
    $wgContribScoreReports = array(
        array(7,50),
        array(30,50),
        array(0,50));
  3. Installation can now be verified through Special:Version on your wiki

Usage[edit | edit source]

Special Page[edit | edit source]

You will have a new Special Page titled "Contribution Scores"

Inclusion/Transclusion[edit | edit source]

You can include this special page in to other pages using the following wikitext:

{{Special:ContributionScores/<limit>/<days>/<options>}}
 
# 10 top contributors from the last 5 days
{{Special:ContributionScores/10/5}}
 
# 10 top contributors since the beginning of wiki
{{Special:ContributionScores/10/all}}
 
# 15 top contributors from the last 7 days, no tool links
{{Special:ContributionScores/15/7/notools}}
 
# 15 top contributors from the last 3 days, not sortable and no tool links
{{Special:ContributionScores/15/3/nosort,notools}}

Appearance Customization[edit | edit source]

The following CSS classes are used, but NOT defined - you can define them in your MediaWiki:Common.css article:

.contributionscores-wrapper       {  }
.contributionscores-title         { background-color: #aaaaaa; margin-bottom: 0px; padding-left: .4em; }
.contributionscores .header { background-color: #cccccc; border-bottom: 1px solid #999999; font-weight: bold; }
.contributionscores .odd        { background-color: #eeeeee; }
.contributionscores .header td   { padding-left: .2em; padding-right: .2em; }
.contributionscores .content   { padding-left: .2em; padding-right: .2em; }

#cscore Parser Function Examples[edit | edit source]

Contribution Score for Tim Laqua

{{#cscore:Tim Laqua|score}}

Changes Made for Tim Laqua

{{#cscore:Tim Laqua|changes}}

Unique Pages Edited for Tim Laqua

{{#cscore:Tim Laqua|pages}}

Adding a link to in the sidebar[edit | edit source]

Edit MediaWiki:Sidebar and add the line

** Special:Contributionscores|contributionscores

See also[edit | edit source]