Change default on $wgSysopUserBans and $wgSysopRangeBans to true
[lhc/web/wiklou.git] / includes / SpecialLonelypages.php
index 86a21a5..6f0f73f 100644 (file)
@@ -1,32 +1,54 @@
 <?php
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
 
+/**
+ *
+ */
 require_once( "QueryPage.php" );
 
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
 class LonelyPagesPage extends PageQueryPage {
 
-    function getName() {
-       return "Lonelypages";
-    }
-    
-    function isExpensive() {
-       return 1;
-    }
-    
-    function getSQL( $offset, $limit ) {
+       function getName() {
+               return "Lonelypages";
+       }
+
+       function sortDescending() {
+               return false;
+       }
+
+       function isExpensive() {
+               return true;
+       }
+       function isSyndicated() { return false; }
        
-       return "SELECT cur_namespace AS namespace, cur_title AS title, cur_title AS value " .
-       "FROM cur LEFT JOIN links ON cur_id=l_to ".
-       "WHERE l_to IS NULL AND cur_namespace=0 AND cur_is_redirect=0";
-    }
+       function getSQL() {
+               $dbr =& wfGetDB( DB_SLAVE );
+               extract( $dbr->tableNames( 'page', 'links' ) );
+
+               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='.NS_MAIN.' AND page_is_redirect=0';
+       }
 }
 
-function wfSpecialLonelypages()
-{
-    list( $limit, $offset ) = wfCheckLimits();
-    
-    $lpp = new LonelyPagesPage();
-    
-    return $lpp->doQuery( $offset, $limit );
+/**
+ * Constructor
+ */
+function wfSpecialLonelypages() {
+       list( $limit, $offset ) = wfCheckLimits();
+
+       $lpp = new LonelyPagesPage();
+
+       return $lpp->doQuery( $offset, $limit );
 }
 
 ?>