Merge "Rename $usableSkins to $allowedSkins"
[mediawiki.git] / includes / specials / SpecialLonelypages.php
blob7c7771d7231d0b47f74ab3e208b1802fd6db97db
1 <?php
2 /**
3 * Implements Special:Lonelypaages
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
20 * @file
21 * @ingroup SpecialPage
24 /**
25 * A special page looking for articles with no article linking to them,
26 * thus being lonely.
28 * @ingroup SpecialPage
30 class LonelyPagesPage extends PageQueryPage {
31 function __construct( $name = 'Lonelypages' ) {
32 parent::__construct( $name );
35 function getPageHeader() {
36 return $this->msg( 'lonelypagestext' )->parseAsBlock();
39 function sortDescending() {
40 return false;
43 function isExpensive() {
44 return true;
47 function isSyndicated() {
48 return false;
51 function getQueryInfo() {
52 return array(
53 'tables' => array(
54 'page', 'pagelinks',
55 'templatelinks'
57 'fields' => array(
58 'namespace' => 'page_namespace',
59 'title' => 'page_title',
60 'value' => 'page_title'
62 'conds' => array(
63 'pl_namespace IS NULL',
64 'page_namespace' => MWNamespace::getContentNamespaces(),
65 'page_is_redirect' => 0,
66 'tl_namespace IS NULL'
68 'join_conds' => array(
69 'pagelinks' => array(
70 'LEFT JOIN', array(
71 'pl_namespace = page_namespace',
72 'pl_title = page_title'
75 'templatelinks' => array(
76 'LEFT JOIN', array(
77 'tl_namespace = page_namespace',
78 'tl_title = page_title'
85 function getOrderFields() {
86 // For some crazy reason ordering by a constant
87 // causes a filesort in MySQL 5
88 if ( count( MWNamespace::getContentNamespaces() ) > 1 ) {
89 return array( 'page_namespace', 'page_title' );
90 } else {
91 return array( 'page_title' );
95 protected function getGroupName() {
96 return 'maintenance';