removed a debug output when setting up the dropbox for language variants
[lhc/web/wiklou.git] / includes / SpecialLongpages.php
index 2a9a1f5..93e55e5 100644 (file)
@@ -1,7 +1,20 @@
 <?php
-
-include_once( "QueryPage.php" );
-
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+
+/**
+ *
+ */
+require_once( "QueryPage.php" );
+
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
 class LongPagesPage extends QueryPage {
 
        function getName() {
@@ -9,22 +22,33 @@ class LongPagesPage extends QueryPage {
        }
 
        function isExpensive() {
-               return 1;
+               return true;
        }
 
-       function getSQL( $offset, $limit ) {
-               return "SELECT cur_title, LENGTH(cur_text) AS len FROM cur " .
-                 "WHERE cur_namespace=0 AND cur_is_redirect=0 ORDER BY len DESC " .
-                 "LIMIT {$offset}, {$limit}";
+       function getSQL() {
+               $dbr =& wfGetDB( DB_SLAVE );
+               $cur = $dbr->tableName( 'cur' );
+
+               return
+                       "SELECT 'Longpages' as type,
+                                       cur_namespace as namespace,
+                               cur_title as title,
+                               LENGTH(cur_text) AS value
+                       FROM $cur
+                       WHERE cur_namespace=0 AND cur_is_redirect=0";
        }
 
        function formatResult( $skin, $result ) {
-               $nb = wfMsg( "nbytes", $result->len );
-               $link = $skin->makeKnownLink( $result->cur_title, "" );
+               global $wgLang;
+               $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value ) );
+               $link = $skin->makeKnownLink( $result->title, "" );
                return "{$link} ({$nb})";
        }
 }
 
+/**
+ * constructor
+ */
 function wfSpecialLongpages()
 {
     list( $limit, $offset ) = wfCheckLimits();