|
|
|
@ -61,17 +61,26 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// then get the amount of icons
|
|
|
|
|
preg_match_all('/\d+/', $iconNumbers, $matches);
|
|
|
|
|
preg_match_all('/([0-9]*[.])?[0-9]+/', $iconNumbers, $matches);
|
|
|
|
|
$numbers = $matches[0];
|
|
|
|
|
$min = $numbers[0];
|
|
|
|
|
$max = $numbers[1];
|
|
|
|
|
if ($iconNumbers === '100-100') {
|
|
|
|
|
echo "<img class=\"iconType\" src=\"$iconImage\" alt=\"$iconType\"> 100%";
|
|
|
|
|
} elseif ($min !== $max) {
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
// print icon image for each point
|
|
|
|
|
for ($i = 1; $i <= $min; $i++) {
|
|
|
|
|
// print icon image for each point up to the rounded min
|
|
|
|
|
$roundedMin = ceil($min);
|
|
|
|
|
$roundedRemainingIcons = floor($max - $min);
|
|
|
|
|
for ($i = 1; $i <= $roundedMin; $i++) {
|
|
|
|
|
echo "<img class=\"iconType\" src=\"$iconImage\" alt=\"$iconType\">";
|
|
|
|
|
}
|
|
|
|
|
// TODO: - Handle conditional icons/effects
|
|
|
|
|
if(!($max - $min > 0)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// for each icon afterwards, if any, print it with a + separator
|
|
|
|
|
echo " + ";
|
|
|
|
|
for($i = 1; $i <= $roundedRemainingIcons; $i++) {
|
|
|
|
|
echo "<img class=\"iconType\" src=\"$iconImage\" alt=\"$iconType\">";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|