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/SpecialFewestrevisions.php | 41 +++++++++++++--------------- 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'includes/specials/SpecialFewestrevisions.php') diff --git a/includes/specials/SpecialFewestrevisions.php b/includes/specials/SpecialFewestrevisions.php index c265ed38..6d621a2e 100644 --- a/includes/specials/SpecialFewestrevisions.php +++ b/includes/specials/SpecialFewestrevisions.php @@ -29,8 +29,8 @@ */ class FewestrevisionsPage extends QueryPage { - function getName() { - return 'Fewestrevisions'; + function __construct( $name = 'Fewestrevisions' ) { + parent::__construct( $name ); } function isExpensive() { @@ -41,31 +41,34 @@ class FewestrevisionsPage extends QueryPage { return false; } - function getSql() { - $dbr = wfGetDB( DB_SLAVE ); - list( $revision, $page ) = $dbr->tableNamesN( 'revision', 'page' ); - - return "SELECT 'Fewestrevisions' as type, - page_namespace as namespace, - page_title as title, - page_is_redirect as redirect, - COUNT(*) as value - FROM $revision - JOIN $page ON page_id = rev_page - WHERE page_namespace = " . NS_MAIN . " - GROUP BY page_namespace, page_title, page_is_redirect - HAVING COUNT(*) > 1"; + function getQueryInfo() { + return array ( + 'tables' => array ( 'revision', 'page' ), + 'fields' => array ( 'page_namespace AS namespace', + 'page_title AS title', + 'COUNT(*) AS value', + 'page_is_redirect AS redirect' ), + 'conds' => array ( 'page_namespace' => MWNamespace::getContentNamespaces(), + 'page_id = rev_page' ), + 'options' => array ( 'HAVING' => 'COUNT(*) > 1', // ^^^ This was probably here to weed out redirects. // Since we mark them as such now, it might be // useful to remove this. People _do_ create pages // and never revise them, they aren't necessarily // redirects. + 'GROUP BY' => 'page_namespace, page_title, page_is_redirect' ) + ); } + function sortDescending() { return false; } + /** + * @param $skin Skin object + * @param $result Object: database row + */ function formatResult( $skin, $result ) { global $wgLang, $wgContLang; @@ -94,9 +97,3 @@ class FewestrevisionsPage extends QueryPage { return wfSpecialList( $plink, $nlink ); } } - -function wfSpecialFewestrevisions() { - list( $limit, $offset ) = wfCheckLimits(); - $frp = new FewestrevisionsPage(); - $frp->doQuery( $offset, $limit ); -} -- cgit v1.2.2