tibiacom: Fix the closing MenuBottom if there are extra categories

This commit is contained in:
slawkens 2025-01-17 16:24:30 +01:00
parent dd47423157
commit d639e77d04

View File

@ -326,7 +326,11 @@ if(isset($config['boxes']))
<?php <?php
$menus = get_template_menus(); $menus = get_template_menus();
$countElements = count($config['menu_categories']);
$i = 0;
foreach($config['menu_categories'] as $id => $cat) { foreach($config['menu_categories'] as $id => $cat) {
$i++;
if(!isset($menus[$id]) || ($id == MENU_CATEGORY_SHOP && !setting('core.gifts_system'))) { if(!isset($menus[$id]) || ($id == MENU_CATEGORY_SHOP && !setting('core.gifts_system'))) {
continue; continue;
} }
@ -369,7 +373,7 @@ foreach($config['menu_categories'] as $id => $cat) {
?> ?>
</div> </div>
<?php <?php
if($id == MENU_CATEGORY_SHOP || (!setting('core.gifts_system') && $id == MENU_CATEGORY_SHOP - 1)) { if($id == MENU_CATEGORY_SHOP || (!setting('core.gifts_system') && $i == $countElements - 1)) {
?> ?>
<div id='MenuBottom' style='background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);'></div> <div id='MenuBottom' style='background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);'></div>
<?php <?php