SimplePortal

Development => Bugs => Fixed or Bogus Bugs => Topic started by: willerby on May 01, 2009, 04:44:44 AM

Title: Calendar Info block
Post by: willerby on May 01, 2009, 04:44:44 AM
Been reading various threads on improvements to Calendar and Calendar Info block and have tried various other php Calendar blocks but all, including the SP version, have a flaw in how they present events...

In SMF the calendar can be used for events that span multiple days (our classic car club use it for weekend and week long shows/exhibitions etc).  These appear in the Calendar Info block as upcoming events but show individual entries for each day... see attached. Othr coded mods have the same issue.

Is it possible to change the coding so that upcoming events that span multiple days only show once?

Thanks

Title: Re: Calendar Info block
Post by: [SiNaN] on May 01, 2009, 05:17:54 AM
Moved to the Bug Reports.

http://simpleportal.net/index.php?issue=191.0

Here is a quick fix:

SPortal2.php

Code: (Find) [Select]
$events = sp_loadCalendarData('getEvents', $today_date, $event_future_date);
Code: (Replace) [Select]
$events = sp_loadCalendarData('getEvents', $today_date, $event_future_date);

$displayed = array();
foreach ($events as $day => $day_events)
foreach ($day_events as $event_key => $event)
if (in_array($event['id'], $displayed))
unset($events[$day][$event_key]);
else
$displayed[] = $event['id'];
Title: Re: Calendar Info block
Post by: willerby on May 01, 2009, 05:47:04 AM
Excellent, as always SiNaN. That was one quick response.

Thanks

W
SimplePortal 2.3.8 © 2008-2024, SimplePortal