Merge "Add ss_active_users in SiteStats::isSane"
[mediawiki.git] / includes / actions / InfoAction.php
blob7cd1f72ee681a78a98b24a0bd0e872171ea87b62
1 <?php
2 /**
3 * Displays information about a page.
5 * Copyright © 2011 Alexandre Emsenhuber
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 * @file
22 * @ingroup Actions
25 /**
26 * Displays information about a page.
28 * @ingroup Actions
30 class InfoAction extends FormlessAction {
31 /**
32 * Returns the name of the action this object responds to.
34 * @return string lowercase
36 public function getName() {
37 return 'info';
40 /**
41 * Whether this action can still be executed by a blocked user.
43 * @return bool
45 public function requiresUnblock() {
46 return false;
49 /**
50 * Whether this action requires the wiki not to be locked.
52 * @return bool
54 public function requiresWrite() {
55 return false;
58 /**
59 * Clear the info cache for a given Title.
61 * @since 1.22
62 * @param Title $title Title to clear cache for
64 public static function invalidateCache( Title $title ) {
65 global $wgMemc;
66 // Clear page info.
67 $revision = WikiPage::factory( $title )->getRevision();
68 if ( $revision !== null ) {
69 $memcKey = wfMemcKey( 'infoaction', $title->getPrefixedText(), $revision->getId() );
70 $wgMemc->delete( $memcKey );
74 /**
75 * Shows page information on GET request.
77 * @return string Page information that will be added to the output
79 public function onView() {
80 $content = '';
82 // Validate revision
83 $oldid = $this->page->getOldID();
84 if ( $oldid ) {
85 $revision = $this->page->getRevisionFetched();
87 // Revision is missing
88 if ( $revision === null ) {
89 return $this->msg( 'missing-revision', $oldid )->parse();
92 // Revision is not current
93 if ( !$revision->isCurrent() ) {
94 return $this->msg( 'pageinfo-not-current' )->plain();
98 // Page header
99 if ( !$this->msg( 'pageinfo-header' )->isDisabled() ) {
100 $content .= $this->msg( 'pageinfo-header' )->parse();
103 // Hide "This page is a member of # hidden categories" explanation
104 $content .= Html::element( 'style', array(),
105 '.mw-hiddenCategoriesExplanation { display: none; }' ) . "\n";
107 // Hide "Templates used on this page" explanation
108 $content .= Html::element( 'style', array(),
109 '.mw-templatesUsedExplanation { display: none; }' ) . "\n";
111 // Get page information
112 $pageInfo = $this->pageInfo();
114 // Allow extensions to add additional information
115 wfRunHooks( 'InfoAction', array( $this->getContext(), &$pageInfo ) );
117 // Render page information
118 foreach ( $pageInfo as $header => $infoTable ) {
119 $content .= $this->makeHeader( $this->msg( "pageinfo-${header}" )->escaped() ) . "\n";
120 $table = "\n";
121 foreach ( $infoTable as $infoRow ) {
122 $name = ( $infoRow[0] instanceof Message ) ? $infoRow[0]->escaped() : $infoRow[0];
123 $value = ( $infoRow[1] instanceof Message ) ? $infoRow[1]->escaped() : $infoRow[1];
124 $table = $this->addRow( $table, $name, $value ) . "\n";
126 $content = $this->addTable( $content, $table ) . "\n";
129 // Page footer
130 if ( !$this->msg( 'pageinfo-footer' )->isDisabled() ) {
131 $content .= $this->msg( 'pageinfo-footer' )->parse();
134 // Page credits
135 /*if ( $this->page->exists() ) {
136 $content .= Html::rawElement( 'div', array( 'id' => 'mw-credits' ), $this->getContributors() );
139 return $content;
143 * Creates a header that can be added to the output.
145 * @param string $header The header text.
146 * @return string The HTML.
148 protected function makeHeader( $header ) {
149 $spanAttribs = array( 'class' => 'mw-headline', 'id' => Sanitizer::escapeId( $header ) );
150 return Html::rawElement( 'h2', array(), Html::element( 'span', $spanAttribs, $header ) );
154 * Adds a row to a table that will be added to the content.
156 * @param string $table The table that will be added to the content
157 * @param string $name The name of the row
158 * @param string $value The value of the row
159 * @return string The table with the row added
161 protected function addRow( $table, $name, $value ) {
162 return $table . Html::rawElement( 'tr', array(),
163 Html::rawElement( 'td', array( 'style' => 'vertical-align: top;' ), $name ) .
164 Html::rawElement( 'td', array(), $value )
169 * Adds a table to the content that will be added to the output.
171 * @param string $content The content that will be added to the output
172 * @param string $table The table
173 * @return string The content with the table added
175 protected function addTable( $content, $table ) {
176 return $content . Html::rawElement( 'table', array( 'class' => 'wikitable mw-page-info' ),
177 $table );
181 * Returns page information in an easily-manipulated format. Array keys are used so extensions
182 * may add additional information in arbitrary positions. Array values are arrays with one
183 * element to be rendered as a header, arrays with two elements to be rendered as a table row.
185 * @return array
187 protected function pageInfo() {
188 global $wgContLang, $wgRCMaxAge, $wgMemc, $wgUnwatchedPageThreshold, $wgPageInfoTransclusionLimit;
190 $user = $this->getUser();
191 $lang = $this->getLanguage();
192 $title = $this->getTitle();
193 $id = $title->getArticleID();
195 $memcKey = wfMemcKey( 'infoaction', sha1( $title->getPrefixedText() ), $this->page->getLatest() );
196 $pageCounts = $wgMemc->get( $memcKey );
197 if ( $pageCounts === false ) {
198 // Get page information that would be too "expensive" to retrieve by normal means
199 $pageCounts = self::pageCounts( $title );
201 $wgMemc->set( $memcKey, $pageCounts );
204 // Get page properties
205 $dbr = wfGetDB( DB_SLAVE );
206 $result = $dbr->select(
207 'page_props',
208 array( 'pp_propname', 'pp_value' ),
209 array( 'pp_page' => $id ),
210 __METHOD__
213 $pageProperties = array();
214 foreach ( $result as $row ) {
215 $pageProperties[$row->pp_propname] = $row->pp_value;
218 // Basic information
219 $pageInfo = array();
220 $pageInfo['header-basic'] = array();
222 // Display title
223 $displayTitle = $title->getPrefixedText();
224 if ( !empty( $pageProperties['displaytitle'] ) ) {
225 $displayTitle = $pageProperties['displaytitle'];
228 $pageInfo['header-basic'][] = array(
229 $this->msg( 'pageinfo-display-title' ), $displayTitle
232 // Is it a redirect? If so, where to?
233 if ( $title->isRedirect() ) {
234 $pageInfo['header-basic'][] = array(
235 $this->msg( 'pageinfo-redirectsto' ),
236 Linker::link( $this->page->getRedirectTarget() ) .
237 $this->msg( 'word-separator' )->text() .
238 $this->msg( 'parentheses', Linker::link(
239 $this->page->getRedirectTarget(),
240 $this->msg( 'pageinfo-redirectsto-info' )->escaped(),
241 array(),
242 array( 'action' => 'info' )
243 ) )->text()
247 // Default sort key
248 $sortKey = $title->getCategorySortkey();
249 if ( !empty( $pageProperties['defaultsort'] ) ) {
250 $sortKey = $pageProperties['defaultsort'];
253 $pageInfo['header-basic'][] = array( $this->msg( 'pageinfo-default-sort' ), $sortKey );
255 // Page length (in bytes)
256 $pageInfo['header-basic'][] = array(
257 $this->msg( 'pageinfo-length' ), $lang->formatNum( $title->getLength() )
260 // Page ID (number not localised, as it's a database ID)
261 $pageInfo['header-basic'][] = array( $this->msg( 'pageinfo-article-id' ), $id );
263 // Language in which the page content is (supposed to be) written
264 $pageLang = $title->getPageLanguage()->getCode();
265 $pageInfo['header-basic'][] = array( $this->msg( 'pageinfo-language' ),
266 Language::fetchLanguageName( $pageLang, $lang->getCode() )
267 . ' ' . $this->msg( 'parentheses', $pageLang ) );
269 // Search engine status
270 $pOutput = new ParserOutput();
271 if ( isset( $pageProperties['noindex'] ) ) {
272 $pOutput->setIndexPolicy( 'noindex' );
275 // Use robot policy logic
276 $policy = $this->page->getRobotPolicy( 'view', $pOutput );
277 $pageInfo['header-basic'][] = array(
278 $this->msg( 'pageinfo-robot-policy' ), $this->msg( "pageinfo-robot-${policy['index']}" )
281 if ( isset( $pageCounts['views'] ) ) {
282 // Number of views
283 $pageInfo['header-basic'][] = array(
284 $this->msg( 'pageinfo-views' ), $lang->formatNum( $pageCounts['views'] )
288 if (
289 $user->isAllowed( 'unwatchedpages' ) ||
290 ( $wgUnwatchedPageThreshold !== false &&
291 $pageCounts['watchers'] >= $wgUnwatchedPageThreshold )
293 // Number of page watchers
294 $pageInfo['header-basic'][] = array(
295 $this->msg( 'pageinfo-watchers' ), $lang->formatNum( $pageCounts['watchers'] )
297 } elseif ( $wgUnwatchedPageThreshold !== false ) {
298 $pageInfo['header-basic'][] = array(
299 $this->msg( 'pageinfo-watchers' ),
300 $this->msg( 'pageinfo-few-watchers' )->numParams( $wgUnwatchedPageThreshold )
304 // Redirects to this page
305 $whatLinksHere = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedText() );
306 $pageInfo['header-basic'][] = array(
307 Linker::link(
308 $whatLinksHere,
309 $this->msg( 'pageinfo-redirects-name' )->escaped(),
310 array(),
311 array( 'hidelinks' => 1, 'hidetrans' => 1 )
313 $this->msg( 'pageinfo-redirects-value' )
314 ->numParams( count( $title->getRedirectsHere() ) )
317 // Is it counted as a content page?
318 if ( $this->page->isCountable() ) {
319 $pageInfo['header-basic'][] = array(
320 $this->msg( 'pageinfo-contentpage' ),
321 $this->msg( 'pageinfo-contentpage-yes' )
325 // Subpages of this page, if subpages are enabled for the current NS
326 if ( MWNamespace::hasSubpages( $title->getNamespace() ) ) {
327 $prefixIndex = SpecialPage::getTitleFor( 'Prefixindex', $title->getPrefixedText() . '/' );
328 $pageInfo['header-basic'][] = array(
329 Linker::link( $prefixIndex, $this->msg( 'pageinfo-subpages-name' )->escaped() ),
330 $this->msg( 'pageinfo-subpages-value' )
331 ->numParams(
332 $pageCounts['subpages']['total'],
333 $pageCounts['subpages']['redirects'],
334 $pageCounts['subpages']['nonredirects'] )
338 if ( $title->inNamespace( NS_CATEGORY ) ) {
339 $category = Category::newFromTitle( $title );
340 $pageInfo['category-info'] = array(
341 array(
342 $this->msg( 'pageinfo-category-pages' ),
343 $lang->formatNum( $category->getPageCount() )
345 array(
346 $this->msg( 'pageinfo-category-subcats' ),
347 $lang->formatNum( $category->getSubcatCount() )
349 array(
350 $this->msg( 'pageinfo-category-files' ),
351 $lang->formatNum( $category->getFileCount() )
356 // Page protection
357 $pageInfo['header-restrictions'] = array();
359 // Is this page effected by the cascading protection of something which includes it?
360 if ( $title->isCascadeProtected() ) {
361 $cascadingFrom = '';
362 $sources = $title->getCascadeProtectionSources(); // Array deferencing is in PHP 5.4 :(
364 foreach ( $sources[0] as $sourceTitle ) {
365 $cascadingFrom .= Html::rawElement( 'li', array(), Linker::linkKnown( $sourceTitle ) );
368 $cascadingFrom = Html::rawElement( 'ul', array(), $cascadingFrom );
369 $pageInfo['header-restrictions'][] = array(
370 $this->msg( 'pageinfo-protect-cascading-from' ),
371 $cascadingFrom
375 // Is out protection set to cascade to other pages?
376 if ( $title->areRestrictionsCascading() ) {
377 $pageInfo['header-restrictions'][] = array(
378 $this->msg( 'pageinfo-protect-cascading' ),
379 $this->msg( 'pageinfo-protect-cascading-yes' )
383 // Page protection
384 foreach ( $title->getRestrictionTypes() as $restrictionType ) {
385 $protectionLevel = implode( ', ', $title->getRestrictions( $restrictionType ) );
387 if ( $protectionLevel == '' ) {
388 // Allow all users
389 $message = $this->msg( 'protect-default' )->escaped();
390 } else {
391 // Administrators only
392 $message = $this->msg( "protect-level-$protectionLevel" );
393 if ( $message->isDisabled() ) {
394 // Require "$1" permission
395 $message = $this->msg( "protect-fallback", $protectionLevel )->parse();
396 } else {
397 $message = $message->escaped();
401 $pageInfo['header-restrictions'][] = array(
402 $this->msg( "restriction-$restrictionType" ), $message
406 if ( !$this->page->exists() ) {
407 return $pageInfo;
410 // Edit history
411 $pageInfo['header-edits'] = array();
413 $firstRev = $this->page->getOldestRevision();
414 $lastRev = $this->page->getRevision();
415 $batch = new LinkBatch;
417 if ( $firstRev ) {
418 $firstRevUser = $firstRev->getUserText( Revision::FOR_THIS_USER );
419 if ( $firstRevUser !== '' ) {
420 $batch->add( NS_USER, $firstRevUser );
421 $batch->add( NS_USER_TALK, $firstRevUser );
425 if ( $lastRev ) {
426 $lastRevUser = $lastRev->getUserText( Revision::FOR_THIS_USER );
427 if ( $lastRevUser !== '' ) {
428 $batch->add( NS_USER, $lastRevUser );
429 $batch->add( NS_USER_TALK, $lastRevUser );
433 $batch->execute();
435 if ( $firstRev ) {
436 // Page creator
437 $pageInfo['header-edits'][] = array(
438 $this->msg( 'pageinfo-firstuser' ),
439 Linker::revUserTools( $firstRev )
442 // Date of page creation
443 $pageInfo['header-edits'][] = array(
444 $this->msg( 'pageinfo-firsttime' ),
445 Linker::linkKnown(
446 $title,
447 $lang->userTimeAndDate( $firstRev->getTimestamp(), $user ),
448 array(),
449 array( 'oldid' => $firstRev->getId() )
454 if ( $lastRev ) {
455 // Latest editor
456 $pageInfo['header-edits'][] = array(
457 $this->msg( 'pageinfo-lastuser' ),
458 Linker::revUserTools( $lastRev )
461 // Date of latest edit
462 $pageInfo['header-edits'][] = array(
463 $this->msg( 'pageinfo-lasttime' ),
464 Linker::linkKnown(
465 $title,
466 $lang->userTimeAndDate( $this->page->getTimestamp(), $user ),
467 array(),
468 array( 'oldid' => $this->page->getLatest() )
473 // Total number of edits
474 $pageInfo['header-edits'][] = array(
475 $this->msg( 'pageinfo-edits' ), $lang->formatNum( $pageCounts['edits'] )
478 // Total number of distinct authors
479 $pageInfo['header-edits'][] = array(
480 $this->msg( 'pageinfo-authors' ), $lang->formatNum( $pageCounts['authors'] )
483 // Recent number of edits (within past 30 days)
484 $pageInfo['header-edits'][] = array(
485 $this->msg( 'pageinfo-recent-edits', $lang->formatDuration( $wgRCMaxAge ) ),
486 $lang->formatNum( $pageCounts['recent_edits'] )
489 // Recent number of distinct authors
490 $pageInfo['header-edits'][] = array(
491 $this->msg( 'pageinfo-recent-authors' ), $lang->formatNum( $pageCounts['recent_authors'] )
494 // Array of MagicWord objects
495 $magicWords = MagicWord::getDoubleUnderscoreArray();
497 // Array of magic word IDs
498 $wordIDs = $magicWords->names;
500 // Array of IDs => localized magic words
501 $localizedWords = $wgContLang->getMagicWords();
503 $listItems = array();
504 foreach ( $pageProperties as $property => $value ) {
505 if ( in_array( $property, $wordIDs ) ) {
506 $listItems[] = Html::element( 'li', array(), $localizedWords[$property][1] );
510 $localizedList = Html::rawElement( 'ul', array(), implode( '', $listItems ) );
511 $hiddenCategories = $this->page->getHiddenCategories();
513 if (
514 count( $listItems ) > 0 ||
515 count( $hiddenCategories ) > 0 ||
516 $pageCounts['transclusion']['from'] > 0 ||
517 $pageCounts['transclusion']['to'] > 0
519 $options = array( 'LIMIT' => $wgPageInfoTransclusionLimit );
520 $transcludedTemplates = $title->getTemplateLinksFrom( $options );
521 $transcludedTargets = $title->getTemplateLinksTo( $options );
523 // Page properties
524 $pageInfo['header-properties'] = array();
526 // Magic words
527 if ( count( $listItems ) > 0 ) {
528 $pageInfo['header-properties'][] = array(
529 $this->msg( 'pageinfo-magic-words' )->numParams( count( $listItems ) ),
530 $localizedList
534 // Hidden categories
535 if ( count( $hiddenCategories ) > 0 ) {
536 $pageInfo['header-properties'][] = array(
537 $this->msg( 'pageinfo-hidden-categories' )
538 ->numParams( count( $hiddenCategories ) ),
539 Linker::formatHiddenCategories( $hiddenCategories )
543 // Transcluded templates
544 if ( $pageCounts['transclusion']['from'] > 0 ) {
545 if ( $pageCounts['transclusion']['from'] > count( $transcludedTemplates ) ) {
546 $more = $this->msg( 'morenotlisted' )->escaped();
547 } else {
548 $more = null;
551 $pageInfo['header-properties'][] = array(
552 $this->msg( 'pageinfo-templates' )
553 ->numParams( $pageCounts['transclusion']['from'] ),
554 Linker::formatTemplates(
555 $transcludedTemplates,
556 false,
557 false,
558 $more )
562 if ( $pageCounts['transclusion']['to'] > 0 ) {
563 if ( $pageCounts['transclusion']['to'] > count( $transcludedTargets ) ) {
564 $more = Linker::link(
565 $whatLinksHere,
566 $this->msg( 'moredotdotdot' )->escaped(),
567 array(),
568 array( 'hidelinks' => 1, 'hideredirs' => 1 )
570 } else {
571 $more = null;
574 $pageInfo['header-properties'][] = array(
575 $this->msg( 'pageinfo-transclusions' )
576 ->numParams( $pageCounts['transclusion']['to'] ),
577 Linker::formatTemplates(
578 $transcludedTargets,
579 false,
580 false,
581 $more )
586 return $pageInfo;
590 * Returns page counts that would be too "expensive" to retrieve by normal means.
592 * @param Title $title Title to get counts for
593 * @return array
595 protected static function pageCounts( Title $title ) {
596 global $wgRCMaxAge, $wgDisableCounters;
598 wfProfileIn( __METHOD__ );
599 $id = $title->getArticleID();
601 $dbr = wfGetDB( DB_SLAVE );
602 $result = array();
604 if ( !$wgDisableCounters ) {
605 // Number of views
606 $views = (int) $dbr->selectField(
607 'page',
608 'page_counter',
609 array( 'page_id' => $id ),
610 __METHOD__
612 $result['views'] = $views;
615 // Number of page watchers
616 $watchers = (int) $dbr->selectField(
617 'watchlist',
618 'COUNT(*)',
619 array(
620 'wl_namespace' => $title->getNamespace(),
621 'wl_title' => $title->getDBkey(),
623 __METHOD__
625 $result['watchers'] = $watchers;
627 // Total number of edits
628 $edits = (int) $dbr->selectField(
629 'revision',
630 'COUNT(rev_page)',
631 array( 'rev_page' => $id ),
632 __METHOD__
634 $result['edits'] = $edits;
636 // Total number of distinct authors
637 $authors = (int) $dbr->selectField(
638 'revision',
639 'COUNT(DISTINCT rev_user_text)',
640 array( 'rev_page' => $id ),
641 __METHOD__
643 $result['authors'] = $authors;
645 // "Recent" threshold defined by $wgRCMaxAge
646 $threshold = $dbr->timestamp( time() - $wgRCMaxAge );
648 // Recent number of edits
649 $edits = (int) $dbr->selectField(
650 'revision',
651 'COUNT(rev_page)',
652 array(
653 'rev_page' => $id,
654 "rev_timestamp >= " . $dbr->addQuotes( $threshold )
656 __METHOD__
658 $result['recent_edits'] = $edits;
660 // Recent number of distinct authors
661 $authors = (int) $dbr->selectField(
662 'revision',
663 'COUNT(DISTINCT rev_user_text)',
664 array(
665 'rev_page' => $id,
666 "rev_timestamp >= " . $dbr->addQuotes( $threshold )
668 __METHOD__
670 $result['recent_authors'] = $authors;
672 // Subpages (if enabled)
673 if ( MWNamespace::hasSubpages( $title->getNamespace() ) ) {
674 $conds = array( 'page_namespace' => $title->getNamespace() );
675 $conds[] = 'page_title ' . $dbr->buildLike( $title->getDBkey() . '/', $dbr->anyString() );
677 // Subpages of this page (redirects)
678 $conds['page_is_redirect'] = 1;
679 $result['subpages']['redirects'] = (int) $dbr->selectField(
680 'page',
681 'COUNT(page_id)',
682 $conds,
683 __METHOD__ );
685 // Subpages of this page (non-redirects)
686 $conds['page_is_redirect'] = 0;
687 $result['subpages']['nonredirects'] = (int) $dbr->selectField(
688 'page',
689 'COUNT(page_id)',
690 $conds,
691 __METHOD__
694 // Subpages of this page (total)
695 $result['subpages']['total'] = $result['subpages']['redirects']
696 + $result['subpages']['nonredirects'];
699 // Counts for the number of transclusion links (to/from)
700 $result['transclusion']['to'] = (int) $dbr->selectField(
701 'templatelinks',
702 'COUNT(tl_from)',
703 array(
704 'tl_namespace' => $title->getNamespace(),
705 'tl_title' => $title->getDBkey()
707 __METHOD__
710 $result['transclusion']['from'] = (int) $dbr->selectField(
711 'templatelinks',
712 'COUNT(*)',
713 array( 'tl_from' => $title->getArticleID() ),
714 __METHOD__
717 wfProfileOut( __METHOD__ );
718 return $result;
722 * Returns the name that goes in the "<h1>" page title.
724 * @return string
726 protected function getPageTitle() {
727 return $this->msg( 'pageinfo-title', $this->getTitle()->getPrefixedText() )->text();
731 * Get a list of contributors of $article
732 * @return string: html
734 protected function getContributors() {
735 global $wgHiddenPrefs;
737 $contributors = $this->page->getContributors();
738 $real_names = array();
739 $user_names = array();
740 $anon_ips = array();
742 # Sift for real versus user names
743 foreach ( $contributors as $user ) {
744 $page = $user->isAnon()
745 ? SpecialPage::getTitleFor( 'Contributions', $user->getName() )
746 : $user->getUserPage();
748 if ( $user->getID() == 0 ) {
749 $anon_ips[] = Linker::link( $page, htmlspecialchars( $user->getName() ) );
750 } elseif ( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() ) {
751 $real_names[] = Linker::link( $page, htmlspecialchars( $user->getRealName() ) );
752 } else {
753 $user_names[] = Linker::link( $page, htmlspecialchars( $user->getName() ) );
757 $lang = $this->getLanguage();
759 $real = $lang->listToText( $real_names );
761 # "ThisSite user(s) A, B and C"
762 if ( count( $user_names ) ) {
763 $user = $this->msg( 'siteusers' )->rawParams( $lang->listToText( $user_names ) )->params(
764 count( $user_names ) )->escaped();
765 } else {
766 $user = false;
769 if ( count( $anon_ips ) ) {
770 $anon = $this->msg( 'anonusers' )->rawParams( $lang->listToText( $anon_ips ) )->params(
771 count( $anon_ips ) )->escaped();
772 } else {
773 $anon = false;
776 # This is the big list, all mooshed together. We sift for blank strings
777 $fulllist = array();
778 foreach ( array( $real, $user, $anon ) as $s ) {
779 if ( $s !== '' ) {
780 array_push( $fulllist, $s );
784 $count = count( $fulllist );
785 # "Based on work by ..."
786 return $count
787 ? $this->msg( 'othercontribs' )->rawParams(
788 $lang->listToText( $fulllist ) )->params( $count )->escaped()
789 : '';
793 * Returns the description that goes below the "<h1>" tag.
795 * @return string
797 protected function getDescription() {
798 return '';