
Originally Posted by
kencor1
Good news I have got the calendar working

except for the same error that the post above mine was having with the dates in the ALL Events view. They are all the same dates as the date that is the furthest out. Has anyone got a fix for this?
Thanks
Tom
I was having an issue with how the dates are displayed although it isn't exactly the same problem that you are describing. My dates were all shifted up by one event. So the first event had the second event's date, the second event had the third event's date etc. and the last two events had the same date. I fixed this by changing when the events array increments in the file /modules/events_calendar_listing.php.
You need to change this code:
PHP Code:
while (!$events->EOF)
{
$row++;
$list_box_contents[$row][] = array('align' => 'left',
'params' => 'class="event_description"',
'text' => '<a href="index.php?main_page='
. FILENAME_EVENTS_CALENDAR . '&select_event=' . $events->fields['event_id'] . '">' . $events->fields['title'] . '</a>');
$events->MoveNext();
list($year, $month, $day) = split ( '[/.-]', $events->fields['start_date']);
$list_box_contents[$row][] = array( 'align' => 'center',
'params' => 'class="event_description"',
'text' => date("F j, Y", mktime(0, 0, 0, $month, $day, $year)));
$endDate = '-';
if(isset($events->fields['end_date']) && trim($events->fields['end_date']) != '')
{
list($year, $month, $day) = split ('[/.-]', $events->fields['end_date']);
$endDate = date("F j, Y", mktime(0, 0, 0, $month, $day, $year));
}
$list_box_contents[$row][] = array('align' => 'center',
'params' => 'class="event_description"',
'text' => $endDate);
}
to this code:
PHP Code:
while (!$events->EOF)
{
$row++;
$list_box_contents[$row][] = array('align' => 'left',
'params'=> 'class="event_description"',
'text' => '<a href="index.php?main_page='
. FILENAME_EVENTS_CALENDAR . '&select_event='
. $events->fields['event_id'] . '">'
. $events->fields['title'] . '</a>');
list($year, $month, $day) = split ( '[/.-]', $events->fields['start_date']);
$list_box_contents[$row][] = array( 'align' => 'center',
'params' => 'class="event_description"',
'text' => date("F j, Y", mktime(0, 0, 0, $month, $day, $year)));
$endDate = '-';
if(isset($events->fields['end_date']) && trim($events->fields['end_date']) != '')
{
list($year, $month, $day) = split ('[/.-]', $events->fields['end_date']);
$endDate = date("F j, Y", mktime(0, 0, 0, $month, $day, $year));
}
$list_box_contents[$row][] = array('align' => 'center',
'params' => 'class="event_description"',
'text' => $endDate);
$events->MoveNext();
}
If you are using the reformatted files from post #57, then the code that needs to be resplaced will be on lines 89-111.
Hope that helps.