Clean up stats page.
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 21 Jan 2009 07:18:39 +0000 (00:18 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 21 Jan 2009 07:18:39 +0000 (00:18 -0700)
chora/stats.php
chora/templates/stats/stats.inc
chora/themes/screen.css

index f6193c8..f54f13f 100644 (file)
 
 require_once dirname(__FILE__) . '/lib/base.php';
 
-$fl = &$VC->getFileObject($where, $cache);
+$fl = $VC->getFileObject($where, $cache);
 Chora::checkError($fl);
 
 $extraLink = Chora::getFileViews();
 
-$author_stats = array();
+$stats = array();
 foreach ($fl->logs as $lg) {
-    @$author_stats[$lg->queryAuthor()]++;
+    $qa = $lg->queryAuthor();
+    if (!isset($stats[$qa])) {
+        $stats[$qa] = 0;
+    }
+    ++$stats[$qa];
 }
-arsort($author_stats);
+arsort($stats);
 
 $title = sprintf(_("Statistics for %s"), Text::htmlallspaces($where));
 Horde::addScriptFile('prototype.js', 'horde', true);
index 1aadea0..a480847 100644 (file)
@@ -8,12 +8,12 @@
 <tbody>
 <?php
 
-$most = max($author_stats);
+$most = max($stats);
 $factor = $most / 400;
-foreach ($author_stats as $author => $commits): $width = (int)($commits / $factor); ?>
+foreach ($stats as $author => $commits): $width = (int)($commits / $factor); ?>
  <tr>
   <td class="rightAlign"><?php echo $author ?>&nbsp;&nbsp;</td>
-  <td><?php echo Horde::img('pixel.php?c=bbcbff', '', 'style="border:1px solid #000;" width="' . $width . '" height="10"', $registry->get('webroot', 'horde') . '/services/images') . ' (' . $commits . ')</td>' ?>
+  <td><?php echo Horde::img('pixel.php?c=bbcbff', '', 'id="statsImg" width="' . $width . '" height="10"', $registry->get('webroot', 'horde') . '/services/images') . ' (' . $commits . ')</td>' ?>
  </tr>
 <?php endforeach ?>
 </tbody>
index 2e5db5e..7040b8d 100644 (file)
@@ -272,10 +272,12 @@ table.hrdiff caption {
     font-weight: bold;
     padding: 5px;
 }
+table.hrdiff caption img, .statsImg {
+    border: 1px solid #000;
+}
 table.hrdiff caption img {
     height: 10px;
     width: 10px;
-    border: 1px solid #000;
     margin-left: 0.5em;
     vertical-align: baseline;
 }