Temporarily revert 14847; makes incompatible changes to message strings.
[lhc/web/wiklou.git] / includes / SpecialLonelypages.php
index 86e0b8d..326ae54 100644 (file)
@@ -5,11 +5,6 @@
  * @subpackage SpecialPage
  */
 
-/**
- *
- */
-require_once( "QueryPage.php" );
-
 /**
  *
  * @package MediaWiki
@@ -29,14 +24,23 @@ class LonelyPagesPage extends PageQueryPage {
                return true;
        }
        function isSyndicated() { return false; }
-       
+
        function getSQL() {
                $dbr =& wfGetDB( DB_SLAVE );
-               extract( $dbr->tableNames( 'page', 'links' ) );
+               extract( $dbr->tableNames( 'page', 'pagelinks' ) );
+
+               return
+                 "SELECT 'Lonelypages'  AS type,
+                         page_namespace AS namespace,
+                         page_title     AS title,
+                         page_title     AS value
+                    FROM $page
+               LEFT JOIN $pagelinks
+                      ON page_namespace=pl_namespace AND page_title=pl_title
+                   WHERE pl_namespace IS NULL
+                     AND page_namespace=".NS_MAIN."
+                     AND page_is_redirect=0";
 
-               return "SELECT 'Lonelypages' as type, page_namespace AS namespace, page_title AS title, page_title AS value " .
-                       "FROM $page LEFT JOIN $links ON page_id=l_to ".
-                       "WHERE l_to IS NULL AND page_namespace=0 AND page_is_redirect=0";
        }
 }