My question is probably more of a PHP question than a concrete5 or Pro Events question so please bare with.
I'm using the Pro Events add-on. I've added an Event List block to the page and with the help of someone, created a custom display template. In short, this allows me to lists movies in chronological order using the Event Dates attribute (which captures show dates and times against each movie).
The code which does this is as follows:
<div class="ccm-page-list">
<?php
if (count($eArray) > 0) {
foreach ($eArray as $date_string => $event) {
extract($eventify->getEventListVars($event));
/*###############
Here we lay out they way the page looks, html with all our vars fed to it. This is the content that displays. It is recommended not to edit anything beyond the content parse. Feel free to structure and re-arrange any element and adjust.###############*/
?>
<!--Custom code-->
<?php
$date_day = date('d, D F', strtotime($date));
if ($cur_day != $date_day) {
echo '<div class="movie-list"><h4>';
echo date('D, d F', strtotime($date));
echo '</h4></div>';
}
$cur_day = $date_day;
?>
<!--Custom code-->
<div class="infowrap">
<div class="titlehead">
<table class="movie-list-table"><tr><td>
<div class="time">
<?php
if (is_array($next_dates_array)) {
foreach ($next_dates_array as $next_date) {
if ($allday != 1) {
echo date(t('g:i A '), strtotime($next_date->start));
} else {
echo ' - ' . t('All Day');
}
}
}
?>
</div></td>
<td>
<div class="title">
<?php
echo '<a href="' . $url;
if (!$grouped) {
echo '?eID=' . $eID;
}
echo '">' . $title . '</a>';
?>
</div></td>
</tr>
</table>
</div>
</div>
</div>
The result of this code looks like this:
SUN, 07 AUGUST
11:00 AM The Big Friendly Giant
12:45 PM Finding Dory
1:30 PM 6:15 PM Poi E - The Story of our Song
3:00 PM Star Trek Beyond
3:45 PM Ghostbusters
5:30 PM 8:30 PM Suicide Squad
1:30 PM 6:15 PM Poi E - The Story of our Song
8:00 PM Jason Boue
5:30 PM 8:30 PM Suicide Squad
MON, 08 AUGUST
12:30 PM Ghostbusters
1:00 PM 8:30 PM Suicide Squad
3:00 PM Poi E - The Story of our Song
3:30 PM The Big Friendly Giant
5:30 PM Hunt for the Wilderpeople
6:00 PM Star Trek Beyond
8:00 PM Jason Boue
1:00 PM 8:30 PM Suicide Squad
You'll notice however that on 7 Aug, Poi-E shows at 1:30PM and 6:15PM and Suicide Squad at 5.30PM and 8.30PM. Instead, I do not want the movies to group but the list to be truly chronological, even if it means movie titles repeat.
You'll also notice that Poi-E and Suicide Squad actually displays twice in the listing. Poi-E in the 1.30 and 6.15 slots - but displays as 1:30 PM 6:15 PM, and Suicide Squad in the 5:30 PM and 8:30 PM slots - but displays as 5:30 PM 8:30 PM.
How do I get it to display like the below instead?
SUN, 07 AUGUST
11:00 AM The Big Friendly Giant
12:45 PM Finding Dory
1:30 PM Poi E - The Story of our Song
3:00 PM Star Trek Beyond
3:45 PM Ghostbusters
5:30 PM Suicide Squad
6:15 PM Poi E - The Story of our Song
8:30 PM Suicide Squad
I'm really at wits end so any help will be much appreciated.
Thanks,
Choppie
