I wanted something similar - a list of people ranked according to the number of records they had contributed. In case it is useful for someone else, this is how I did it:
1. Make a block with the following code in the block body, and the block text format set to php code:
<?php
iform_load_helpers(array('report_helper'));
global $auth;
if (!isset($auth))
$auth = report_helper::get_read_auth(variable_get('indicia_website_id',''), variable_get('indicia_password',''));
echo report_helper::report_grid(array(
'readAuth' => $auth,
'dataSource'=>'library/alice/leaderboard',
'itemsPerPage' => 10,
'columns'=>array(
array('fieldname'=>'recorders', 'display'=>'Observer'),
array('fieldname'=>'records', 'display'=>'Records')
),
'includeAllColumns' => false,
'pager' => false,
'sendOutputToMap'=>false,
'rowClass'=>'',
'extraParams' => array(
'survey_id'=>'',
'taxon_group_id'=>'',
'smpattrs'=>'',
'occattrs'=>'',
'searchArea'=>'',
'idlist'=>'',
'currentUser'=>'',
'ownData'=>'',
'location_id'=>'',
'ownLocality'=>'',
'taxon_groups'=>'',
'ownGroups'=>'')
));
?>
2. make a file called leaderboard.xml with this content and save it to the location specified in 'datasource' above:
<report
title="Leaderboard"
description="Leaderboard"
>
<query>SELECT recorders, count(id) as records FROM cache_occurrences GROUP BY recorders ORDER by records DESC</query>
<columns>
<column name='recorders' display='Observer' sql='o.recorders' datatype='text' />
<column name='records' sql='o.records' datatype='integer' />
</columns>
</report>
3. make sure the block is set to display where you want it
That's it. Hopefully it will save somebody some time...
Alice