function __construct() { add_filter('eventon_extra_tax', array($this, 'extra_tax'), 10, 1); add_action('init', array($this, 'register_frontend_scripts'), 15); //when a new post is published add_action('transition_post_status', array($this, 'send_approval_email'), 10, 3); $this->options = get_option('evcal_options_evcal_1'); $this->tax_count = evo_get_ett_count($this->options); $this->tax_names = evo_get_ettNames($this->options); $this->evoau_opt = get_option('evcal_options_evoau_1'); $this->evoau_opt_2 = get_option('evcal_options_evoau_2'); }
function event_type_options() { $event_type_names = evo_get_ettNames($this->evcal_opt[1]); // event types category names $ett_verify = evo_get_ett_count($this->evcal_opt[1]); $event_type_options['event_location'] = 'Event Location'; $event_type_options['event_organizer'] = 'Event Organizer'; for ($x = 1; $x < $ett_verify + 1; $x++) { $ab = $x == 1 ? '' : '_' . $x; $event_type_options['event_type' . $ab] = $event_type_names[$x]; } return $event_type_options; }
function evoAU_language_additions($_existen) { $evcal_opt = get_option('evcal_options_evcal_1'); $new_ar = array(array('type' => 'togheader', 'name' => 'ADDON: Action User'), array('label' => 'Event Name', 'name' => 'evoAUL_evn', 'legend' => ''), array('label' => 'Event Sub Title', 'name' => 'evoAUL_est', 'legend' => ''), array('label' => 'Event Start Date/Time', 'name' => 'evoAUL_esdt', 'legend' => ''), array('label' => 'Event End Date/Time', 'name' => 'evoAUL_eedt', 'legend' => ''), array('label' => 'Event Details', 'name' => 'evcal_evcard_details_au', 'legend' => ''), array('label' => 'Event Color', 'name' => 'evoAUL_ec', 'legend' => ''), array('label' => 'Event Location Name', 'name' => 'evoAUL_lca'), array('label' => 'Event Location Address', 'name' => 'evoAUL_ln'), array('label' => 'Event Location Coordinates (lat,lon Seperated by comma)', 'name' => 'evoAUL_lcor'), array('label' => 'Event Organizer', 'name' => 'evoAUL_eo', 'legend' => ''), array('label' => 'Event Organizer Contact Information', 'name' => 'evoAUL_eoc', 'legend' => ''), array('label' => 'Learn More Link', 'name' => 'evoAUL_lml', 'legend' => '')); // event taxnomies upto 5 all active ones only $ett_verify = evo_get_ett_count($evcal_opt); $_tax_names_array = evo_get_ettNames($evcal_opt); $new_ar_1 = ''; for ($x = 1; $x < $ett_verify + 1; $x++) { $ab = $x == 1 ? '' : '_' . $x; $__tax_name = $_tax_names_array[$x]; $new_ar_1[] = array('label' => 'Select the ' . $__tax_name . '', 'name' => 'evoAUL_stet' . $x, 'legend' => ''); } $new_ar_2 = array(array('label' => 'Edit Submitted Event', 'name' => 'evoAUL_ese', 'legend' => ''), array('label' => 'Event Image', 'name' => 'evoAUL_ei', 'legend' => ''), array('label' => 'All Day Event', 'name' => 'evoAUL_001', 'legend' => ''), array('label' => 'No End time', 'name' => 'evoAUL_002', 'legend' => ''), array('label' => 'Your Full Name', 'name' => 'evoAUL_fn', 'legend' => ''), array('label' => 'Your Email Address', 'name' => 'evoAUL_ea', 'legend' => ''), array('label' => 'Form Human Submission Validation', 'name' => 'evoAUL_cap', 'legend' => ''), array('label' => 'Select an Image', 'name' => 'evoAUL_img002', 'legend' => ''), array('label' => 'Image Chosen', 'name' => 'evoAUL_img001', 'legend' => ''), array('label' => 'Additional Field', 'name' => 'evoAU_add', 'legend' => ''), array('label' => '(Text)', 'var' => '1'), array('label' => '(Link)', 'var' => '1'), array('label' => 'Submit Event', 'name' => 'evoAUL_se', 'legend' => ''), array('label' => 'Submit another event', 'var' => '1'), array('label' => 'Form field placeholders', 'type' => 'subheader'), array('label' => 'Start Date', 'name' => 'evoAUL_phsd', 'legend' => ''), array('label' => 'Start Time', 'name' => 'evoAUL_phst', 'legend' => ''), array('label' => 'End Date', 'name' => 'evoAUL_phed', 'legend' => ''), array('label' => 'End Time', 'name' => 'evoAUL_phet', 'legend' => ''), array('type' => 'togend'), array('label' => 'User Interaction values', 'type' => 'subheader'), array('label' => 'Slide Down EventCard', 'name' => 'evoAUL_ux1', 'legend' => ''), array('label' => 'External Link', 'name' => 'evoAUL_ux2', 'legend' => ''), array('label' => 'Lightbox popup window', 'name' => 'evoAUL_ux3', 'legend' => ''), array('type' => 'togend'), array('label' => 'Form Notification Messages', 'type' => 'subheader'), array('label' => 'You must login to submit events.', 'name' => 'evoAUL_ymlse', 'legend' => ''), array('label' => 'Required Fields Missing', 'name' => 'evoAUL_nof1', 'legend' => ''), array('label' => 'Invalid validation code please try again', 'name' => 'evoAUL_nof2', 'legend' => ''), array('label' => 'Thank you for submitting your event!', 'name' => 'evoAUL_nof3', 'legend' => ''), array('label' => 'Could not create event post, try again later!', 'name' => 'evoAUL_nof4', 'legend' => ''), array('label' => 'Bad nonce form verification, try again!', 'name' => 'evoAUL_nof5', 'legend' => ''), array('label' => 'You can only submit one event!', 'name' => 'evoAUL_nof6', 'legend' => ''), array('type' => 'togend'), array('type' => 'togend')); $new_ar = array_merge($new_ar, $new_ar_1, $new_ar_2); return is_array($_existen) ? array_merge($_existen, $new_ar) : $_existen; }
public static function register_taxonomies() { // Taxonomies do_action('eventon_register_taxonomy'); $evOpt = self::$evOpt; $__capabilities = array('manage_terms' => 'manage_eventon_terms', 'edit_terms' => 'edit_eventon_terms', 'delete_terms' => 'delete_eventon_terms', 'assign_terms' => 'assign_eventon_terms'); register_taxonomy('event_location', apply_filters('eventon_taxonomy_objects_event_location', array('ajde_events')), apply_filters('eventon_taxonomy_args_event_location', array('hierarchical' => false, 'label' => __('Event Location', 'eventon'), 'show_ui' => true, 'query_var' => true, 'show_in_quick_edit' => false, 'meta_box_cb' => false, 'capabilities' => $__capabilities, 'rewrite' => apply_filters('evotax_slug_loc', array('slug' => 'event-location'))))); register_taxonomy('event_organizer', apply_filters('eventon_taxonomy_objects_event_organizer', array('ajde_events')), apply_filters('eventon_taxonomy_args_event_organizer', array('hierarchical' => false, 'label' => __('Event Organizer', 'eventon'), 'show_ui' => true, 'query_var' => true, 'show_in_quick_edit' => false, 'meta_box_cb' => false, 'capabilities' => $__capabilities, 'rewrite' => apply_filters('evotax_slug_org', array('slug' => 'event-organizer'))))); // Event type custom taxonomy NAMES $event_type_names = evo_get_ettNames($evOpt); // for each activated event type category for ($x = 1; $x < evo_get_ett_count($evOpt) + 1; $x++) { $ab = $x == 1 ? '' : '_' . $x; $ab2 = $x == 1 ? '' : '-' . $x; $evt_name = $event_type_names[$x]; register_taxonomy('event_type' . $ab, apply_filters('eventon_taxonomy_objects_event_type' . $ab, array('ajde_events')), apply_filters('eventon_taxonomy_args_event_type' . $ab, array('hierarchical' => true, 'labels' => array('name' => __("{$evt_name} Categories", 'eventon'), 'singular_name' => __("{$evt_name} Category", 'eventon'), 'menu_name' => _x($evt_name, 'Admin menu name', 'eventon'), 'search_items' => __("Search {$evt_name} Categories", 'eventon'), 'all_items' => __("All {$evt_name} Categories", 'eventon'), 'parent_item' => __("Parent {$evt_name} Category", 'eventon'), 'parent_item_colon' => __("Parent {$evt_name} Category:", 'eventon'), 'edit_item' => __("Edit {$evt_name} Category", 'eventon'), 'update_item' => __("Update {$evt_name} Category", 'eventon'), 'add_new_item' => __("Add New {$evt_name} Category", 'eventon'), 'new_item_name' => __("New {$evt_name} Category Name", 'eventon')), 'show_ui' => true, 'query_var' => true, 'capabilities' => $__capabilities, 'rewrite' => array('slug' => 'event-type' . $ab2)))); } }
function form($instance) { global $eventon; extract($instance); $evo_title = !empty($evo_title) ? $evo_title : null; $evOpt = get_option('evcal_options_evcal_1'); $event_type_names = evo_get_ettNames($evOpt); ?> <div id='eventon_widget_settings' class='eventon_widget_settings'> <div class='eventon_widget_top'><p></p></div> <div class='evo_widget_outter evowig'> <div class='evo_wig_item'> <input id="<?php echo $this->get_field_id('evo_title'); ?> " name="<?php echo $this->get_field_name('evo_title'); ?> " type="text" value="<?php echo esc_attr($evo_title); ?> " placeholder='Widget Title' title='Widget Title'/> </div> </div> <?php foreach (array('1', '2') as $type) { ?> <div class='evo_widget_outter evowig'> <div class='evo_wig_item input_checkboxes'> <p>Select <?php echo $event_type_names[$type]; ?> </p> <p> <?php $ab = $type == 1 ? '' : '_' . $type; $ett = get_terms('event_type' . $ab, array('hide_empty' => false)); if (!empty($ett) && !is_wp_error($ett)) { foreach ($ett as $term) { $name = 'evo_wig_ett_' . $type; $name = $this->get_field_name($name); $checked = !empty($instance['evo_wig_ett_' . $type]) && in_array($term->term_id, $instance['evo_wig_ett_' . $type]) ? 'checked="checked"' : null; echo "<span><input type='checkbox' name='" . $name . "[]' value='{$term->term_id}' {$checked}> {$term->name}</span>"; } } ?> </p> </div> </div> <?php } ?> <p style='opacity:0.6'><i><?php _e('Selecting event type categories above will show events fall into all those categories for the current month.', 'eventon'); ?> <br/><br/>If you are not able to achieve what you desire, try <a href='http://www.myeventon.com/documentation/use-eventon-shortcode-executor-widget/' target='_blank'>EventON Shortcode Executor Widget</a></i></p> </div> <?php }
function _array_part_taxonomies() { $output = ''; $event_type_names = evo_get_ettNames($this->evopt); $ett_verify = evo_get_ett_count($this->evopt); $output[] = array('type' => 'togheader', 'name' => 'Event Type Categories'); for ($x = 1; $x < $ett_verify + 1; $x++) { $default = $event_type_names[$x]; $output[] = array('label' => $default, 'name' => 'evcal_lang_et' . $x); // each term of taxonomy $ab = $x == 1 ? '' : '_' . $x; $terms = get_terms('event_type' . $ab, array('hide_empty' => false)); $termitem = ''; if (!empty($terms)) { foreach ($terms as $term) { $var = 'evolang_' . 'event_type' . $ab . '_' . $term->term_id; $termitem[$var] = !empty($this->lang_options[$var]) ? $this->lang_options[$var] : $term->name; } } if (!empty($termitem)) { $output[] = array('type' => 'multibox_open', 'items' => $termitem); } } $output[] = array('label' => 'Event Location', 'name' => 'evcal_lang_evloc'); $output[] = array('label' => 'Events at this location', 'var' => '1'); $output[] = array('label' => 'Event Organizer', 'name' => 'evcal_lang_evorg'); $output[] = array('label' => 'Events by this organizer', 'var' => '1'); $output[] = array('type' => 'togend'); return $output; }
/** * Settings page. * * Handles the display of the main EventON settings page in admin. * * @access public * @return void */ function eventon_settings() { global $eventon, $ajde; do_action('eventon_settings_start'); // Settings Tabs array $evcal_tabs = apply_filters('eventon_settings_tabs', array('evcal_1' => __('Settings', 'eventon'), 'evcal_2' => __('Language', 'eventon'), 'evcal_3' => __('Styles', 'eventon'), 'evcal_4' => __('Addons & Licenses', 'eventon'), 'evcal_5' => __('Support', 'eventon'))); // Get current tab/section $focus_tab = isset($_GET['tab']) ? sanitize_text_field(urldecode($_GET['tab'])) : 'evcal_1'; $current_section = isset($_GET['section']) ? sanitize_text_field(urldecode($_GET['section'])) : ''; // Update or add options if (isset($_POST['evcal_noncename']) && isset($_POST)) { if (wp_verify_nonce($_POST['evcal_noncename'], AJDE_EVCAL_BASENAME)) { foreach ($_POST as $pf => $pv) { if ($pf != 'evcal_styles' && $focus_tab != 'evcal_4' || $pf != 'evcal_sort_options') { $pv = is_array($pv) ? $pv : addslashes(esc_html(stripslashes($pv))); $evcal_options[$pf] = $pv; } if ($pf == 'evcal_sort_options') { $evcal_options[$pf] = $pv; } } // General settings page - write styles to head option if ($focus_tab == 'evcal_1' && isset($_POST['evcal_css_head']) && $_POST['evcal_css_head'] == 'yes') { ob_start(); include AJDE_EVCAL_PATH . '/assets/css/dynamic_styles.php'; $evo_dyn_css = ob_get_clean(); update_option('evo_dyn_css', $evo_dyn_css); } //language tab if ($focus_tab == 'evcal_2') { $new_lang_opt = ''; $_lang_version = !empty($_GET['lang']) ? $_GET['lang'] : 'L1'; $lang_opt = get_option('evcal_options_evcal_2'); if (!empty($lang_opt)) { $new_lang_opt[$_lang_version] = $evcal_options; $new_lang_opt = array_merge($lang_opt, $new_lang_opt); } else { $new_lang_opt[$_lang_version] = $evcal_options; } update_option('evcal_options_evcal_2', $new_lang_opt); } elseif ($focus_tab == 'evcal_1' || empty($focus_tab)) { // store custom meta box count $cmd_count = evo_calculate_cmd_count(); $evcal_options['cmd_count'] = $cmd_count; update_option('evcal_options_' . $focus_tab, $evcal_options); // all other settings tabs } else { update_option('evcal_options_' . $focus_tab, $evcal_options); } // STYLES if (isset($_POST['evcal_styles'])) { update_option('evcal_styles', strip_tags(stripslashes($_POST['evcal_styles']))); } $_POST['settings-updated'] = 'true'; eventon_generate_options_css(); // nonce check } else { die(__('Action failed. Please refresh the page and retry.', 'eventon')); } } // Load eventon settings values for current tab $current_tab_number = substr($focus_tab, -1); if (!is_numeric($current_tab_number)) { // if the tab last character is not numeric then get the whole tab name as the variable name for the options $current_tab_number = $focus_tab; } $evcal_opt[$current_tab_number] = get_option('evcal_options_' . $focus_tab); // activation notification if (!$eventon->evo_updater->is_activated('eventon')) { echo '<div class="update-nag">' . __('Your eventON license is not saved. eventON should still work fine. <a href="' . get_admin_url() . 'admin.php?page=eventon&tab=evcal_4">Enter License Now</a>', 'eventon') . '</div>'; } // TABBBED HEADER ?> <div class="wrap" id='evcal_settings'> <h2><?php _e('EventON Settings', 'eventon'); ?> (ver <?php echo get_option('eventon_plugin_version'); ?> ) <?php do_action('eventon_updates_in_settings'); ?> </h2> <h2 class='nav-tab-wrapper' id='meta_tabs'> <?php foreach ($evcal_tabs as $nt => $ntv) { $evo_notification = ''; echo "<a href='?page=eventon&tab=" . $nt . "' class='nav-tab " . ($focus_tab == $nt ? 'nav-tab-active' : null) . " {$nt}' evcal_meta='evcal_{$nt}'>" . $ntv . $evo_notification . "</a>"; } ?> </h2> <div class='evo_settings_box'> <?php // SETTINGS SAVED MESSAGE $updated_code = isset($_POST['settings-updated']) && $_POST['settings-updated'] == 'true' ? '<div class="updated fade"><p>' . __('Settings Saved', 'eventon') . '</p></div>' : null; echo $updated_code; // TABS switch ($focus_tab) { case "evcal_1": // Event type custom taxonomy NAMES $event_type_names = evo_get_ettNames($evcal_opt[1]); $evt_name = $event_type_names[1]; $evt_name2 = $event_type_names[2]; ?> <form method="post" action=""><?php settings_fields('evcal_field_group'); wp_nonce_field(AJDE_EVCAL_BASENAME, 'evcal_noncename'); ?> <div id="evcal_1" class=" evcal_admin_meta evcal_focus"> <div class="evo_inside"> <?php require_once AJDE_EVCAL_PATH . '/includes/admin/settings/class-settings-settings.php'; $settings = new evo_settings_settings($evcal_opt); $ajde->load_ajde_backender(); print_ajde_customization_form($settings->content(), $evcal_opt[1]); ?> </div> </div> <div class='evo_diag'> <input type="submit" class="evo_admin_btn btn_prime" value="<?php _e('Save Changes'); ?> " /> <a id='resetColor' style='display:none' class='evo_admin_btn btn_secondary'><?php _e('Reset to default colors', 'eventon'); ?> </a><br/><br/> <a target='_blank' href='http://www.myeventon.com/support/'><img src='<?php echo AJDE_EVCAL_URL; ?> /assets/images/myeventon_resources.png'/></a> </div> </form> <?php break; // LANGUAGE TAB // LANGUAGE TAB case "evcal_2": require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_language_tab.php'; $settings_lang = new evo_settings_lang($evcal_opt); $settings_lang->get_content(); break; // STYLES TAB // STYLES TAB case "evcal_3": echo '<form method="post" action="">'; //settings_fields('evcal_field_group'); wp_nonce_field(AJDE_EVCAL_BASENAME, 'evcal_noncename'); // styles settings tab content require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_styles_tab.php'; break; // ADDON TAB // ADDON TAB case "evcal_4": // Addons settings tab content require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_addons_tab.php'; break; // support TAB // support TAB case "evcal_5": // Addons settings tab content require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_support_tab.php'; break; // ADVANDED extra field // ADVANDED extra field case "extra": // advanced tab content require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_advanced_tab.php'; break; default: do_action('eventon_settings_tabs_' . $focus_tab); break; } echo "</div>"; }
<?php /** * Language Settings * * @version 2.2.10 * @package EventON/settings * @category Settings * @author AJDE */ // Event type custom taxonomy NAMES $evopt = get_option('evcal_options_evcal_1'); $event_type_names = evo_get_ettNames($evopt); $_ett_lang_ar = array(); $ett_verify = evo_get_ett_count($evopt); for ($x = 1; $x < $ett_verify + 1; $x++) { $_ett_lang_ar[$x] = array('label' => $event_type_names[$x], 'name' => 'evcal_lang_et' . $x); } // Custom meta fields $_cmd_lang_ar = array(); $cmd_verify = evo_retrieve_cmd_count($evopt); for ($x = 1; $x < $cmd_verify + 1; $x++) { $label = $evopt['evcal_ec_f' . $x . 'a1']; $_cmd_lang_ar[$x] = array('label' => $label, 'name' => 'evcal_cmd_' . $x); } // MAIN ARRAY $eventon_custom_language_array = array(array('type' => 'togheader', 'name' => 'General Calendar'), array('label' => 'No Events', 'name' => 'evcal_lang_noeve', 'legend' => ''), array('label' => 'All Day', 'name' => 'evcal_lang_allday', 'legend' => ''), array('label' => 'Year Around Event', 'name' => 'evcal_lang_yrrnd', 'legend' => ''), array('label' => 'Events', 'name' => 'evcal_lang_events'), array('label' => 'Show More Events', 'name' => 'evcal_lang_sme'), array('type' => 'togend'), array('type' => 'togheader', 'name' => 'Calendar Header'), array('label' => 'Jump Months', 'name' => 'evcal_lang_jumpmonths', 'legend' => ''), array('label' => 'Jump Months: Month', 'name' => 'evcal_lang_jumpmonthsM', 'legend' => ''), array('label' => 'Jump Months: Year', 'name' => 'evcal_lang_jumpmonthsY', 'legend' => ''), array('label' => 'Sort Options', 'name' => 'evcal_lang_sopt', 'legend' => ''), array('label' => 'Sort By', 'name' => 'evcal_lang_sort', 'legend' => ''), array('label' => 'Date', 'name' => 'evcal_lang_sdate', 'legend' => ''), array('label' => 'Title', 'name' => 'evcal_lang_stitle', 'legend' => ''), array('label' => 'All', 'name' => 'evcal_lang_all', 'legend' => 'Sort options all text'), $_ett_lang_ar[1], $_ett_lang_ar[2], !empty($_ett_lang_ar[3]) ? $_ett_lang_ar[3] : null, !empty($_ett_lang_ar[4]) ? $_ett_lang_ar[4] : null, array('type' => 'togend'), array('type' => 'togheader', 'name' => 'Event Card'), array('label' => 'Location Name', 'name' => 'evcal_lang_location_name', 'legend' => ''), array('label' => 'Location', 'name' => 'evcal_lang_location', 'legend' => ''), array('label' => 'Event Location', 'name' => 'evcal_lang_evloc'), array('label' => 'Type your address', 'name' => 'evcalL_getdir_placeholder', 'legend' => 'Get directions section'), array('label' => 'Click here to get directions', 'name' => 'evcalL_getdir_title', 'legend' => 'Get directions section'), array('label' => 'Time', 'name' => 'evcal_lang_time', 'legend' => ''), array('label' => 'Color', 'name' => 'evcal_lang_scolor', 'legend' => ''), array('label' => 'At (event location)', 'name' => 'evcal_lang_at', 'legend' => ''), array('label' => 'Event Details', 'name' => 'evcal_evcard_details', 'legend' => ''), array('label' => 'Event Organized by', 'name' => 'evcal_evcard_org', 'legend' => ''), array('label' => 'Event Organizer', 'name' => 'evcal_lang_evorg'), array('label' => 'Close event button text', 'name' => 'evcal_lang_close'), array('label' => 'More', 'name' => 'evcal_lang_more', 'legend' => 'More/less text for long event description'), array('label' => 'Less', 'name' => 'evcal_lang_less', 'legend' => 'More/less text for long event description'), array('label' => 'Buy ticket via Paypal', 'name' => 'evcal_evcard_tix1', 'legend' => 'for Paypal'), array('label' => 'Buy Now button text', 'name' => 'evcal_evcard_btn1', 'legend' => 'for Paypal'), array('label' => 'Ticket for the event', 'name' => 'evcal_evcard_tix2', 'legend' => 'for eventbrite'), array('label' => 'Buy now button', 'name' => 'evcal_evcard_btn2', 'legend' => 'for eventbrite'), array('label' => 'Event Capacity', 'name' => 'evcal_evcard_cap', 'legend' => ''), array('label' => 'Learn More about this event', 'name' => 'evcal_evcard_learnmore', 'legend' => 'for meetup'), array('label' => 'Learn More link text', 'name' => 'evcal_evcard_learnmore2', 'legend' => 'for meetup'), array('type' => 'subheader', 'label' => 'Add to calendar Section'), array('label' => 'Calendar', 'name' => 'evcal_evcard_calncal'), array('label' => 'GoogleCal', 'name' => 'evcal_evcard_calgcal'), array('label' => 'Add to your calendar', 'name' => 'evcal_evcard_addics', 'legend' => 'Alt text for add to calendar button'), array('label' => 'Add to google calendar', 'name' => 'evcal_evcard_addgcal', 'legend' => 'Alt text for add to google calendar button'), array('type' => 'togend'), !empty($_cmd_lang_ar[1]) ? $_cmd_lang_ar[1] : null, !empty($_cmd_lang_ar[2]) ? $_cmd_lang_ar[2] : null, !empty($_cmd_lang_ar[3]) ? $_cmd_lang_ar[3] : null, array('type' => 'togend'));
/** GENERATE individual event data */ public function generate_event_data($event_list_array, $focus_month_beg_range = '', $FOCUS_month_int = '', $FOCUS_year_int = '') { $months_event_array = ''; // Initial variables $wp_time_format = get_option('time_format'); $default_event_color = !empty($this->evopt1['evcal_hexcode']) ? '#' . $this->evopt1['evcal_hexcode'] : '#206177'; $__shortC_arg = $this->shortcode_args; $__count = 0; // EVENT CARD open by default variables $_is_eventCardOpen = !empty($__shortC_arg['evc_open']) && $__shortC_arg['evc_open'] == 'yes' ? true : ($this->is_eventcard_open ? true : false); $eventcard_script_class = $_is_eventCardOpen ? "gmaponload" : null; $this->is_eventcard_open = false; // check featured events are prioritized $__feature_events = !empty($__shortC_arg['ft_event_priority']) && $__shortC_arg['ft_event_priority'] != 'no' ? true : false; // GET EventTop fields - v2.1.17 $eventop_fields = !empty($this->evopt1['evcal_top_fields']) ? $this->evopt1['evcal_top_fields'] : null; // Number of activated taxnomonies v 2.2.15 $_active_tax = evo_get_ett_count($this->evopt1); // eventCARD HTML require_once AJDE_EVCAL_PATH . '/includes/eventon_eventCard.php'; // check if single event exist $_sin_ev_ex = in_array('eventon-single-event/eventon-single-event.php', get_option('active_plugins')) ? true : false; // EACH EVENT if (is_array($event_list_array)) { foreach ($event_list_array as $event_) { $__count++; //print_r($event); $event_id = $event_['event_id']; $event_start_unix = $event_['event_start_unix']; $event_end_unix = $event_['event_end_unix']; $event_type = $event_['event_type']; $ev_vals = $event_['event_pmv']; $event = get_post($event_id); // year long or not $__year_long_event = !empty($ev_vals['evo_year_long']) && $ev_vals['evo_year_long'][0] == 'yes' ? true : 0; // define variables $ev_other_data = $ev_other_data_top = $html_event_type_info = $_event_date_HTML = $_eventcard = $html_event_type_2_info = ''; $_is_end_date = true; $DATE_start_val = eventon_get_formatted_time($event_start_unix); if (empty($event_end_unix)) { $_is_end_date = false; $DATE_end_val = $DATE_start_val; } else { $DATE_end_val = eventon_get_formatted_time($event_end_unix); } // if this event featured $__featured = !empty($ev_vals['_featured']) && $ev_vals['_featured'][0] == 'yes' ? true : false; // GET: repeat interval for this event $__repeatInterval = !empty($event_['event_repeat_interval']) ? $event_['event_repeat_interval'] : (!empty($_GET['ri']) ? $_GET['ri'] : 0); // Unique ID generation $unique_varied_id = 'evc' . $event_start_unix . uniqid() . $event_id; $unique_id = 'evc_' . $event_start_unix . $event_id; // All day event variables $_is_allday = !empty($ev_vals['evcal_allday']) && $ev_vals['evcal_allday'][0] == 'yes' ? true : false; $_hide_endtime = !empty($ev_vals['evo_hide_endtime']) && $ev_vals['evo_hide_endtime'][0] == 'yes' ? true : false; $evcal_lang_allday = eventon_get_custom_language($this->evopt2, 'evcal_lang_allday', 'All Day'); /* evo_hide_endtime NOTE: if its set to hide end time, meaning end time and date would be empty on wp-admin, which will fall into same start end month category. */ $_event_date_HTML = $this->generate_time_($DATE_start_val, $DATE_end_val, $ev_vals, $evcal_lang_allday, $focus_month_beg_range, $FOCUS_month_int, $event_start_unix, $event_end_unix); // (---) hook for addons if (has_filter('eventon_eventcard_date_html')) { $_event_date_HTML = apply_filters('eventon_eventcard_date_html', $_event_date_HTML, $event_id); } // EACH DATA FIELD // EVENT FEATURES IMAGE $img_id = get_post_thumbnail_id($event_id); $img_med_src = ''; if ($img_id != '') { $img_src = wp_get_attachment_image_src($img_id, 'full'); $img_med_src = wp_get_attachment_image_src($img_id, 'medium'); $img_thumb_src = wp_get_attachment_image_src($img_id, 'thumbnail'); // append to eventcard array $_eventcard['ftimage'] = array('img' => $img_src, 'hovereffect' => !empty($this->evopt1['evo_ftimghover']) ? $this->evopt1['evo_ftimghover'] : null, 'clickeffect' => !empty($this->evopt1['evo_ftimgclick']) ? $this->evopt1['evo_ftimgclick'] : null, 'min_height' => !empty($this->evopt1['evo_ftimgheight']) ? $this->evopt1['evo_ftimgheight'] : 400, 'ftimg_sty' => !empty($this->evopt1['evo_ftimg_height_sty']) ? $this->evopt1['evo_ftimg_height_sty'] : 'minimized'); } else { $img_thumb_src = ''; } // EVENT DESCRIPTION $evcal_event_content = $event->post_content; if (!empty($evcal_event_content)) { $event_full_description = $evcal_event_content; } else { // event description compatibility from older versions. $event_full_description = !empty($ev_vals['evcal_description']) ? $ev_vals['evcal_description'][0] : null; } if (!empty($event_full_description)) { $except = $event->post_excerpt; $event_excerpt = eventon_get_event_excerpt($event_full_description, 30, $except); $_eventcard['eventdetails'] = array('fulltext' => $event_full_description, 'excerpt' => $event_excerpt); } // EVENT LOCATION $lonlat = !empty($ev_vals['evcal_lat']) && !empty($ev_vals['evcal_lon']) ? 'data-latlng="' . $ev_vals['evcal_lat'][0] . ',' . $ev_vals['evcal_lon'][0] . '" ' : null; $__location = evo_meta($ev_vals, 'evcal_location'); // location name $__location_name = evo_meta($ev_vals, 'evcal_location_name'); $_eventcard['timelocation'] = array('timetext' => $_event_date_HTML['html_prettytime'], 'location' => $__location, 'location_name' => $__location_name); // Location Image $loc_img_id = !empty($ev_vals['evo_loc_img']) ? $ev_vals['evo_loc_img'][0] : null; if (!empty($loc_img_id)) { $_eventcard['locImg'] = array('id' => $loc_img_id, 'fullheight' => !empty($this->evopt1['evo_locimgheight']) ? $this->evopt1['evo_locimgheight'] : 400); // location name and address if (evo_check_yn($ev_vals, 'evcal_name_over_img') && !empty($__location_name)) { $_eventcard['locImg']['locName'] = $__location_name; if (!empty($__location)) { $_eventcard['locImg']['locAdd'] = $__location; } } } // GOOGLE maps if ($this->google_maps_load && !empty($ev_vals['evcal_location']) && (!empty($ev_vals['evcal_gmap_gen']) && $ev_vals['evcal_gmap_gen'][0] == 'yes')) { $gmap_api_status = ''; $_eventcard['gmap'] = array('id' => $unique_varied_id); // GET directions if ($this->evopt1['evo_getdir'] == 'yes') { $_eventcard['getdirection'] = array('fromaddress' => $ev_vals['evcal_location'][0]); } } else { $gmap_api_status = 'data-gmap_status="null"'; } // EVENT BRITE // check if eventbrite actually used in this event if (!empty($ev_vals['evcal_eventb_data_set']) && $ev_vals['evcal_eventb_data_set'][0] == 'yes') { // Event brite capacity if (!empty($ev_vals['evcal_eventb_tprice']) && !empty($ev_vals['evcal_eventb_url'])) { $_eventcard['eventbrite'] = array('capacity' => !empty($ev_vals['evcal_eventb_capacity']) ? $ev_vals['evcal_eventb_capacity'][0] : null, 'tix_price' => $ev_vals['evcal_eventb_tprice'][0], 'url' => $ev_vals['evcal_eventb_url'][0]); } } // PAYPAL Code if (!empty($ev_vals['evcal_paypal_item_price'][0]) && $this->evopt1['evcal_paypal_pay'] == 'yes') { $_eventcard['paypal'] = array('title' => $event->post_title, 'price' => $ev_vals['evcal_paypal_item_price'][0], 'text' => !empty($ev_vals['evcal_paypal_text']) ? $ev_vals['evcal_paypal_text'][0] : null); } // Event Organizer if (!empty($ev_vals['evcal_organizer']) && (!empty($ev_vals['evo_evcrd_field_org']) && $ev_vals['evo_evcrd_field_org'][0] != 'yes')) { $_eventcard['organizer'] = array('value' => $ev_vals['evcal_organizer'][0], 'contact' => !empty($ev_vals['evcal_org_contact']) ? $ev_vals['evcal_org_contact'][0] : null, 'img' => !empty($ev_vals['evcal_org_img']) ? $ev_vals['evcal_org_img'][0] : null); } // Custom fields $_cmf_count = evo_retrieve_cmd_count($this->evopt1); for ($x = 1; $x < $_cmf_count + 1; $x++) { if (!empty($this->evopt1['evcal_ec_f' . $x . 'a1']) && !empty($this->evopt1['evcal__fai_00c' . $x]) && !empty($ev_vals["_evcal_ec_f" . $x . "a1_cus"])) { // check if hide this from eventCard set to yes if (empty($this->evopt1['evcal_ec_f' . $x . 'a3']) || $this->evopt1['evcal_ec_f' . $x . 'a3'] == 'no') { $faicon = $this->evopt1['evcal__fai_00c' . $x]; $_eventcard['customfield' . $x] = array('imgurl' => $faicon, 'x' => $x, 'value' => $ev_vals["_evcal_ec_f" . $x . "a1_cus"][0], 'valueL' => !empty($ev_vals["_evcal_ec_f" . $x . "a1_cusL"]) ? $ev_vals["_evcal_ec_f" . $x . "a1_cusL"][0] : null, '_target' => !empty($ev_vals["_evcal_ec_f" . $x . "_onw"]) ? $ev_vals["_evcal_ec_f" . $x . "_onw"][0] : null, 'type' => $this->evopt1['evcal_ec_f' . $x . 'a2']); } } } // LEARN MORE and ICS if (!empty($ev_vals['evcal_lmlink']) || !empty($this->evopt1['evo_ics']) && $this->evopt1['evo_ics'] == 'yes') { $_eventcard['learnmoreICS'] = array('event_id' => $event_id, 'learnmorelink' => !empty($ev_vals['evcal_lmlink']) ? $ev_vals['evcal_lmlink'][0] : null, 'learnmore_target' => !empty($ev_vals['evcal_lmlink_target']) && $ev_vals['evcal_lmlink_target'][0] == 'yes' ? 'target="_blank"' : null, 'estart' => $event_start_unix, 'eend' => $event_end_unix, 'etitle' => $event->post_title, 'evals' => $ev_vals); } // ======================= /** CONSTRUCT the EVENT CARD **/ if (!empty($_eventcard) && count($_eventcard) > 0) { // filter hook for eventcard content array - updated 2.2.20 $_eventcard = apply_filters('eventon_eventcard_array', $_eventcard, $ev_vals, $event_id, $__repeatInterval); // if an order is set reorder things $_eventcard = eventon_EVC_sort($_eventcard, $this->evopt1['evoCard_order']); ob_start(); echo "<div class='event_description evcal_eventcard " . ($_is_eventCardOpen ? 'open' : null) . "' " . ($_is_eventCardOpen ? 'style="display:block"' : 'style="display:none"') . ">"; echo eventon_eventcard_print($_eventcard, $this->evopt1, $this->evopt2); // (---) hook for addons if (has_action('eventon_eventcard_additions')) { do_action('eventon_eventcard_additions', $event_id, $this->__calendar_type, $event->post_title, $event_full_description, $img_thumb_src); } echo "</div>"; $html_event_detail_card = ob_get_clean(); } else { $html_event_detail_card = null; } /** Trigger attributes **/ $event_description_trigger = !empty($html_event_detail_card) ? "desc_trig" : null; $gmap_trigger = !empty($ev_vals['evcal_gmap_gen']) && $ev_vals['evcal_gmap_gen'][0] == 'yes' ? 'data-gmtrig="1"' : 'data-gmtrig="0"'; // Generate tax terms for event top $html_event_type_tax_ar = array(); $_tax_names_array = evo_get_ettNames($this->evopt1); $term_class = $evcal_terms_ = ''; if (!empty($eventop_fields)) { // foreach active tax for ($b = 1; $b <= $_active_tax; $b++) { $__tx_content = ''; $__tax_slug = 'event_type' . ($b == 1 ? '' : '_' . $b); $__tax_fields = 'eventtype' . ($b == 1 ? '' : $b); // for override evc colors if ($b == 1) { $evcal_terms_ = wp_get_post_terms($event_id, $__tax_slug); } if (in_array($__tax_fields, $eventop_fields)) { $evcal_terms = !empty($evcal_terms_) && $b == 1 ? $evcal_terms_ : wp_get_post_terms($event_id, $__tax_slug); if ($evcal_terms) { $__tax_name = $_tax_names_array[$b]; $__tx_content .= "<span class='evcal_event_types ett{$b}'><em><i>" . $__tax_name . ":</i></em>"; foreach ($evcal_terms as $termA) { // add tax term slug to event element class names $term_class .= ' evo_' . $termA->slug; $__tx_content .= "<em data-filter='{$__tax_slug}'>" . $termA->name . "</em>"; } $__tx_content .= "<i class='clear'></i></span>"; $html_event_type_tax_ar[$b] = $__tx_content; } } } } $_html_tax_content = count($html_event_type_tax_ar) > 0 ? implode('', $html_event_type_tax_ar) : null; //event color $event_color = eventon_get_hex_color($ev_vals, $default_event_color); // override event colors if (!empty($__shortC_arg['etc_override']) && $__shortC_arg['etc_override'] == 'yes' && !empty($evcal_terms_)) { $ev_id = $evcal_terms_[0]->term_id; $ev_color = get_option("evo_et_taxonomy_{$ev_id}"); $event_color = !empty($ev_color['et_color']) ? '#' . $ev_color['et_color'] : $event_color; } // event ex link $exlink_option = !empty($ev_vals['_evcal_exlink_option']) ? $ev_vals['_evcal_exlink_option'][0] : 1; $event_permalink = get_permalink($event_id); // if UX to be open in new window then use link to single event or that link $link_append = array(); $_link_text = ''; if (!empty($__shortC_arg['lang']) && $__shortC_arg['lang'] != 'L1') { $link_append['l'] = $__shortC_arg['lang']; } $link_append['ri'] = $__repeatInterval; if (!empty($link_append)) { foreach ($link_append as $lp => $lpk) { if ($lp == 'ri' && $lpk == '0') { continue; } $_link_text .= $lp . '=' . $lpk . '&'; } } $_link_text = !empty($_link_text) ? '?' . $_link_text : null; $href = !empty($ev_vals['evcal_exlink']) && $exlink_option != '1' ? 'data-exlk="1" href="' . $ev_vals['evcal_exlink'][0] . $_link_text . '"' : 'data-exlk="0"'; // target $target_ex = !empty($ev_vals['_evcal_exlink_target']) && $ev_vals['_evcal_exlink_target'][0] == 'yes' ? 'target="_blank"' : null; // EVENT LOCATION if (evo_location_exists($ev_vals)) { $location_address = !empty($ev_vals['evcal_location']) ? $ev_vals['evcal_location'][0] : null; // location as LON LAT $event_location_variables = (!empty($lonlat) ? $lonlat : null) . ' data-location_address="' . $location_address . '" '; // conditional schema data for event if (!empty($this->evopt1['evo_schema']) && $this->evopt1['evo_schema'] == 'yes') { $__scheme_data_location = ''; } else { $__scheme_data_location = ' <item style="display:none" itemprop="location" itemscope itemtype="http://schema.org/Place"> <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> <item itemprop="streetAddress">' . $location_address . '</item> </span> </item>'; } $ev_location = '<em class="evcal_location" ' . (!empty($lonlat) ? $lonlat : null) . ' data-add_str="' . $location_address . '">' . $location_address . '</em>'; // location type $event_location_variables .= !empty($lonlat) ? 'data-location_type="lonlat"' : 'data-location_type="address"'; // location name $event_location_variables .= !empty($ev_vals['evcal_location_name']) ? ' data-location_name="' . $ev_vals['evcal_location_name'][0] . '"' : null; // location status $event_location_variables .= ' data-location_status="true"'; } else { // location status $ev_location = $event_location_variables = $__scheme_data_location = null; $event_location_variables .= ' data-location_status="false"'; } /* ------------------- // HTML // EventTop - building of the eventTop section -------------*/ $eventtop_html = $eventop_fields_ = ''; // featured image $eventtop_html[] = !empty($img_thumb_src) && !empty($__shortC_arg['show_et_ft_img']) && $__shortC_arg['show_et_ft_img'] == 'yes' ? "<span class='ev_ftImg' style='background-image:url(" . $img_thumb_src[0] . ")'></span>" : null; // CHECK for event top fields array $eventop_fields_ = is_array($eventop_fields) ? true : false; // date number $___day_name = $eventop_fields_ && in_array('dayname', $eventop_fields) ? "<em class='evo_day' >" . $DATE_start_val['D'] . "</em>" : null; if (!$__year_long_event) { $eventtop_html[] = "<span class='evcal_cblock' data-bgcolor='" . $event_color . "' data-smon='" . $DATE_start_val['F'] . "' data-syr='" . $DATE_start_val['Y'] . "'><em class='evo_date' >" . $___day_name . $_event_date_HTML['html_date'] . '</em>'; } // time for events $eventtop_html[] = "<em class='evo_time'>" . $_event_date_HTML['html_time'] . "</em>"; $eventtop_html[] = "<em class='clear'></em></span>"; // event title $eventtop_html[] = "<span class='evcal_desc evo_info " . ($__year_long_event ? 'yrl' : null) . "' {$event_location_variables} ><span class='evcal_desc2 evcal_event_title' itemprop='name'>" . $event->post_title . "</span>"; // subtitle if (!empty($ev_vals['evcal_subtitle'])) { $eventtop_html[] = "<span class='evcal_event_subtitle' >" . $ev_vals['evcal_subtitle'][0] . "</span>"; } $eventtop_html[] = "<span class='evcal_desc_info' >"; // time if ($eventop_fields_ && in_array('time', $eventop_fields)) { $eventtop_html[] = "<em class='evcal_time'>" . $_event_date_HTML['html_fromto'] . "</em> "; } // location if ($eventop_fields_ && in_array('location', $eventop_fields)) { $eventtop_html[] = $ev_location; } // location Name if ($eventop_fields_ && in_array('locationame', $eventop_fields)) { $__location_name = !empty($ev_vals['evcal_location_name']) ? $ev_vals['evcal_location_name'][0] : null; $eventtop_html[] = !empty($__location_name) ? '<em class="evcal_location event_location_name">' . $__location_name . '</em>' : null; } $eventtop_html[] = "</span><span class='evcal_desc3'>"; // organizer if ($eventop_fields_ && in_array('organizer', $eventop_fields) && !empty($ev_vals['evcal_organizer'])) { $eventtop_html[] = "<em class='evcal_oganizer'><i>" . eventon_get_custom_language($this->evopt2, 'evcal_evcard_org', 'Event Organized By') . ':</i> ' . $ev_vals['evcal_organizer'][0] . "</em>"; } // event type if (!empty($_html_tax_content)) { $eventtop_html[] = $_html_tax_content; } // custom meta fields for ($x = 1; $x < $_cmf_count + 1; $x++) { if ($eventop_fields_ && in_array('cmd' . $x, $eventop_fields) && !empty($ev_vals['_evcal_ec_f' . $x . 'a1_cus'])) { $def = $this->evopt1['evcal_ec_f' . $x . 'a1']; // default custom meta field name $i18n_nam = eventon_get_custom_language($this->evopt2, 'evcal_cmd_' . $x, $def); $eventtop_html[] = ($x == 1 ? "<b class='clear'></b>" : null) . "<em class='evcal_cmd'><i>" . $i18n_nam . ':</i> ' . $ev_vals['_evcal_ec_f' . $x . 'a1_cus'][0] . "</em> "; } } $eventtop_html[] = "</span>"; $eventtop_html[] = "</span><em class='clear'></em>"; $eventtop_html = apply_filters('eventon_eventtop_html', $eventtop_html); // -- // Combine the event top individual sections $html_info_line = implode('', $eventtop_html); // (---) hook for addons if (has_filter('eventon_event_cal_short_info_line')) { $html_info_line = apply_filters('eventon_event_cal_short_info_line', $html_info_line); } // SCHEME SEO // conditional schema data if (!empty($this->evopt1['evo_schema']) && $this->evopt1['evo_schema'] == 'yes') { $__scheme_data = '<div class="evo_event_schema" style="display:none" > <a href="' . $event_permalink . '"></a></div>'; $__scheme_attributes = ''; } else { $event_permalink = $_sin_ev_ex ? $event_permalink : "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $__scheme_data = '<div class="evo_event_schema" style="display:none" > <a href="' . $event_permalink . '" itemprop="url"></a> <time itemprop="startDate" datetime="' . $DATE_start_val['Y'] . '-' . $DATE_start_val['n'] . '-' . $DATE_start_val['j'] . '"></time> <time itemprop="endDate" datetime="' . $DATE_end_val['Y'] . '-' . $DATE_end_val['n'] . '-' . $DATE_end_val['j'] . '"></time>' . $__scheme_data_location . '</div>'; $__scheme_attributes = "itemscope itemtype='http://schema.org/Event'"; } // ## Eventon Calendar events list -- single event // CLASES - attribute $_eventClasses = array(); $_eventAttr = array(); $_eventClasses[] = 'eventon_list_event'; $_eventClasses[] = 'event'; $_ft_imgClass = !empty($img_thumb_src) && !empty($__shortC_arg['show_et_ft_img']) && $__shortC_arg['show_et_ft_img'] == 'yes' ? 'hasFtIMG' : null; $__attr_class = "evcal_list_a " . $event_description_trigger . " " . $_event_date_HTML['class_daylength'] . " " . ($event_type != 'nr' ? 'event_repeat ' : null) . $eventcard_script_class . $_ft_imgClass; $_ft_event = $__feature_events && !empty($ev_vals['_featured']) && $ev_vals['_featured'][0] == 'yes' ? ' ft_event ' : null; // class attribute for event $__a_class = $__attr_class . $_ft_event . $term_class . ($__featured ? ' featured_event' : null); // show limit styles if (!empty($__shortC_arg['show_limit']) && $__shortC_arg['show_limit'] == 'yes' && !empty($__shortC_arg['event_count']) && $__shortC_arg['event_count'] > 0 && $__count > $__shortC_arg['event_count']) { $show_limit_styles = 'style="display:none"'; $_eventClasses[] = 'evSL'; } else { $show_limit_styles = ''; } // event color for the row/box $___styles_a = $___styles = ''; // TILES STYLE if (!empty($__shortC_arg['tiles']) && $__shortC_arg['tiles'] == 'yes') { // boxy event colors // if featured image exists for an event if (!empty($img_med_src) && $__shortC_arg['tile_bg'] == 1) { $___styles_a[] = 'background-image: url(' . $img_med_src[0] . '); background-color:' . $event_color . ';'; $_eventClasses[] = 'hasbgimg'; } else { $___styles_a[] = 'background-color: ' . $event_color . ';'; } // tile height if ($__shortC_arg['tile_height'] != 0) { $___styles_a[] = 'height: ' . $__shortC_arg['tile_height'] . 'px;'; } // tile count if ($__shortC_arg['tile_count'] != 2) { $perct = (int) (100 / $__shortC_arg['tile_count']); $___styles_a[] = 'width: ' . $perct . '%;'; } $___styles = ''; } else { $___styles[] = 'border-color: ' . $event_color . ';'; $___styles_a[] = ''; } // div or an e tag $html_tag = $exlink_option == '1' ? 'div' : 'a'; // process passed on array if (!empty($___styles_a)) { $___styles_a = 'style="' . implode(' ', $___styles_a) . '"'; } if (!empty($___styles)) { $___styles = 'style="' . implode(' ', $___styles) . '"'; } $event_html_code = "<div id='event_{$event_id}' class='" . implode(' ', $_eventClasses) . "' data-event_id='{$event_id}' data-ri='{$__repeatInterval}' {$__scheme_attributes} {$show_limit_styles} {$___styles_a} data-colr='{$event_color}'>{$__scheme_data}\n\t\t\t\t<{$html_tag} id='" . $unique_id . "' class='" . $__a_class . "' " . $href . " " . $target_ex . " " . $___styles . " " . $gmap_trigger . " " . (!empty($gmap_api_status) ? $gmap_api_status : null) . " data-ux_val='{$exlink_option}'>{$html_info_line}</{$html_tag}>" . $html_event_detail_card . "<div class='clear end'></div></div>"; //evc_open // prepare output $months_event_array[] = array('event_id' => $event_id, 'srow' => $event_start_unix, 'erow' => $event_end_unix, 'content' => $event_html_code); } } else { $months_event_array; } return $months_event_array; }
/** * Settings page. * * Handles the display of the main EventON settings page in admin. * * @access public * @return void */ function eventon_settings() { global $eventon; do_action('eventon_settings_start'); // Settings Tabs array $evcal_tabs = apply_filters('eventon_settings_tabs', array('evcal_1' => __('Settings', 'eventon'), 'evcal_2' => __('Language', 'eventon'), 'evcal_3' => __('Styles', 'eventon'), 'evcal_4' => __('Addons & Licenses', 'eventon'), 'evcal_5' => __('Support', 'eventon'))); // Get current tab/section $focus_tab = isset($_GET['tab']) ? sanitize_text_field(urldecode($_GET['tab'])) : 'evcal_1'; $current_section = isset($_GET['section']) ? sanitize_text_field(urldecode($_GET['section'])) : ''; $evcal_skins[] = 'slick'; // Update or add options if (isset($_POST['evcal_noncename']) && isset($_POST)) { if (wp_verify_nonce($_POST['evcal_noncename'], AJDE_EVCAL_BASENAME)) { foreach ($_POST as $pf => $pv) { if ($pf != 'evcal_styles' && $focus_tab != 'evcal_4' || $pf != 'evcal_sort_options') { $pv = is_array($pv) ? $pv : $pv; $evcal_options[$pf] = $pv; } if ($pf == 'evcal_sort_options') { $evcal_options[$pf] = $pv; } } // General settings page - write styles to head option if ($focus_tab == 'evcal_1' && isset($_POST['evcal_css_head']) && $_POST['evcal_css_head'] == 'yes') { ob_start(); include AJDE_EVCAL_PATH . '/assets/css/dynamic_styles.php'; $evo_dyn_css = ob_get_clean(); update_option('evo_dyn_css', $evo_dyn_css); } //language tab if ($focus_tab == 'evcal_2') { $new_lang_opt = ''; $_lang_version = !empty($_GET['lang']) ? $_GET['lang'] : 'L1'; $lang_opt = get_option('evcal_options_evcal_2'); if (!empty($lang_opt)) { $new_lang_opt[$_lang_version] = $evcal_options; $new_lang_opt = array_merge($lang_opt, $new_lang_opt); } else { $new_lang_opt[$_lang_version] = $evcal_options; } update_option('evcal_options_evcal_2', $new_lang_opt); } elseif ($focus_tab == 'evcal_1' || empty($focus_tab)) { // store custom meta box count $cmd_count = evo_calculate_cmd_count(); $evcal_options['cmd_count'] = $cmd_count; update_option('evcal_options_' . $focus_tab, $evcal_options); // all other settings tabs } else { update_option('evcal_options_' . $focus_tab, $evcal_options); } // STYLES if (isset($_POST['evcal_styles'])) { update_option('evcal_styles', strip_tags(stripslashes($_POST['evcal_styles']))); } $_POST['settings-updated'] = 'true'; eventon_generate_options_css(); // nonce check } else { die(__('Action failed. Please refresh the page and retry.', 'eventon')); } } // Load eventon settings values for current tab $current_tab_number = substr($focus_tab, -1); if (!is_numeric($current_tab_number)) { // if the tab last character is not numeric then get the whole tab name as the variable name for the options $current_tab_number = $focus_tab; } $evcal_opt[$current_tab_number] = get_option('evcal_options_' . $focus_tab); //print_r(get_option('_evo_licenses')); //print_r($evcal_opt[1]); // activation notification if (!$eventon->evo_updater->is_activated('eventon')) { echo '<div class="update-nag">' . __('Your copy of EventOn is not activated yet some features may be restricted. <a href="' . get_admin_url() . 'admin.php?page=eventon&tab=evcal_4">Activate License Now</a>', 'eventon') . '</div>'; } // TABBBED HEADER ?> <div class="wrap" id='evcal_settings'> <div id='eventon'><div id="icon-themes" class="icon32"></div></div> <h2>EventON Settings (ver <?php echo get_option('eventon_plugin_version'); ?> ) <?php do_action('eventon_updates_in_settings'); ?> </h2> <h2 class='nav-tab-wrapper' id='meta_tabs'> <?php foreach ($evcal_tabs as $nt => $ntv) { $evo_notification = ''; echo "<a href='?page=eventon&tab=" . $nt . "' class='nav-tab " . ($focus_tab == $nt ? 'nav-tab-active' : null) . " {$nt}' evcal_meta='evcal_{$nt}'>" . $ntv . $evo_notification . "</a>"; } ?> </h2> <div class='evo_settings_box'> <?php // SETTINGS SAVED MESSAGE $updated_code = isset($_POST['settings-updated']) && $_POST['settings-updated'] == 'true' ? '<div class="updated fade"><p>' . __('Settings Saved', 'eventon') . '</p></div>' : null; echo $updated_code; // TABS switch ($focus_tab) { case "evcal_1": // Event type custom taxonomy NAMES $event_type_names = evo_get_ettNames($evcal_opt[1]); $evt_name = $event_type_names[1]; $evt_name2 = $event_type_names[2]; ?> <form method="post" action=""><?php settings_fields('evcal_field_group'); wp_nonce_field(AJDE_EVCAL_BASENAME, 'evcal_noncename'); ?> <div id="evcal_1" class=" evcal_admin_meta evcal_focus"> <div class="evo_inside"> <?php require_once AJDE_EVCAL_PATH . '/includes/admin/settings/class-settings-settings.php'; $settings = new evo_settings_settings($evcal_opt); $eventon->load_ajde_backender(); print_ajde_customization_form($settings->content(), $evcal_opt[1]); ?> </div> </div> <div class='evo_diag'> <input type="submit" class="evo_admin_btn btn_prime" value="<?php _e('Save Changes'); ?> " /> <a id='resetColor' style='display:none' class='evo_admin_btn btn_secondary'><?php _e('Reset to default colors', 'eventon'); ?> </a><br/><br/> <a target='_blank' href='http://www.myeventon.com/support/'><img src='<?php echo AJDE_EVCAL_URL; ?> /assets/images/myeventon_resources.png'/></a> </div> </form> <?php break; // LANGUAGE TAB // LANGUAGE TAB case "evcal_2": //print_r($evcal_opt[1]); $__lang_version = !empty($_GET['lang']) ? $_GET['lang'] : 'L1'; $lang_options = !empty($evcal_opt[2][$__lang_version]) ? $evcal_opt[2][$__lang_version] : null; //$lang_options =eventon_process_lang_options($lang_options); $eventon_months = array(1 => 'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'); $eventon_days = array(1 => 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'); // Language variations $lang_variations = apply_filters('eventon_lang_variation', array('L1', 'L2', 'L3')); $uri_parts = explode('?', $_SERVER['REQUEST_URI'], 2); ?> <form method="post" action=""><?php settings_fields('evcal_field_group'); wp_nonce_field(AJDE_EVCAL_BASENAME, 'evcal_noncename'); ?> <div id="evcal_2" class="postbox evcal_admin_meta"> <div class="inside"> <h2><?php _e('Type in custom language text for front-end calendar', 'eventon'); ?> </h2> <h4><?php _e('Select your language', 'eventon'); ?> <select id='evo_lang_selection' url=<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $uri_parts[0]; ?> > <?php foreach ($lang_variations as $lang) { echo "<option value='{$lang}' " . ($__lang_version == $lang ? 'selected="select"' : null) . ">{$lang}</option>"; } ?> </select><span class='evoGuideCall'>?<em><?php _e("You can use this to save upto 2 different languages for customized text. Once saved use the shortcode to show calendar text in that customized language. eg. [add_eventon lang='L2']", 'eventon'); ?> </em></span></h4> <p><i><?php _e('Please use the below fields to type in custom language text that will be used to replace the default language text on the front-end of the calendar.', 'eventon'); ?> </i></p> <div class='evoLANG_section_header evo_settings_toghead'><?php _e('Months and Dates', 'eventon'); ?> </div> <div class='evo_settings_togbox'> <div class='evcal_lang_box '> <?php // full month names for ($x = 1; $x < 13; $x++) { $pre_var_name = 'evcal_lang_'; echo "<p class='evcal_lang_p'><input type='text' name='" . $pre_var_name . $x . "' class='evcal_lang' value='"; echo !empty($lang_options[$pre_var_name . $x]) ? $lang_options[$pre_var_name . $x] : $eventon_months[$x]; echo "'/></p>"; } echo "<p class='clear' style='padding-top:5px'></p>"; // 3 letter month names for ($x = 1; $x < 13; $x++) { $pre_var_name = 'evo_lang_3Lm_'; $month_3l = substr($eventon_months[$x], 0, 3); echo "<p class='evcal_lang_p'><input type='text' name='" . $pre_var_name . $x . "' class='evcal_lang' value='"; echo !empty($lang_options[$pre_var_name . $x]) ? $lang_options[$pre_var_name . $x] : $month_3l; echo "'/></p>"; } echo "<p class='clear' style='padding-top:5px'></p>"; // 1 letter month names for ($x = 1; $x < 13; $x++) { $pre_var_name = 'evo_lang_1Lm_'; $month_3l = substr($eventon_months[$x], 0, 1); echo "<p class='evcal_lang_p'><input type='text' name='" . $pre_var_name . $x . "' class='evcal_lang' value='"; echo !empty($lang_options[$pre_var_name . $x]) ? $lang_options[$pre_var_name . $x] : $month_3l; echo "'/></p>"; } echo "<p class='clear' style='padding-top:5px'></p>"; ?> <p style='clear:both'></p> </div> <div class='evcal_lang_box'> <?php // full day names for ($x = 1; $x < 8; $x++) { $num = $x; $pre_var_name = 'evcal_lang_day'; echo "<p class='evcal_lang_p'><input type='text' name='" . $pre_var_name . $num . "' class='evcal_lang' value='"; echo !empty($lang_options[$pre_var_name . $num]) ? $lang_options[$pre_var_name . $num] : $eventon_days[$x]; echo "'/></p>"; } echo "<p class='clear' style='padding-top:5px'></p>"; // 3 letter day names for ($x = 1; $x < 8; $x++) { $num = $x; $pre_var_name = 'evo_lang_3Ld_'; $day_3l = substr($eventon_days[$x], 0, 3); echo "<p class='evcal_lang_p'><input type='text' name='" . $pre_var_name . $num . "' class='evcal_lang' value='"; echo !empty($lang_options[$pre_var_name . $num]) ? $lang_options[$pre_var_name . $num] : $day_3l; echo "'/></p>"; } if (has_action('eventon_lang_after_daynames')) { do_action('eventon_lang_after_daynames'); } ?> <p style='clear:both'></p> </div> </div> <?php require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_language_tab.php'; // hook into addons //eventon_settings_lang_tab_content $eventon_custom_language_array_updated = apply_filters('eventon_settings_lang_tab_content', array_filter($eventon_custom_language_array)); foreach ($eventon_custom_language_array_updated as $cl) { if (!empty($cl['type']) && $cl['type'] == 'togheader') { echo "<div class='evoLANG_section_header evo_settings_toghead'>{$cl['name']}</div>\n\t\t\t\t\t\t<div class='evo_settings_togbox'>"; } else { if (!empty($cl['type']) && $cl['type'] == 'togend') { echo '</div>'; } else { if (!empty($cl['type']) && $cl['type'] == 'subheader') { echo '<div class="evoLANG_subheader">' . $cl['label'] . '</div><div class="evoLANG_subsec">'; } else { $val = !empty($lang_options[$cl['name']]) ? $lang_options[$cl['name']] : ''; $placeholder = !empty($cl['placeholder']) ? $cl['placeholder'] : ''; echo "\n\t\t\t\t\t\t<div class='eventon_custom_lang_line'>\n\t\t\t\t\t\t\t<div class='eventon_cl_label_out'>\n\t\t\t\t\t\t\t\t<p class='eventon_cl_label'>{$cl['label']}</p>\n\t\t\t\t\t\t\t</div>"; echo '<input class="eventon_cl_input" type="text" name="' . $cl['name'] . '" placeholder="' . $placeholder . '" value="' . stripslashes($val) . '"/>'; echo "<div class='clear'></div>\n\t\t\t\t\t\t</div>"; echo !empty($cl['legend']) ? "<p class='eventon_cl_legend'>{$cl['legend']}</p>" : null; } } } } ?> </div> </div> <input type="submit" class="evo_admin_btn btn_prime" value="<?php _e('Save Changes', 'eventon'); ?> " style='margin-top:15px'/> </form> <?php break; // STYLES TAB // STYLES TAB case "evcal_3": echo '<form method="post" action="">'; //settings_fields('evcal_field_group'); wp_nonce_field(AJDE_EVCAL_BASENAME, 'evcal_noncename'); // styles settings tab content require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_styles_tab.php'; break; // ADDON TAB // ADDON TAB case "evcal_4": // Addons settings tab content require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_addons_tab.php'; break; // support TAB // support TAB case "evcal_5": // Addons settings tab content require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_support_tab.php'; break; // ADVANDED extra field // ADVANDED extra field case "extra": // advanced tab content require_once AJDE_EVCAL_PATH . '/includes/admin/settings/settings_advanced_tab.php'; break; default: do_action('eventon_settings_tabs_' . $focus_tab); break; } echo "</div>"; }
/** GENERATE individual event data */ public function generate_event_data($event_list_array, $focus_month_beg_range = '', $FOCUS_month_int = '', $FOCUS_year_int = '') { $months_event_array = ''; // Initial variables $wp_time_format = get_option('time_format'); $default_event_color = !empty($this->evopt1['evcal_hexcode']) ? '#' . $this->evopt1['evcal_hexcode'] : '#206177'; $__shortC_arg = $this->shortcode_args; // user interavtion for the calendar $calendar_ux_val = !empty($__shortC_arg['ux_val']) ? $__shortC_arg['ux_val'] : '0'; $__count = 0; // EVENT CARD open by default variables $_is_eventCardOpen = !empty($__shortC_arg['evc_open']) && $__shortC_arg['evc_open'] == 'yes' ? true : ($this->is_eventcard_open ? true : false); $eventcard_script_class = $_is_eventCardOpen ? "gmaponload" : null; $this->is_eventcard_open = false; // check featured events are prioritized $__feature_events = !empty($__shortC_arg['ft_event_priority']) && $__shortC_arg['ft_event_priority'] != 'no' ? true : false; // GET EventTop fields - v2.1.17 $eventop_fields = !empty($this->evopt1['evcal_top_fields']) ? $this->evopt1['evcal_top_fields'] : null; // Number of activated taxnomonies v 2.2.15 $_active_tax = evo_get_ett_count($this->evopt1); // eventCARD HTML require_once AJDE_EVCAL_PATH . '/includes/eventon_eventCard.php'; require_once AJDE_EVCAL_PATH . '/includes/eventon-eventTop.php'; // check if single event exist $_sin_ev_ex = in_array('eventon-single-event/eventon-single-event.php', get_option('active_plugins')) ? true : false; // EACH EVENT if (is_array($event_list_array)) { foreach ($event_list_array as $event_) { // Intials $html_event_detail_card = ''; $_eventClasses = $_eventInClasses = array(); $_eventAttr = $_eventInAttr = array(); $__count++; $event_id = $event_['event_id']; $event_start_unix = $event_['event_start_unix']; $event_end_unix = $event_['event_end_unix']; $event_type = $event_['event_type']; $ev_vals = $event_['event_pmv']; $event = get_post($event_id); $_eventInClasses[] = $eventcard_script_class; // set how a single event would interact $event_ux_val = !empty($ev_vals['_evcal_exlink_option']) ? $ev_vals['_evcal_exlink_option'][0] : 1; $event_permalink = get_permalink($event_id); $event_ux_val = $calendar_ux_val != '1' ? $calendar_ux_val : $event_ux_val; // whether eventcard elements need to be included or not $_event_card_on = $calendar_ux_val == '4' || $calendar_ux_val == 'X' || $event_ux_val == '4' || $event_ux_val == '2' ? false : true; $_event_card_on = $_is_eventCardOpen ? true : $_event_card_on; // if event card is forced to open then $html_tag = $event_ux_val == '1' ? 'div' : 'a'; $html_tag = $_event_card_on ? 'a' : $html_tag; //echo ($_is_eventCardOpen?3:4). ' '.($_event_card_on?3:4). ' '.$calendar_ux_val.' '.$event_ux_val; // year long or not $__year_long_event = !empty($ev_vals['evo_year_long']) && $ev_vals['evo_year_long'][0] == 'yes' ? true : 0; // define variables $ev_other_data = $ev_other_data_top = $html_event_type_info = $_event_date_HTML = $_eventcard = $html_event_type_2_info = ''; $_is_end_date = true; // UNIX date values $DATE_start_val = eventon_get_formatted_time($event_start_unix); if (empty($event_end_unix)) { $_is_end_date = false; $DATE_end_val = $DATE_start_val; } else { $DATE_end_val = eventon_get_formatted_time($event_end_unix); } // if this event featured $_eventInClasses['__featured'] = $this->helper->evo_meta('_featured', $ev_vals, 'tf'); $_eventInClasses['_cancel'] = $this->helper->evo_meta('_cancel', $ev_vals, 'tf'); // GET: repeat interval for this event $__repeatInterval = !empty($event_['event_repeat_interval']) ? $event_['event_repeat_interval'] : (!empty($_GET['ri']) ? $_GET['ri'] : 0); // Unique ID generation $unique_varied_id = 'evc' . $event_start_unix . uniqid() . $event_id; $unique_id = 'evc_' . $event_start_unix . $event_id; // All day event variables $_is_allday = $this->helper->evo_meta('evcal_allday', $ev_vals, 'tf'); $_hide_endtime = $this->helper->evo_meta('evo_hide_endtime', $ev_vals, 'tf'); $evcal_lang_allday = $this->lang('evcal_lang_allday', 'All Day'); /* evo_hide_endtime NOTE: if its set to hide end time, meaning end time and date would be empty on wp-admin, which will fall into same start end month category. */ $_event_date_HTML = $this->generate_time_($DATE_start_val, $DATE_end_val, $ev_vals, $evcal_lang_allday, $focus_month_beg_range, $FOCUS_month_int, $event_start_unix, $event_end_unix); // (---) hook for addons $_event_date_HTML = apply_filters('eventon_eventcard_date_html', $_event_date_HTML, $event_id); // EACH DATA FIELD // EVENT FEATURES IMAGE $img_id = get_post_thumbnail_id($event_id); $img_med_src = $img_thumb_src = ''; if ($img_id != '') { $img_src = wp_get_attachment_image_src($img_id, 'full'); $img_med_src = wp_get_attachment_image_src($img_id, 'medium'); $img_thumb_src = wp_get_attachment_image_src($img_id, 'thumbnail'); // append to eventcard array $_eventcard['ftimage'] = array('img' => $img_src, 'hovereffect' => !empty($this->evopt1['evo_ftimghover']) ? $this->evopt1['evo_ftimghover'] : null, 'clickeffect' => !empty($this->evopt1['evo_ftimgclick']) ? $this->evopt1['evo_ftimgclick'] : null, 'min_height' => !empty($this->evopt1['evo_ftimgheight']) ? $this->evopt1['evo_ftimgheight'] : 400, 'ftimg_sty' => !empty($this->evopt1['evo_ftimg_height_sty']) ? $this->evopt1['evo_ftimg_height_sty'] : 'minimized'); } // EVENT DESCRIPTION $evcal_event_content = $event->post_content; if (!empty($evcal_event_content)) { $event_full_description = $evcal_event_content; } else { // event description compatibility from older versions. $event_full_description = !empty($ev_vals['evcal_description']) ? $ev_vals['evcal_description'][0] : null; } if (!empty($event_full_description)) { $except = $event->post_excerpt; $event_excerpt = eventon_get_event_excerpt($event_full_description, 30, $except); $_eventcard['eventdetails'] = array('fulltext' => $event_full_description, 'excerpt' => $event_excerpt); } // EVENT LOCATION $lonlat = !empty($ev_vals['evcal_lat']) && !empty($ev_vals['evcal_lon']) ? 'data-latlng="' . $ev_vals['evcal_lat'][0] . ',' . $ev_vals['evcal_lon'][0] . '" ' : null; $__location = $this->helper->evo_meta('evcal_location', $ev_vals, 'null'); // location name $__location_name = stripslashes(evo_meta($ev_vals, 'evcal_location_name')); $_eventcard['timelocation'] = array('timetext' => $_event_date_HTML['html_prettytime'], 'location' => $__location, 'location_name' => $__location_name, 'timezone' => !empty($ev_vals['evo_event_timezone']) ? $ev_vals['evo_event_timezone'][0] : null); // Location Image $loc_img_id = $this->helper->evo_meta('evo_loc_img', $ev_vals, 'null'); if (!empty($loc_img_id)) { $_eventcard['locImg'] = array('id' => $loc_img_id, 'fullheight' => !empty($this->evopt1['evo_locimgheight']) ? $this->evopt1['evo_locimgheight'] : 400); // location name and address if (evo_check_yn($ev_vals, 'evcal_name_over_img') && !empty($__location_name)) { $_eventcard['locImg']['locName'] = $__location_name; if (!empty($__location)) { $_eventcard['locImg']['locAdd'] = $__location; } } } // GOOGLE maps if ($this->google_maps_load && ($__location || !empty($lonlat)) && (!empty($ev_vals['evcal_gmap_gen']) && $ev_vals['evcal_gmap_gen'][0] == 'yes')) { $_eventcard['gmap'] = array('id' => $unique_varied_id); // GET directions if ($this->evopt1['evo_getdir'] == 'yes' && !empty($ev_vals['evcal_location'])) { $_eventcard['getdirection'] = array('fromaddress' => $ev_vals['evcal_location'][0]); } } else { $_eventInAttr['data-gmap_status'] = 'null'; } // EVENT BRITE // check if eventbrite actually used in this event if ($_event_card_on && !empty($ev_vals['evcal_eventb_data_set']) && $ev_vals['evcal_eventb_data_set'][0] == 'yes') { // Event brite capacity if (!empty($ev_vals['evcal_eventb_tprice']) && !empty($ev_vals['evcal_eventb_url'])) { $_eventcard['eventbrite'] = array('capacity' => !empty($ev_vals['evcal_eventb_capacity']) ? $ev_vals['evcal_eventb_capacity'][0] : null, 'tix_price' => $ev_vals['evcal_eventb_tprice'][0], 'url' => $ev_vals['evcal_eventb_url'][0]); } } // PAYPAL Code if (!empty($ev_vals['evcal_paypal_item_price'][0]) && $this->evopt1['evcal_paypal_pay'] == 'yes') { $_eventcard['paypal'] = array('title' => $event->post_title, 'price' => $ev_vals['evcal_paypal_item_price'][0], 'text' => !empty($ev_vals['evcal_paypal_text']) ? $ev_vals['evcal_paypal_text'][0] : null); } // Event Organizer if (!empty($ev_vals['evcal_organizer']) && (!empty($ev_vals['evo_evcrd_field_org']) && $ev_vals['evo_evcrd_field_org'][0] != 'yes')) { $_eventcard['organizer'] = array('value' => $ev_vals['evcal_organizer'][0], 'contact' => !empty($ev_vals['evcal_org_contact']) ? $ev_vals['evcal_org_contact'][0] : null, 'imgid' => !empty($ev_vals['evo_org_img']) ? $ev_vals['evo_org_img'][0] : null); } // Custom fields $_cmf_count = evo_retrieve_cmd_count($this->evopt1); for ($x = 1; $x < $_cmf_count + 1; $x++) { if (!empty($this->evopt1['evcal_ec_f' . $x . 'a1']) && !empty($this->evopt1['evcal__fai_00c' . $x]) && !empty($ev_vals["_evcal_ec_f" . $x . "a1_cus"])) { // check if hide this from eventCard set to yes if (empty($this->evopt1['evcal_ec_f' . $x . 'a3']) || $this->evopt1['evcal_ec_f' . $x . 'a3'] == 'no') { $faicon = $this->evopt1['evcal__fai_00c' . $x]; $_eventcard['customfield' . $x] = array('imgurl' => $faicon, 'x' => $x, 'value' => $ev_vals["_evcal_ec_f" . $x . "a1_cus"][0], 'valueL' => !empty($ev_vals["_evcal_ec_f" . $x . "a1_cusL"]) ? $ev_vals["_evcal_ec_f" . $x . "a1_cusL"][0] : null, '_target' => !empty($ev_vals["_evcal_ec_f" . $x . "_onw"]) ? $ev_vals["_evcal_ec_f" . $x . "_onw"][0] : null, 'type' => $this->evopt1['evcal_ec_f' . $x . 'a2']); } } } // LEARN MORE and ICS if (!empty($ev_vals['evcal_lmlink']) || !empty($this->evopt1['evo_ics']) && $this->evopt1['evo_ics'] == 'yes') { $_eventcard['learnmoreICS'] = array('event_id' => $event_id, 'learnmorelink' => !empty($ev_vals['evcal_lmlink']) ? $ev_vals['evcal_lmlink'][0] : null, 'learnmore_target' => !empty($ev_vals['evcal_lmlink_target']) && $ev_vals['evcal_lmlink_target'][0] == 'yes' ? 'target="_blank"' : null, 'estart' => $event_start_unix, 'eend' => $event_end_unix, 'etitle' => $event->post_title, 'evals' => $ev_vals); } // ======================= /** CONSTRUCT the EVENT CARD **/ if ($_event_card_on && !empty($_eventcard) && count($_eventcard) > 0) { // filter hook for eventcard content array - updated 2.2.20 $_eventcard = apply_filters('eventon_eventcard_array', $_eventcard, $ev_vals, $event_id, $__repeatInterval); // if an order is set reorder things if (!empty($this->evopt1['evoCard_order'])) { $_eventcard = $this->helper->eventcard_sort($_eventcard, $this->evopt1); } ob_start(); echo "<div class='event_description evcal_eventcard " . ($_is_eventCardOpen ? 'open' : null) . "' " . ($_is_eventCardOpen ? 'style="display:block"' : 'style="display:none"') . ">"; echo eventon_eventcard_print($_eventcard, $this->evopt1, $this->evopt2); // (---) hook for addons do_action('eventon_eventcard_additions', $event_id, $this->__calendar_type, $event->post_title, $event_full_description, $img_thumb_src, $__repeatInterval); echo "</div>"; $html_event_detail_card = ob_get_clean(); } /** Trigger attributes **/ $event_description_trigger = "desc_trig"; $_eventInAttr['data-gmtrig'] = !empty($ev_vals['evcal_gmap_gen']) && $ev_vals['evcal_gmap_gen'][0] == 'yes' ? '1' : '0'; // Generate tax terms for event top $html_event_type_tax_ar = array(); $_tax_names_array = evo_get_ettNames($this->evopt1); $evcal_terms_ = ''; if (!empty($eventop_fields)) { // foreach active tax for ($b = 1; $b <= $_active_tax; $b++) { $__tx_content = ''; $__tax_slug = 'event_type' . ($b == 1 ? '' : '_' . $b); $__tax_fields = 'eventtype' . ($b == 1 ? '' : $b); // for override evc colors if ($b == 1) { $evcal_terms_ = wp_get_post_terms($event_id, $__tax_slug); } if (in_array($__tax_fields, $eventop_fields)) { $evcal_terms = !empty($evcal_terms_) && $b == 1 ? $evcal_terms_ : wp_get_post_terms($event_id, $__tax_slug); if ($evcal_terms) { $__tax_name = $_tax_names_array[$b]; $__tx_content .= "<span class='evcal_event_types ett{$b}'><em><i>" . $__tax_name . ":</i></em>"; $i = 1; foreach ($evcal_terms as $termA) { // get translated tax term name $term_name = $this->lang('evolang_' . $__tax_slug . '_' . $termA->term_id, $termA->name); // tax term slug as class name $_eventInClasses[] = 'evo_' . $termA->slug; $__tx_content .= "<em data-filter='{$__tax_slug}'>" . $term_name . (count($evcal_terms) != $i ? ',' : '') . "</em>"; $i++; } $__tx_content .= "<i class='clear'></i></span>"; $html_event_type_tax_ar[$b] = $__tx_content; } } } } $_html_tax_content = count($html_event_type_tax_ar) > 0 ? implode('', $html_event_type_tax_ar) : null; // event color $event_color = eventon_get_hex_color($ev_vals, $default_event_color); // override event colors if (!empty($__shortC_arg['etc_override']) && $__shortC_arg['etc_override'] == 'yes' && !empty($evcal_terms_)) { $ev_id = $evcal_terms_[0]->term_id; $ev_color = get_option("evo_et_taxonomy_{$ev_id}"); $event_color = !empty($ev_color['et_color']) ? $ev_color['et_color'] : $event_color; // remove additional '#' in the hex code $event_color = '#' . str_replace('#', '', $event_color); } // if UX to be open in new window then use link to single event or that link $link_append = array(); $_link_text = ''; if (!empty($__shortC_arg['lang']) && $__shortC_arg['lang'] != 'L1') { $link_append['l'] = $__shortC_arg['lang']; } // append repeat interval value to event link $link_append['ri'] = $__repeatInterval; if (!empty($link_append)) { foreach ($link_append as $lp => $lpk) { if ($lp == 'ri' && $lpk == '0') { continue; } $_link_text .= $lp . '=' . $lpk . '&'; } } // passing URL variables values $_link_text_append = strpos($event_permalink, '?') === false ? '?' : '&'; $_link_text = !empty($_link_text) ? $_link_text_append . $_link_text : null; $_eventInAttr['rest'][] = !empty($ev_vals['evcal_exlink']) && $event_ux_val != '1' ? 'data-exlk="1" href="' . $ev_vals['evcal_exlink'][0] . $_link_text . '"' : 'data-exlk="0"'; // target $_eventInAttr['rest'][] = !empty($ev_vals['_evcal_exlink_target']) && $ev_vals['_evcal_exlink_target'][0] == 'yes' ? 'target="_blank"' : null; // EVENT LOCATION if (evo_location_exists($ev_vals)) { $location_address = !empty($ev_vals['evcal_location']) ? $ev_vals['evcal_location'][0] : null; // location as LON LAT $event_location_variables = (!empty($lonlat) ? $lonlat : null) . ' data-location_address="' . $location_address . '" '; // conditional schema data for event if (!empty($this->evopt1['evo_schema']) && $this->evopt1['evo_schema'] == 'yes') { $__scheme_data_location = ''; } else { $__scheme_data_location = ' <item style="display:none" itemprop="location" itemscope itemtype="http://schema.org/Place"> ' . (!empty($__location_name) ? '<span itemprop="name">' . $__location_name . '</span>' : '') . ' <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> <item itemprop="streetAddress">' . $location_address . '</item> </span> </item>'; } $ev_location = !empty($location_address) ? '<em class="evcal_location" ' . (!empty($lonlat) ? $lonlat : null) . ' data-add_str="' . $location_address . '">' . $location_address . '</em>' : null; // location type $event_location_variables .= !empty($lonlat) ? 'data-location_type="lonlat"' : 'data-location_type="address"'; // location name $event_location_variables .= !empty($ev_vals['evcal_location_name']) ? ' data-location_name="' . $ev_vals['evcal_location_name'][0] . '"' : null; // location status $event_location_variables .= ' data-location_status="true"'; } else { // location status $ev_location = $event_location_variables = $__scheme_data_location = null; $event_location_variables .= ' data-location_status="false"'; } // EVENT tags $_event_tags = wp_get_post_tags($event_id); // EVENT TOP $eventtop_html = $eventop_fields_ = $__eventtop = ''; // CHECK for event top fields array $eventop_fields_ = is_array($eventop_fields) ? true : false; // featured image if (!empty($img_thumb_src) && !empty($__shortC_arg['show_et_ft_img']) && $__shortC_arg['show_et_ft_img'] == 'yes') { $__eventtop['ft_img'] = array('url' => $img_thumb_src[0], 'url_med' => !empty($img_med_src[0]) ? $img_med_src[0] : ''); } // date block if (!$__year_long_event) { // date number $___day_name = $eventop_fields_ && in_array('dayname', $eventop_fields) ? "<em class='evo_day' >" . $DATE_start_val['D'] . "</em>" : null; $__eventtop['day_block'] = array('start' => $DATE_start_val, 'color' => $event_color, 'day_name' => $___day_name, 'html' => $_event_date_HTML); } // event titles $__eventtop['titles'] = array('yearlong' => $__year_long_event, 'loc_vars' => $event_location_variables, 'title' => $event->post_title, 'cancel' => $_eventInClasses['_cancel'], 'cancel_reason' => $this->helper->evo_meta('_cancel_reason', $ev_vals, 'null'), 'subtitle' => !empty($ev_vals['evcal_subtitle']) ? $ev_vals['evcal_subtitle'][0] : null); // below title $__eventtop['belowtitle'] = array('fields_' => $eventop_fields_, 'fields' => $eventop_fields, 'evvals' => $ev_vals, 'html' => $_event_date_HTML, 'location' => $ev_location, 'locationname' => !empty($ev_vals['evcal_location_name']) ? $ev_vals['evcal_location_name'][0] : null, 'tax' => $_html_tax_content, 'tags' => $_event_tags, 'cmdcount' => $_cmf_count, 'timezone' => !empty($ev_vals['evo_event_timezone']) ? $ev_vals['evo_event_timezone'][0] : null); // close eventtop $_passVal = array('eventid' => $event_id, 'ri' => $__repeatInterval, 'fields_' => $eventop_fields_, 'fields' => $eventop_fields); $__eventtop = apply_filters('eventon_eventtop_one', $__eventtop, $ev_vals, $_passVal); $__eventtop['close1'] = array(); $__eventtop = apply_filters('eventon_eventtop_two', $__eventtop, $ev_vals, $_passVal); $__eventtop['close2'] = array(); // CONSTRUCT event top html if (!empty($__eventtop) && count($__eventtop) > 0) { ob_start(); echo eventon_get_eventtop_print($__eventtop, $this->evopt1, $this->evopt2); $eventtop_html = ob_get_clean(); $eventtop_html = apply_filters('eventon_eventtop_html', $eventtop_html); } else { $eventtop_html = null; } // (---) hook for addons $html_info_line = apply_filters('eventon_event_cal_short_info_line', $eventtop_html); // SCHEME SEO // conditional schema data if (!empty($this->evopt1['evo_schema']) && $this->evopt1['evo_schema'] == 'yes') { $__scheme_data = '<div class="evo_event_schema" style="display:none" > <a href="' . $event_permalink . '"></a></div>'; $__scheme_attributes = ''; } else { $event_permalink = $_sin_ev_ex ? $event_permalink . $_link_text : "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $__scheme_data = '<div class="evo_event_schema" style="display:none" > <a href="' . $event_permalink . '" itemprop="url"></a> <time itemprop="startDate" datetime="' . $DATE_start_val['Y'] . '-' . $DATE_start_val['n'] . '-' . $DATE_start_val['j'] . '"></time> <time itemprop="endDate" datetime="' . $DATE_end_val['Y'] . '-' . $DATE_end_val['n'] . '-' . $DATE_end_val['j'] . '"></time>' . $__scheme_data_location . '</div>'; $__scheme_attributes = "itemscope itemtype='http://schema.org/Event'"; } // CLASES - attribute $_eventClasses[] = 'eventon_list_event'; $_eventClasses[] = 'event'; $_eventInClasses[] = $_event_date_HTML['class_daylength']; $_eventInClasses[] = 'evcal_list_a'; $_eventInClasses_ = $this->helper->get_eventinclasses(array('existing_classes' => $_eventInClasses, 'show_et_ft_img' => !empty($__shortC_arg['show_et_ft_img']) ? $__shortC_arg['show_et_ft_img'] : 'no', 'img_thumb_src' => $img_thumb_src, 'event_type' => $event_type, 'event_description_trigger' => $event_description_trigger)); // show limit styles if (!empty($__shortC_arg['show_limit']) && $__shortC_arg['show_limit'] == 'yes' && !empty($__shortC_arg['event_count']) && $__shortC_arg['event_count'] > 0 && $__count > $__shortC_arg['event_count']) { $_eventAttr['style'][] = "display:none"; $_eventClasses[] = 'evSL'; } $eventbefore = ''; // TILES STYLE if (!empty($__shortC_arg['tiles']) && $__shortC_arg['tiles'] == 'yes') { // boxy event colors // if featured image exists for an event if (!empty($img_med_src) && $__shortC_arg['tile_bg'] == 1) { $_this_style = 'background-image: url(' . $img_med_src[0] . '); background-color:' . $event_color . ';'; $_eventClasses[] = 'hasbgimg'; } else { $_this_style = 'background-color: ' . $event_color . ';'; } // support different tile style if (!empty($__shortC_arg['tile_style']) && $__shortC_arg['tile_style'] != '0') { $eventbefore = '<div class="evo_topbar" style="' . $_this_style . '"></div>'; } else { $_eventAttr['style'][] = $_this_style; } // tile height if ($__shortC_arg['tile_height'] != 0) { $_eventAttr['style'][] = 'height: ' . $__shortC_arg['tile_height'] . 'px;'; } // tile count if ($__shortC_arg['tile_count'] != 2) { //$perct = (int)(100/$__shortC_arg['tile_count']); //$_eventAttr['style'][] = 'width: '.$perct.'%;'; } } else { $_eventInAttr['style'][] = 'border-color: ' . $event_color . ';'; } $_eventAttr['id'] = 'event_' . $event_id; $_eventAttr['class'] = $this->helper->implode($_eventClasses); $_eventAttr['data-event_id'] = $event_id; $_eventAttr['data-ri'] = $__repeatInterval; $_eventAttr['data-colr'] = $event_color; $_eventAttr['rest'][] = $__scheme_attributes; $atts = $this->helper->get_attrs($_eventAttr); $_eventInAttr['id'] = $unique_id; $_eventInAttr['class'] = $_eventInClasses_; $_eventInAttr['data-ux_val'] = $event_ux_val; $attsIn = $this->helper->get_attrs($_eventInAttr); // build the event HTML $event_html_code = "<div {$atts}>{$eventbefore}{$__scheme_data}\r\n\t\t\t\t<{$html_tag} {$attsIn}>{$html_info_line}</{$html_tag}>" . $html_event_detail_card . "<div class='clear end'></div></div>"; // prepare output $months_event_array[] = array('event_id' => $event_id, 'srow' => $event_start_unix, 'erow' => $event_end_unix, 'content' => $event_html_code); } } else { $months_event_array; } return $months_event_array; }