* Fixed E_NOTICE..
[mediawiki.git] / includes / SpecialMostimages.php
blobbeb42fc1a7000a776aeca4fa88580ce55b381692
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 * implements Special:Mostimages
12 * @addtogroup SpecialPage
14 class MostimagesPage extends ImageQueryPage {
16 function getName() { return 'Mostimages'; }
17 function isExpensive() { return true; }
18 function isSyndicated() { return false; }
20 function getSQL() {
21 $dbr = wfGetDB( DB_SLAVE );
22 $imagelinks = $dbr->tableName( 'imagelinks' );
23 return
25 SELECT
26 'Mostimages' as type,
27 " . NS_IMAGE . " as namespace,
28 il_to as title,
29 COUNT(*) as value
30 FROM $imagelinks
31 GROUP BY 1,2,3
32 HAVING COUNT(*) > 1
36 function getCellHtml( $row ) {
37 global $wgLang;
38 return wfMsgExt( 'nlinks', array( 'parsemag', 'escape' ),
39 $wgLang->formatNum( $row->value ) ) . '<br />';
44 /**
45 * Constructor
47 function wfSpecialMostimages() {
48 list( $limit, $offset ) = wfCheckLimits();
50 $wpp = new MostimagesPage();
52 $wpp->doQuery( $offset, $limit );