GPL Headers for all!
[lhc/web/wiklou.git] / includes / specials / SpecialUncategorizedimages.php
1 <?php
2 /**
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 * http://www.gnu.org/copyleft/gpl.html
18 */
19
20 /**
21 * Special page lists images which haven't been categorised
22 *
23 * @file
24 * @ingroup SpecialPage
25 * @author Rob Church <robchur@gmail.com>
26 */
27
28 /**
29 * @ingroup SpecialPage
30 */
31 class UncategorizedImagesPage extends ImageQueryPage {
32
33 function getName() {
34 return 'Uncategorizedimages';
35 }
36
37 function sortDescending() {
38 return false;
39 }
40
41 function isExpensive() {
42 return true;
43 }
44
45 function isSyndicated() {
46 return false;
47 }
48
49 function getSQL() {
50 $dbr = wfGetDB( DB_SLAVE );
51 list( $page, $categorylinks ) = $dbr->tableNamesN( 'page', 'categorylinks' );
52 $ns = NS_FILE;
53
54 return "SELECT 'Uncategorizedimages' AS type, page_namespace AS namespace,
55 page_title AS title, page_title AS value
56 FROM {$page} LEFT JOIN {$categorylinks} ON page_id = cl_from
57 WHERE cl_from IS NULL AND page_namespace = {$ns} AND page_is_redirect = 0";
58 }
59
60 }
61
62 function wfSpecialUncategorizedimages() {
63 $uip = new UncategorizedImagesPage();
64 list( $limit, $offset ) = wfCheckLimits();
65 return $uip->doQuery( $offset, $limit );
66 }