2015-03-18

Recover archive

New page

== Known Issues / Errors ==

=== Reset Users Scores ===

Is there anyway to reset the contribution scores?

=== 1.12.0 ===

I upgraded my wiki to 1.12.0, and noticed that after the update, all contribution scores (score / pages / edits) show the same number. In 1.11.1 it showed an individual number for each field, now they're all the same.

:Are you using version 1.7.1 of the extension? I just tested on the SVN trunk (1.13alpha) and it's working fine. [[User:Tim_Laqua|Tim Laqua]] <sup><small>[[User talk:Tim_Laqua|talk]]</small></sup> 17:06, 26 March 2008 (UTC)

::This works fine for me with 1.12.0. Thanks :) [[User:Patheticcockroach|Patheticcockroach]] 08:17, 11 April 2008 (UTC)

=== Doesn't work on MW 1.8.4 ===

I have installed this on 1.8.4 and get an empty SpecialPages page. Does anyone know why this is?

:It's only been tested down to MW 1.9.3 and only intended for use above 1.10.0 - Not sure what changed from 1.8.4-1.9.3. {{User:Tim_Laqua/Signature|02:43, 20 August 2007}}

=== (fixed) This extension does not work on portgresql database.===

The exception :

<pre>

A database error has occurred Query: SELECT user_id, user_name, COUNT(DISTINCT rev_page) AS page_count, COUNT(rev_id) AS rev_count, (COUNT(DISTINCT rev_page)+SQRT(COUNT(rev_id)-COUNT(DISTINCT rev_page))*2) AS wikiRank FROM mwuser userTable JOIN revision revTable ON (userTable.user_id=revTable.rev_user) WHERE rev_timestamp > '20070815000000' AND user_id NOT IN (SELECT ug_user FROM user_groups WHERE ug_group='bot') GROUP BY user_id, user_name ORDER BY wikiRank DESC LIMIT 50 Function: Error: 1 ERROR: invalid input syntax for type timestamp with time zone: "20070815000000"

Backtrace:

#0 /var/www/html/wiki/includes/Database.php(761): DatabasePostgres->reportQueryError('ERROR: invalid...', 1, 'SELECT user_id,...', '', false)

#1 /var/www/html/wiki/extensions/ContributionScores/ContributionScores_body.php(46): Database->query('SELECT user_id,...')

#2 /var/www/html/wiki/extensions/ContributionScores/ContributionScores_body.php(98): ContributionScores->genContributionScoreTable(NULL, NULL, 7, 50)

#3 /var/www/html/wiki/includes/SpecialPage.php(433): ContributionScores->execute(NULL)

#4 /var/www/html/wiki/includes/Wiki.php(196): SpecialPage::executePath(Object(Title))

#5 /var/www/html/wiki/includes/Wiki.php(45): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))

#6 /var/www/html/wiki/index.php(89): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))

#7 {main}

</pre>

:Lookin' in to it. I'll switch from literal to use dbr->timestamp() for compatibility. {{User:Tim_Laqua/Signature|20:35, 22 August 2007}}

::Fixed in r25071. {{User:Tim_Laqua/Signature|20:51, 22 August 2007}}<br>

::Thank you for your support but now i have a new error :

::But at the end of the error i have the stats

<div style="margin-left: 4em;">

<pre>

Notice: Undefined variable: sql in /var/www/html/wiki/extensions/ContributionScores/ContributionScores_body.php on line 97

Notice: Undefined property: stdClass::$wikiRank in /var/www/html/wiki/extensions/ContributionScores/ContributionScores_body.php on line 57

</pre>

</div>

:::Fixed $sql/line 97 error in r25086 - do you still get the line 57 error for wikiRank? I also changed the grouping f/ the SQL statement, maybe Postgres doesn't like the way that I did it the first time... (btw, thx for helping w/ this) {{User:Tim_Laqua/Signature|15:43, 23 August 2007}}

