Fix stats script.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 29 Jan 2009 04:19:19 +0000 (21:19 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 29 Jan 2009 08:12:55 +0000 (01:12 -0700)
chora/stats.php

index 965a738..486ebff 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 /**
+ * Stats script.
+ *
  * Copyright 2000-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
@@ -20,12 +22,9 @@ try {
 $extraLink = Chora::getFileViews($where, 'stats');
 
 $stats = array();
-foreach ($fl->logs as $lg) {
+foreach ($fl->queryLogs() as $lg) {
     $qa = $lg->queryAuthor();
-    if (!isset($stats[$qa])) {
-        $stats[$qa] = 0;
-    }
-    ++$stats[$qa];
+    $stats[$qa] = isset($stats[$qa]) ? ($stats[$qa] + 1) : 1;
 }
 arsort($stats);