query_event($_POST['id']); $event->start_date = ajax_event_calendar::date_convert($event->start, AEC_DB_DATETIME_FORMAT, AEC_WP_DATE_FORMAT); $event->start_time = ajax_event_calendar::date_convert($event->start, AEC_DB_DATETIME_FORMAT, AEC_WP_TIME_FORMAT); $event->end_date = ajax_event_calendar::date_convert($event->end, AEC_DB_DATETIME_FORMAT, AEC_WP_DATE_FORMAT); $event->end_time = ajax_event_calendar::date_convert($event->end, AEC_DB_DATETIME_FORMAT, AEC_WP_TIME_FORMAT); $out = '

'; if ($event->start_date != $event->end_date) { // multiple day event, spanning all day if ($event->allDay) { $out .= "{$event->start_date} - {$event->end_date}"; // multiple day event, not spanning all day } else { $out .= "{$event->start_date} {$event->start_time} - {$event->end_date} {$event->end_time}"; } } else { // one day event, spanning all day if ($event->allDay) { $out .= $event->start_date; // one day event, spanning hours } else { $out .= "{$event->start_date} {$event->start_time} - {$event->end_time}"; } } $out .= "

\n"; // maintain lines breaks entered in textarea $description = nl2br($event->description); // convert urls in text into clickable links if ($options['make_links']) $description = make_clickable($description); $out .= "

{$description}

\n"; if (!empty($event->venue) || !empty($event->address) || !empty($event->city) || !empty($event->state) || !empty($event->zip) ) { $city = (!empty($event->city)) ? $event->city : ''; $state = (!empty($event->state)) ? $event->state : ''; $zip = (!empty($event->zip)) ? $event->zip : ''; $csz = ($options['addy_format']) ? "{$zip} {$city}" : "{$city} {$state}, {$zip}"; $out .= '

' . __('Location', AEC_PLUGIN_NAME) . "

\n"; // google map link if ($options['show_map_link'] && (!empty($event->address) || !empty($csz))) { $out .= "" . __('View Map', AEC_PLUGIN_NAME) . "\n"; } if (!empty($event->venue)) $out .= "

{$event->venue}\n"; $out .= (!empty($event->address)) ? "
{$event->address}
{$csz}

" : "
{$csz}

"; } if (!empty($event->contact) || !empty($event->contact_info)) { $out .= "

" . __('Contact Information', AEC_PLUGIN_NAME) . "

\n"; $contact = (!empty($event->contact)) ? $event->contact : ''; $cntinfo = (!empty($event->contact_info)) ? "(" . make_clickable($event->contact_info) . ")" : ''; $out .= "

{$contact} {$cntinfo}

\n"; } if ($event->access || $event->rsvp) { 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)) { $organization = stripslashes($org->organization); $out .= '

' . __('Presented by', AEC_PLUGIN_NAME) . ' '; if (!empty($org->user_url)) { $out .= "{$organization}"; } else { $out .= $organization; } $out .= "

\n"; } if (!empty($event->link)) { $link = ""; $link .= __('Event Link', AEC_PLUGIN_NAME); $link .= "\n"; $out .= $link; } $categories = $this->query_categories(); foreach ($categories as $category) { if ($event->category_id == $category->id) { $cat = $category->category; break; } } if ($event->allDay) { $event->start = $event->start_date; $event->end = $event->end_date; } // make links open in a new window if ($options['popup_links']) $out = popuplinks($out); $output = array( 'title' => "{$event->title} ({$cat})", 'content' => $out, 'start' => date('m/d/Y H:i:00', strtotime($event->start)), // used by javascript duration calculation 'end' => date('m/d/Y H:i:00', strtotime($event->end)), // used by javascript duration calculation 'allDay' => $event->allDay // used by javascript duration calculation ); $this->render_json($output); ?>