From c4aced4aaf75d471972101657f8d1a8bc7694c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Mon, 1 Dec 2008 22:57:55 +0100 Subject: [PATCH] [svn r17036] fix a Warning message: Division by zero, when Dokeos run in Test Server mode --- main/wiki/index.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main/wiki/index.php b/main/wiki/index.php index 50c078ce81..ad9cff1943 100644 --- a/main/wiki/index.php +++ b/main/wiki/index.php @@ -1805,7 +1805,14 @@ if ($_GET['action']=='discuss') echo ' - '.get_lang('NumCommentsScore').': '.$countWPost_score;// - $avg_WPost_score = round($row2['sumWPost'] / $countWPost_score,2).' / 10'; + if ($countWPost_score!=0) + { + $avg_WPost_score = round($row2['sumWPost'] / $countWPost_score,2).' / 10'; + } + else + { + $avg_WPost_score = $countWPost_score; + } echo ' - '.get_lang('RatingMedia').': '.$avg_WPost_score; // average rating