New special page: SpecialUncategorizedpages (pages that are not in any category)...
authorArne Heizmann <timwi@users.mediawiki.org>
Wed, 4 Aug 2004 12:52:52 +0000 (12:52 +0000)
committerArne Heizmann <timwi@users.mediawiki.org>
Wed, 4 Aug 2004 12:52:52 +0000 (12:52 +0000)
discussion on German mailing list. Essentially the same thing as Special:Lonelypages but using
categorylinks instead of links.

includes/SpecialPage.php
includes/SpecialUncategorizedpages.php [new file with mode: 0755]
languages/Language.php

index 9cccc3f..46b8aaa 100644 (file)
@@ -1,19 +1,20 @@
 <?php
 global $wgSpecialPages;
 $wgSpecialPages = array(
-       "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" ),
-       "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 (executable)
index 0000000..6c374d8
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+
+require_once( "QueryPage.php" );
+
+class UncategorizedPagesPage extends PageQueryPage {
+
+       function getName() {
+               return "Uncategorizedpages";
+       }
+
+       function sortDescending() {
+               return false;
+       }
+
+       function isExpensive() {
+               return true;
+       }
+       
+       function getSQL() {
+               $dbr =& wfGetDB( DB_SLAVE );
+               extract( $dbr->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 );
+}
+
+?>
index f340071..6d0707f 100644 (file)
@@ -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',