* (bug 6061) Improper escaping in some html forms
[mediawiki.git] / includes / SpecialMostimages.php
blobb1ecb9018637d32be7a37405bef04b6a27bbdd34
1 <?php
2 /**
3 * @package MediaWiki
4 * @subpackage SpecialPage
6 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
7 * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
8 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
9 */
11 /* */
12 require_once 'QueryPage.php';
14 /**
15 * @package MediaWiki
16 * @subpackage SpecialPage
18 class MostimagesPage extends QueryPage {
20 function getName() { return 'Mostimages'; }
21 function isExpensive() { return true; }
22 function isSyndicated() { return false; }
24 function getSQL() {
25 $dbr =& wfGetDB( DB_SLAVE );
26 extract( $dbr->tableNames( 'imagelinks' ) );
27 return
29 SELECT
30 'Mostimages' as type,
31 " . NS_IMAGE . " as namespace,
32 il_to as title,
33 COUNT(*) as value
34 FROM $imagelinks
35 GROUP BY il_to
36 HAVING COUNT(*) > 1
40 function formatResult( $skin, $result ) {
41 global $wgLang, $wgContLang;
43 $nt = Title::makeTitle( $result->namespace, $result->title );
44 $text = $wgContLang->convert( $nt->getPrefixedText() );
46 $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text );
48 $nl = wfMsgExt( 'nlinks', array( 'parsemag', 'escape'),
49 $wgLang->formatNum ( $result->value ) );
50 $nlink = $skin->makeKnownLink( $nt->getPrefixedText() . '#filelinks', $nl );
52 return wfSpecialList($plink, $nlink);
56 /**
57 * Constructor
59 function wfSpecialMostimages() {
60 list( $limit, $offset ) = wfCheckLimits();
62 $wpp = new MostimagesPage();
64 $wpp->doQuery( $offset, $limit );