From 5e66cc4067c8b4683d412cb2fe7dd654ed0cc1f1 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Fri, 14 Jul 2006 19:45:08 +0000 Subject: [PATCH] Change from hardcoding to limitResult function. --- includes/SpecialStatistics.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/SpecialStatistics.php b/includes/SpecialStatistics.php index 7db133950d..e18399b37b 100644 --- a/includes/SpecialStatistics.php +++ b/includes/SpecialStatistics.php @@ -84,7 +84,9 @@ function wfSpecialStatistics() { global $wgDisableCounters, $wgMiserMode, $wgUser, $wgLang, $wgContLang; if( !$wgDisableCounters && !$wgMiserMode ) { - $res = $dbr->query( "SELECT page_namespace, page_title, page_counter FROM {$page} WHERE page_is_redirect = 0 AND page_counter > 0 ORDER BY page_counter DESC LIMIT 0,10", __METHOD__ ); + $sql = "SELECT page_namespace, page_title, page_counter FROM {$page} WHERE page_is_redirect = 0 AND page_counter > 0 ORDER BY page_counter DESC"; + $sql = $dbr->limitResult($sql, 10, 0); + $res = $dbr->query( $sql, $fname ); if( $res ) { $wgOut->addHtml( '

' . wfMsgHtml( 'statistics-mostpopular' ) . '

' ); $skin =& $wgUser->getSkin(); -- 2.20.1