* Update plural for uk
[mediawiki.git] / includes / SpecialUnusedimages.php
blobd71b638fa585a9f7fdf5a8c8d03efa5842d2df8d
1 <?php
2 /**
3 * @file
4 * @ingroup SpecialPage
5 */
7 /**
8 * implements Special:Unusedimages
9 * @ingroup SpecialPage
11 class UnusedimagesPage extends ImageQueryPage {
13 function isExpensive() { return true; }
15 function getName() {
16 return 'Unusedimages';
19 function sortDescending() {
20 return false;
22 function isSyndicated() { return false; }
24 function getSQL() {
25 global $wgCountCategorizedImagesAsUsed;
26 $dbr = wfGetDB( DB_SLAVE );
28 if ( $wgCountCategorizedImagesAsUsed ) {
29 list( $page, $image, $imagelinks, $categorylinks ) = $dbr->tableNamesN( 'page', 'image', 'imagelinks', 'categorylinks' );
31 return "SELECT 'Unusedimages' as type, 6 as namespace, img_name as title, img_timestamp as value,
32 img_user, img_user_text, img_description
33 FROM ((($page AS I LEFT JOIN $categorylinks AS L ON I.page_id = L.cl_from)
34 LEFT JOIN $imagelinks AS P ON I.page_title = P.il_to)
35 INNER JOIN $image AS G ON I.page_title = G.img_name)
36 WHERE I.page_namespace = ".NS_IMAGE." AND L.cl_from IS NULL AND P.il_to IS NULL";
37 } else {
38 list( $image, $imagelinks ) = $dbr->tableNamesN( 'image','imagelinks' );
40 return "SELECT 'Unusedimages' as type, 6 as namespace, img_name as title, img_timestamp as value,
41 img_user, img_user_text, img_description
42 FROM $image LEFT JOIN $imagelinks ON img_name=il_to WHERE il_to IS NULL ";
46 function getPageHeader() {
47 return wfMsgExt( 'unusedimagestext', array( 'parse') );
52 /**
53 * Entry point
55 function wfSpecialUnusedimages() {
56 list( $limit, $offset ) = wfCheckLimits();
57 $uip = new UnusedimagesPage();
59 return $uip->doQuery( $offset, $limit );