X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialMostimages.php;h=9d16f389df4993ea8ec80ee875be1fe8436e6c5e;hb=7de32afa9ae90941505558328341ca285f73c59a;hp=5a072a5bc068c5703869b404d4efac63b9787699;hpb=a26d5a49d755ff4b8039b11d1f26abb5d7bc7e8c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialMostimages.php b/includes/SpecialMostimages.php index 5a072a5bc0..9d16f389df 100644 --- a/includes/SpecialMostimages.php +++ b/includes/SpecialMostimages.php @@ -1,29 +1,25 @@ * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ -/* */ -require_once 'QueryPage.php'; - /** - * @package MediaWiki - * @subpackage SpecialPage + * implements Special:Mostimages + * @addtogroup SpecialPage */ -class MostimagesPage extends QueryPage { +class MostimagesPage extends ImageQueryPage { function getName() { return 'Mostimages'; } function isExpensive() { return true; } function isSyndicated() { return false; } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); - extract( $dbr->tableNames( 'imagelinks' ) ); + $dbr = wfGetDB( DB_SLAVE ); + $imagelinks = $dbr->tableName( 'imagelinks' ); return " SELECT @@ -32,24 +28,17 @@ class MostimagesPage extends QueryPage { il_to as title, COUNT(*) as value FROM $imagelinks - GROUP BY il_to + GROUP BY 1,2,3 HAVING COUNT(*) > 1 "; } - function formatResult( $skin, $result ) { - global $wgContLang; - - $nt = Title::makeTitle( $result->namespace, $result->title ); - $text = $wgContLang->convert( $nt->getPrefixedText() ); - - $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text ); - - $nl = wfMsg( 'nlinks', $result->value ); - $nlink = $skin->makeKnownLink( $nt->getPrefixedText() . '#filelinks', $nl ); - - return "$plink ($nlink)"; + function getCellHtml( $row ) { + global $wgLang; + return wfMsgExt( 'nlinks', array( 'parsemag', 'escape' ), + $wgLang->formatNum( $row->value ) ) . '
'; } + } /**