summaryrefslogtreecommitdiff
path: root/includes/SpecialStatistics.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2007-01-11 19:06:07 +0000
committerPierre Schmitz <pierre@archlinux.de>2007-01-11 19:06:07 +0000
commita58285fd06c8113c45377c655dd43cef6337e815 (patch)
treedfe31d3d12652352fe44890b4811eda0728faefb /includes/SpecialStatistics.php
parent20194986f6638233732ba1fc3e838f117d3cc9ea (diff)
Aktualisierung auf MediaWiki 1.9.0
Diffstat (limited to 'includes/SpecialStatistics.php')
-rw-r--r--includes/SpecialStatistics.php39
1 files changed, 7 insertions, 32 deletions
diff --git a/includes/SpecialStatistics.php b/includes/SpecialStatistics.php
index 4a51efd9..a5a0fc3a 100644
--- a/includes/SpecialStatistics.php
+++ b/includes/SpecialStatistics.php
@@ -15,39 +15,13 @@ function wfSpecialStatistics() {
$action = $wgRequest->getVal( 'action' );
$dbr =& wfGetDB( DB_SLAVE );
- extract( $dbr->tableNames( 'page', 'site_stats', 'user', 'user_groups' ) );
- $row = $dbr->selectRow( 'site_stats', '*', false, $fname );
- $views = $row->ss_total_views;
- $edits = $row->ss_total_edits;
- $good = $row->ss_good_articles;
- $images = $row->ss_images;
-
- # This code is somewhat schema-agnostic, because I'm changing it in a minor release -- TS
- if ( isset( $row->ss_total_pages ) && $row->ss_total_pages == -1 ) {
- # Update schema
- $u = new SiteStatsUpdate( 0, 0, 0 );
- $u->doUpdate();
- $row = $dbr->selectRow( 'site_stats', '*', false, $fname );
- }
-
- if ( isset( $row->ss_total_pages ) ) {
- $total = $row->ss_total_pages;
- } else {
- $sql = "SELECT COUNT(page_namespace) AS total FROM $page";
- $res = $dbr->query( $sql, $fname );
- $pageRow = $dbr->fetchObject( $res );
- $total = $pageRow->total;
- }
-
- if ( isset( $row->ss_users ) ) {
- $users = $row->ss_users;
- } else {
- $sql = "SELECT MAX(user_id) AS total FROM $user";
- $res = $dbr->query( $sql, $fname );
- $userRow = $dbr->fetchObject( $res );
- $users = $userRow->total;
- }
+ $views = SiteStats::views();
+ $edits = SiteStats::edits();
+ $good = SiteStats::articles();
+ $images = SiteStats::images();
+ $total = SiteStats::pages();
+ $users = SiteStats::users();
$admins = $dbr->selectField( 'user_groups', 'COUNT(*)', array( 'ug_group' => 'sysop' ), $fname );
$numJobs = $dbr->selectField( 'job', 'COUNT(*)', '', $fname );
@@ -84,6 +58,7 @@ function wfSpecialStatistics() {
global $wgDisableCounters, $wgMiserMode, $wgUser, $wgLang, $wgContLang;
if( !$wgDisableCounters && !$wgMiserMode ) {
+ $page = $dbr->tableName( 'page' );
$sql = "SELECT page_namespace, page_title, page_counter FROM {$page} WHERE page_is_redirect = 0 AND page_counter > 0 ORDER BY page_counter DESC";
$sql = $dbr->limitResult($sql, 10, 0);
$res = $dbr->query( $sql, $fname );