Extension talk:ContributionCredits/Archive

Not working on site with FCK Editor installed
I just installed this extension on a site I am developing that uses MediaWiki 1.13 and the FCK Editor extension (a WYIWYG text editor). Nothing broke when I installed the ContributionCredits extension, but it isn't adding the credits to any pages.

Any ideas?
 * Well I have it installed in a wiki with FCK and it works fine... May be an error of copy-paste... you can see it on the front page of http://wiki.mangas-tv.com.

I use to put an incremential criteria to remove the "s" if there's only one contributor in the while loop... Kronoxt 03:42, 7 April 2009 (UTC)

First User don't display in the List
array("rev_page = $page_id","rev_user > 1"), must change to     array("rev_page = $page_id","rev_user > 0"), --84.173.67.53 15:49, 7 April 2009 (UTC)

PHP end tag

 * I'm not sure if the code required ?> . --Manop 02:45, 1 June 2009 (UTC)
 * 148.177.1.218 18:17, 18 July 2012 (UTC): I don't think it is included in many extensions.

bug report
when I install ContributionCredits ,  http://en.wikicaptions.org/wiki/Extensions:Discussion:Installation   don't display.

thanks.

Custom header isn't working
I am using WM1.15, and when I have no setting for $wgContributionCreditsHeader, it works properly (the header says "Contributors" with a L2 heading).

However, when I try to change it (see below), I end up with: ==Contributors to this page== instead of the L2 heading!

Any ideas about what I am doing wrong? -- Phantom Steve /talk &#124;contribs \ 10:10, 17 June 2010 (UTC)


 * Try adding \n like so:




 * --A2E 05:08, 13 May 2011 (UTC)

Contributors vs ContributionCredits
Can anyone explain the difference between these two extensions?

We are trying to something very simple (like the first line on this page: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/vtkDistanceWidget )

that simply shows (without users having to go specifically looking for the information) which people have been involved with the creation and maintenance of the page.

Thanks,

David

visual fix
In my wiki, which uses lots of fancy layout, this broke the pages in some places. Replacing the last text assignement this this:

fixed it. This clears floats that you may have used in the page above, and makes sure that the contributors block is really at the bottom of the page.

Custom namespaces
Does this extension work in custom namespaces?
 * 148.177.1.218 17:36, 28 June 2012 (UTC): Maybe if you update the snippet below:
 * 64.134.70.217 01:20, 5 August 2012 (UTC): I've implemented this and it works nicely. I have one custom namespace at 500 and 501 (talk) and I simply extended this conditional to include anything larger than 500.  My assumption is that this won't break any other extensions that might, by chance, use a namespace ID of 500 or greater.
 * 64.134.70.217 01:20, 5 August 2012 (UTC): I've implemented this and it works nicely. I have one custom namespace at 500 and 501 (talk) and I simply extended this conditional to include anything larger than 500.  My assumption is that this won't break any other extensions that might, by chance, use a namespace ID of 500 or greater.

real user name
how to display real user name set in preferences instead of login nickname?

Signature as Contributor Name
We made some Changes to this extension to use the users signature instead of the username. So you can configure what to show on the contributors list in you preferences, for example your real name. Here is the new code: you can enable/diable the signature with A preview is shown on my wiki --212.21.161.88 12:26, 8 May 2012 (UTC)


 * There is an updated version 2.3 (2012/05/09) available. Cheers --&#91;&#91;kgh&#93;&#93; (talk) 14:17, 2 May 2013 (UTC)

Add code between page content and contribution credits
In my skin it seems the contribution credits are outputted with $this->html('bodytext') as part of the main page content. I would like to insert code for a comment section between the page content and the credits. What code can I use to call the credit section separately after the comments code? LTech 23.07.2012

How to sort list of users by number of edits?
I would like to sort the list of users by number of edits.

Does anyone know how to do that? I'm not familiar with SQL yet...

Thanks for any help!

--Stefahn (talk) 22:28, 22 March 2013 (UTC)


 * Just for the record: I ended up using Extension:Contributors (tweaking it with some hacks). Stefahn (talk) 15:12, 2 May 2013 (UTC)

