10 class UnusedCategoriesPage
extends QueryPage
{
12 function isExpensive() { return true; }
15 return 'Unusedcategories';
18 function getPageHeader() {
19 return wfMsgExt( 'unusedcategoriestext', array( 'parse' ) );
24 $dbr = wfGetDB( DB_SLAVE
);
25 list( $categorylinks, $page, $page_props ) = $dbr->tableNamesN( 'categorylinks', 'page', 'page_props' );
26 return "SELECT 'Unusedcategories' as type,
27 {$NScat} as namespace, page_title as title, page_title as value
29 LEFT JOIN $categorylinks ON page_title=cl_to
30 LEFT JOIN $page_props ON (pp_page=page_id AND pp_propname = 'ignoreunused')
32 AND page_namespace = {$NScat}
33 AND page_is_redirect = 0
34 AND pp_propname IS NULL";
37 function formatResult( $skin, $result ) {
38 $title = Title
::makeTitle( NS_CATEGORY
, $result->title
);
39 return $skin->makeLinkObj( $title, $title->getText() );
44 function wfSpecialUnusedCategories() {
45 list( $limit, $offset ) = wfCheckLimits();
46 $uc = new UnusedCategoriesPage();
47 return $uc->doQuery( $offset, $limit );