summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialFewestrevisions.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
commitca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch)
treeec04cc15b867bc21eedca904cea9af0254531a11 /includes/specials/SpecialFewestrevisions.php
parenta22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff)
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing
Diffstat (limited to 'includes/specials/SpecialFewestrevisions.php')
-rw-r--r--includes/specials/SpecialFewestrevisions.php41
1 files changed, 19 insertions, 22 deletions
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 );
-}