get_event($_POST['id']);
// split date/time into form fields
$start_date = $this->date_convert($event->start, AEC_WP_DATE_TIME_FORMAT, AEC_WP_DATE_FORMAT);
$start_time = $this->date_convert($event->start, AEC_WP_DATE_TIME_FORMAT, AEC_WP_TIME_FORMAT);
$end_date = $this->date_convert($event->end, AEC_WP_DATE_TIME_FORMAT, AEC_WP_DATE_FORMAT);
$end_time = $this->date_convert($event->end, AEC_WP_DATE_TIME_FORMAT, AEC_WP_TIME_FORMAT);
$out = '
';
$out .= '';
if ($start_date != $end_date) {
// multiple day event, spanning all day
if ($event->allDay) {
$out .= $start_date;
$out .= ' - ' . $end_date;
$event->start = $start_date;
$event->end = $end_date;
// multiple day event, not spanning all day
} else {
$out .= $start_date . ' ' . $start_time;
$out .= '
' . $end_date . ' ' . $end_time;
}
} else {
// one day event, spanning all day
if ($event->allDay) {
$out .= $start_date;
$event->start = $start_date;
$event->end = $end_date;
// one day event, spanning hours
} else {
$out .= $start_date;
$out .= '
' . $start_time . ' - ' . $end_time;
}
}
$out .= '
';
$duration = $this->process_duration($event);
$out .= '' . __('Duration', AEC_PLUGIN_NAME) . '
' . $duration . '';
$out .= ' ';
$out .= '- ' . stripslashes($event->description) . '
';
if (!empty($event->venue) || !empty($event->address) ||
!empty($event->city) || !empty($event->state) ||
!empty($event->zip) ) {
$out .= '' . __('Location', AEC_PLUGIN_NAME) . '
';
if (!empty($event->venue)) $out .= stripslashes($event->venue) . '
';
$city = (!empty($event->city)) ? stripslashes($event->city) . ', ' : '';
$state = (!empty($event->state)) ? strtoupper($event->state) . ', ' : '';
$zip = (!empty($event->zip)) ? stripslashes($event->zip) : '';
$csz = $city . $state . $zip;
if (!empty($event->address)) {
$address = stripslashes($event->address);
$out .= $address . '
' . $csz;
} else {
$out .= $csz;
}
$out .= ' ';
// google map link
if ($options['show_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)) $out .= stripslashes($event->contact) . '
';
if (!empty($event->contact_info)) $out .= stripslashes($event->contact_info);
$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 .= '' . stripslashes($org->organization) . '';
} else {
$out .= stripslashes($org->organization);
}
$out .= '
';
}
if (!empty($event->link)) $out .= '- ' . __('Event Link', AEC_PLUGIN_NAME) . '
';
$out .= '
';
$categories = $this->get_categories();
foreach ($categories as $category) {
if ($category->id == $event->category_id) $cat = $category->category;
}
$output = array(
'title' => $event->title . ' (' . $cat . ')',
'content' => $out
);
header( "Content-Type: application/json" );
echo json_encode($output);
exit;
?>