X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialMostimages.php;h=beb42fc1a7000a776aeca4fa88580ce55b381692;hb=b76908589ab7134d3c95c33575ec721dcad89fd0;hp=d881e9bd3a1860ea38ae3eb9cd2231d3c40b3006;hpb=93eb6f30d7ed3ef30cb2a540e7002ed18f62bd8a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialMostimages.php b/includes/SpecialMostimages.php index d881e9bd3a..beb42fc1a7 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 $wgLang, $wgContLang; - - $nt = Title::makeTitle( $result->namespace, $result->title ); - $text = $wgContLang->convert( $nt->getPrefixedText() ); - - $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text ); - - $nl = wfMsg( 'nlinks', $wgLang->formatNum ( $result->value ) ); - $nlink = $skin->makeKnownLink( $nt->getPrefixedText() . '#filelinks', $nl ); - - return wfSpecialList($plink, $nlink); + function getCellHtml( $row ) { + global $wgLang; + return wfMsgExt( 'nlinks', array( 'parsemag', 'escape' ), + $wgLang->formatNum( $row->value ) ) . '
'; } + } /** @@ -63,4 +52,4 @@ function wfSpecialMostimages() { $wpp->doQuery( $offset, $limit ); } -?> +