<?php
/**
- * @package MediaWiki
- * @subpackage SpecialPage
+ * @addtogroup SpecialPage
*
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
* @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
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 ) ) . '<br />';
}
+
}
/**