"Release statistics" table format
| From: | Jon Parise | Date: | Mon, 07 Jul 2003 05:05:10 +0000 |
| Subject: | "Release statistics" table format | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-18061@lists.php.net to get a copy of this message | ||
Attached is a short patch that simplifies the "Release statistics"
table. Now that we have packages with a large number of releases, the
old format was (in my opinion) growing unwieldy.
Feel free to comment on or change the style I chose. And if no one
objects to the change, I'll commit it soon.
--
Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/)
Index: package-stats.php =================================================================== RCS file: /repository/pearweb/public_html/package-stats.php,v retrieving revision 1.39 diff -u -r1.39 package-stats.php --- package-stats.php 6 Jul 2003 16:51:45 -0000 1.39 +++ package-stats.php 7 Jul 2003 04:57:51 -0000 @@ -146,19 +146,17 @@ $release_statistics = statistics::release($_GET['pid'], (isset($_GET['rid']) ? $_GET['rid'] : "")); $i= 0; + echo "<table width=\"100%\">\n"; + echo "<tr><th class=\"others\">Release</th><th class=\"others\">Downloads</th><th class=\"others\">First Download</th><th class=\"others\">Last Download</th></tr>\n"; foreach ($release_statistics as $key => $value) { - $bb2 = new Borderbox("Release: " . $value['version'], 400); - echo "Number of downloads: <b>" . number_format($value['total'], 0, '.', ',') . "</b><br />\n"; - - if ($value['total'] > 1) { - echo "First download: <b>" . $value['first_download'] . "</b><br />\n"; - echo "Last download: <b>" . $value['last_download'] . "</b><br />\n"; - } - - $bb2->end(); - echo "<br />\n"; + echo '<tr>'; + echo '<td>' . $value['version'] . '</td>'; + echo '<td>' . number_format($value['total'], 0, '.', ',') . '</td>'; + echo '<td>' . $value['first_download'] . '</td>'; + echo '<td>' . $value['last_download'] . '</td>'; + echo "</tr>\n"; } - + echo "</table>\n"; $bb->end(); /**
Index: package-stats.php =================================================================== RCS file: /repository/pearweb/public_html/package-stats.php,v retrieving revision 1.39 diff -u -r1.39 package-stats.php --- package-stats.php 6 Jul 2003 16:51:45 -0000 1.39 +++ package-stats.php 7 Jul 2003 04:57:51 -0000 @@ -146,19 +146,17 @@ $release_statistics = statistics::release($_GET['pid'], (isset($_GET['rid']) ? $_GET['rid'] : "")); $i= 0; + echo "<table width=\"100%\">\n"; + echo "<tr><th class=\"others\">Release</th><th class=\"others\">Downloads</th><th class=\"others\">First Download</th><th class=\"others\">Last Download</th></tr>\n"; foreach ($release_statistics as $key => $value) { - $bb2 = new Borderbox("Release: " . $value['version'], 400); - echo "Number of downloads: <b>" . number_format($value['total'], 0, '.', ',') . "</b><br />\n"; - - if ($value['total'] > 1) { - echo "First download: <b>" . $value['first_download'] . "</b><br />\n"; - echo "Last download: <b>" . $value['last_download'] . "</b><br />\n"; - } - - $bb2->end(); - echo "<br />\n"; + echo '<tr>'; + echo '<td>' . $value['version'] . '</td>'; + echo '<td>' . number_format($value['total'], 0, '.', ',') . '</td>'; + echo '<td>' . $value['first_download'] . '</td>'; + echo '<td>' . $value['last_download'] . '</td>'; + echo "</tr>\n"; } - + echo "</table>\n"; $bb->end(); /**