cvs: php-bugs-web / lstats.php

From: Date: Sat, 08 Feb 2003 08:21:50 +0000
Subject: cvs: php-bugs-web / lstats.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-15589@lists.php.net to get a copy of this message
sniper Sat Feb 8 03:21:50 2003 EDT Modified files: /php-bugs-web lstats.php Log: Fixed the per-category view + optimized in general Index: php-bugs-web/lstats.php diff -u php-bugs-web/lstats.php:1.4 php-bugs-web/lstats.php:1.5 --- php-bugs-web/lstats.php:1.4 Sun Nov 10 20:34:30 2002 +++ php-bugs-web/lstats.php Sat Feb 8 03:21:50 2003 @@ -1,8 +1,8 @@ <?php /* vim: set noet ts=4 sw=4: : */ -function status_print ($status, $num) { +function status_print ($status, $num, $width, $align='left') { $str = ucfirst($status).":"; - $str.= str_repeat(" ", 14-strlen($str)); + $str.= str_repeat(" ", $width - strlen($str) + (($align == 'right') ? (4 - strlen($num)) : 0)); $str.= "<!-- NUM -->$num<!-- /NUM -->\n<br>"; echo $str; } @@ -12,11 +12,16 @@ global $phpver; $query = "SELECT count(id) from bugdb WHERE"; + if ($phpver > 0) { $query .= " php_version LIKE '" . $phpver . "%' AND"; } - $query.= " status='$status' "; - $query.= (empty($category)) ? "AND bug_type NOT LIKE '%Change Request%'" : "AND bug_type='$category'"; + + if ($category != '') { + $query.= " $status AND bug_type='$category' AND bug_type != 'Feature/Change Request'"; + } else { + $query.= " status='$status' AND bug_type != 'Feature/Change Request'"; + } $result=mysql_unbuffered_query($query); $row=mysql_fetch_row($result); @@ -38,9 +43,9 @@ ); if(!isset($phpver)) { - echo "<h3>Bug stats for both <a href='lstats.php?phpver=3'>PHP 3</a> and <a href='lstats.php?phpver=4'>PHP 4</a>:</h3><pre>\n"; + echo "<h3>Bug stats for both <a href='lstats.php?phpver=3'>PHP 3</a> and <a href='lstats.php?phpver=4'>PHP 4</a>:</h3>\n<pre>\n"; } else { - echo "<h3>Bug stats for PHP $phpver:</h3><pre>\n"; + echo "<h3>Bug stats for PHP $phpver:</h3>\n<pre>\n"; } mysql_pconnect("localhost","nobody",""); @@ -49,22 +54,25 @@ if (isset($per_category)) { include ('bugtypes.inc'); + $totals = array(); foreach ($items as $category => $name) { - $out = "$category"; - foreach($statuses as $status) { - $count = get_status_count ($status, $category); - $out.="|$status=$count"; + $count = get_status_count ("status NOT IN('closed', 'bogus', 'duplicate', 'wont fix', 'no feedback')", $category); + if ($count > 0) { + $totals[$category] = $count; } - echo "$out\n<br>"; } - + arsort($totals); + foreach ($totals as $category => $total) { + status_print($category, $total, 35, 'right'); + } + } else { foreach($statuses as $status) { $count = get_status_count ($status); - status_print($status, $count); + status_print($status, $count, 14); } } -echo "</pre>\n"; +echo "\n</pre>\n"; ?>

« previous php.mirrors (#15589) next »