4 * @addtogroup SpecialPage
8 * implements Special:Unusedimages
9 * @addtogroup SpecialPage
11 class UnusedimagesPage
extends ImageQueryPage
{
14 return 'Unusedimages';
17 function sortDescending() {
20 function isSyndicated() { return false; }
23 global $wgCountCategorizedImagesAsUsed;
24 $dbr = wfGetDB( DB_SLAVE
);
26 if ( $wgCountCategorizedImagesAsUsed ) {
27 list( $page, $image, $imagelinks, $categorylinks ) = $dbr->tableNamesN( 'page', 'image', 'imagelinks', 'categorylinks' );
29 return 'SELECT img_name as title, img_user, img_user_text, img_timestamp as value, img_description
30 FROM ((('.$page.' AS I LEFT JOIN '.$categorylinks.' AS L ON I.page_id = L.cl_from)
31 LEFT JOIN '.$imagelinks.' AS P ON I.page_title = P.il_to)
32 INNER JOIN '.$image.' AS G ON I.page_title = G.img_name)
33 WHERE I.page_namespace = '.NS_IMAGE
.' AND L.cl_from IS NULL AND P.il_to IS NULL';
35 list( $image, $imagelinks ) = $dbr->tableNamesN( 'image','imagelinks' );
37 return 'SELECT img_name as title, img_user, img_user_text, img_timestamp as value, img_description' .
38 ' FROM '.$image.' LEFT JOIN '.$imagelinks.' ON img_name=il_to WHERE il_to IS NULL ';
42 function getPageHeader() {
43 return wfMsg( "unusedimagestext" );
51 function wfSpecialUnusedimages() {
52 list( $limit, $offset ) = wfCheckLimits();
53 $uip = new UnusedimagesPage();
55 return $uip->doQuery( $offset, $limit );