summaryrefslogtreecommitdiff
path: root/includes/SpecialMostcategories.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/SpecialMostcategories.php')
-rw-r--r--includes/SpecialMostcategories.php21
1 files changed, 6 insertions, 15 deletions
diff --git a/includes/SpecialMostcategories.php b/includes/SpecialMostcategories.php
index c0d662cc..41bfb0cd 100644
--- a/includes/SpecialMostcategories.php
+++ b/includes/SpecialMostcategories.php
@@ -20,7 +20,7 @@ class MostcategoriesPage extends QueryPage {
function getSQL() {
$dbr =& wfGetDB( DB_SLAVE );
- extract( $dbr->tableNames( 'categorylinks', 'page' ) );
+ list( $categorylinks, $page) = $dbr->tableNamesN( 'categorylinks', 'page' );
return
"
SELECT
@@ -37,20 +37,11 @@ class MostcategoriesPage extends QueryPage {
}
function formatResult( $skin, $result ) {
- global $wgContLang, $wgLang;
-
- $nt = Title::makeTitle( $result->namespace, $result->title );
- $text = $wgContLang->convert( $nt->getPrefixedText() );
-
- $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text );
-
- $nl = wfMsgExt( 'ncategories', array( 'parsemag', 'escape' ),
- $wgLang->formatNum( $result->value ) );
-
- $nlink = $skin->makeKnownLink( $wgContLang->specialPage( 'Categories' ),
- $nl, 'article=' . $nt->getPrefixedURL() );
-
- return wfSpecialList($plink, $nlink);
+ global $wgLang;
+ $title = Title::makeTitleSafe( $result->namespace, $result->title );
+ $count = wfMsgExt( 'ncategories', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->value ) );
+ $link = $skin->makeKnownLinkObj( $title, $title->getText() );
+ return wfSpecialList( $link, $count );
}
}