Contributor Name and Percentage Score
Very usefull extension, thank you very much. I have done a little upgrade to show a bland percentage score after each page contributors. A score is calculated using square root of characters added or removed plus number of revisions done by the contributor, then this score is normalized to 100. You can see an example on http://www.scrimipedia.it. --Ale Bat (talk) 10:34, 13 August 2013 (UTC) Here is the code if anyone would try it: <?php /** * Contribution Credits extension - Adds contribution credits to the footer * @version 2.0 - 2010/04/30 * * 2013/08/13 added percentage score by Alessandro Battistini * * @link http://www.mediawiki.org/wiki/Extension:Contribution_Credits Documentation * * @file ContributionCredits.php * @ingroup Extensions * @package MediaWiki * @author Jaime Prilusky * @author Al Maghi * @copyright © 2008 Jaime Prilusky * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ if( !defined( 'MEDIAWIKI' ) ) { echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); die( 1 ); } define ('CONTRIBUTIONCREDITS_VERSION','2.0'); $wgHooks['OutputPageBeforeHTML'][] = 'addFooter'; $wgExtensionCredits['other'][] = array(       'name' => 'Contribution Credits',        'version' => CONTRIBUTIONCREDITS_VERSION,        'author' => array( 'Jaime Prilusky', 'Al Maghi' ),        'description' => 'Adds contribution credits to the footer with percentage score',        'url' => 'https://www.mediawiki.org/wiki/Extension:Contribution_Credits'        ); function addFooter (&$articleTitle, &$text) { global $wgTitle,$wgOut,$wgRequest; global $wgContributionCreditsHeader; $NS = $wgTitle->getNamespace; $action = $wgRequest->getVal('action'); if (($NS==0 or $NS==1) and ($action != 'edit')) { $dbr =& wfGetDB( DB_SLAVE ); $page_id = $wgTitle->getArticleID; $struserstat= ''; $res = $dbr->select(     'revision',      array('rev_user_text', 'rev_len', 'rev_minor_edit', 'rev_deleted'),      array("rev_page = $page_id","rev_user >= 1"),      __METHOD__,      array('ORDER BY' => 'rev_id ASC',));

$stat=array; if( $res && $dbr->numRows( $res ) > 0 ) { $lastuser=""; $lastnchars=-1; while( $row = $dbr->fetchObject( $res ) ) { $deletedUser = preg_match("/ZDelete/",$row->rev_user_text); # deleted users are renamed as ZDelete#### if (!$deletedUser) { $user=$row->rev_user_text; $nchars=$row->rev_len; $minor=$row->rev_minor_edit; $deleted=$row->rev_deleted; if(($deleted)!=0) continue; if(array_key_exists ( $user, $stat )==false){ $stat[$user]=array; $stat[$user]['revisions']=0; $stat[$user]['nchars']=0; }           $stat[$user]['nchars']+=1; if($lastuser<>"" && $lastnchars>0){ $deltachars=$nchars-$lastnchars; }           else{ $deltachars=$nchars; }           $stat[$user]['nchars']+=abs($deltachars); //echo $user.":".$deltachars." "; $lastuser=$user; $lastnchars=$nchars; }     }    }    //     $dbr->freeResult( $res ); //print_r($stat); $scoreTot=0; foreach($stat as $k => $v){ $score=sqrt(abs($v['nchars']))+$v['revisions']; $stat[$k]['score']=$score; $scoreTot+=$score; }

$dataarray=array; foreach($stat as $k => $v){ $score=($v['score']/$scoreTot)*100; $dataarray[]=''.$k.' ('.sprintf("%01.1f", $score).'%)'; }   $dataarray=array_reverse($dataarray); $struserstat= implode ( ", ", $dataarray ); $contributorsBlock = ''; if (!empty($struserstat)) { if (!$wgContributionCreditsHeader) {$wgContributionCreditsHeader = "==Contributors==\n";} $contributorsBlock = $wgOut->parse("\n" . $wgContributionCreditsHeader . $struserstat); }   $text = $text."\n$contributorsBlock "; }  return false; } ?>