get_event($_POST['id']);
$out = '
';
// Split date/time fields
list($start_date, $start_time) = str_split($event->start, 10);
list($end_date, $end_time) = str_split($event->end, 10);
$start_time = trim($start_time);
$end_time = trim($end_time);
$duration = $aec->calcDuration($event->start,$event->end,$event->allDay);
$out .= '';
if ($start_date != $end_date) {
if ($event->allDay) {
$out .= $start_date;
$out .= ' - ' . $end_date;
} else {
$out .= $event->start;
$out .= '
' . $event->end;
}
} else {
if ($event->allDay) {
$out .= $start_date;
$duration = __('All Day', AEC_PLUGIN_NAME);
} else {
$out .= $start_date;
$out .= '
' . $start_time . ' - ' . $end_time;
}
}
$out .= ' ' . $duration . '';
$out .= '
';
$out .= '- ' . stripslashes($event->description) . '
';
if (!empty($event->venue) || !empty($event->address) ||
!empty($event->city) || !empty($event->state) ||
!empty($event->zip) ) {
$v = array();
$csz = array();
if (!empty($event->venue)) $v[] = $event->venue;
if (!empty($event->address)) $v[] = $event->address;
if (!empty($event->city)) $csz[] = $event->city;
if (!empty($event->state)) $csz[] = strtoupper($event->state);
if (!empty($event->zip)) $csz[] = $event->zip;
$out .= '' . __('Location', AEC_PLUGIN_NAME) . '
';
$v[] = implode($csz, ', ');
$out .= implode($v, '
');
$out .= ' ';
}
// Google Map Link
$out .= '- ';
$out .= '' . __('View Map', AEC_PLUGIN_NAME) . '';
$out .= '
';
if (!empty($event->contact) || !empty($event->contact_info)) {
$out .= '' . __('Contact Information', AEC_PLUGIN_NAME) . '
';
if (!empty($event->contact)) $c[] = $event->contact;
if (!empty($event->contact_info)) $c[] = $event->contact_info;
$out .= implode($c, '
');
$out .= ' ';
}
if ($event->access || $event->rsvp) {
$out .= '
';
if ($event->access) $out .= '- ' . __('This event is accessible to people with disabilities.', AEC_PLUGIN_NAME) . '
';
if ($event->rsvp) $out .= '- ' . __('Please register with the contact person for this event.' , AEC_PLUGIN_NAME) . '
';
}
$org = get_userdata($event->user_id);
if (!empty($org->organization)) {
$out .= '- ' . __('Presented by', AEC_PLUGIN_NAME) . ' ';
if (!empty($org->user_url)) {
$out .= '' . $org->organization . '';
} else {
$out .= $org->organization;
}
$out .= '
';
}
if (!empty($event->link)) $out .= '- ' . __('Event Link', AEC_PLUGIN_NAME) . '
';
$out .= '
';
$categories = $aec->get_categories();
foreach ($categories as $category) {
if ($category->id == $event->category_id) $cat = $category->category;
}
$output = array(
'title' => $event->title . ' (' . $cat . ')',
'content' => $out
);
echo json_encode($output);
exit;
}
?>