(bug 6344) Add Special:Uncategorizedimages page
authorRob Church <robchurch@users.mediawiki.org>
Sat, 17 Jun 2006 16:24:01 +0000 (16:24 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sat, 17 Jun 2006 16:24:01 +0000 (16:24 +0000)
RELEASE-NOTES
includes/QueryPage.php
includes/SpecialPage.php
includes/SpecialUncategorizedimages.php [new file with mode: 0644]
languages/Messages.php

index 7163b18..82cad06 100644 (file)
@@ -517,7 +517,7 @@ Some default configuration options have changed:
 * (bug 6300) Bug fixes for sr: variants
 * namespaceDupes.php can now accept an arbitrary prefix, for checking rogue
   interwikis and such. Not yet fully automated.
-
+* (bug 6344) Add Special:Uncategorizedimages page
 
 == Compatibility ==
 
index 515e458..53e1761 100644 (file)
@@ -30,6 +30,7 @@ $wgQueryPages = array(
        array( 'ShortPagesPage',                'Shortpages'                    ),
        array( 'UncategorizedCategoriesPage',   'Uncategorizedcategories'       ),
        array( 'UncategorizedPagesPage',        'Uncategorizedpages'            ),
+       array( 'UncategorizedImagesPage', 'Uncategorizedimages' ),
        array( 'UnusedCategoriesPage',          'Unusedcategories'              ),
        array( 'UnusedimagesPage',              'Unusedimages'                  ),
        array( 'WantedCategoriesPage',          'Wantedcategories'              ),
index fc7efaf..5ab0987 100644 (file)
@@ -39,6 +39,7 @@ $wgSpecialPages = array(
        'Lonelypages'       => new SpecialPage( 'Lonelypages' ),
        'Uncategorizedpages'=> new SpecialPage( 'Uncategorizedpages' ),
        'Uncategorizedcategories'=> new SpecialPage( 'Uncategorizedcategories' ),
+       'Uncategorizedimages' => new SpecialPage( 'Uncategorizedimages' ),
        'Unusedcategories'      => new SpecialPage( 'Unusedcategories' ),
        'Unusedimages'      => new SpecialPage( 'Unusedimages' ),
        'Wantedpages'   => new IncludableSpecialPage( 'Wantedpages' ),
diff --git a/includes/SpecialUncategorizedimages.php b/includes/SpecialUncategorizedimages.php
new file mode 100644 (file)
index 0000000..3815697
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * Special page lists images which haven't been categorised
+ *
+ * @package MediaWiki
+ * @subpackage Special pages
+ * @author Rob Church <robchur@gmail.com>
+ */
+class UncategorizedImagesPage extends QueryPage {
+
+       function getName() {
+               return 'Uncategorizedimages';
+       }
+       
+       function sortDescending() {
+               return false;
+       }
+       
+       function isExpensive() {
+               return true;
+       }
+       
+       function isSyndicated() {
+               return false;
+       }
+       
+       function getSQL() {
+               $dbr =& wfGetDB( DB_SLAVE );
+               extract( $dbr->tableNames( 'page', 'categorylinks' ) );
+               $ns = NS_IMAGE;
+
+               return "SELECT 'Uncategorizedimages' AS type, page_namespace AS namespace,
+                               page_title AS title, page_title AS value
+                               FROM {$page} LEFT JOIN {$categorylinks} ON page_id = cl_from
+                               WHERE cl_from IS NULL AND page_namespace = {$ns} AND page_is_redirect = 0";
+       }
+       
+       function formatResult( &$skin, $row ) {
+               global $wgContLang;
+               $title = Title::makeTitleSafe( NS_IMAGE, $row->title );
+               $label = htmlspecialchars( $wgContLang->convert( $title->getText() ) );
+               return $skin->makeKnownLinkObj( $title, $label );
+       }
+                               
+}
+
+function wfSpecialUncategorizedimages() {
+       $uip = new UncategorizedImagesPage();
+       list( $limit, $offset ) = wfCheckLimits();
+       return $uip->doQuery( $offset, $limit );
+}
+
+?>
index b82bdb5..ddd15a7 100644 (file)
@@ -952,6 +952,7 @@ The [http://meta.wikimedia.org/wiki/Help:Job_queue job queue] length is '''$7'''
 'lonelypages'  => 'Orphaned pages',
 'uncategorizedpages'   => 'Uncategorized pages',
 'uncategorizedcategories'      => 'Uncategorized categories',
+'uncategorizedimages' => 'Uncategorized images',
 'unusedcategories' => 'Unused categories',
 'unusedimages' => 'Unused files',
 'popularpages' => 'Popular pages',