:::Ok the extension work perfectly with postgres. Thank you for your support

== Spanish translation ==

How can I translate this extension in Spanish?

I was trying to edit ContributionScores.i18n.php, but I can't translate it

<pre>

'es' => array(

'contributionscores' => 'Puntuaciones por contribuir',

'contributionscores-info' => "Las puntuaciones son calculadas siguiendo:\n".

"*1 punto por cada página única editada\n".

"*Raíz cuadrada de (Ediciones totales efectuadas) - (Páginas totales únicas) x 2\n".

"Las puntuaciones son calculadas de esta manera considerando la diversidad sobre el volumen de edición.".

"Básicamente, esta puntuación mide fundamentalmente las páginas únicas editadas, considerando que un alto ".

"volumen de edición supone que es un artículo de mayor calidad.",

'contributionscores-top' => '(Top $1)',

'contributionscores-days' => 'Últimos $1 días',

'contributionscores-allrevisions' => 'Estadísticas globales'

),

</pre>

What's the problem? :(

[[User:EmuAGR|EmuAGR]] 17:46, 2 September 2007 (UTC)

:I would imagine you're testing by changing your User Preferences language - it was using wfMsgForContent (which is based on the site language), I just changed it in r25412 to use wfMsg - it should work as you expect now. Note, I added the above translation to the i18n file. Thx for the translation. {{User:Tim_Laqua/Signature|19:17, 2 September 2007}}

::Thanks for everything, but it doesn't work yet. You can see it at www.wikimanga.net/wiki/index.php?title=Especial:ContributionScores [[User:EmuAGR|EmuAGR]] 19:45, 2 September 2007 (UTC)

:::Yeah, that doesn't look good at all. ;-) I switched all the accented spanish characters over to the <tt>&*acute;</tt> HTML codes and it works great now. Let me know if you're still having problems w/ the new i18n file - fixed in r25414. {{User:Tim_Laqua/Signature|21:03, 2 September 2007}}

::::My bad. I flipped my editor over to UTF-8. Works fine now. ;-) {{User:Tim_Laqua/Signature|21:50, 2 September 2007}}

=== New Spanish translation ===

Hi, I've translated a new Spanish version, here you have:

<pre>

/** Spanish (Español)

* @author EmuAGR

*/

$messages['es'] = array(

'contributionscores' => 'Puntuaciones por contribuir',

'contributionscores-desc' => 'Acude a la base de datos del wiki en busca de los [[Special:ContributionScores|usuarios que contribuyen más]]',

'contributionscores-info' => 'Las puntuaciones se calculan de la siguiente forma:

*Un (1) punto por cada página única editada

*Raíz cuadrada de (Ediciones totales efectuadas) - (Páginas totales únicas) x 2

Las puntuaciones calculadas de esta manera dan más importancia a la diversidad que al volumen de edición. Básicamente, esta puntuación mide fundamentalmente las páginas únicas editadas, considerando que un alto volumen de edición supone que es un artículo de mayor calidad.',

'contributionscores-top' => '(Top $1)',

'contributionscores-days' => 'Últimos $1 días',

'contributionscores-allrevisions' => 'Estadísticas globales',

'contributionscores-score' => 'Puntuación',

'contributionscores-pages' => 'Páginas',

'contributionscores-changes' => 'Cambios',

'contributionscores-username' => 'Nombre de usuario',

'contributionscores-invalidusername' => 'Nombre de usuario no válido',

'contributionscores-invalidmetric' => 'Métrica no válida',

);

</pre>

--[[User:EmuAGR|EmuAGR]] 12:52, 23 November 2008 (UTC)

== Excellent Extension ==

I installed this on my 1.9 wiki and it worked like a charm! Great job! --[[User:Vaccano|Vaccano]] 21:37, 24 October 2007 (UTC)

:: Same for me on MediaWiki 1.17. Thanks for the great job. --[[User:Pintman|Pintman]] 09:53, 18 August 2011 (UTC)

