From 5879a462de2740a42f9d990ff71a0f5d02bfacd6 Mon Sep 17 00:00:00 2001 From: piapassecker Date: Mon, 20 Nov 2023 20:24:04 +0100 Subject: [PATCH] limit to 5 submenuitems --- web/pages/tournaments/controller.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/pages/tournaments/controller.php b/web/pages/tournaments/controller.php index 5d69366..1d12494 100644 --- a/web/pages/tournaments/controller.php +++ b/web/pages/tournaments/controller.php @@ -16,11 +16,16 @@ class Tournaments extends Page { if($_SESSION['user']->data['tournaments'] && count($_SESSION['user']->data['tournaments']) > 0) { $this->addSubmenuItem('divider'); + $counter = 0; foreach($_SESSION['user']->data['tournaments'] as $tid) { $t = new Tournament(); $t->load($tid); $this->addSubmenuItem($t->data['name'],'/tournaments/event/'.$tid,'fas fa-calendar-star'); + $counter++; + if ($counter === 5) { + break; + } } } }