Revision: 46196
Author:   simetrical
Date:     2009-01-25 12:43:55 +0000 (Sun, 25 Jan 2009)

Log Message:
-----------
__IGNOREUNUSED__ excludes cats from UnusedCategories

An extra left join and filter condition added to the query.  Should
cause no significant performance issues.  Patch by Ahmad Sherif (bug
17145).

Modified Paths:
--------------
    trunk/phase3/CREDITS
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/MagicWord.php
    trunk/phase3/includes/parser/Parser.php
    trunk/phase3/includes/specials/SpecialUnusedcategories.php
    trunk/phase3/languages/messages/MessagesEn.php

Modified: trunk/phase3/CREDITS
===================================================================
--- trunk/phase3/CREDITS        2009-01-25 12:24:02 UTC (rev 46195)
+++ trunk/phase3/CREDITS        2009-01-25 12:43:55 UTC (rev 46196)
@@ -56,6 +56,7 @@
 
 == Patch Contributors ==
 * Agbad
+* Ahmad Sherif
 * Brad Jorsch
 * Brent G
 * Daniel Arnold

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2009-01-25 12:24:02 UTC (rev 46195)
+++ trunk/phase3/RELEASE-NOTES  2009-01-25 12:43:55 UTC (rev 46196)
@@ -60,6 +60,8 @@
   link instead of Go button & Search button
 * (bug 2314) Add links to user custom CSS and JS to Special:Preferences
 * More helpful error message on raw page access if PHP_SELF isn't set
+* (bug 17145) Specific categories can be excluded from Special:UnusedCategories
+  with __IGNOREUNUSED__
 
 === Bug fixes in 1.15 ===
 * (bug 16968) Special:Upload no longer throws useless warnings.

Modified: trunk/phase3/includes/MagicWord.php
===================================================================
--- trunk/phase3/includes/MagicWord.php 2009-01-25 12:24:02 UTC (rev 46195)
+++ trunk/phase3/includes/MagicWord.php 2009-01-25 12:43:55 UTC (rev 46196)
@@ -159,6 +159,7 @@
                'noeditsection',
                'newsectionlink',
                'hiddencat',
+               'ignoreunused',
                'index',
                'noindex',
                'staticredirect',

Modified: trunk/phase3/includes/parser/Parser.php
===================================================================
--- trunk/phase3/includes/parser/Parser.php     2009-01-25 12:24:02 UTC (rev 
46195)
+++ trunk/phase3/includes/parser/Parser.php     2009-01-25 12:43:55 UTC (rev 
46196)
@@ -3439,6 +3439,9 @@
                                wfDebug( __METHOD__.": 
[[MediaWiki:hidden-category-category]] is not a valid title!\n" );
                        }
                }
+               if ( isset( $this->mDoubleUnderscores['ignoreunused'] ) && 
$this->mTitle->getNamespace() == NS_CATEGORY ) {
+                       $this->mOutput->setProperty( 'ignoreunused', 'y' );
+               }
                # (bug 8068) Allow control over whether robots index a page.
                #
                # FIXME (bug 14899): __INDEX__ always overrides __NOINDEX__ 
here!  This

Modified: trunk/phase3/includes/specials/SpecialUnusedcategories.php
===================================================================
--- trunk/phase3/includes/specials/SpecialUnusedcategories.php  2009-01-25 
12:24:02 UTC (rev 46195)
+++ trunk/phase3/includes/specials/SpecialUnusedcategories.php  2009-01-25 
12:43:55 UTC (rev 46196)
@@ -22,14 +22,16 @@
        function getSQL() {
                $NScat = NS_CATEGORY;
                $dbr = wfGetDB( DB_SLAVE );
-               list( $categorylinks, $page ) = $dbr->tableNamesN( 
'categorylinks', 'page' );
+               list( $categorylinks, $page, $page_props ) = $dbr->tableNamesN( 
'categorylinks', 'page', 'page_props' );
                return "SELECT 'Unusedcategories' as type,
                                {$NScat} as namespace, page_title as title, 
page_title as value
                                FROM $page
                                LEFT JOIN $categorylinks ON page_title=cl_to
+                               LEFT JOIN $page_props ON pp_page=page_id
                                WHERE cl_from IS NULL
                                AND page_namespace = {$NScat}
-                               AND page_is_redirect = 0";
+                               AND page_is_redirect = 0
+                               AND (pp_propname IS NULL OR pp_propname != 
'ignoreunused')";
        }
 
        function formatResult( $skin, $result ) {

Modified: trunk/phase3/languages/messages/MessagesEn.php
===================================================================
--- trunk/phase3/languages/messages/MessagesEn.php      2009-01-25 12:24:02 UTC 
(rev 46195)
+++ trunk/phase3/languages/messages/MessagesEn.php      2009-01-25 12:43:55 UTC 
(rev 46196)
@@ -327,6 +327,7 @@
        'filepath'               => array( 0,    'FILEPATH:'              ),
        'tag'                    => array( 0,    'tag'                    ),
        'hiddencat'              => array( 1,    '__HIDDENCAT__'          ),
+       'ignoreunused'           => array( 1,    '__IGNOREUNUSED__'       ),
        'pagesincategory'        => array( 1,    'PAGESINCATEGORY', 
'PAGESINCAT' ),
        'pagesize'               => array( 1,    'PAGESIZE'               ),
        'index'                  => array( 1,    '__INDEX__'              ),



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to