* (bug 146) List number of category members in Special:Categories
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 24 Nov 2005 03:11:22 +0000 (03:11 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 24 Nov 2005 03:11:22 +0000 (03:11 +0000)
  (patch by Joel Nothman)

RELEASE-NOTES
includes/SpecialCategories.php

index cf8f4db..29b693f 100644 (file)
@@ -246,6 +246,8 @@ fully support the editing toolbar, but was found to be too confusing.
 * (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 ===
index 3545195..9615101 100644 (file)
@@ -34,11 +34,14 @@ class CategoriesPage extends QueryPage {
                $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() {
@@ -48,7 +51,9 @@ class CategoriesPage extends QueryPage {
        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)";
        }
 }