Browse Source

[svn r17036] fix a Warning message: Division by zero, when Dokeos run in Test Server mode

Juan Carlos Raña 16 years ago
parent
commit
c4aced4aaf
1 changed files with 8 additions and 1 deletions
  1. 8 1
      main/wiki/index.php

+ 8 - 1
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