Stop loading feed.php every time by moving available feeds classes in defines.php...
[lhc/web/wiklou.git] / includes / SpecialWantedpages.php
index 95e65b6..7fd09db 100644 (file)
@@ -1,11 +1,24 @@
 <?php
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
 
-require_once ( "QueryPage.php" ) ;
+/**
+ *
+ */
+require_once ( 'QueryPage.php' ) ;
 
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
 class WantedPagesPage extends QueryPage {
 
        function getName() {
-               return "Wantedpages";
+               return 'Wantedpages';
        }
 
        function isExpensive() {
@@ -18,6 +31,7 @@ class WantedPagesPage extends QueryPage {
 
                # We cheat and return the full-text from bl_to in the title.
                # In the future, a pre-parsed name will be available.
+               $agrvalue=$dbr->aggregateValue('COUNT(DISTINCT bl_from)');
                return
                        "SELECT 'Wantedpages' as type,
                                0 as namespace,
@@ -25,9 +39,15 @@ class WantedPagesPage extends QueryPage {
                                COUNT(DISTINCT bl_from) as value
                        FROM $brokenlinks
                        GROUP BY bl_to
-                       HAVING value > 1";
+                       HAVING $agrvalue > 1
+                       ORDER BY $agrvalue ".
+                       ($this->sortDescending() ? 'DESC' : '');
        }
 
+        function getOrder() {
+                return '';
+        }
+
        function formatResult( $skin, $result ) {
                global $wgLang;
 
@@ -44,8 +64,10 @@ class WantedPagesPage extends QueryPage {
        }
 }
 
-function wfSpecialWantedpages()
-{
+/**
+ * constructor
+ */
+function wfSpecialWantedpages() {
        list( $limit, $offset ) = wfCheckLimits();
 
        $wpp = new WantedPagesPage();