* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
*/
-/* */
-require_once 'QueryPage.php';
-
/**
* @package MediaWiki
* @subpackage SpecialPage
function getSQL() {
$dbr =& wfGetDB( DB_SLAVE );
- extract( $dbr->tableNames( 'categorylinks', 'page' ) );
+ $categorylinks = $dbr->tableName( 'categorylinks' );
$name = $dbr->addQuotes( $this->getName() );
return
"
- SELECT
+ SELECT
$name as type,
" . NS_CATEGORY . " as namespace,
cl_to as title,
COUNT(*) as value
FROM $categorylinks
- GROUP BY cl_to
+ GROUP BY 1,2,3
";
}
-
+
function sortDescending() { return true; }
/**
* Fetch user page links and cache their existence
*/
function preprocessResults( &$db, &$res ) {
- global $wgLinkCache;
-
$batch = new LinkBatch;
while ( $row = $db->fetchObject( $res ) )
- $batch->addObj( Title::makeTitleSafe( NS_USER, $row->title ) );
- $batch->execute( $wgLinkCache );
+ $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
+ $batch->execute();
// Back to start for display
if ( $db->numRows( $res ) > 0 )
}
function formatResult( $skin, $result ) {
- global $wgContLang;
+ global $wgLang, $wgContLang;
$nt = Title::makeTitle( $result->namespace, $result->title );
$text = $wgContLang->convert( $nt->getText() );
-
+
$plink = $skin->makeLinkObj( $nt, htmlspecialchars( $text ) );
-
- $nlinks = wfMsg( 'ncategories', $result->value );
- return "$plink ($nlinks)";
+
+ $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
+ $wgLang->formatNum( $result->value ) );
+ return wfSpecialList($plink, $nlinks);
}
}