From 15fda377a513e16c2195a89110f938a37c1f5684 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sat, 17 Jun 2006 16:24:01 +0000 Subject: [PATCH] (bug 6344) Add Special:Uncategorizedimages page --- RELEASE-NOTES | 2 +- includes/QueryPage.php | 1 + includes/SpecialPage.php | 1 + includes/SpecialUncategorizedimages.php | 55 +++++++++++++++++++++++++ languages/Messages.php | 1 + 5 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 includes/SpecialUncategorizedimages.php diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7163b186be..82cad06ee0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/QueryPage.php b/includes/QueryPage.php index 515e458a3b..53e1761606 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -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' ), diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index fc7efaf473..5ab0987d33 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -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 index 0000000000..3815697630 --- /dev/null +++ b/includes/SpecialUncategorizedimages.php @@ -0,0 +1,55 @@ + + */ + +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 ); +} + +?> diff --git a/languages/Messages.php b/languages/Messages.php index b82bdb50a6..ddd15a76ec 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -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', -- 2.20.1