summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialUnusedcategories.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialUnusedcategories.php')
-rw-r--r--includes/specials/SpecialUnusedcategories.php34
1 files changed, 14 insertions, 20 deletions
diff --git a/includes/specials/SpecialUnusedcategories.php b/includes/specials/SpecialUnusedcategories.php
index ff2a66e1..e4b8e544 100644
--- a/includes/specials/SpecialUnusedcategories.php
+++ b/includes/specials/SpecialUnusedcategories.php
@@ -28,25 +28,26 @@ class UnusedCategoriesPage extends QueryPage {
function isExpensive() { return true; }
- function getName() {
- return 'Unusedcategories';
+ function __construct( $name = 'Unusedcategories' ) {
+ parent::__construct( $name );
}
function getPageHeader() {
return wfMsgExt( 'unusedcategoriestext', array( 'parse' ) );
}
- function getSQL() {
- $NScat = NS_CATEGORY;
- $dbr = wfGetDB( DB_SLAVE );
- list( $categorylinks, $page ) = $dbr->tableNamesN( 'categorylinks', 'page' );
- return "SELECT 'Unusedcategories' as type,
- {$NScat} as namespace, page_title as title, page_title as value
- FROM $page
- LEFT JOIN $categorylinks ON page_title=cl_to
- WHERE cl_from IS NULL
- AND page_namespace = {$NScat}
- AND page_is_redirect = 0";
+ function getQueryInfo() {
+ return array (
+ 'tables' => array ( 'page', 'categorylinks' ),
+ 'fields' => array ( 'page_namespace AS namespace',
+ 'page_title AS title',
+ 'page_title AS value' ),
+ 'conds' => array ( 'cl_from IS NULL',
+ 'page_namespace' => NS_CATEGORY,
+ 'page_is_redirect' => 0 ),
+ 'join_conds' => array ( 'categorylinks' => array (
+ 'LEFT JOIN', 'cl_to = page_title' ) )
+ );
}
/**
@@ -61,10 +62,3 @@ class UnusedCategoriesPage extends QueryPage {
return $skin->link( $title, $title->getText() );
}
}
-
-/** constructor */
-function wfSpecialUnusedCategories() {
- list( $limit, $offset ) = wfCheckLimits();
- $uc = new UnusedCategoriesPage();
- return $uc->doQuery( $offset, $limit );
-}