$sidebarEvent = '<h4 class="scheduler_sidebar_link"><a href="{*URL*}#date={*DATE_SQL*},mode=month" target="_blank">{*DATE*}</a></h4>
<div class="scheduler_sidebar_text">{*TEXT*}</div>';
This is a snippet from a plugin that I'm using. It prints event date followed by description. How do I modify it so that all same-day events are printed together as one list?
This is the relevant function in a separate file:
for ($i = 0; $i < count($events); $i++) {
$event = $sidebarEvent;
$start_date = str_replace("-", "/", $events[$i]->start_date);
$start_date = date_parse($events[$i]->start_date);
$start_date = mktime($start_date['hour'], $start_date['minute'], $start_date['second'], $start_date['month'], $start_date['day'], $start_date['year']);
$start_date = date(get_option('date_format').' '.get_option('time_format'), $start_date);
$event = str_replace("{*URL*}", $url, $event);
$event = str_replace("{*DATE*}", $start_date, $event);
$event = str_replace("{*DATE_SQL*}", $events[$i]->start_date, $event);
$event = str_replace("{*TEXT*}", $events[$i]->text, $event);
$final .= $event;
}
Thanks