Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1404,6 +1404,7 @@ |
1405 | 1405 | 'statistics-header-edits', |
1406 | 1406 | 'statistics-header-views', |
1407 | 1407 | 'statistics-header-users', |
| 1408 | + 'statistics-header-hooks', |
1408 | 1409 | 'statistics-articles', |
1409 | 1410 | 'statistics-pages', |
1410 | 1411 | 'statistics-pages-desc', |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -4156,3 +4156,15 @@ |
4157 | 4157 | */ |
4158 | 4158 | $wgMemoryLimit = "50M"; |
4159 | 4159 | |
| 4160 | +/** |
| 4161 | + * Allow extensions to add Statistics at the end of Special:Statistics. |
| 4162 | + */ |
| 4163 | +$wgAllowStatsOther = true; |
| 4164 | + |
| 4165 | +/** |
| 4166 | + * Statistics which add at the end of Special:Statistics. |
| 4167 | + * Use: $wgStatsOther['<name of statistic>'] = <value>; |
| 4168 | + * Example: $wgStatsOther['Time since 01.01.1970'] = time(); |
| 4169 | + */ |
| 4170 | +$wgStatsOther = array(); |
| 4171 | + |
Index: trunk/phase3/includes/specials/SpecialStatistics.php |
— | — | @@ -38,6 +38,7 @@ |
39 | 39 | $this->activeUsers = SiteStats::activeUsers(); |
40 | 40 | $this->admins = SiteStats::numberingroup('sysop'); |
41 | 41 | $this->numJobs = SiteStats::jobs(); |
| 42 | + $this->hook = ''; |
42 | 43 | |
43 | 44 | # Staticic - views |
44 | 45 | $viewsStats = ''; |
— | — | @@ -75,6 +76,9 @@ |
76 | 77 | if( !$wgDisableCounters && !$wgMiserMode ) { |
77 | 78 | $text .= $this->getMostViewedPages(); |
78 | 79 | } |
| 80 | + |
| 81 | + # Statistic - other |
| 82 | + $text .= $this->getOtherStats(); |
79 | 83 | |
80 | 84 | $text .= Xml::closeElement( 'table' ); |
81 | 85 | |
— | — | @@ -258,6 +262,27 @@ |
259 | 263 | return $text; |
260 | 264 | } |
261 | 265 | |
| 266 | + private function getOtherStats() { |
| 267 | + global $wgLang, $wgAllowStatsOther, $wgStatsOther; |
| 268 | + |
| 269 | + if( !$wgAllowStatsOther ) return; |
| 270 | + |
| 271 | + if ( count( $wgStatsOther ) < 1 ) return; |
| 272 | + |
| 273 | + $return = Xml::openElement( 'tr' ) . |
| 274 | + Xml::tags( 'th', array( 'colspan' => '2' ), wfMsgExt( 'statistics-header-hooks', array( 'parseinline' ) ) ) . |
| 275 | + Xml::closeElement( 'tr' ); |
| 276 | + |
| 277 | + foreach( $wgStatsOther as $name => $number ) { |
| 278 | + $name = htmlspecialchars( $name ); |
| 279 | + $number = htmlspecialchars( $number ); |
| 280 | + |
| 281 | + $return .= $this->formatRow( $name, $wgLang->formatNum( $number ), array( 'class' => 'mw-statistics-hook' ) ); |
| 282 | + } |
| 283 | + |
| 284 | + return $return; |
| 285 | + } |
| 286 | + |
262 | 287 | /** |
263 | 288 | * Do the action=raw output for this page. Legacy, but we support |
264 | 289 | * it for backwards compatibility |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2278,6 +2278,7 @@ |
2279 | 2279 | 'statistics-header-edits' => 'Edit statistics', |
2280 | 2280 | 'statistics-header-views' => 'View statistics', |
2281 | 2281 | 'statistics-header-users' => 'User statistics', |
| 2282 | +'statistics-header-hooks' => 'Other statistics', |
2282 | 2283 | 'statistics-articles' => 'Content pages', |
2283 | 2284 | 'statistics-pages' => 'Pages', |
2284 | 2285 | 'statistics-pages-desc' => 'All pages in the wiki, including talk pages, redirects, etc.', |