From cba8097d7ddf8d36333ffd5f159f322c4434f39c Mon Sep 17 00:00:00 2001 From: "Stefan A. Brannfjell" Date: Mon, 18 May 2020 09:51:06 +0200 Subject: [PATCH] Small fix to achievements.php Fix #390 Default image medal for achievements without configured image. Secret key set to default if it hasn't been configured already. --- achievements.php | 57 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/achievements.php b/achievements.php index c266d0a..d74e637 100644 --- a/achievements.php +++ b/achievements.php @@ -20,35 +20,36 @@ if ($config['Ach'] == true) { $achName) { -$secret = false; -if (($achName['points'] >= 1) and ($achName['points'] <= 3) and (!$achName['img'])) { -echo '
'; + // Set defaults + if (!isset($achName['secret'])) $achName['secret'] = false; + if (!isset($achName['img'])) $achName['img'] = 'https://i.imgur.com/ZqWp1TE.png'; + + if (($achName['points'] >= 1) and ($achName['points'] <= 3) and (!$achName['img'])) { + echo '
'; + + } elseif (($achName['points'] >= 4) and ($achName['points'] <= 6) and (!$achName['img'])) { + echo '
'; + + } elseif (($achName['points'] >= 7) and ($achName['points'] <= 9) and (!$achName['img'])) { + echo '
'; + + } elseif (($achName['points'] >= 10) and (!$achName['img'])) { + echo '
'; + + } else { + echo '

'; + } + echo '' .$achName[0]. ''; + echo '' .$achName[1]. ''; + if ($achName['secret'] == true) { + echo ''; + echo ''. $achName['points'] .''; + } else { + echo ''. $achName['points'] .''; + } + echo ''; } -elseif (($achName['points'] >= 4) and ($achName['points'] <= 6) and (!$achName['img'])) -{ -echo '
'; -} -elseif (($achName['points'] >= 7) and ($achName['points'] <= 9) and (!$achName['img'])) -{ -echo '
'; -} -elseif (($achName['points'] >= 10) and (!$achName['img'])) -{ -echo '
'; -} -else { -echo '

'; -} -echo '' .$achName[0]. ''; -echo '' .$achName[1]. ''; -if ($achName['secret'] == true){ -echo ''; -echo ''. $achName['points'] .''; -} else { -echo ''. $achName['points'] .''; -} -echo ''; -}?> +?>