Fix {{NUMBEROFADMINS}} magic word
[lhc/web/wiklou.git] / includes / SpecialMostcategories.php
index 0deaac9..5591bbc 100644 (file)
@@ -8,9 +8,6 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
  */
 
-/* */
-require_once 'QueryPage.php';
-
 /**
  * @package MediaWiki
  * @subpackage SpecialPage
@@ -34,23 +31,26 @@ class MostcategoriesPage extends QueryPage {
                        FROM $categorylinks
                        LEFT JOIN $page ON cl_from = page_id
                        WHERE page_namespace = " . NS_MAIN . "
-                       GROUP BY cl_from, page_namespace, page_title
+                       GROUP BY cl_from
                        HAVING COUNT(*) > 1
                        ";
        }
 
        function formatResult( $skin, $result ) {
-               global $wgContLang;
+               global $wgContLang, $wgLang;
 
                $nt = Title::makeTitle( $result->namespace, $result->title );
                $text = $wgContLang->convert( $nt->getPrefixedText() );
 
                $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text );
 
-               $nl = wfMsg( 'ncategories', $result->value );
-               $nlink = $skin->makeKnownLink( $wgContLang->specialPage( 'Categories' ), $nl, 'article=' . $nt->getPrefixedURL() );
+               $nl = wfMsgExt( 'ncategories', array( 'parsemag', 'escape' ),
+                       $wgLang->formatNum( $result->value ) );
+
+               $nlink = $skin->makeKnownLink( $wgContLang->specialPage( 'Categories' ),
+                       $nl, 'article=' . $nt->getPrefixedURL() );
 
-               return "{$plink} ({$nlink})";
+               return wfSpecialList($plink, $nlink);
        }
 }