Index: trunk/phase3/includes/SpecialUnusedcategories.php |
— | — | @@ -0,0 +1,52 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * |
| 5 | + * @package MediaWiki |
| 6 | + * @subpackage SpecialPage |
| 7 | + */ |
| 8 | + |
| 9 | +/** */ |
| 10 | +require_once('QueryPage.php'); |
| 11 | + |
| 12 | +/** |
| 13 | + * |
| 14 | + * @package MediaWiki |
| 15 | + * @subpackage SpecialPage |
| 16 | + */ |
| 17 | +class UnusedCategoriesPage extends QueryPage { |
| 18 | + |
| 19 | + function getName() { |
| 20 | + return 'Unusedcategories'; |
| 21 | + } |
| 22 | + |
| 23 | + function getPageHeader() { |
| 24 | + return '<p>'.wfMsg('unusedcategoriestext')."</p><br />\n"; |
| 25 | + } |
| 26 | + |
| 27 | + function getSQL() { |
| 28 | + $NScat = NS_CATEGORY; |
| 29 | + $dbr =& wfGetDB( DB_SLAVE ); |
| 30 | + extract( $dbr->tableNames( 'categorylinks','page' )); |
| 31 | + return "SELECT DISTINCT 'Unusedcategories' as type, |
| 32 | + {$NScat} as namespace, page_title as title, 1 as value |
| 33 | + FROM $page |
| 34 | + LEFT JOIN $categorylinks ON page_title=cl_to |
| 35 | + WHERE cl_from IS NULL |
| 36 | + AND page_namespace = {$NScat} |
| 37 | + AND page_is_redirect = 0"; |
| 38 | + } |
| 39 | + |
| 40 | + function formatResult( $skin, $result ) { |
| 41 | + global $wgLang; |
| 42 | + $title = Title::makeTitle( NS_CATEGORY, $result->title ); |
| 43 | + return $skin->makeLinkObj( $title, $title->getText() ); |
| 44 | + } |
| 45 | +} |
| 46 | + |
| 47 | +/** constructor */ |
| 48 | +function wfSpecialUnusedCategories() { |
| 49 | + list( $limit, $offset ) = wfCheckLimits(); |
| 50 | + $uc = new UnusedCategoriesPage(); |
| 51 | + return $uc->doQuery( $offset, $limit ); |
| 52 | +} |
| 53 | +?> |
Property changes on: trunk/phase3/includes/SpecialUnusedcategories.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 54 | + native |
Added: svn:keywords |
2 | 55 | + Author Date Id Revision |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -44,6 +44,7 @@ |
45 | 45 | 'Lonelypages' => new SpecialPage( 'Lonelypages' ), |
46 | 46 | 'Uncategorizedpages'=> new SpecialPage( 'Uncategorizedpages' ), |
47 | 47 | 'Uncategorizedcategories'=> new SpecialPage( 'Uncategorizedcategories' ), |
| 48 | + 'Unusedcategories' => new SpecialPage( 'Unusedcategories' ), |
48 | 49 | 'Unusedimages' => new SpecialPage( 'Unusedimages' ), |
49 | 50 | 'Wantedpages' => new SpecialPage( 'Wantedpages' ), |
50 | 51 | 'Shortpages' => new SpecialPage( 'Shortpages' ), |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -549,6 +549,8 @@ |
550 | 550 | interesting errors with signitures. |
551 | 551 | * (bug 2764) Number format for Nds |
552 | 552 | * (bug 1553) Stop forcing lowercase in Monobook skin for German language. |
| 553 | +* (bug 1064) Implements Special:Unusedcategories |
| 554 | + |
553 | 555 | |
554 | 556 | === Caveats === |
555 | 557 | |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -1117,6 +1117,7 @@ |
1118 | 1118 | 'lonelypages' => 'Orphaned pages', |
1119 | 1119 | 'uncategorizedpages' => 'Uncategorized pages', |
1120 | 1120 | 'uncategorizedcategories' => 'Uncategorized categories', |
| 1121 | +'unusedcategories' => 'Unused categories', |
1121 | 1122 | 'unusedimages' => 'Unused files', |
1122 | 1123 | 'popularpages' => 'Popular pages', |
1123 | 1124 | 'nviews' => '$1 views', |
— | — | @@ -1156,6 +1157,8 @@ |
1157 | 1158 | 'unusedimagestext' => '<p>Please note that other web sites may link to an image with |
1158 | 1159 | a direct URL, and so may still be listed here despite being |
1159 | 1160 | in active use.</p>', |
| 1161 | +'unusedcategoriestext' => '<p>The following categorie pages exist although no other article or category make use of them.</p>', |
| 1162 | + |
1160 | 1163 | 'booksources' => 'Book sources', |
1161 | 1164 | 'categoriespagetext' => 'The following categories exist in the wiki.', |
1162 | 1165 | 'data' => 'Data', |