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() {
48 function isSyndicated() {
52 function getQueryInfo() {
54 'tables' => array( 'page', 'pagelinks',
56 'fields' => array( 'namespace' => 'page_namespace',
57 'title' => 'page_title',
58 'value' => 'page_title' ),
59 'conds' => array( 'pl_namespace IS NULL',
60 'page_namespace' => MWNamespace
::getContentNamespaces(),
61 'page_is_redirect' => 0,
62 'tl_namespace IS NULL' ),
63 'join_conds' => array(
66 'pl_namespace = page_namespace',
67 'pl_title = page_title' ) ),
68 'templatelinks' => array(
70 'tl_namespace = page_namespace',
71 'tl_title = page_title' ) ) )
75 function getOrderFields() {
76 // For some crazy reason ordering by a constant
77 // causes a filesort in MySQL 5
78 if ( count( MWNamespace
::getContentNamespaces() ) > 1 ) {
79 return array( 'page_namespace', 'page_title' );
81 return array( 'page_title' );
85 protected function getGroupName() {