Fix broken contribution listings with postgres by adding a new variable
[lhc/web/wiklou.git] / includes / SpecialLongpages.php
index 44fa88a..3736d6f 100644 (file)
@@ -1,36 +1,35 @@
-<?
+<?php
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
 
-include_once( "QueryPage.php" );
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+class LongPagesPage extends ShortPagesPage {
 
-class LongPagesPage extends QueryPage {
-    
-    function getName() {
-       return "Longpages";
-    }
-    
-    function isExpensive() {
-       return 1;
-    }
-    
-    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 " .
-         "LENGTH(cur_text) DESC LIMIT {$offset}, {$limit}";
-    }
+       function getName() {
+               return "Longpages";
+       }
 
-    function formatResult( $skin, $result ) {
-       $nb = wfMsg( "nbytes", $result->len );
-       $link = $skin->makeKnownLink( $result->cur_title, "" );
-       return "{$link} ({$nb})";
-    }
+       function sortDescending() {
+               return true;
+       }
 }
 
+/**
+ * constructor
+ */
 function wfSpecialLongpages()
 {
     list( $limit, $offset ) = wfCheckLimits();
 
-    $lpp = new LongPagesPage( );
-    
+    $lpp = new LongPagesPage();
+
     $lpp->doQuery( $offset, $limit );
 }