00001 <?php 00015 class MostimagesPage extends ImageQueryPage { 00016 00017 function getName() { return 'Mostimages'; } 00018 function isExpensive() { return true; } 00019 function isSyndicated() { return false; } 00020 00021 function getSQL() { 00022 $dbr = wfGetDB( DB_SLAVE ); 00023 $imagelinks = $dbr->tableName( 'imagelinks' ); 00024 return 00025 " 00026 SELECT 00027 'Mostimages' as type, 00028 " . NS_FILE . " as namespace, 00029 il_to as title, 00030 COUNT(*) as value 00031 FROM $imagelinks 00032 GROUP BY il_to 00033 HAVING COUNT(*) > 1 00034 "; 00035 } 00036 00037 function getCellHtml( $row ) { 00038 global $wgLang; 00039 return wfMsgExt( 'nlinks', array( 'parsemag', 'escape' ), 00040 $wgLang->formatNum( $row->value ) ) . '<br />'; 00041 } 00042 00043 } 00044 00048 function wfSpecialMostimages() { 00049 list( $limit, $offset ) = wfCheckLimits(); 00050 00051 $wpp = new MostimagesPage(); 00052 00053 $wpp->doQuery( $offset, $limit ); 00054 }