diff --git a/application/controllers/Contestcalendar.php b/application/controllers/Contestcalendar.php index bed46615b..f3f22290c 100644 --- a/application/controllers/Contestcalendar.php +++ b/application/controllers/Contestcalendar.php @@ -182,8 +182,20 @@ class Contestcalendar extends CI_Controller { $contestsNextWeekend[] = $contest; } if ($start <= $nextSunday && $end >= $nextFriday) { + $contestExists = false; + foreach ($contestsNextWeekend as $existingContest) { + if ($existingContest['title'] === $contest['title']) { + $contestExists = true; + break; + } + } + if (!$contestExists) { $contestsNextWeekend[] = $contest; + $contestsNextWeekend[] = $contest; + $contestsNextWeekend[] = $contest; + } } + } return $contestsNextWeekend;