00001 <?php
00002
00003
00004
00005
00006
00016 class WantedFilesPage extends WantedQueryPage {
00017
00018 function getName() {
00019 return 'Wantedfiles';
00020 }
00021
00022 function getSQL() {
00023 $dbr = wfGetDB( DB_SLAVE );
00024 list( $imagelinks, $page ) = $dbr->tableNamesN( 'imagelinks', 'page' );
00025 $name = $dbr->addQuotes( $this->getName() );
00026 return
00027 "
00028 SELECT
00029 $name as type,
00030 " . NS_FILE . " as namespace,
00031 il_to as title,
00032 COUNT(*) as value
00033 FROM $imagelinks
00034 LEFT JOIN $page ON il_to = page_title AND page_namespace = ". NS_FILE ."
00035 WHERE page_title IS NULL
00036 GROUP BY il_to
00037 ";
00038 }
00039 }
00040
00044 function wfSpecialWantedFiles() {
00045 list( $limit, $offset ) = wfCheckLimits();
00046
00047 $wpp = new WantedFilesPage();
00048
00049 $wpp->doQuery( $offset, $limit );
00050 }