From 4a8bebbf71d3a73cb82115c11336fe1629a3c948 Mon Sep 17 00:00:00 2001 From: Arne Heizmann Date: Wed, 4 Aug 2004 12:52:52 +0000 Subject: [PATCH] New special page: SpecialUncategorizedpages (pages that are not in any category). Inspired by discussion on German mailing list. Essentially the same thing as Special:Lonelypages but using categorylinks instead of links. --- includes/SpecialPage.php | 27 ++++++++++--------- includes/SpecialUncategorizedpages.php | 37 ++++++++++++++++++++++++++ languages/Language.php | 1 + 3 files changed, 52 insertions(+), 13 deletions(-) create mode 100755 includes/SpecialUncategorizedpages.php diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 9cccc3f7ef..46b8aaa6dd 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -1,19 +1,20 @@ new UnlistedSpecialPage( "Userlogin" ), - "Userlogout" => new UnlistedSpecialPage( "Userlogout" ), - "Preferences" => new SpecialPage( "Preferences" ), - "Watchlist" => new SpecialPage( "Watchlist" ), - "Recentchanges" => new SpecialPage( "Recentchanges" ), - "Upload" => new SpecialPage( "Upload" ), - "Imagelist" => new SpecialPage( "Imagelist" ), - "Listusers" => new SpecialPage( "Listusers" ), - "Listadmins" => new SpecialPage( "Listadmins" ), - "Statistics" => new SpecialPage( "Statistics" ), - "Randompage" => new SpecialPage( "Randompage" ), - "Lonelypages" => new SpecialPage( "Lonelypages" ), - "Unusedimages" => new SpecialPage( "Unusedimages" ) + "Userlogin" => new UnlistedSpecialPage( "Userlogin" ), + "Userlogout" => new UnlistedSpecialPage( "Userlogout" ), + "Preferences" => new SpecialPage( "Preferences" ), + "Watchlist" => new SpecialPage( "Watchlist" ), + "Recentchanges" => new SpecialPage( "Recentchanges" ), + "Upload" => new SpecialPage( "Upload" ), + "Imagelist" => new SpecialPage( "Imagelist" ), + "Listusers" => new SpecialPage( "Listusers" ), + "Listadmins" => new SpecialPage( "Listadmins" ), + "Statistics" => new SpecialPage( "Statistics" ), + "Randompage" => new SpecialPage( "Randompage" ), + "Lonelypages" => new SpecialPage( "Lonelypages" ), + "Uncategorizedpages"=> new SpecialPage( "Uncategorizedpages" ), + "Unusedimages" => new SpecialPage( "Unusedimages" ) ); global $wgDisableCounters; if( !$wgDisableCounters ) diff --git a/includes/SpecialUncategorizedpages.php b/includes/SpecialUncategorizedpages.php new file mode 100755 index 0000000000..6c374d8c61 --- /dev/null +++ b/includes/SpecialUncategorizedpages.php @@ -0,0 +1,37 @@ +tableNames( 'cur', 'categorylinks' ) ); + + return "SELECT 'Uncategorizedpages' as type, cur_namespace AS namespace, cur_title AS title, cur_title AS value " . + "FROM $cur LEFT JOIN $categorylinks ON cur_id=cl_to ". + "WHERE cl_to IS NULL AND cur_namespace=0 AND cur_is_redirect=0"; + } +} + +function wfSpecialUncategorizedpages() { + list( $limit, $offset ) = wfCheckLimits(); + + $lpp = new UncategorizedPagesPage(); + + return $lpp->doQuery( $offset, $limit ); +} + +?> diff --git a/languages/Language.php b/languages/Language.php index f340071e66..6d0707f821 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -958,6 +958,7 @@ That comes to '''$5''' average edits per page, and '''$6''' views per edit.", 'geo' => 'GEO coordinates', 'validate' => 'Validate page', 'lonelypages' => 'Orphaned pages', +'uncategorizedpages' => 'Uncategorized pages', 'unusedimages' => 'Unused images', 'popularpages' => 'Popular pages', 'nviews' => '$1 views', -- 2.20.1