From: Rob Church Date: Tue, 11 Jul 2006 15:06:57 +0000 (+0000) Subject: * (bug 6592) Add most viewed pages summary to Special:Statistics X-Git-Tag: 1.31.0-rc.0~56303 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=47d955aac2040b50b3cb86f4733d4b76a03e5044;p=lhc%2Fweb%2Fwiklou.git * (bug 6592) Add most viewed pages summary to Special:Statistics --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9c8660391d..473b55d0c6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -47,10 +47,11 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN cache object. * (bug 6299) Maintain parser's revision ID across recursive calls to fix {{REVISIONID}} when Cite extension is used -* (bug 6622) Removed deprecated function image::newFromTitle +* (bug 6622) Removed deprecated function Image::newFromTitle * (bug 6627) Fix regression in Special:Ipblocklist with table prefix * Removed forced dereferencements (new() returns a reference in PHP5) * Note about $wgUploadSizeWarning using byte +* (bug 6592) Add most viewed pages summary to Special:Statistics == Languages updated == diff --git a/includes/SpecialStatistics.php b/includes/SpecialStatistics.php index 5903546ade..a6a975a351 100644 --- a/includes/SpecialStatistics.php +++ b/includes/SpecialStatistics.php @@ -81,6 +81,22 @@ function wfSpecialStatistics() { ); $wgOut->addWikiText( $text ); + + global $wgDisableCounters, $wgUser, $wgLang; + if( !$wgDisableCounters ) { + $res = $dbr->query( "SELECT page_namespace, page_title, page_counter FROM {$page} WHERE page_is_redirect = 0 ORDER BY page_counter DESC LIMIT 0,10", __METHOD__ ); + if( $res ) { + $wgOut->addHtml( '

' . wfMsgHtml( 'statistics-mostpopular' ) . '

' ); + $skin =& $wgUser->getSkin(); + $wgOut->addHtml( '
    ' ); + while( $row = $dbr->fetchObject( $res ) ) { + $link = $skin->makeKnownLinkObj( Title::makeTitleSafe( $row->page_namespace, $row->page_title ) ); + $wgOut->addHtml( '
  1. ' . $link . ' [' . $wgLang->formatNum( $row->page_counter ) . ']
  2. ' ); + } + $wgOut->addHtml( '
' ); + } + } + } } ?> diff --git a/languages/Messages.php b/languages/Messages.php index 7be2e5e1dd..060107d2f9 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -932,6 +932,7 @@ That comes to '''$5''' average edits per page, and '''$6''' views per edit. The [http://meta.wikimedia.org/wiki/Help:Job_queue job queue] length is '''$7'''.", 'userstatstext' => "There are '''$1''' registered users, of which '''$2''' (or '''$4%''') are administrators (see $3).", +'statistics-mostpopular' => 'Most viewed pages', 'disambiguations' => 'Disambiguation pages', 'disambiguationspage' => 'Template:disambig',