*/ /** * Querypage that lists the most wanted files * * @ingroup SpecialPage */ class WantedFilesPage extends WantedQueryPage { function getName() { return 'Wantedfiles'; } /** * KLUGE: The results may contain false positives for files * that exist e.g. in a shared repo. Setting this at least * keeps them from showing up as redlinks in the output, even * if it doesn't fix the real problem (bug 6220). */ function forceExistenceCheck() { return true; } function getSQL() { $dbr = wfGetDB( DB_SLAVE ); list( $imagelinks, $image ) = $dbr->tableNamesN( 'imagelinks', 'image' ); $name = $dbr->addQuotes( $this->getName() ); return " SELECT $name as type, " . NS_FILE . " as namespace, il_to as title, COUNT(*) as value FROM $imagelinks LEFT JOIN $image ON il_to = img_name WHERE img_name IS NULL GROUP BY il_to "; } } /** * constructor */ function wfSpecialWantedFiles() { list( $limit, $offset ) = wfCheckLimits(); $wpp = new WantedFilesPage(); $wpp->doQuery( $offset, $limit ); }