svn: /web/qa/trunk/reports/ index.php viewreports.php

From: Date: Thu, 16 Jun 2011 22:07:34 +0000
Subject: svn: /web/qa/trunk/reports/ index.php viewreports.php
Groups: php.qa 
Request: Send a blank email to php-qa+get-65815@lists.php.net to get a copy of this message
philip Thu, 16 Jun 2011 22:07:34 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=312214 Log: Added a few 'plural vs singular checks' (e.g., 1 day vs 1 days) Changed paths: U web/qa/trunk/reports/index.php U web/qa/trunk/reports/viewreports.php Modified: web/qa/trunk/reports/index.php =================================================================== --- web/qa/trunk/reports/index.php 2011-06-16 19:24:16 UTC (rev 312213) +++ web/qa/trunk/reports/index.php 2011-06-16 22:07:34 UTC (rev 312214) @@ -92,14 +92,19 @@ $lastReport = time()-strtotime($line['lastReport']); if($lastReport < 3600) { - echo round($lastReport/60).' minutes ago'; + $_tmp = round($lastReport/60); + echo "$_tmp ", ($_tmp == 1) ? 'minute' : 'minutes'; } elseif ($lastReport < 3600*24) { - echo round($lastReport/3600).' hours ago'; + $_tmp = round($lastReport/3600); + echo "$_tmp ", ($_tmp == 1) ? 'hour' : 'hours'; } elseif ($lastReport < 3600*24*60) { - echo round($lastReport/3600/24).' days ago'; + $_tmp = round($lastReport/3600/24); + echo "$_tmp ", ($_tmp == 1) ? 'day' : 'days'; } else { - echo floor($lastReport/3600/24/30).' month ago'; + $_tmp = floor($lastReport/3600/24/30); + echo "$_tmp ", ($_tmp == 1) ? 'month' : 'months'; } + echo " ago"; echo '</td>'; echo '<td nowrap align="right"><small>'.round($line['dbsize']/1024/1024).' MB</small></td>'; echo '</tr>'."\n"; Modified: web/qa/trunk/reports/viewreports.php =================================================================== --- web/qa/trunk/reports/viewreports.php 2011-06-16 19:24:16 UTC (rev 312213) +++ web/qa/trunk/reports/viewreports.php 2011-06-16 22:07:34 UTC (rev 312214) @@ -88,7 +88,18 @@ } ?></h1> -<b><i>There are <?php echo count($allDiffArray); ?> different diff reported by users for this test.</i></b><br /><br /> +<strong><em> +<?php +$count = count($allDiffArray); + +if ($count === 1) { + echo "There is 1 diff reported by users for this test."; +} else { + echo "There are $count different diffs reported by users for this test."; +} +?> +</em></strong> +<br /><br /> <style> .diffClass { overflow: auto;

« previous php.qa (#65815) next »