From: Domas Mituzas Date: Thu, 9 Sep 2004 12:10:58 +0000 (+0000) Subject: Use Database:aggregateValue() for HAVING and GROUP BY clauses, closes bug387 X-Git-Tag: 1.5.0alpha1~2039 X-Git-Url: http://git.cyclocoop.org/%27.%28%24current%20%3E%202?a=commitdiff_plain;h=e7e9f1dbc7441f6119ff598f9cb7061e64b65d60;p=lhc%2Fweb%2Fwiklou.git Use Database:aggregateValue() for HAVING and GROUP BY clauses, closes bug387 --- diff --git a/includes/SpecialWantedpages.php b/includes/SpecialWantedpages.php index aece6c6d4f..7fd09db4e4 100644 --- a/includes/SpecialWantedpages.php +++ b/includes/SpecialWantedpages.php @@ -31,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, @@ -38,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;