r10033 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10032‎ | r10033 | r10034 >
Date:19:19, 9 July 2005
Author:hashar
Status:old
Tags:
Comment:
Fix #1064 by implementing the new Special:Unusedcategories (thanks avar for the name)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialPage.php (modified) (history)
  • /trunk/phase3/includes/SpecialUnusedcategories.php (added) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

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
154 + native
Added: svn:keywords
255 + Author Date Id Revision
Index: trunk/phase3/includes/SpecialPage.php
@@ -44,6 +44,7 @@
4545 'Lonelypages' => new SpecialPage( 'Lonelypages' ),
4646 'Uncategorizedpages'=> new SpecialPage( 'Uncategorizedpages' ),
4747 'Uncategorizedcategories'=> new SpecialPage( 'Uncategorizedcategories' ),
 48+ 'Unusedcategories' => new SpecialPage( 'Unusedcategories' ),
4849 'Unusedimages' => new SpecialPage( 'Unusedimages' ),
4950 'Wantedpages' => new SpecialPage( 'Wantedpages' ),
5051 'Shortpages' => new SpecialPage( 'Shortpages' ),
Index: trunk/phase3/RELEASE-NOTES
@@ -549,6 +549,8 @@
550550 interesting errors with signitures.
551551 * (bug 2764) Number format for Nds
552552 * (bug 1553) Stop forcing lowercase in Monobook skin for German language.
 553+* (bug 1064) Implements Special:Unusedcategories
 554+
553555
554556 === Caveats ===
555557
Index: trunk/phase3/languages/Language.php
@@ -1117,6 +1117,7 @@
11181118 'lonelypages' => 'Orphaned pages',
11191119 'uncategorizedpages' => 'Uncategorized pages',
11201120 'uncategorizedcategories' => 'Uncategorized categories',
 1121+'unusedcategories' => 'Unused categories',
11211122 'unusedimages' => 'Unused files',
11221123 'popularpages' => 'Popular pages',
11231124 'nviews' => '$1 views',
@@ -1156,6 +1157,8 @@
11571158 'unusedimagestext' => '<p>Please note that other web sites may link to an image with
11581159 a direct URL, and so may still be listed here despite being
11591160 in active use.</p>',
 1161+'unusedcategoriestext' => '<p>The following categorie pages exist although no other article or category make use of them.</p>',
 1162+
11601163 'booksources' => 'Book sources',
11611164 'categoriespagetext' => 'The following categories exist in the wiki.',
11621165 'data' => 'Data',

Status & tagging log