Fix r20109, which was kind of insane. It was a wikitext list with only some output...
[mediawiki.git] / includes / SpecialMostimages.php
blob6a6d8c5f6800c1de4bcb94d5e13d0e8d9278a369
1 <?php
2 /**
3 * @addtogroup SpecialPage
5 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
6 * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
7 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
8 */
10 /**
11 * @addtogroup SpecialPage
13 class MostimagesPage extends QueryPage {
15 function getName() { return 'Mostimages'; }
16 function isExpensive() { return true; }
17 function isSyndicated() { return false; }
19 function getSQL() {
20 $dbr = wfGetDB( DB_SLAVE );
21 $imagelinks = $dbr->tableName( 'imagelinks' );
22 return
24 SELECT
25 'Mostimages' as type,
26 " . NS_IMAGE . " as namespace,
27 il_to as title,
28 COUNT(*) as value
29 FROM $imagelinks
30 GROUP BY 1,2,3
31 HAVING COUNT(*) > 1
35 function formatResult( $skin, $result ) {
36 global $wgLang, $wgContLang;
38 $nt = Title::makeTitle( $result->namespace, $result->title );
39 $text = $wgContLang->convert( $nt->getPrefixedText() );
41 $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text );
43 $nl = wfMsgExt( 'nlinks', array( 'parsemag', 'escape'),
44 $wgLang->formatNum ( $result->value ) );
45 $nlink = $skin->makeKnownLink( $nt->getPrefixedText() . '#filelinks', $nl );
47 return wfSpecialList($plink, $nlink);
51 /**
52 * Constructor
54 function wfSpecialMostimages() {
55 list( $limit, $offset ) = wfCheckLimits();
57 $wpp = new MostimagesPage();
59 $wpp->doQuery( $offset, $limit );