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
21 * @ingroup SpecialPage
25 * A special page looking for articles with no article linking to them,
28 * @ingroup SpecialPage
30 class LonelyPagesPage
extends PageQueryPage
{
32 function __construct( $name = 'Lonelypages' ) {
33 parent
::__construct( $name );
36 function getPageHeader() {
37 return $this->msg( 'lonelypagestext' )->parseAsBlock();
40 function sortDescending() {
44 function isExpensive() {
47 function isSyndicated() { return false; }
49 function getQueryInfo() {
51 'tables' => array ( 'page', 'pagelinks',
53 'fields' => array ( 'page_namespace AS namespace',
54 'page_title AS title',
55 'page_title AS value' ),
56 'conds' => array ( 'pl_namespace IS NULL',
57 'page_namespace' => MWNamespace
::getContentNamespaces(),
58 'page_is_redirect' => 0,
59 'tl_namespace IS NULL' ),
60 'join_conds' => array (
61 'pagelinks' => array (
63 'pl_namespace = page_namespace',
64 'pl_title = page_title' ) ),
65 'templatelinks' => array (
67 'tl_namespace = page_namespace',
68 'tl_title = page_title' ) ) )
72 function getOrderFields() {
73 // For some crazy reason ordering by a constant
74 // causes a filesort in MySQL 5
75 if( count( MWNamespace
::getContentNamespaces() ) > 1 ) {
76 return array( 'page_namespace', 'page_title' );
78 return array( 'page_title' );