Scripts and data used for generating ZhConversion.php
[lhc/web/wiklou.git] / includes / SpecialWantedpages.php
index 6369e16..001dc30 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 /**
  *
+ * @package MediaWiki
+ * @subpackage SpecialPage
  */
 
 /**
@@ -10,6 +12,8 @@ require_once ( 'QueryPage.php' ) ;
 
 /**
  *
+ * @package MediaWiki
+ * @subpackage SpecialPage
  */
 class WantedPagesPage extends QueryPage {
 
@@ -27,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,
@@ -34,11 +39,17 @@ 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;
+               global $wgContLang;
 
                $nt = Title::newFromDBkey( $result->title );
                if( is_null( $nt ) ) {
@@ -46,7 +57,7 @@ class WantedPagesPage extends QueryPage {
                }
                $plink = $skin->makeBrokenLink( $nt->getPrefixedText(), "" );
                $nl = wfMsg( "nlinks", $result->value );
-               $nlink = $skin->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ), $nl,
+               $nlink = $skin->makeKnownLink( $wgContLang->specialPage( "Whatlinkshere" ), $nl,
                  "target=" . $nt->getPrefixedURL() );
 
                return "{$plink} ({$nlink})";