mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-16 16:21:01 +00:00
Fix divesion by Zero bug
This commit is contained in:
@@ -70,10 +70,18 @@
|
|||||||
<td><?php
|
<td><?php
|
||||||
echo $tribes[0]; ?></td>
|
echo $tribes[0]; ?></td>
|
||||||
|
|
||||||
<td><?php
|
<td>
|
||||||
$percents = 100 * (($tribes[0]) / $users);
|
<?php
|
||||||
echo $percents = intval($percents);
|
if($users > 0){
|
||||||
echo "%"; ?></td>
|
$percents = 100 * (($tribes[0]) / $users);
|
||||||
|
echo $percents = intval($percents);
|
||||||
|
echo "%";
|
||||||
|
}else{
|
||||||
|
echo '---';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
@@ -83,9 +91,14 @@
|
|||||||
echo $tribes[1]; ?></td>
|
echo $tribes[1]; ?></td>
|
||||||
|
|
||||||
<td><?php
|
<td><?php
|
||||||
$percents = 100 * ($tribes[1] / $users);
|
if($users > 0){
|
||||||
echo $percents = intval($percents);
|
$percents = 100 * ($tribes[1] / $users);
|
||||||
echo "%"; ?></td>
|
echo $percents = intval($percents);
|
||||||
|
echo "%";
|
||||||
|
}else{
|
||||||
|
echo '---';
|
||||||
|
}
|
||||||
|
?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
@@ -95,9 +108,14 @@
|
|||||||
echo $tribes[2]; ?></td>
|
echo $tribes[2]; ?></td>
|
||||||
|
|
||||||
<td><?php
|
<td><?php
|
||||||
$percents = 100 * ($tribes[2] / $users);
|
if($users > 0){
|
||||||
|
$percents = 100 * ($tribes[2] / $users);
|
||||||
echo $percents = intval($percents);
|
echo $percents = intval($percents);
|
||||||
echo "%"; ?></td>
|
echo "%";
|
||||||
|
}else{
|
||||||
|
echo '---';
|
||||||
|
}
|
||||||
|
?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user