From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- includes/specials/SpecialMostcategories.php | 49 +++++++++++++---------------- 1 file changed, 21 insertions(+), 28 deletions(-) (limited to 'includes/specials/SpecialMostcategories.php') diff --git a/includes/specials/SpecialMostcategories.php b/includes/specials/SpecialMostcategories.php index 124f0bd5..2e437196 100644 --- a/includes/specials/SpecialMostcategories.php +++ b/includes/specials/SpecialMostcategories.php @@ -31,28 +31,32 @@ */ class MostcategoriesPage extends QueryPage { - function getName() { return 'Mostcategories'; } + function __construct( $name = 'Mostcategories' ) { + parent::__construct( $name ); + } + function isExpensive() { return true; } function isSyndicated() { return false; } - function getSQL() { - $dbr = wfGetDB( DB_SLAVE ); - list( $categorylinks, $page) = $dbr->tableNamesN( 'categorylinks', 'page' ); - return - " - SELECT - 'Mostcategories' as type, - page_namespace as namespace, - page_title as title, - COUNT(*) as value - FROM $categorylinks - LEFT JOIN $page ON cl_from = page_id - WHERE page_namespace = " . NS_MAIN . " - GROUP BY page_namespace, page_title - HAVING COUNT(*) > 1 - "; + function getQueryInfo() { + return array ( + 'tables' => array ( 'categorylinks', 'page' ), + 'fields' => array ( 'page_namespace AS namespace', + 'page_title AS title', + 'COUNT(*) AS value' ), + 'conds' => array ( 'page_namespace' => MWNamespace::getContentNamespaces() ), + 'options' => array ( 'HAVING' => 'COUNT(*) > 1', + 'GROUP BY' => 'page_namespace, page_title' ), + 'join_conds' => array ( 'page' => array ( 'LEFT JOIN', + 'page_id = cl_from' ) ) + ); } + /** + * @param $skin Skin + * @param $result + * @return string + */ function formatResult( $skin, $result ) { global $wgLang; $title = Title::makeTitleSafe( $result->namespace, $result->title ); @@ -62,14 +66,3 @@ class MostcategoriesPage extends QueryPage { return wfSpecialList( $link, $count ); } } - -/** - * constructor - */ -function wfSpecialMostcategories() { - list( $limit, $offset ) = wfCheckLimits(); - - $wpp = new MostcategoriesPage(); - - $wpp->doQuery( $offset, $limit ); -} -- cgit v1.2.3-54-g00ecf