avoid division by 0 warning when there are no rates in the database

git-svn-id: http://piwigo.org/svn/branches/2.3@12413 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices 2011-10-11 20:14:11 +00:00
parent 6acbf6dfc3
commit 4d8cd5a9e3

View file

@ -150,8 +150,11 @@ SELECT element_id,
$by_item[$row['element_id']] = $row;
}
$all_rates_avg /= $all_rates_count;
$item_ratecount_avg = $all_rates_count / count($by_item);
if ($all_rates_count>0)
{
$all_rates_avg /= $all_rates_count;
$item_ratecount_avg = $all_rates_count / count($by_item);
}
$updates = array();
foreach ($by_item as $id => $rate_summary )