diff --git a/Templates/Profile/medal.php b/Templates/Profile/medal.php index 4d8aa878..54d04bb3 100644 --- a/Templates/Profile/medal.php +++ b/Templates/Profile/medal.php @@ -38,17 +38,73 @@ $geregistreerd=date('d.m.Y', ($displayarray['regtime'])); $profiel = preg_replace("/\[#0]/is",'', $profiel, 1); } -// Added by Shadow - cata7007@gmail.com / Skype : cata7007 -if(NEW_FUNCTIONS_TRIBE_IMAGES){ - if($displayarray['tribe'] == "1"){ - $profiel = preg_replace("/\[#roman]/is",'', $profiel, 1); - }elseif($displayarray['tribe'] == "2"){ - $profiel = preg_replace("/\[#teuton]/is",'', $profiel, 1); - }elseif($displayarray['tribe'] == "3"){ - $profiel = preg_replace("/\[#gaul]/is",'', $profiel, 1); +// Added by Shadow - cata7007@gmail.com +if (NEW_FUNCTIONS_TRIBE_IMAGES) { + + $tribe = (int)($displayarray['tribe'] ?? 0); + + switch ($tribe) { + case 1: // Romans + $replacement = ''; + $profiel = preg_replace("/\[#roman]/is", $replacement, $profiel, 1); + break; + + case 2: // Teutons + $replacement = ''; + $profiel = preg_replace("/\[#teuton]/is", $replacement, $profiel, 1); + break; + + case 3: // Gauls + $replacement = ''; + $profiel = preg_replace("/\[#gaul]/is", $replacement, $profiel, 1); + break; + + // ==================== NOILE TRIBURI ==================== + case 6: // Huns + $tooltip = '
The Huns: Fast and deadly, the Huns are known for their lightning raids and powerful cavalry. They live to conquer and leave nothing but ashes behind.
'; + $replacement = ''; + $profiel = preg_replace('/\[#huns\]/i', $replacement, $profiel, 1); + break; + + case 7: // Egyptians + $tooltip = '
The Egyptians: Masters of architecture and ancient magic. Their troops are resilient and their cities are fortified with monumental structures.
'; + $replacement = ''; + $profiel = preg_replace('/\[#egyptians\]/i', $replacement, $profiel, 1); + break; + + case 8: // Spartans + $tooltip = '
The Spartans: Born warriors with unbreakable discipline. "Come back with your shield or on it" is their creed.
'; + $replacement = ''; + $profiel = preg_replace('/\[#spartans\]/i', $replacement, $profiel, 1); + break; + + case 9: // Vikings + $tooltip = '
The Vikings: Fierce seafarers and feared raiders. Their axes sing songs of glory and their longships strike terror across the seas.
'; + $replacement = ''; + $profiel = preg_replace('/\[#vikings\]/i', $replacement, $profiel, 1); + break; } } - // ========================= // NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM - DYNAMIC // ========================= diff --git a/Templates/Profile/profile.tpl b/Templates/Profile/profile.tpl index a8d55ec0..51b7b5fa 100644 --- a/Templates/Profile/profile.tpl +++ b/Templates/Profile/profile.tpl @@ -231,18 +231,38 @@ foreach ($varmedal as $medal) { // ========================= // TRIBE MEDALS // ========================= -if(defined('NEW_FUNCTIONS_TRIBE_IMAGES') && NEW_FUNCTIONS_TRIBE_IMAGES){ - if(($session->userinfo['tribe'] ?? 0) == 1){ - echo "Tribe Romans - [#roman]"; - } elseif(($session->userinfo['tribe'] ?? 0) == 2){ - echo "Tribe Teutons - [#teuton]"; - } elseif(($session->userinfo['tribe'] ?? 0) == 3){ - echo "Tribe Gauls - [#gaul]"; - } +$tribeMedals = []; + +if (defined('NEW_FUNCTIONS_TRIBE_IMAGES') && NEW_FUNCTIONS_TRIBE_IMAGES) { + $tribeMedals[1] = ['Romans', 'roman']; + $tribeMedals[2] = ['Teutons', 'teuton']; + $tribeMedals[3] = ['Gauls', 'gaul']; +} + +if (defined('NEW_FUNCTION_TRIBE_HUNS') && NEW_FUNCTION_TRIBE_HUNS) { + $tribeMedals[6] = ['Huns', 'huns']; +} + +if (defined('NEW_FUNCTION_TRIBE_EGIPTEANS') && NEW_FUNCTION_TRIBE_EGIPTEANS) { + $tribeMedals[7] = ['Egyptians', 'egyptians']; +} + +if (defined('NEW_FUNCTION_TRIBE_SPARTANS') && NEW_FUNCTION_TRIBE_SPARTANS) { + $tribeMedals[8] = ['Spartans', 'spartans']; +} + +if (defined('NEW_FUNCTION_TRIBE_VIKINGS') && NEW_FUNCTION_TRIBE_VIKINGS) { + $tribeMedals[9] = ['Vikings', 'vikings']; +} + +$tribe = $session->userinfo['tribe'] ?? 0; + +if (isset($tribeMedals[$tribe])) { + [$name, $tag] = $tribeMedals[$tribe]; + + echo "Tribe {$name} + [#{$tag}]"; } // ========================= diff --git a/img/rpage/Egyptians1.jpg b/img/rpage/Egyptians1.jpg new file mode 100644 index 00000000..02f57a9e Binary files /dev/null and b/img/rpage/Egyptians1.jpg differ diff --git a/img/rpage/Huns1.jpg b/img/rpage/Huns1.jpg new file mode 100644 index 00000000..d7b76296 Binary files /dev/null and b/img/rpage/Huns1.jpg differ diff --git a/img/rpage/Spartans1.jpg b/img/rpage/Spartans1.jpg new file mode 100644 index 00000000..0a1aa930 Binary files /dev/null and b/img/rpage/Spartans1.jpg differ diff --git a/img/rpage/Vikings1.jpg b/img/rpage/Vikings1.jpg new file mode 100644 index 00000000..e9a752fe Binary files /dev/null and b/img/rpage/Vikings1.jpg differ