* (bug 2894) Enhanced Recent Changes link fixes
* (bug 4059) fix 'hide minor edits' on Recentchangeslinked
* (bug 3922) bidi embedding overrides on category links
+* (bug 146) List number of category members in Special:Categories
+ (patch by Joel Nothman)
=== Caveats ===
$NScat = NS_CATEGORY;
$dbr =& wfGetDB( DB_SLAVE );
$categorylinks = $dbr->tableName( 'categorylinks' );
- return "SELECT DISTINCT 'Categories' as type,
+ $s= "SELECT 'Categories' as type,
{$NScat} as namespace,
cl_to as title,
- 1 as value
- FROM $categorylinks";
+ 1 as value,
+ COUNT(*) as count
+ FROM $categorylinks
+ GROUP BY cl_to";
+ return $s;
}
function sortDescending() {
function formatResult( $skin, $result ) {
global $wgLang;
$title = Title::makeTitle( NS_CATEGORY, $result->title );
- return $skin->makeLinkObj( $title, $title->getText() );
+ $plink = $skin->makeLinkObj( $title, $title->getText() );
+ $nlinks = wfMsg( 'nlinks', $result->count );
+ return "$plink ($nlinks)";
}
}