* (bug 6592) Add most viewed pages summary to Special:Statistics
authorRob Church <robchurch@users.mediawiki.org>
Tue, 11 Jul 2006 15:06:57 +0000 (15:06 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Tue, 11 Jul 2006 15:06:57 +0000 (15:06 +0000)
RELEASE-NOTES
includes/SpecialStatistics.php
languages/Messages.php

index 9c86603..473b55d 100644 (file)
@@ -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 ==
 
index 5903546..a6a975a 100644 (file)
@@ -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( '<h2>' . wfMsgHtml( 'statistics-mostpopular' ) . '</h2>' );
+                               $skin =& $wgUser->getSkin();
+                               $wgOut->addHtml( '<ol>' );
+                               while( $row = $dbr->fetchObject( $res ) ) {
+                                       $link = $skin->makeKnownLinkObj( Title::makeTitleSafe( $row->page_namespace, $row->page_title ) );
+                                       $wgOut->addHtml( '<li>' . $link . ' [' . $wgLang->formatNum( $row->page_counter ) . ']</li>' );
+                               }
+                               $wgOut->addHtml( '</ol>' );
+                       }
+               }
+               
        }
 }
 ?>
index 7be2e5e..060107d 100644 (file)
@@ -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',