http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65351

Revision: 65351
Author:   siebrand
Date:     2010-04-20 23:06:59 +0000 (Tue, 20 Apr 2010)

Log Message:
-----------
(bug 22647) Add category details in search results. Contributed by Lejonel.

Modified Paths:
--------------
    trunk/phase3/CREDITS
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/specials/SpecialSearch.php
    trunk/phase3/languages/messages/MessagesEn.php
    trunk/phase3/maintenance/language/messages.inc

Modified: trunk/phase3/CREDITS
===================================================================
--- trunk/phase3/CREDITS        2010-04-20 22:49:50 UTC (rev 65350)
+++ trunk/phase3/CREDITS        2010-04-20 23:06:59 UTC (rev 65351)
@@ -89,9 +89,10 @@
 * Karun Dambietz
 * Kim Hyun-Joon
 * Lee Worden
+* Lejonel
 * liangent
+* Louperivois
 * Lucas Garczewski
-* Louperivois
 * Luigi Corsaro
 * Manuel Menal
 * Marcin Cieślak

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2010-04-20 22:49:50 UTC (rev 65350)
+++ trunk/phase3/RELEASE-NOTES  2010-04-20 23:06:59 UTC (rev 65351)
@@ -51,6 +51,7 @@
 * (bug 23206) Add Special::Search hook for detecting successful "Go"
 * When visiting a "red link" of a deleted file, a deletion and move log excerpt
   is provided on the Upload form.
+* (bug 22647) Add category details in search results.
 
 === Bug fixes in 1.17 ===
 * (bug 17560) Half-broken deletion moved image files to deletion archive

Modified: trunk/phase3/includes/specials/SpecialSearch.php
===================================================================
--- trunk/phase3/includes/specials/SpecialSearch.php    2010-04-20 22:49:50 UTC 
(rev 65350)
+++ trunk/phase3/includes/specials/SpecialSearch.php    2010-04-20 23:06:59 UTC 
(rev 65351)
@@ -539,6 +539,18 @@
                        $this->sk->formatSize( $byteSize ),
                        $wgLang->formatNum( $wordCount )
                );
+
+               if( $t->getNamespace() == NS_CATEGORY ) {
+                       $cat = Category::newFromTitle( $t );
+                       $size = wfMsgExt(
+                               'search-result-category-size',
+                               array( 'parsemag', 'escape' ),
+                               $wgLang->formatNum( $cat->getPageCount() ),
+                               $wgLang->formatNum( $cat->getSubcatCount() ),
+                               $wgLang->formatNum( $cat->getFileCount() )
+                       );
+               }
+
                $date = $wgLang->timeanddate( $timestamp );
 
                // link to related articles if supported

Modified: trunk/phase3/languages/messages/MessagesEn.php
===================================================================
--- trunk/phase3/languages/messages/MessagesEn.php      2010-04-20 22:49:50 UTC 
(rev 65350)
+++ trunk/phase3/languages/messages/MessagesEn.php      2010-04-20 23:06:59 UTC 
(rev 65351)
@@ -1625,6 +1625,7 @@
 'searchprofile-everything-tooltip' => 'Search all of content (including talk 
pages)',
 'searchprofile-advanced-tooltip'   => 'Search in custom namespaces',
 'search-result-size'               => '$1 ({{PLURAL:$2|1 word|$2 words}})',
+'search-result-category-size'      => '{{PLURAL:$1|1 member|$1 members}} 
({{PLURAL:$2|1 subcategory|$2 subcategories}}, {{PLURAL:$3|1 file|$3 files}})',
 'search-result-score'              => 'Relevance: $1%',
 'search-redirect'                  => '(redirect $1)',
 'search-section'                   => '(section $1)',

Modified: trunk/phase3/maintenance/language/messages.inc
===================================================================
--- trunk/phase3/maintenance/language/messages.inc      2010-04-20 22:49:50 UTC 
(rev 65350)
+++ trunk/phase3/maintenance/language/messages.inc      2010-04-20 23:06:59 UTC 
(rev 65351)
@@ -818,6 +818,7 @@
                'searchprofile-everything-tooltip',
                'searchprofile-advanced-tooltip',
                'search-result-size',
+               'search-result-category-size',
                'search-result-score',
                'search-redirect',
                'search-section',



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

Reply via email to