MediaWiki  REL1_19
SpecialLonelypages.php
Go to the documentation of this file.
00001 <?php
00030 class LonelyPagesPage extends PageQueryPage {
00031 
00032         function __construct( $name = 'Lonelypages' ) {
00033                 parent::__construct( $name );
00034         }
00035 
00036         function getPageHeader() {
00037                 return wfMsgExt( 'lonelypagestext', array( 'parse' ) );
00038         }
00039 
00040         function sortDescending() {
00041                 return false;
00042         }
00043 
00044         function isExpensive() {
00045                 return true;
00046         }
00047         function isSyndicated() { return false; }
00048 
00049         function getQueryInfo() {
00050                 return array (
00051                         'tables' => array ( 'page', 'pagelinks',
00052                                         'templatelinks' ),
00053                         'fields' => array ( 'page_namespace AS namespace',
00054                                         'page_title AS title',
00055                                         'page_title AS value' ),
00056                         'conds' => array ( 'pl_namespace IS NULL',
00057                                         'page_namespace' => MWNamespace::getContentNamespaces(),
00058                                         'page_is_redirect' => 0,
00059                                         'tl_namespace IS NULL' ),
00060                         'join_conds' => array (
00061                                         'pagelinks' => array (
00062                                                 'LEFT JOIN', array (
00063                                                 'pl_namespace = page_namespace',
00064                                                 'pl_title = page_title' ) ),
00065                                         'templatelinks' => array (
00066                                                 'LEFT JOIN', array (
00067                                                 'tl_namespace = page_namespace',
00068                                                 'tl_title = page_title' ) ) )
00069                 );
00070         }
00071 
00072         function getOrderFields() {
00073                 // For some crazy reason ordering by a constant
00074                 // causes a filesort in MySQL 5
00075                 if( count( MWNamespace::getContentNamespaces() ) > 1 ) {
00076                         return array( 'page_namespace', 'page_title' );
00077                 } else {
00078                         return array( 'page_title' );
00079                 }
00080         }
00081 }