== Inclusion ==

If is that possible to be include in a template or something like that?. It could remplace de edicount extension. Or make a fusion of the two.--[[User:Add|Add]] 18:28, 17 December 2007 (UTC)

:Implemented the ability to include the page in '''r28646'''. See main article for instructions. I believe editcount is a parser function extension - it doesn't have much in common with this extension.

::Nice feature. I put it on [[betawiki:User:Siebrand]]. Would it be possible to strip the talk/contribs/block links from this somehow? In the way I am using it (and they way I assume more will use it, it is taking up more space that I would like to). Cheers! [[User:Siebrand|Siebrand]] 11:28, 19 December 2007 (UTC)

:::Sure. I'm also trying to optimize that query so it doesn't take 14 seconds to load the Special Page. ;-)

::::'''notools''' and '''nosort''' options implemented in '''r28669'''. See main article for usage. I also tried to optimize the SQL query - I got an 84% speed increase on a 32000 revision wiki. I'm interested to see what it does to the 7.716 second load time on Betawiki f/ the Special Page. [[User:Tim_Laqua|Tim Laqua]] <sup><small>[[User talk:Tim_Laqua|talk]]</small></sup> 15:51, 19 December 2007 (UTC)

== Tested 1.11.1 ==

Works on the latest, 1.11.1. Very easy to set up. Thanks a bunch, this was exactly what we were looking for. Link at<s> http://www.arcandio.com/wiki/index.php5?title=Special:ContributionScores </s>

:Note - example link above is now dead. Wiki appears to no longer exist. [[User:Tim_Laqua|Tim Laqua]] <sup><small>[[User talk:Tim_Laqua|talk]]</small></sup> 15:12, 27 March 2008 (UTC)

== Possible Enhancement? ==

I echo the sentiments above. Easy to set up and provides useful data. Thanks. We have only recently set up our wiki and wish to gauge its use. Whilst user contributions are very useful we also wish to establish the total number of views per user in a summary report such as this. None of the other available extensions seem to provide quite what is needed. Would it be possible to add a column with this information? --[[User:Phil Clark|Phil]] 09:50, 3 April 2008 (UTC)

:No, per-user view activity isn't recorded anywhere. You could take the total number of views and get an 'average' - but you couldn't determine 'who' had more views. An extension could be created to maintain that data. Feel free to post it in [[Extension Requests]]. [[User:Tim_Laqua|Tim Laqua]] <sup><small>[[User talk:Tim_Laqua|talk]]</small></sup> 02:27, 4 April 2008 (UTC)

== ignore blocked users ==

