扩展:贡献得分

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

贡献分数扩展统计维基数据库中最高的用户贡献量。此扩展旨在用一个有趣的标准来衡量贡献者们到底做了多少贡献。

安裝

  • 下载文件,并将其放置在您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 it to true to disable the cache for the parser function and the inclusion of the 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,以验证已成功安装扩展。

贡献分数

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

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}}
过去7天中的15位最佳撰稿人,无工具链接
{{Special:ContributionScores/15/7/notools}}
过去3天中贡献最多的15人,不可排序,没有工具链接
{{Special:ContributionScores/15/3/nosort,notools}}

<span id="#cscore_Parser_Function_Examples">

#cscore解析器函数的示例

Tim Laqua的贡献分数

{{#cscore:Tim Laqua|score}}

Tim Laqua的编辑数

{{#cscore:Tim Laqua|changes}}

Tim Laqua编辑的页面数

{{#cscore:Tim Laqua|pages}}

參見