扩展:贡献得分

From mediawiki.org
This page is a translated version of the page Extension:Contribution Scores and the translation is 92% complete.
MediaWiki扩展手册
Contribution Scores
发行状态: 稳定版
实现 用户活动 , 特殊页面 , 解析器函数
描述 统计维基数据库中最高的用户贡献量。
作者 Tim Laqua留言
最新版本 1.26.0 (2021-02-08)
MediaWiki 1.33+
数据库更改
许可协议 GNU通用公眾授權條款2.0或更新版本
下載
log
示例
$wgContribScoreIgnoreBots, $wgContribScoreIgnoreBlockedUsers, $wgContribScoreIgnoreUsernames, $wgContribScoresUseRealName, $wgContribScoreDisableCache, $wgContribScoreReports
前往translatewiki.net翻譯Contribution Scores扩展
問題 开启的任务 · 报告错误

贡献分数扩展统计维基数据库中最高的用户贡献量。它在诸如tranlatewiki.net这样的高度使用的维基上一样可以稳定工作。此扩展旨在用一个有趣的标准来衡量贡献者们到底做了多少贡献。

分数的计算方法是 编辑页面数 + 2 * (编辑数 - 编辑页面数)的平方根。

安裝

  • 下载文件,并将其放置在您extensions/文件夹中的ContributionScores目录内。
    开发者和代码贡献人员应从Git安装扩展,输入:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ContributionScores
  • 将下列代码放置在您的LocalSettings.php 的底部:
    wfLoadExtension( 'ContributionScores' );
    // Exclude Bots from the reporting - Can be omitted.
    $wgContribScoreIgnoreBots = true; 
    // Exclude Blocked Users from the reporting - Can be omitted.
    $wgContribScoreIgnoreBlockedUsers = true;
    // Exclude specific usernames from the reporting - Can be omitted.
    $wgContribScoreIgnoreUsernames = [];
    // Use real user names when available - Can be omitted. Only for MediaWiki 1.19 and later.
    $wgContribScoresUseRealName = true;
    // Set to true to disable cache for parser function and inclusion of table.
    $wgContribScoreDisableCache = false;
    // Use the total edit count to compute the Contribution score.
    $wgContribScoreUseRoughEditCount = false;   
    // Each array defines a report - 7,50 is "past 7 days" and "LIMIT 50" - Can be omitted.
    $wgContribScoreReports = [
        [ 7, 50 ],
        [ 30, 50 ],
        [ 0, 50 ]
    ];
    
  • Yes 完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。

致使用MediaWiki 1.35或更早版本的用户:

上面的说明介绍的是安装此扩展的新方法,它使用wfLoadExtension()。 如果您需要在早期版本(MediaWiki 1.35和更早版本)中安装此扩展,而不是wfLoadExtension( 'ContributionScores' );,您需要使用:

require_once "$IP/extensions/ContributionScores/ContributionScores.php";

贡献分数

贡献分数使用下列SQL公式计算得出:

page_count+SQRT(rev_count-page_count)*2

自定义

界面

默认使用下列CSS类型,但它们不是被定义的。你可以在你的"MediaWiki:Common.css"里定义它们:

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

在侧边栏加上一个链接

添加下面一行到MediaWiki:Sidebar

** Special:Contributionscores|contributionscores

用法

特殊页面

你将会有一个标题为“贡献得分”的特殊页面。

引用/嵌入

你可以使用下面的维基代码来在其他页面引用这个特殊页面:

{{Special:ContributionScores/<limit>/<days>/<options>}}
过往5天的前10名贡献者
{{Special:ContributionScores/10/5}}
从wiki建成起的前10名贡献者
{{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}}

#cscore 解析器函数的示例

Tim Laqua的贡献分数

{{#cscore:Tim Laqua|score}}

Tim Laqua的编辑数

{{#cscore:Tim Laqua|changes}}

Tim Laqua编辑的页面数

{{#cscore:Tim Laqua|pages}}

參見