/** * Displays the saved organizer * Used in the settings screen * * @return void * @deprecated * @todo move this to the settings classes and remove */ function tribe_display_saved_organizer() { $current_organizer_id = Tribe__Events__Main::instance()->defaults()->organizer_id(); $current_organizer = $current_organizer_id != 'none' && $current_organizer_id != 0 && $current_organizer_id ? tribe_get_organizer($current_organizer_id) : __('No default set', 'tribe-events-calendar-pro'); $current_organizer = esc_html($current_organizer); echo '<p class="tribe-field-indent description">' . sprintf(__('The current default organizer is: %s', 'tribe-events-calendar-pro'), '<strong>' . $current_organizer . '</strong>') . '</p>'; }
/** * Generates the iCal file * * @static * * @param int|null $post If you want the ical file for a single event */ public static function generate_ical_feed($post = null) { $tec = Tribe__Events__Main::instance(); $events = ''; $blogHome = get_bloginfo('url'); $blogName = get_bloginfo('name'); if ($post) { $events_posts = array(); $events_posts[] = $post; } else { if (tribe_is_month()) { $events_posts = self::get_month_view_events(); } else { global $wp_query; $events_posts = $wp_query->posts; } } $event_ids = wp_list_pluck($events_posts, 'ID'); foreach ($events_posts as $event_post) { // add fields to iCal output $item = array(); $full_format = 'Ymd\\THis\\Z'; $time = (object) array('start' => self::wp_strtotime($event_post->EventStartDate), 'end' => self::wp_strtotime($event_post->EventEndDate), 'modified' => self::wp_strtotime($event_post->post_modified), 'created' => self::wp_strtotime($event_post->post_date)); if ('yes' == get_post_meta($event_post->ID, '_EventAllDay', true)) { $type = 'DATE'; $format = 'Ymd'; } else { $type = 'DATE-TIME'; $format = $full_format; } $tzoned = (object) array('start' => date($format, $time->start), 'end' => date($format, $time->end), 'modified' => date($full_format, $time->modified), 'created' => date($full_format, $time->created)); if ('DATE' === $type) { $item[] = "DTSTART;VALUE={$type}:" . $tzoned->start; $item[] = "DTEND;VALUE={$type}:" . $tzoned->end; } else { $item[] = 'DTSTART:' . $tzoned->start; $item[] = 'DTEND:' . $tzoned->end; } $item[] = 'DTSTAMP:' . date($full_format, time()); $item[] = 'CREATED:' . $tzoned->created; $item[] = 'LAST-MODIFIED:' . $tzoned->modified; $item[] = 'UID:' . $event_post->ID . '-' . $time->start . '-' . $time->end . '@' . parse_url(home_url('/'), PHP_URL_HOST); $item[] = 'SUMMARY:' . str_replace(array(',', "\n", "\r", "\t"), array('\\,', '\\n', '', '\\t'), html_entity_decode(strip_tags($event_post->post_title), ENT_QUOTES)); $item[] = 'DESCRIPTION:' . str_replace(array(',', "\n", "\r", "\t"), array('\\,', '\\n', '', '\\t'), html_entity_decode(strip_tags($event_post->post_content), ENT_QUOTES)); $item[] = 'URL:' . get_permalink($event_post->ID); // add location if available $location = $tec->fullAddressString($event_post->ID); if (!empty($location)) { $str_location = str_replace(array(',', "\n"), array('\\,', '\\n'), html_entity_decode($location, ENT_QUOTES)); $item[] = 'LOCATION:' . $str_location; } // add geo coordinates if available if (class_exists('Tribe__Events__Pro__Geo_Loc')) { $long = Tribe__Events__Pro__Geo_Loc::instance()->get_lng_for_event($event_post->ID); $lat = Tribe__Events__Pro__Geo_Loc::instance()->get_lat_for_event($event_post->ID); if (!empty($long) && !empty($lat)) { $item[] = sprintf('GEO:%s;%s', $long, $lat); $str_title = str_replace(array(',', "\n"), array('\\,', '\\n'), html_entity_decode(tribe_get_address($event_post->ID), ENT_QUOTES)); if (!empty($str_title) && !empty($str_location)) { $item[] = 'X-APPLE-STRUCTURED-LOCATION;VALUE=URI;X-ADDRESS=' . str_replace('\\,', '', trim($str_location)) . ';' . 'X-APPLE-RADIUS=500;' . 'X-TITLE=' . trim($str_title) . ':geo:' . $long . ',' . $lat; } } } // add categories if available $event_cats = (array) wp_get_object_terms($event_post->ID, Tribe__Events__Main::TAXONOMY, array('fields' => 'names')); if (!empty($event_cats)) { $item[] = 'CATEGORIES:' . html_entity_decode(join(',', $event_cats), ENT_QUOTES); } // add featured image if available if (has_post_thumbnail($event_post->ID)) { $thumbnail_id = get_post_thumbnail_id($event_post->ID); $thumbnail_url = wp_get_attachment_url($thumbnail_id); $thumbnail_mime_type = get_post_mime_type($thumbnail_id); $item[] = apply_filters('tribe_ical_feed_item_thumbnail', sprintf('ATTACH;FMTTYPE=%s:%s', $thumbnail_mime_type, $thumbnail_url), $event_post->ID); } // add organizer if available $organizer_email = tribe_get_organizer_email($event_post->ID); if ($organizer_email) { $organizer_name = tribe_get_organizer($event_post->ID); if ($organizer_name) { $item[] = sprintf('ORGANIZER;CN=%s:MAILTO:%s', $organizer_name, $organizer_email); } else { $item[] = sprintf('ORGANIZER:MAILTO:%s', $organizer_email); } } $item = apply_filters('tribe_ical_feed_item', $item, $event_post); $events .= "BEGIN:VEVENT\r\n" . implode("\r\n", $item) . "\r\nEND:VEVENT\r\n"; } header('Content-type: text/calendar; charset=UTF-8'); header('Content-Disposition: attachment; filename="ical-event-' . implode($event_ids) . '.ics"'); $content = "BEGIN:VCALENDAR\r\n"; $content .= "VERSION:2.0\r\n"; $content .= 'PRODID:-//' . $blogName . ' - ECPv' . Tribe__Events__Main::VERSION . "//NONSGML v1.0//EN\r\n"; $content .= "CALSCALE:GREGORIAN\r\n"; $content .= "METHOD:PUBLISH\r\n"; $content .= 'X-WR-CALNAME:' . apply_filters('tribe_ical_feed_calname', $blogName) . "\r\n"; $content .= 'X-ORIGINAL-URL:' . $blogHome . "\r\n"; $content .= 'X-WR-CALDESC:Events for ' . $blogName . "\r\n"; $content = apply_filters('tribe_ical_properties', $content); $content .= $events; $content .= 'END:VCALENDAR'; echo $content; exit; }
* This file contains one event in the list view * * Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/single-event.php * * @package TribeEventsCalendar * */ if (!defined('ABSPATH')) { die('-1'); } // Setup an array of venue details for use later in the template $venue_details = tribe_get_venue_details(); // Venue $has_venue_address = !empty($venue_details['address']) ? ' location' : ''; // Organizer $organizer = tribe_get_organizer(); ?> <!-- Event Cost --> <?php if (tribe_get_cost()) { ?> <div class="tribe-events-event-cost"> <span><?php echo tribe_get_cost(null, true); ?> </span> </div> <?php }
<?php /** * @var array $events */ $columns = array(_x('ID', 'csv-data', 'eventrocket'), _x('Title', 'csv-data', 'eventrocket'), _x('Description', 'csv-data', 'eventrocket'), _x('Start Date', 'csv-data', 'eventrocket'), _x('Start Time', 'csv-data', 'eventrocket'), _x('End Date', 'csv-data', 'eventrocket'), _x('End Time', 'csv-data', 'eventrocket'), _x('Venue', 'csv-data', 'eventrocket'), _x('Organizer', 'csv-data', 'eventrocket'), _x('All Day', 'csv-data', 'eventrocket'), _x('Recurring', 'csv-data', 'eventrocket')); echo join(', ', $columns) . "\n"; foreach ($events as $event) { $fields = array(absint($event->ID), get_the_title($event), $event->post_content, tribe_get_start_date($event->ID, false, 'Y-m-d'), tribe_get_start_date($event->ID, false, 'H:i:s'), tribe_get_end_date($event->ID, false, 'Y-m-d'), tribe_get_end_date($event->ID, false, 'H:i:s'), tribe_get_venue($event->ID), tribe_get_organizer($event->ID), tribe_event_is_all_day($event->ID) ? '1' : '0', tribe_is_recurring_event($event->ID) ? '1' : '0'); foreach ($fields as &$csv_field) { $csv_field = '"' . str_replace('"', '""', $csv_field) . '"'; } echo join(', ', $fields) . "\n"; }
<?php $args = array('post_status' => 'publish', 'post_type' => 'tribe_organizer', 'posts_per_page' => -1, 'order' => 'ASC', 'orderby' => 'title'); $get_posts = null; $get_posts = new WP_Query(); $get_posts->query($args); if ($get_posts->have_posts()) { while ($get_posts->have_posts()) { $get_posts->the_post(); ?> <li> <a href="<?php echo tribe_get_organizer_website_url(); ?> " target="_blank"><?php echo tribe_get_organizer(); ?> </a> <?php $args = array('post_type' => array(TribeEvents::POSTTYPE), 'posts_per_page' => -1, 'order' => 'ASC', 'meta_query' => array(array('key' => '_EventOrganizerID', 'value' => get_the_ID(), 'compare' => 'LIKE')), 'orderby' => 'date'); $events = new WP_Query($args); if ($events->have_posts()) { ?> <ul> <li><b>Upcoming Events</b></li> <?php while ($events->have_posts()) { $events->the_post();
/** * Displays the saved organizer * Used in the settings screen * * @author jkudish * @since 2.0.5 * @return void */ function tribe_display_saved_organizer() { $current_organizer_id = tribe_get_option('eventsDefaultOrganizerID', 'none'); $current_organizer = $current_organizer_id != 'none' && $current_organizer_id != 0 && $current_organizer_id ? tribe_get_organizer($current_organizer_id) : __('No default set', 'tribe-events-calendar-pro'); echo '<p class="tribe-field-indent description">' . sprintf(__('The current default organizer is: %s', 'tribe-events-calendar-pro'), '<strong>' . $current_organizer . '</strong>') . '</p>'; }
} ?> <?php if (isset($country) && $country && tribe_get_country() != '') { ?> <span class="country-name"><?php echo tribe_get_country(); ?> </span> <?php } ?> <?php if (isset($organizer) && $organizer && tribe_get_organizer() != '') { ?> <span class="tribe-organizer"> <?php _e('Organizer:', 'tribe-events-calendar-pro'); ?> <?php echo tribe_get_organizer_link(); ?> </span> <?php } ?> <?php if (isset($phone) && $phone && tribe_get_phone() != '') {
</a><br /> <a href="#" style="color:#006caa !important; display:block; margin:0; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size:13px; text-decoration:underline;"><?php echo $venue_web; ?> </a> </td> </tr> </table> </td> <td class="ticket-organizer" valign="top" align="left" width="140" style="padding: 0 !important; width:140px; margin:0 !important;"> <h6 style="color:#909090 !important; margin:0 0 4px 0; font-family: 'Helvetica Neue', Helvetica, sans-serif; text-transform:uppercase; font-size:13px; font-weight:700 !important;"><?php _e(tribe_get_organizer_label_singular(), "tribe-events-calendar"); ?> </h6> <span style="color:#0a0a0e !important; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size:15px;"><?php echo tribe_get_organizer($event->ID); ?> </span> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center"> <tr> <td class="ticket-footer" valign="top" align="left" width="100%" style="padding: 0 !important; width:100%; margin:0 !important;"> <a href="<?php echo esc_url(home_url()); ?> " style="color:#006caa !important; display:block; margin-top:20px; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size:13px; text-decoration:underline;"><?php echo home_url(); ?> </a>
/** * Send email alert to email list when an event is submitted. * * @param int $tribe_event_id The event ID. * @return void * @author Nick Ciske * @since 1.0 */ public function sendEmailAlerts($tribe_event_id) { $post = get_post($tribe_event_id); $subject = sprintf('[%s] ' . __('Community Events Submission', 'tribe-events-community') . ':', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES)) . ' "' . $post->post_title . '"'; $message = '<html><body>'; $message .= '<h2>' . $post->post_title . '</h2>'; $message .= '<h4>' . tribe_get_start_date($tribe_event_id) . ' - ' . tribe_get_end_date($tribe_event_id) . '</h4>'; $message .= '<hr />'; $message .= '<h3>' . __('Event Organizer', 'tribe-events-community') . '</h3><p>' . tribe_get_organizer(tribe_get_event_meta($post->ID, '_EventOrganizerID', true)) . '</p>'; $message .= '<h3>' . __('Event Venue', 'tribe-events-community') . '</h3><p>' . tribe_get_venue(tribe_get_event_meta($post->ID, '_EventVenueID', true)) . '</p>'; $message .= '<h3>' . __('Description', 'tribe-events-community') . "</h3>\r\n" . $post->post_content; $message .= '<hr /><h4>' . $this->getEditButton($post, __('Review Event', 'tribe-events-community')); if ($post->post_status == 'publish') { $message .= ' | <a href="' . get_permalink($tribe_event_id) . '">View Event</a>'; } $message .= '</h4></body></html>'; $headers = array('Content-Type: text/html'); $h = implode("\r\n", $headers) . "\r\n"; if (is_array($this->emailAlertsList)) { foreach ($this->emailAlertsList as $email) { wp_mail(trim($email), $subject, $message, $h); } } }
function axiom_tribe_events_get_blog_title($title, $page) { if (!empty($title)) { return $title; } if (axiom_strpos($page, 'tribe') !== false) { //return tribe_get_events_title(); if ($page == 'tribe_category') { $cat = get_term_by('slug', get_query_var('tribe_events_cat'), 'tribe_events_cat', ARRAY_A); $title = $cat['name']; } else { if ($page == 'tribe_tag') { $title = sprintf(__('Tag: %s', 'axiom'), single_tag_title('', false)); } else { if ($page == 'tribe_venue') { $title = sprintf(__('Venue: %s', 'axiom'), tribe_get_venue()); } else { if ($page == 'tribe_organizer') { $title = sprintf(__('Organizer: %s', 'axiom'), tribe_get_organizer()); } else { if ($page == 'tribe_day') { $title = sprintf(__('Daily Events: %s', 'axiom'), date_i18n(tribe_get_date_format(true), strtotime(get_query_var('start_date')))); } else { if ($page == 'tribe_month') { $title = sprintf(__('Monthly Events: %s', 'axiom'), date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date()))); } else { if ($page == 'tribe_event') { $title = axiom_get_post_title(); } else { $title = __('Tribe Events', 'axiom'); } } } } } } } } return $title; }
* creating an organizer for user submitted events. * * This is ALSO used in the Organizer edit view. Be careful to test changes in both places. * * Override this template in your own theme by creating a file at * [your-theme]/tribe-events/community/modules/organizer.php * * @package TribeCommunityEvents * @since 2.1 * @author Modern Tribe Inc. * */ if (!defined('ABSPATH')) { die('-1'); } $organizer_name = esc_attr(tribe_get_organizer()); $organizer_phone = esc_attr(tribe_get_organizer_phone()); $organizer_website = esc_url(tribe_get_organizer_website_url()); $organizer_email = esc_attr(tribe_get_organizer_email()); if (!isset($event)) { $event = null; } ?> <!-- Organizer --> <div class="tribe-events-community-details eventForm bubble" id="event_organizer"> <table class="tribe-community-event-info" cellspacing="0" cellpadding="0"> <tr> <td colspan="2" class="tribe_sectionheader">
_e('Default Organizer for Events', 'tribe-events-calendar-pro'); ?> </th> <td> <fieldset> <legend class="screen-reader-text"><?php _e('Default Organizer', 'tribe-events-calendar-pro'); ?> </legend> <label><?php $tecp->saved_organizers_dropdown(tribe_get_option('eventsDefaultOrganizerID'), 'eventsDefaultOrganizerID'); _e('The default organizer value', 'tribe-events-calendar-pro'); ?> </label><br /> <?php echo tribe_get_option('eventsDefaultOrganizerID') != 0 ? sprintf(__('<em>The current default value is:</em> <strong>%s</strong>', 'tribe-events-calendar-pro'), tribe_get_organizer(tribe_get_option('eventsDefaultOrganizerID'))) : '<em>' . __('No default value set') . '</em>'; ?> </fieldset></td> </tr> <tr class="tribe-defaults-dropdown"> <th scope="row"><?php _e('Default Venue for Events', 'tribe-events-calendar-pro'); ?> </th> <td> <fieldset> <legend class="screen-reader-text"><?php _e('Default Venue', 'tribe-events-calendar-pro'); ?> </legend> <label><?php
function getBlogTitle() { global $wp_query; $page = getBlogType(); if (themerex_strpos($page, 'woocommerce') !== false) { if ($page == 'woocommerce_category') { $cat = get_term_by('slug', get_query_var('product_cat'), 'product_cat', ARRAY_A); return $cat['name']; } else { if ($page == 'woocommerce_tag') { return sprintf(__('Tag: %s', 'themerex'), single_tag_title('', false)); } else { if ($page == 'woocommerce_cart') { return __('Your cart', 'themerex'); } else { if ($page == 'woocommerce_checkout') { return __('Checkout', 'themerex'); } else { if ($page == 'woocommerce_account') { return __('Account', 'themerex'); } else { if ($page == 'woocommerce_product') { return getPostTitle(); } else { if (($page_id = get_option('woocommerce_shop_page_id')) > 0) { return getPostTitle($page_id); } //__( 'Shop', 'themerex' ); } } } } } } } else { if (themerex_strpos($page, 'tribe') !== false) { //return tribe_get_events_title(); if ($page == 'tribe_category') { $cat = get_term_by('slug', get_query_var('tribe_events_cat'), 'tribe_events_cat', ARRAY_A); return $cat['name']; } else { if ($page == 'tribe_tag') { return sprintf(__('Tag: %s', 'themerex'), single_tag_title('', false)); } else { if ($page == 'tribe_venue') { return sprintf(__('Venue: %s', 'themerex'), tribe_get_venue()); } else { if ($page == 'tribe_organizer') { return sprintf(__('Organizer: %s', 'themerex'), tribe_get_organizer()); } else { if ($page == 'tribe_day') { return sprintf(__('Daily Events: %s', 'themerex'), date_i18n(tribe_get_date_format(true), strtotime($wp_query->get('start_date')))); } else { if ($page == 'tribe_month') { return sprintf(__('Monthly Events: %s', 'themerex'), date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date()))); } else { if ($page == 'tribe_event') { return getPostTitle(); } else { return __('Tribe Events', 'themerex'); } } } } } } } } else { if ($page == 'blog') { return __('All Posts', 'themerex'); } else { if ($page == 'author') { $curauth = get_query_var('author_name') ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author')); return sprintf(__('Author page: %s', 'themerex'), $curauth->display_name); } else { if ($page == 'error') { return __('URL not found', 'themerex'); } else { if ($page == 'search') { return sprintf(__('Search Results for: %s', 'themerex'), get_search_query()); } else { if ($page == 'archives_day') { return sprintf(__('Daily Archives: %s', 'themerex'), prepareDateForTranslation(get_the_date())); } else { if ($page == 'archives_month') { return sprintf(__('Monthly Archives: %s', 'themerex'), prepareDateForTranslation(get_the_date('F Y'))); } else { if ($page == 'archives_year') { return sprintf(__('Yearly Archives: %s', 'themerex'), get_the_date('Y')); } else { if ($page == 'category') { return sprintf(__('%s', 'themerex'), single_cat_title('', false)); } else { if ($page == 'tag') { return sprintf(__('Tag: %s', 'themerex'), single_tag_title('', false)); } else { if ($page == 'attachment') { return sprintf(__('Attachment: %s', 'themerex'), getPostTitle()); } else { if ($page == 'single') { return getPostTitle(); } else { if ($page == 'page') { return getPostTitle(); } else { return get_bloginfo('name', 'raw'); } } } } } } } } } } } } } } // Unknown pages - as homepage }
<div class="tribe-events-meta-group tribe-events-meta-group-organizer"> <h3 class="tribe-events-single-section-title"><?php echo 'CONTACT: '; ?> </h3> <dl> <?php do_action('tribe_events_single_meta_organizer_section_start'); foreach ($organizer_ids as $organizer) { if (!$organizer) { continue; ?> <i class="fa fa-user"></i> <dd class="fn org"> <?php echo strip_tags(tribe_get_organizer($organizer)); ?> </dd> <?php } } if (!$multiple) { // only show organizer details if there is one if (!empty($phone)) { ?> <dt> <i class="fa fa-phone"></i> <?php //esc_html_e( 'Phone:', 'the-events-calendar' ) ?> </dt>
function display_day($day, $monthView) { global $post; $output = ''; $posts_per_page = tribe_get_option('postsPerPage', 10); for ($i = 0; $i < count($monthView[$day]); $i++) { $post = $monthView[$day][$i]; setup_postdata($post); $eventId = $post->ID . '-' . $day; $start = tribe_get_start_date($post->ID, false, 'U'); $end = tribe_get_end_date($post->ID, false, 'U'); $cost = tribe_get_cost($post->ID); ?> <?php if (tribe_get_organizer() == 'Illinois Science Council') { $organizerClass = "org_isc"; } else { $organizerClass = "org_unknown"; } ?> <div id='event_<?php echo $eventId; ?> ' <?php post_class('tribe-events-event tribe-events-real-event ' . $organizerClass); ?> > <a href="<?php tribe_event_link(); ?> "><?php the_title(); ?> </a> <div id='tooltip_<?php echo $eventId; ?> ' class="tribe-events-tooltip" style="display:none;"> <h5 class="tribe-events-event-title"><?php the_title(); ?> </h5> <div class="tribe-events-event-body"> <div class="tribe-events-event-date"> <?php if (!empty($start)) { echo date_i18n(get_option('date_format', 'F j, Y'), $start); } if (!tribe_get_event_meta($post->ID, '_EventAllDay', true)) { echo ' ' . date_i18n(get_option('time_format', 'g:i a'), $start); } ?> <?php if (!empty($end) && $start !== $end) { if (date_i18n('Y-m-d', $start) == date_i18n('Y-m-d', $end)) { $time_format = get_option('time_format', 'g:i a'); if (!tribe_get_event_meta($post->ID, '_EventAllDay', true)) { echo " – " . date_i18n($time_format, $end); } } else { echo " – " . date_i18n(get_option('date_format', 'F j, Y'), $end); if (!tribe_get_event_meta($post->ID, '_EventAllDay', true)) { echo ' ' . date_i18n(get_option('time_format', 'g:i a'), $end) . '<br />'; } } } ?> </div> <?php if (function_exists('has_post_thumbnail') && has_post_thumbnail()) { ?> <div class="tribe-events-event-thumb"><?php the_post_thumbnail(array(75, 75)); ?> </div> <?php } ?> <?php echo has_excerpt() ? TribeEvents::truncate($post->post_excerpt) : TribeEvents::truncate(get_the_content(), 30); ?> </div> <span class="tribe-events-arrow"></span> </div> </div> <?php if ($i < count($monthView[$day]) - 1) { echo "<hr />"; } } }
/** * @deprecated */ function sp_get_organizer($postId = null) { _deprecated_function(__FUNCTION__, '2.0', 'tribe_get_organizer()'); return tribe_get_organizer($postId); }
/** * Generates the iCal file * * @static * * @param int|null $post If you want the ical file for a single event */ public static function generate_ical_feed($post = null) { $tec = TribeEvents::instance(); $wp_timezone = get_option('timezone_string'); $events = ''; $blogHome = get_bloginfo('url'); $blogName = get_bloginfo('name'); if ($post) { $events_posts = array(); $events_posts[] = $post; } else { if (tribe_is_month()) { $events_posts = self::get_month_view_events(); } else { global $wp_query; $events_posts = $wp_query->posts; } } foreach ($events_posts as $event_post) { $startDate = $event_post->EventStartDate; $endDate = $event_post->EventEndDate; // convert 2010-04-08 00:00:00 to 20100408T000000 or YYYYMMDDTHHMMSS $startDate = str_replace(array('-', ' ', ':'), array('', 'T', ''), $startDate); $endDate = str_replace(array('-', ' ', ':'), array('', 'T', ''), $endDate); if (get_post_meta($event_post->ID, '_EventAllDay', true) == 'yes') { $startDate = substr($startDate, 0, 8); $endDate = substr($endDate, 0, 8); // endDate bumped ahead one day to counter iCal's off-by-one error $endDateStamp = strtotime($endDate); $endDate = date('Ymd', $endDateStamp + 86400); $type = 'DATE'; } else { $type = 'DATE-TIME'; } $description = preg_replace("/[\n\t\r]/", ' ', strip_tags($event_post->post_content)); // add fields to iCal output $item = array(); $item[] = "DTSTART;VALUE={$type}:" . $startDate; $item[] = "DTEND;VALUE={$type}:" . $endDate; $item[] = 'DTSTAMP:' . date('Ymd\\THis', time()); $item[] = 'CREATED:' . str_replace(array('-', ' ', ':'), array('', 'T', ''), $event_post->post_date); $item[] = 'LAST-MODIFIED:' . str_replace(array('-', ' ', ':'), array('', 'T', ''), $event_post->post_modified); $item[] = 'UID:' . $event_post->ID . '-' . strtotime($startDate) . '-' . strtotime($endDate) . '@' . $blogHome; $item[] = 'SUMMARY:' . $event_post->post_title; $item[] = 'DESCRIPTION:' . str_replace(',', '\\,', $description); $item[] = 'URL:' . get_permalink($event_post->ID); // add location if available $location = $tec->fullAddressString($event_post->ID); if (!empty($location)) { $item[] = 'LOCATION:' . html_entity_decode($location, ENT_QUOTES); } // add geo coordinates if available if (class_exists('TribeEventsGeoLoc')) { $long = TribeEventsGeoLoc::instance()->get_lng_for_event($event_post->ID); $lat = TribeEventsGeoLoc::instance()->get_lat_for_event($event_post->ID); if (!empty($long) && !empty($lat)) { $item[] = sprintf('GEO:%s;%s', $long, $lat); } } // add categories if available $event_cats = (array) wp_get_object_terms($event_post->ID, TribeEvents::TAXONOMY, array('fields' => 'names')); if (!empty($event_cats)) { $item[] = 'CATEGORIES:' . html_entity_decode(join(',', $event_cats), ENT_QUOTES); } // add featured image if available if (has_post_thumbnail($event_post->ID)) { $thumbnail_id = get_post_thumbnail_id($event_post->ID); $thumbnail_url = wp_get_attachment_url($thumbnail_id); $thumbnail_mime_type = get_post_mime_type($thumbnail_id); $item[] = apply_filters('tribe_ical_feed_item_thumbnail', sprintf('ATTACH;FMTTYPE=%s:%s', $thumbnail_mime_type, $thumbnail_url), $event_post->ID); } // add organizer if available $organizer_email = tribe_get_organizer_email($event_post->ID); if ($organizer_email) { $organizer_name = tribe_get_organizer($event_post->ID); if ($organizer_name) { $item[] = sprintf('ORGANIZER;CN=%s:MAILTO:%s', $organizer_name, $organizer_email); } else { $item[] = sprintf('ORGANIZER:MAILTO:%s', $organizer_email); } } $item = apply_filters('tribe_ical_feed_item', $item, $event_post); $events .= "BEGIN:VEVENT\r\n" . implode("\r\n", $item) . "\r\nEND:VEVENT\r\n"; } header('Content-type: text/calendar; charset=UTF-8'); header('Content-Disposition: attachment; filename="iCal-TribeEvents.ics"'); $content = "BEGIN:VCALENDAR\r\n"; $content .= "VERSION:2.0\r\n"; $content .= 'PRODID:-//' . $blogName . ' - ECPv' . TribeEvents::VERSION . "//NONSGML v1.0//EN\r\n"; $content .= "CALSCALE:GREGORIAN\r\n"; $content .= "METHOD:PUBLISH\r\n"; $content .= 'X-WR-CALNAME:' . apply_filters('tribe_ical_feed_calname', $blogName) . "\r\n"; $content .= 'X-ORIGINAL-URL:' . $blogHome . "\r\n"; $content .= 'X-WR-CALDESC:Events for ' . $blogName . "\r\n"; if ($wp_timezone) { $content .= 'X-WR-TIMEZONE:' . $wp_timezone . "\r\n"; } $content = apply_filters('tribe_ical_properties', $content); $content .= $events; $content .= 'END:VCALENDAR'; echo $content; exit; }
</tr> </table> </td> <td class="ticket-organizer" valign="top" align="left" width="140" style="padding: 0 !important; width:140px; margin:0 !important;"> <?php $organizers = tribe_get_organizer_ids($event->ID); ?> <h6 style="color:#909090 !important; margin:0 0 4px 0; font-family: 'Helvetica Neue', Helvetica, sans-serif; text-transform:uppercase; font-size:13px; font-weight:700 !important;"><?php echo tribe_get_organizer_label(count($organizers) < 2); ?> </h6> <?php foreach ($organizers as $organizer_id) { ?> <span style="color:#0a0a0e !important; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size:15px;"><?php echo tribe_get_organizer($organizer_id); ?> </span> <?php } ?> </td> <?php $qr_code_url = apply_filters('tribe_tickets_ticket_qr_code', '', $ticket); ?> <?php if (!empty($qr_code_url)) { ?> <td class="ticket-qr" valign="top" align="right" width="160" style="padding: 0 !important; width:160px; margin:0 !important;">
} if ($canDelete) { echo TribeCommunityEvents::instance()->getDeleteButton($post); } ?> </div><!-- .row-actions --> </td> <td> <?php if (tribe_has_organizer($post->ID)) { $organizer_id = tribe_get_organizer_id($post->ID); if (current_user_can('edit_post', $organizer_id)) { echo '<a href="' . TribeCommunityEvents::instance()->getUrl('edit', $organizer_id, null, TribeEvents::ORGANIZER_POST_TYPE) . '">' . tribe_get_organizer($post->ID) . '</a>'; } else { echo tribe_get_organizer($post->ID); } } ?> </td> <td> <?php if (tribe_has_venue($post->ID)) { $venue_id = tribe_get_venue_id($post->ID); if (current_user_can('edit_post', $venue_id)) { echo '<a href="' . TribeCommunityEvents::instance()->getUrl('edit', $venue_id, null, TribeEvents::VENUE_POST_TYPE) . '">' . tribe_get_venue($post->ID) . '</a>'; } else { echo tribe_get_venue($post->ID); } }
/** * Get organizer name * * @param int $meta_id * @return string */ public static function organizer_name($meta_id) { global $_tribe_meta_factory; $post_id = get_the_ID(); $name = tribe_get_organizer($post_id); $organizer_name = empty($name) ? '' : Tribe_Meta_Factory::template($_tribe_meta_factory->meta[$meta_id]['label'], $name, $meta_id); return apply_filters('tribe_event_meta_organizer_name', $organizer_name, $meta_id); }
} ?> <?php if ($country && tribe_get_country() != '') { ?> <span class="country-name"><?php echo tribe_get_country(); ?> </span> <?php } ?> <?php if ($organizer && tribe_get_organizer() != '') { ?> <?php _e('Organizer:', 'tribe-events-calendar-pro'); ?> <span class="tribe-organizer"><?php echo tribe_get_organizer_link(); ?> </span> <?php } ?> <?php if ($phone && tribe_get_phone() != '') { ?>
/** * Organizer Page Link * * Returns the event Organizer Name with a link to their single organizer page * * @param int $postId Can supply either event id or organizer id, if none specified, current post is used * @param bool $full_link If true outputs a complete HTML <a> link, otherwise only the URL is output * @param bool $echo If true, echo the link, otherwise return * * @return string Organizer Name and Url */ function tribe_get_organizer_link($postId = null, $full_link = true, $echo = false) { // As of TEC 4.0 this argument is deprecated // If needed precede the call to this function with echo if ($echo != false) { _deprecated_argument(__FUNCTION__, '4.0'); } $org_id = tribe_get_organizer_id($postId); if (class_exists('Tribe__Events__Pro__Main')) { $url = esc_url_raw(get_permalink($org_id)); if ($full_link) { $name = tribe_get_organizer($org_id); $attr_title = the_title_attribute(array('post' => $org_id, 'echo' => false)); $link = !empty($url) && !empty($name) ? '<a href="' . esc_url($url) . '" title="' . $attr_title . '"">' . $name . '</a>' : false; } else { $link = $url; } // Remove this in or before 5.x to fully deprecate the echo arg if ($echo) { echo apply_filters('tribe_get_organizer_link', $link, $postId, $echo, $url); } else { return apply_filters('tribe_get_organizer_link', $link, $postId, $full_link, $url); } } }
/** * Organizer Page Link * * Returns the event Organizer Name with a link to their single organizer page * * @param int $postId Can supply either event id or organizer id, if none specified, current post is used * @param bool $full_link If true displays full html links around organizers name, if false returns just the link without displaying it * @param bool $echo If true, echo the link, otherwise return * * @return string Organizer Name and Url */ function tribe_get_organizer_link($postId = null, $full_link = true, $echo = true) { $postId = Tribe__Events__Main::postIdHelper($postId); if (class_exists('Tribe__Events__Pro__Main')) { $url = esc_url_raw(get_permalink(tribe_get_organizer_id($postId))); if ($full_link) { $name = tribe_get_organizer($postId); $link = !empty($url) && !empty($name) ? '<a href="' . esc_url($url) . '">' . $name . '</a>' : false; $link = apply_filters('tribe_get_organizer_link', $link, $postId, $echo, $url, $name); } else { $link = $url; } if ($echo) { echo $link; } else { return $link; } } }
<!-- h3 class="tribe-events-single-section-title"><?php echo tribe_get_organizer_label(!$multiple); ?> </h3 --> <h3 class="tribe-events-single-section-title">Instructor</h3> <dl> <?php do_action('tribe_events_single_meta_organizer_section_start'); foreach ($organizer_ids as $organizer) { if (!$organizer) { continue; } ?> <dd class="fn org"> <?php echo tribe_get_organizer($organizer); ?> </dd> <?php } if (!$multiple) { // only show organizer details if there is one if (!empty($phone)) { ?> <dt> <?php esc_html_e('Phone:', 'the-events-calendar'); ?> </dt> <dd class="tel"> <?php
/** * Organizer Website Link * * Returns the event Organizer Name with a link to their supplied website url * * @param int $postId Can supply either event id or organizer id, if none specified, current post is used * @param bool $full_link If true displays full html links around organizers name, if false returns just the link without displaying it * @param bool $display If true, echo the link, otherwise return * @return string Organizer Name and Url * @since 2.0 */ function tribe_get_organizer_link($postId = null, $full_link = true, $display = true) { $postId = TribeEvents::postIdHelper($postId); $url = esc_url(tribe_get_event_meta(tribe_get_organizer_id($postId), '_OrganizerWebsite', true)); if ($full_link && $url != '') { $organizer_name = tribe_get_organizer($postId); $link = '<a href="' . $url . '">' . $organizer_name . '</a>'; } else { $link = $url; } $link = apply_filters('tribe_get_organizer_link', $link, $postId, $display, $url); if ($display) { echo $link; } else { return $link; } }