There's an option <code>$contribScoreIgnoreBots</code> to ignore bots, but is it possible to '''ignore blocked users'''? I want to have

Contribution Scores table with only active users. gr [[User:Jerone|Jerone]] 09:36, 17 April 2008 (UTC)

:Implemented in v1.9, r33496. Use '''<tt>$wgContribScoreIgnoreBlockedUsers = true;</tt>''' [[User:Tim_Laqua|Tim Laqua]] <sup><small>[[User talk:Tim_Laqua|talk]]</small></sup> 17:37, 17 April 2008 (UTC)

:: Thank you ||[[User:Jerone|Jerone]] 20:49, 17 April 2008 (UTC)

==User Score as Variable?==

Could you tell how to make the score of a user a Variable for [[Extension:Variables]]? I want to crete a user template the gives out the score of a user or at last the number of edits. Thanks! --[[User:Subfader|Subfader]] 20:18, 14 May 2008 (UTC)

:Hmm... I have write a static function to give you that info - So you want it to throw the score of the currently logged in user? Or you want like a parser function? A parser function would allow you to display the score for a given user (which I assume is what you would want to do on a user page template). [[User:Tim_Laqua|Tim Laqua]] <sup><small>[[User talk:Tim_Laqua|talk]]</small></sup> 22:00, 14 May 2008 (UTC)

::Yep as parser function would be ace for the user on whose page the parser is included (via template), not the logged in user (he can check his on his user page :). Would be good to make 3 parser funcs score, changes, pages. Btw: If this parser works I won't need Extension:EditCount which has [[Extension_talk:EditCount#Inconsistance|Inconsistances]] in the total edit# compared to yours (which I simply assume is the correct one). --[[User:Subfader|Subfader]] 09:00, 15 May 2008 (UTC)

:::k, I'll try to find some time over the weekend to throw those together. [[User:Tim_Laqua|Tim Laqua]] <sup><small>[[User talk:Tim_Laqua|talk]]</small></sup> 10:40, 15 May 2008 (UTC)

::::Biggup! ;) --[[User:Subfader|Subfader]]

:::::Implemented in r34903, v1.10 - all #cscore metrics are based on *all* revisions. I also added in <tt>$wgContribScoreDisableCache</tt> so you can have the metrics display realtime. Just set it to <tt>true</tt></tt> [[User:Tim_Laqua|Tim Laqua]] <sup><small>[[User talk:Tim_Laqua|talk]]</small></sup> 02:03, 16 May 2008 (UTC)

::::::Awesome! Smooth like a baby. Thanks for the fast coding :) --[[User:Subfader|Subfader]] 07:19, 16 May 2008 (UTC)

<br/><br/>

--[[Special:Contributions/207.96.208.130|207.96.208.130]] 21:28, 21 August 2008 (UTC)<br/>

In a template, expression '''<nowiki>{{ #expr: {{#cscore:Username|score}}>10 |FALSE| TRUE }}</nowiki>''' does not work, when in fact <nowiki>{{#cscore:Username|score}} == 63</nowiki> . <br/>Getting: Expression error: Unrecognised punctuation character "�" . This is also true if i pass the result via <nowiki>{{{1}}}</nowiki><br/>Any ideas?...

Thanks for the help!

:Guess it's the first | in <nowiki>#cscore:Username|score</nowiki> which is used in #expr? Try replacing the | with <nowiki>{{!}}</nowiki> so it's <nowiki>{{ #expr: {{#cscore:Username{{!}}score}}>10 |FALSE| TRUE }}</nowiki> while [[Template:!]] in your wiki should read |. --[[User:Subfader|Subfader]] 16:01, 23 August 2008 (UTC)

::Thanks for the reply, unfortunatly I'm still getting the same result. Both {{#ifexpr:<nowiki>{{#cscore:Username{{!}}score}}>10|FALSE|TRUE}}</nowiki> and <nowiki>{{#ifexpr:{{#cscore:Username}}>10|FALSE|TRUE}}</nowiki> return: Expression error: Unrecognised punctuation character "�". <br/> Let me know if you see anything else, thanks! --[[Special:Contributions/207.96.208.130|207.96.208.130]] 17:07, 25 August 2008 (UTC)

::: SOLUTION, replace

return $parser->insertStripItem($output, $parser->mStripState);

:::by

return $output;

:::please advise if you see anything wrong with doing this. thx --[[Special:Contributions/207.96.208.130|207.96.208.130]] 21:10, 3 June 2009 (UTC)

==Examples==

You can add my site as example if you like.

*[http://mixesdb.com/db/index.php/MixesDB:ContributionScores Inclusion/Transclusion] with disabled $title in _body.php

*[http://mixesdb.com/db/index.php/User:MDB #cscore Parser Function] used as "user stats" --[[User:Subfader|Subfader]] 09:44, 16 May 2008 (UTC)

== Edits vs "Changes" ==

I just noticed that my number of total changes is higher than the number of total edits on Special:Preferences. What causes it? Does edits exclude actions "changes" considers? Will take it off Special:Preferences anyway. --[[User:Subfader|Subfader]] 15:25, 21 May 2008 (UTC)

:Well - "edits" is from user.user_editcount - it's a counter that get incremented every time a user edits a page. "changes" is a count of the revisions in the database that belong to a particular user ID. Which is more accurate? Dunno. I'd say "changes" is the real number. I would imagine there are reasons that user_editcount wouldn't be incremented (I'm not real familiar with when/why that counter gets incremented/decremented). One is a counter, the other is a result of a query - that's why I never called it an edit count - it's either "revisions" or "changes" from my perspective. [[User:Tim_Laqua|Tim Laqua]] <sup><small>[[User talk:Tim_Laqua|talk]]</small></sup> 10:27, 23 May 2008 (UTC)

== MySQL 4.0.24 Compability ==

After installation it keeps showing error "1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT rev_user, COUNT(DISTINCT rev_ (localhost)". I'm using ContributionScores-MW1.12-r31252 with MySQL 4.0.24. Any ideas would be great since I didn't find anything in the MySQL documentation. Cheers, --[[User:Till Kraemer|Till Kraemer]] 22:22, 2 August 2008 (UTC)

== Time Period Enhancement ==

This is a brilliant extension ( I can't thank you enough ). I'd love the option to have a drop down list of months with the year (ie. Jan 2008, Feb 2008, etc) to pull historical reporting on contribution scores...Is that really easy of much harder then I think? Doug [[Special:Contributions/38.117.240.100|38.117.240.100]] 23:34, 7 August 2008 (UTC)

:OK...I just figured out a way to do it ( sorry for complaining ) but it's so dumb thing with SQL involving this: (PS this involves altering the file ContributionScores_body.php and the code is found around line 49)

<div style="margin-left: 2em;">

<pre>

if ( $days > 0 && $days < 200601 ) {

$date = time() - (60*60*24*$days);

$dateString = $dbr->timestamp($date);

$sqlWhere .= " {$nextPrefix} rev_timestamp > '$dateString'";

$nextPrefix = "AND";

}

if ( $days == 200801 ) {

$sqlWhere .= " {$nextPrefix} rev_timestamp";

$sqlWhere .= " BETWEEN '20080101000000' AND '20080131235959'";

$nextPrefix = "AND";

}

</pre>

</div>

:'''PREFACE:This is a horrible way to do it (since I don't really know SQL)'''

:If the user types in:

<div style="margin-left: 2em;">

<pre>

{{Special:ContributionScores/10/200801}}

</pre>

</div>

:Instead of getting the intended 200,801 days go, they will get all user contributions between the timestamps of 01/01/2008 00:00:00 to 01/31/2008 11:59:59 (essentially all of Jan 2008). Why? the SQL statement “BETWEEN '20080101000000' AND '20080131235959'” will only look for activity during that time period...I'm in the process of making it so the extension will throw in the correct title of "January 2008" instead of defaulting to the day count of 200,801 (since it will look cooler)...If anyone wants to pick up the ball and do it the right way, be my guest (but I hope this helps out)!—[[User:Sanbitter|Sanbitter]] 01:25, 8 August 2008 (UTC)

== MW 1.13? ==

When I try to open a User Page using an apostrophe from whatever page I get this error:

"Fatal error: Call to a member function getID() on a non-object in .../extensions/ContributionScores/ContributionScores.php on line 80"

which is <pre>if ($user->getID() != 0) {</pre>

--[[User:Subfader|Subfader]] 17:26, 26 August 2008 (UTC)

*Installed on 1.13 without issue, using the standard installation documentation. [[User:CaliVW78|CaliVW78]] 09:16, 29 July 2009 (UTC)

== Modification to show most active users this month ==

In file ContributionScores_body.php, line 182, after this:

if ( is_null( $days ) || $days < 0 )

$days = 7;

Add this:

if ( $days=='m' )

$days = date('j');

In this case, if you call with {{Special:ContributionScores/50/m}}, m will be replaced with the current day of the month, so you will get a table of most active users this month.

== Option To Specify Columns? ==

This looks like a great extension. I haven't tried it in my own wiki yet, but I've played with it in the sandbox of another wiki that has it. I would like to be able to specify which columns are shown in the output, though, because my users are only interested in the final score, not pages or changes. Could you make options for that?

I thought that if no column options were given, then the display would be as it is now. If options for one or more of the three numeric columns is given, those columns and the name column would be shown. The name column would always be shown. The options could be named <code>scorecolumn</code>, <code>pagescolumn</code>, and <code>changescolumn</code>. To get a able of the top 20 scores in a wiki, but not show pages or changes, one could use:

<source lang="text">

{{Special:ContributionScores/15/7/scorecolumn}}

</source>

Also, is there a way to specify options without specifying a number of days, the "7" in this example?

--[[User:Lsloan|Lance E Sloan]] 20:18, 6 March 2009 (UTC)

== odd class in MW 1.14 ==

I think the .contributionscores.odd {} is broken in MW 1.14. --[[User:Subfader|Subfader]] 23:07, 26 March 2009 (UTC)

== Disable score definition? ==

I don't think the score definition is fair. E.g. I have 54470 changes on 33365 pages - score: 33656. Is it possible to use a plain average instead? --[[User:Subfader|Subfader]] 11:44, 4 June 2009 (UTC)

:Another odd one: 5 changes on 3 pages = score 6 huh? --[[User:Subfader|Subfader]] 00:31, 9 June 2009 (UTC)

== Mediawiki 1.15 ==

Has anyone got this to work on mediawiki 1.15?--[[User:Bluesoju|Bluesoju]] 02:32, 3 July 2009 (UTC)

:Incase anyone else is wondering, it works --[[User:Bluesoju|Bluesoju]] 05:25, 14 July 2009 (UTC)

== List of "User --- Pages" ==

Thanks for the great extension. Would it be possible to alter the extension to show a table of:

<pre>

User Pages edited Date of last edit

---- ------------ -----------------

Jonathan dfjsdflskjf 1/2/08

sdkfljsfljsdfslkj 1/5/09

sdflkjdflsfj 1/1/09

Andrew sdsdflkjsdfljk 5/4/02

sdflkjsflksjf 5/5/09

(etc)

</pre>

My wiki is quite small so I wouldn't be worried if it involved a lot of SQL queries!

Also, would it be possible to ignore a particular editor (me) who has done nearly all the pages?

Many thanks [[User:Jonathan3|Jonathan3]] 18:09, 31 August 2009 (UTC)

== Namespace Filtering ==

This is a nice extension that has motivated my users to contribute. Unfortunately the scores are bloated by image uploads which each count as a page. Could you please add an option to limit or include only certain namespaces, for example '''Main''' only, or excluding '''File''' namespace. I think this would be an easy addition to the SQL as the field is in the page table.

== Wonderful Extension ==

Really like it a lot. Had a quick look at the mysql database and came up with two potentially useful/interesting additions that could be made rather easily:

* Number of new Pages created (while in populating your wiki stage could be boosted in the score calculation)

select count(*) from revision where user_id=x and rev_parent_id=0;

* Total number of characters added (pseudo_code)

Sum_all-revisions-of-user-X( (rev_len(current revision) - rev_len(parent revision) )

In addition I'd think it would be neat if the formula for the Contribution Score could include those values and be changed in either LocalSettings.php or via a Special:ContributionScoreFormula page. Scores really get people hooked and changing the formula helps steer users in the direction you want the wiki to take.

=== code changes to add new metric "Pages created" ===

Had a little programming fun and implemented the new metric Page Creations (for MW 1.13). Only new pages created with a minimum of 256Bytes will count,

in order to avoid having Users try to boost their score by creating lots of empty pages. As well file uploads are logged as 0 length new page creations.

I'd rather not have those count either.

''Note: I use a different formula than the one that was precoded. I'm not much of a sql wizard. And never used php before. So be weary of this code ;-)''

ContributionScores.php: these changes will add a new metric <nowiki>{{#cscore:Rst|pagecreations}}</nowiki> and change how the score metric is calculated.

if ($metric=='score') {

$res = $dbr->select('revision',

'COUNT(DISTINCT rev_page)+(COUNT(rev_id)-COUNT(DISTINCT rev_page))/2 AS wiki_rank',

array('rev_user' => $user->getID()));

$row = $dbr->fetchObject($res);

$wiki_rank = $row->wiki_rank;

$userid = $user->getID();

$res = $dbr->query("SELECT COUNT(rev_id) AS pagecreation_count FROM revision WHERE rev_parent_id=0 AND rev_len>256 AND rev_user={$userid}");

$row = $dbr->fetchObject($res);

$wiki_rank = $wiki_rank + $row->pagecreation_count/2;

$output = round($wiki_rank,0);

} elseif ($metric=='pagecreations') {

$userid = $user->getID();

$res = $dbr->query("SELECT COUNT(rev_id) AS pagecreation_count FROM revision WHERE rev_parent_id=0 AND rev_len>256 AND rev_user={$userid}");

$row = $dbr->fetchObject($res);

$output = $row->pagecreation_count;

}

ContributionScores_body.php: these changes will add new column Pages Created to the Lists:

<pre>

$sqlMostNewPages = "SELECT rev_user,

COUNT(DISTINCT rev_page) AS newpage_count

FROM {$revTable}

{$sqlWhere} AND rev_parent_id=0 AND rev_len > 256

GROUP BY rev_user

ORDER BY newpage_count DESC

LIMIT {$limit}";

$sqltmp = "SELECT user_id, " .

"user_name, " .

"page_count, " .

"rev_count " .

"FROM $userTable u JOIN (($sqlMostPages) UNION ($sqlMostRevs)) s ON (user_id=rev_user) " .

"LIMIT $limit";

$sql = "SELECT res1.user_id, " .

"res1.user_name, " .

"res1.page_count, " .

"res2.newpage_count, " .

"res1.rev_count, " .

"res1.page_count+(res1.rev_count-res1.page_count)/2 + res2.newpage_count/2 AS wiki_rank " .

"FROM ( ($sqltmp) as res1, ($sqlMostNewPages) as res2 ) " .

"WHERE res1.user_id=res2.rev_user ORDER BY wiki_rank DESC " .

"LIMIT $limit";

$output = "<table class=\"wikitable contributionscores plainlinks{$sortable}\" >\n".

"<tr class='header'>\n".

"<td>" . wfMsgHtml( 'contributionscores-score' ) . "</td>\n" .

"<td>" . wfMsgHtml( 'contributionscores-pages' ) . "</td>\n" .

"<td>" . wfMsgHtml( 'contributionscores-changes' ) . "</td>\n" .

"<td>" . wfMsgHtml( 'contributionscores-newpages' ) . "</td>\n" .

"<td>" . wfMsgHtml( 'contributionscores-username' ) . "</td>\n";

$output .= "</tr><tr class='{$altrow}'>\n<td class='content'>" .

round($row->wiki_rank,0) . "\n</td><td class='content'>" .

$row->page_count . "\n</td><td class='content'>" .

$row->rev_count . "\n</td><td class='content'>" .

$row->newpage_count . "\n</td><td class='content'>" .

$skin->userLink( $row->user_id, $row->user_name );

</pre>

ContributionScores.i18n.php: only showing en changes:

<pre>

$messages['en'] = array(

'contributionscores' => 'Contribution scores',

'contributionscores-desc' => 'Polls the wiki database for highest [[Special:ContributionScores|user contribution volume]]',

'contributionscores-info' => "Scores are calculated as follows:

*One (1) point for each unique page edited

*(total edits made - total unique pages) / 2

*Half a point for each newly created Page with content

Scores calculated in this manner weight edit diversity over edit volume.

Basically, this score measures primarily unique pages edited, with consideration for high edit volume - assumed to be a higher quality page.",

'contributionscores-top' => '(Top $1)',

'contributionscores-days' => 'Last $1 days',

'contributionscores-allrevisions' => 'All revisions',

'contributionscores-score' => 'Score',

'contributionscores-pages' => 'Pages',

'contributionscores-changes' => 'Changes',

'contributionscores-newpages' => 'Page creations',

'contributionscores-username' => 'Username',

'contributionscores-invalidusername' => 'Invalid username',

'contributionscores-invalidmetric' => 'Invalid metric',

);

</pre>

==Show real name or e-mail instead of username?==

Hi! I would like to use this extension on our company wiki because it seems great, but unfortunately our usernames must corespond to our user-ID so our toplist would look something like...

:*AA1984

:*AB8373

:*BA8308

:* etc...

This would make it impossible to know who has contributed and I believe the point with the extension would be lost. =/ <br>Is there a possibility to use the column "real name" or "e-mail" instead of username? Thanks! --[[User:P.Nilsson|P.Nilsson]] 08:52, 23 February 2010 (UTC)

== Return formatted numbers ==

The extension should return formatted numbers, i.e. 12,365 instead of 12365. It's an easy fix:<br>

* replace <code>$row->page_count</code> with <code>number_format($row->page_count)</code> (4 times for "pages" and "changes")

* replace <code>round($row->wiki_rank,0)</code> with <code>number_format(round($row->wiki_rank,0))</code> (2 times for "score")

in ContributionScores.php and ContributionScores_body.php --[[User:Subfader|Subfader]] 13:15, 26 February 2010 (UTC)

== Correction of table ==

The cells inside the tr tag should be th's, not td's:

<pre>

$output = "<table class=\"wikitable contributionscores plainlinks{$sortable}\" >\n".

"<tr class='header'>\n".

"<th>" . wfMsgHtml( 'contributionscores-score' ) . "</th>\n" .

"<th>" . wfMsgHtml( 'contributionscores-pages' ) . "</th>\n" .

"<th>" . wfMsgHtml( 'contributionscores-changes' ) . "</th>\n" .

"<th>" . wfMsgHtml( 'contributionscores-username' ) . "</th>\n";

</pre> --[[User:Subfader|Subfader]] 18:43, 5 June 2011 (UTC)

== Excluding persons from contribution scores ==

Is it possible to exclude persons/groups etc from the list? I read on mixed db's wiki that the bots have been excluded but how? Thomas [[Special:Contributions/84.243.24.18|84.243.24.18]] 12:07, 10 June 2011 (UTC)

== formatNum ==

You forgot <code>$wgLang->formatNum();</code>. --[[User:Subfader|Subfader]] 03:29, 13 June 2011 (UTC)

== Unrecognised punctuation character ==

<pre>* {{PLURAL:{{#cscore:SomeUser|changes}}|change|changes}} (should return "change" if user has 1 edit)

* {{#ifeq:{{#cscore:SomeUser|changes}}|1|change|changes}} (should return "change" if user has 1 edit)

* {{#ifexpr: {{#cscore:SomeUser|changes}} > 2 | 2+ | 0 or 1 }}</pre>

The output of #cscore cannot be used for further parsing. --[[User:Subfader|Subfader]] 19:04, 1 July 2011 (UTC)

== Does not work with SQLite ==

When using the extension with the SQLite database backend i get an SQL error.

„1: near "UNION": syntax error“.

Maybe SQLite is not aware of union statements? --[[User:Pintman|Pintman]] 11:54, 18 August 2011 (UTC)

== User Scores by Group ==

Would it be possible to display scores of certain groups only (say Administrators)? My wiki currently has many different groups and it would be great to be able to display the top scores of each group. Nicholas --[[Special:Contributions/64.126.15.20|64.126.15.20]] 20:56, 23 August 2011 (UTC)

== MW 1.18 / Contribution Scores ==

There appears to be no errors, however the extension never updates after edits.

Show more