*/
$wgMemoryLimit = "50M";
+/**
+ * Allow extensions to add Statistics at the end of Special:Statistics.
+ */
+$wgAllowStatsOther = true;
+
+/**
+ * Statistics which add at the end of Special:Statistics.
+ * Use: $wgStatsOther['<name of statistic>'] = <value>;
+ * Example: $wgStatsOther['Time since 01.01.1970'] = time();
+ */
+$wgStatsOther = array();
+
$this->activeUsers = SiteStats::activeUsers();
$this->admins = SiteStats::numberingroup('sysop');
$this->numJobs = SiteStats::jobs();
+ $this->hook = '';
# Staticic - views
$viewsStats = '';
if( !$wgDisableCounters && !$wgMiserMode ) {
$text .= $this->getMostViewedPages();
}
+
+ # Statistic - other
+ $text .= $this->getOtherStats();
$text .= Xml::closeElement( 'table' );
return $text;
}
+ private function getOtherStats() {
+ global $wgLang, $wgAllowStatsOther, $wgStatsOther;
+
+ if( !$wgAllowStatsOther ) return;
+
+ if ( count( $wgStatsOther ) < 1 ) return;
+
+ $return = Xml::openElement( 'tr' ) .
+ Xml::tags( 'th', array( 'colspan' => '2' ), wfMsgExt( 'statistics-header-hooks', array( 'parseinline' ) ) ) .
+ Xml::closeElement( 'tr' );
+
+ foreach( $wgStatsOther as $name => $number ) {
+ $name = htmlspecialchars( $name );
+ $number = htmlspecialchars( $number );
+
+ $return .= $this->formatRow( $name, $wgLang->formatNum( $number ), array( 'class' => 'mw-statistics-hook' ) );
+ }
+
+ return $return;
+ }
+
/**
* Do the action=raw output for this page. Legacy, but we support
* it for backwards compatibility
'statistics-header-edits' => 'Edit statistics',
'statistics-header-views' => 'View statistics',
'statistics-header-users' => 'User statistics',
+'statistics-header-hooks' => 'Other statistics',
'statistics-articles' => 'Content pages',
'statistics-pages' => 'Pages',
'statistics-pages-desc' => 'All pages in the wiki, including talk pages, redirects, etc.',
'statistics-header-edits',
'statistics-header-views',
'statistics-header-users',
+ 'statistics-header-hooks',
'statistics-articles',
'statistics-pages',
'statistics-pages-desc',