convert "::1" and other pseudo-IPv6 addresses that Apache may throw at us to their...
[lhc/web/wiklou.git] / includes / SpecialCategories.php
index 977484b..89cff20 100644 (file)
@@ -5,11 +5,6 @@
  * @subpackage SpecialPage
  */
 
-/**
- *
- */
-require_once("QueryPage.php");
-
 /**
  *
  * @package MediaWiki
@@ -28,19 +23,23 @@ class CategoriesPage extends QueryPage {
        function isSyndicated() { return false; }
 
        function getPageHeader() {
-               return '<p>'.wfMsg('categoriespagetext')."</p><br />\n";
+               return wfMsgWikiHtml( 'categoriespagetext' );
        }
+       
        function getSQL() {
                $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 1,2,3,4";
+               return $s;
        }
-       
+
        function sortDescending() {
                return false;
        }
@@ -48,7 +47,10 @@ 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 = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
+                       $wgLang->formatNum( $result->count ) );
+               return wfSpecialList($plink, $nlinks);
        }
 }