main->get_flags($event)); ?> get_label_captions($event ,'mec-fc-style')); ?>
main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID ); ?>- 00
- 00
- 00
- 00
main->get_styling(); $event = $this->events[0]; $settings = $this->main->get_settings(); $this->localtime = $this->skin_options['include_local_time'] ?? false; $display_label = $this->skin_options['display_label'] ?? false; $reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; $dark_mode = $styling['dark_mode'] ?? ''; if($dark_mode == 1) $set_dark = 'mec-dark-mode'; else $set_dark = ''; // Event is not valid! if(!isset($event->data)) return; $event_colorskin = (isset($styling['mec_colorskin']) || isset($styling['color'])) ? 'colorskin-custom' : ''; $location_id = $this->main->get_master_location_id($event); $event_location = ($location_id ? $this->main->get_location_data($location_id) : array()); $organizer_id = $this->main->get_master_organizer_id($event); $event_organizer = ($organizer_id ? $this->main->get_organizer_data($organizer_id) : array()); $event_date = (isset($event->date['start']) ? $event->date['start']['date'] : $event->data->meta['mec_start_date']); $event_title = apply_filters('mec_occurrence_event_title', $event->data->title, $event); $start_date = (isset($event->date['start']) and isset($event->date['start']['date'])) ? $event->date['start']['date'] : date('Y-m-d H:i:s'); $end_date = (isset($event->date['end']) and isset($event->date['end']['date'])) ? $event->date['end']['date'] : date('Y-m-d H:i:s'); $event_time = ''; if(isset($event->data->time['start_raw'])) $event_time = $event->data->time['start_raw']; else { $event_time .= sprintf("%02d", ($event->data->meta['mec_date']['start']['hour'] ?? 8)).':'; $event_time .= sprintf("%02d", ($event->data->meta['mec_date']['start']['minutes'] ?? 0)); $event_time .= ($event->data->meta['mec_date']['start']['ampm'] ?? 'AM'); } $event_etime = ''; if(isset($event->data->time['end_raw'])) $event_etime = $event->data->time['end_raw']; else { $event_etime .= sprintf("%02d", ($event->data->meta['mec_date']['end']['hour'] ?? 6)).':'; $event_etime .= sprintf("%02d", ($event->data->meta['mec_date']['end']['minutes'] ?? 0)); $event_etime .= ($event->data->meta['mec_date']['end']['ampm'] ?? 'PM'); } $start_time = date('D M j Y G:i:s', strtotime($start_date.' '.date('H:i:s', strtotime($event_time)))); $end_time = date('D M j Y G:i:s', strtotime($end_date.' '.date('H:i:s', strtotime($event_etime)))); // Timezone $TZO = $this->main->get_TZO($event); $d1 = new DateTime($start_time, $TZO); $d2 = new DateTime(current_time("D M j Y G:i:s"), $TZO); $d3 = new DateTime($end_time, $TZO); $countdown_method = get_post_meta($event->ID, 'mec_countdown_method', true); if(trim($countdown_method) == '') $countdown_method = 'global'; if($countdown_method == 'global') $ongoing = (isset($settings['hide_time_method']) and trim($settings['hide_time_method']) == 'end'); else $ongoing = $countdown_method == 'end'; if($ongoing and $d3 < $d2) $ongoing = false; // Skip if event is ongoing if($d1 < $d2 and !$ongoing) return; $gmt_offset = $this->main->get_gmt_offset($event, strtotime($start_date)); if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') === false) $gmt_offset = ' : '.$gmt_offset; if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'Edge') == true) $gmt_offset = substr(trim($gmt_offset), 0 , 3); if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') == true) $gmt_offset = substr(trim($gmt_offset), 2 , 3); // Generating javascript code of countdown module $javascript = ''; // Include javascript code into the page if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); else $this->factory->params('footer', $javascript); do_action('mec_start_skin', $this->id); do_action('mec_countdown_skin_head'); ?>