more specific error message, using WikiError, if user trys to create account with...
[mediawiki.git] / includes / specials / SpecialUnusedcategories.php
blobfe7d7a17ce0db656a5b4f19b6eb309c1db8f54e3
1 <?php
2 /**
3 * @file
4 * @ingroup SpecialPage
5 */
7 /**
8 * @ingroup SpecialPage
9 */
10 class UnusedCategoriesPage extends QueryPage {
12 function isExpensive() { return true; }
14 function getName() {
15 return 'Unusedcategories';
18 function getPageHeader() {
19 return wfMsgExt( 'unusedcategoriestext', array( 'parse' ) );
22 function getSQL() {
23 $NScat = NS_CATEGORY;
24 $dbr = wfGetDB( DB_SLAVE );
25 list( $categorylinks, $page ) = $dbr->tableNamesN( 'categorylinks', 'page' );
26 return "SELECT 'Unusedcategories' as type,
27 {$NScat} as namespace, page_title as title, page_title as value
28 FROM $page
29 LEFT JOIN $categorylinks ON page_title=cl_to
30 WHERE cl_from IS NULL
31 AND page_namespace = {$NScat}
32 AND page_is_redirect = 0";
35 function formatResult( $skin, $result ) {
36 $title = Title::makeTitle( NS_CATEGORY, $result->title );
37 return $skin->link( $title, $title->getText() );
41 /** constructor */
42 function wfSpecialUnusedCategories() {
43 list( $limit, $offset ) = wfCheckLimits();
44 $uc = new UnusedCategoriesPage();
45 return $uc->doQuery( $offset, $limit );