function block_tribe_event_output($params) { extract($params); $default_excerpt_length = 650; if (!isset($event_ID) || empty($event_ID)) { return; } $event = get_post($event_ID); // if block has event ID but the actual event does not exist then exit if (!isset($event)) { return; } // BLOCK CLASSES $block_classes = "outter-wrapper"; if (!empty($custom_classes)) { $block_classes .= " " . $custom_classes; } ?> <!-- BLOCK: LATEST POSTS--> <!-- start outter-wrapper --> <div <?php pb_block_id_class($block_classes, $params); ?> > <!-- block styles --> <style type="text/css" scoped> <?php include 'includes/inc_block_output_style.php'; ?> </style> <!-- start main-container --> <div class="main-container"> <!-- start main wrapper --> <div class="main wrapper clearfix"> <!-- start main-content --> <div class="main-content"> <!-- Start Post --> <div class="clearfix tribe-events-tcblock"> <!-- Event Cost --> <div class="tribe-events-event-cost"> <span><?php echo tribe_get_formatted_cost($event_ID); ?> </span> </div> <!-- Event Title --> <h2 class="tribe-events-list-event-title summary"> <?php printf('<a class="url" href="%s" title="%s" rel="bookmark">%s</a>', esc_url(tribe_get_event_link($event_ID)), esc_attr(get_the_title($event_ID)), esc_attr(get_the_title($event_ID))); ?> </h2> <!-- Event Image --> <div class="tribe-events-event-image"> <?php if (has_post_thumbnail($event_ID) && get_post(get_post_thumbnail_id($event_ID))) { $post_thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id($event_ID), 'full'); printf('<a href="%s" title="%s"><img src="%s" title="%s"/></a>', esc_url(tribe_get_event_link($event_ID)), esc_attr(get_the_title($event_ID)), esc_url($post_thumbnail_src[0]), esc_attr(get_the_title($event_ID))); } ?> </div> <!-- Event Meta --> <div class="tribe-events-event-meta vcard location"> <!-- Schedule & Recurrence Details --> <div class="updated published time-details"> <?php printf('<span class="date-start dtstart">%s</span>', esc_attr(tribe_get_start_date($event_ID))); ?> </div> <!-- Venue Display Info --> <div class="tribe-events-venue-details"> <span class="author fn org"><?php echo tribe_get_venue($event_ID); ?> </span>, <address class="tribe-events-address"> <span class="adr"> <span class="street-address"><?php echo tribe_get_address($event_ID); ?> </span> <span class="delimiter">,</span> <span class="locality"><?php echo tribe_get_city($event_ID); ?> </span> <span class="delimiter">,</span> <span class="postal-code"><?php echo tribe_get_zip($event_ID); ?> </span> <span class="country-name"><?php echo tribe_get_country($event_ID); ?> </span> </span> </address> <?php printf('<a class="tribe-events-gmap" href="%s" title="Click to view a Google Map" target="_blank">- Google Map</a>', esc_url(tribe_get_map_link($event_ID))); ?> </div> <!-- .tribe-events-venue-details --> </div><!-- .tribe-events-event-meta --> <!-- Event Content --> <div class="tribe-events-list-event-description tribe-events-content description entry-summary"> <?php $event_excerpt = !empty($event->post_excerpt) ? do_shortcode($event->post_excerpt) : mb_make_excerpt($event->post_content, $default_excerpt_length, true); // excerpt echo "<p>"; echo $event_excerpt; echo "</p>"; // read more printf('<a href="%s" class="tribe-events-read-more" rel="bookmark">%s »</a>', esc_url(tribe_get_event_link($event_ID)), esc_attr(__('Find out more', "loc_sport_core_plugin"))); ?> </div><!-- .tribe-events-list-event-description --> </div> </div> <!-- end main-content --> </div> <!-- end main wrapper --> </div> <!-- end main-container --> </div> <!-- end outter-wrapper --> <!-- END BLOCK --> <?php return true; }
/** * Compile the schema.org event data into an array */ private function build_data() { global $post; $id = $post->ID; $events_data = array(); // Index by ID: this will allow filter code to identify the actual event being referred to // without injecting an additional property $events_data[$id] = new stdClass(); $events_data[$id]->{'@context'} = 'http://schema.org'; $events_data[$id]->{'@type'} = 'Event'; $events_data[$id]->name = get_the_title(); if (has_post_thumbnail()) { $events_data[$id]->image = wp_get_attachment_url(get_post_thumbnail_id($post->ID)); } $events_data[$id]->url = get_the_permalink($post->ID); $events_data[$id]->startDate = get_gmt_from_date(tribe_get_start_date($post, true, TribeDateUtils::DBDATETIMEFORMAT), 'c'); $events_data[$id]->endDate = get_gmt_from_date(tribe_get_end_date($post, true, TribeDateUtils::DBDATETIMEFORMAT), 'c'); if (tribe_has_venue($id)) { $events_data[$id]->location = new stdClass(); $events_data[$id]->location->{'@type'} = 'Place'; $events_data[$id]->location->name = tribe_get_venue($post->ID); $events_data[$id]->location->address = strip_tags(str_replace("\n", '', tribe_get_full_address($post->ID))); } /** * Allows the event data to be modifed by themes and other plugins. * * @param array $events_data objects representing the Google Markup for each event. */ $events_data = apply_filters('tribe_google_event_data', $events_data); // Strip the post ID indexing before returning $events_data = array_values($events_data); return $events_data; }
/** * Render the name of the venue (with the link). * * @deprecated since 3.6 * @param string $html The current venue name. * @param string $meta_id The meta group this is in. * @return string The modified/linked venue name. * @author Timothy Wood * @since 3.0 */ public static function venue_name($html, $meta_id) { global $_tribe_meta_factory; $post_id = get_the_ID(); $name = tribe_get_venue($post_id); $link = !empty($name) ? '<a href="' . tribe_get_venue_link($post_id, false) . '">' . $name . '</a>' : ''; $html = empty($link) ? $html : Tribe_Meta_Factory::template($_tribe_meta_factory->meta[$meta_id]['label'], $link, $meta_id); return apply_filters('tribe_event_pro_meta_venue_name', $html, $meta_id); }
function bs_event_table_content($column_name, $post_id) { if ($column_name == 'date_pub') { $event_date = get_post_meta($post_id, '_bs_meta_event_date', true); //echo date( _x( 'F d, Y', 'Event date format', 'textdomain' ), strtotime( $event_date ) ); echo get_the_date(); } if ($column_name == 'venue') { echo $venue = tribe_get_venue($post_id); } }
/** * Compile the schema.org event data into an array */ protected function build_data() { global $post; $id = $post->ID; $event_data = parent::build_data(); $event_data[$id]->{'@type'} = 'Event'; $event_data[$id]->startDate = get_gmt_from_date(tribe_get_start_date($post, true, Tribe__Events__Date_Utils::DBDATETIMEFORMAT), 'c'); $event_data[$id]->endDate = get_gmt_from_date(tribe_get_end_date($post, true, Tribe__Events__Date_Utils::DBDATETIMEFORMAT), 'c'); if (tribe_has_venue($id)) { $event_data[$id]->location = new stdClass(); $event_data[$id]->location->{'@type'} = 'Place'; $event_data[$id]->location->name = tribe_get_venue($post->ID); $event_data[$id]->location->address = strip_tags(str_replace("\n", '', tribe_get_full_address($post->ID))); } return $event_data; }
/** * Venue Link * * Returns or display the event Organizer Name with a link to their supplied website url * * @param int $postId Can supply either event id or venue id, if none specified, current post is used * @param bool $display If true displays full html links around venue's name, if false returns just the link without displaying it * @return string Venue if $display is set to false, void if it's set to true. * @since 2.0 */ function tribe_get_venue_link($postId = null, $display = true) { $url = esc_url(get_permalink(tribe_get_venue_id($postId))); if ($display && $url != '') { $venue_name = tribe_get_venue($postId); $link = '<a href="' . $url . '">' . $venue_name . '</a>'; } else { $link = $url; } $link = apply_filters('tribe_get_venue_link', $link, $postId, $display, $url); if ($display) { echo $link; } else { return $link; } }
/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $atts = shortcode_atts(array('categories' => "", 'items' => "3", 'paginate' => "no"), $atts, $this->config['shortcode']); $output = ""; $posts = $this->query_entries($atts); $entries = $posts->posts; if (!empty($entries)) { $output .= "<div class='av-upcoming-events " . $meta['el_class'] . "'>"; foreach ($entries as $entry) { $class = "av-upcoming-event-entry"; $image = get_the_post_thumbnail($entry->ID, 'square', array('class' => 'av-upcoming-event-image')); $class .= empty($image) ? " av-upcoming-event-with-image" : " av-upcoming-event-without-image"; $title = get_the_title($entry->ID); $link = get_permalink($entry->ID); $price = tribe_get_cost($entry->ID, true); $venue = tribe_get_venue($entry->ID); $output .= "<a href='{$link}' class='{$class}'>"; if ($image) { $output .= $image; } $output .= "<div class='av-upcoming-event-data'>"; $output .= "<h4 title='av-upcoming-event-title'>{$title}</h4>"; $output .= "<div class='av-upcoming-event-meta'>"; $output .= "<span class='av-upcoming-event-schedule'>" . tribe_events_event_schedule_details($entry) . "</span>"; if ($price) { $output .= "<span class='av-upcoming-event-cost'>{$price}</span>"; } if ($price && $venue) { $output .= " - "; } if ($venue) { $output .= "<span class='av-upcoming-event-venue'>{$venue}</span>"; } $output .= apply_filters('avf_upcoming_event_extra_data', "", $entry); $output .= "</div>"; $output .= "</div>"; $output .= "</a>"; } if ($atts['paginate'] == "yes" && ($avia_pagination = avia_pagination($posts->max_num_pages, 'nav'))) { $output .= "<div class='pagination-wrap pagination-" . TribeEvents::POSTTYPE . "'>{$avia_pagination}</div>"; } $output .= "</div>"; } return $output; }
/** * Retrieve the data to use when returning an event through the REST API. * * @param $object * @param $field * @param $request * * @return string */ public function get_api_meta_data($object, $field, $request) { if ('event_city' === $field) { return esc_html(tribe_get_city($object['id'])); } if ('event_state' === $field) { return esc_html(tribe_get_state($object['id'])); } if ('event_venue' === $field) { return esc_html(tribe_get_venue($object['id'])); } if ('start_date' === $field) { return esc_html(get_post_meta($object['id'], '_EventStartDate', true)); } if ('end_date' === $field) { return esc_html(get_post_meta($object['id'], '_EventEndDate', true)); } return ''; }
/** * Injects event meta data into the Attendees report * * @param int $event_id */ public function event_details_top($event_id) { $post_type = get_post_type($event_id); if (Tribe__Events__Main::POSTTYPE === $post_type) { echo ' <li> <strong>' . esc_html__('Start Date:', 'the-events-calendar') . '</strong> ' . tribe_get_start_date($event_id, false, tribe_get_date_format(true)) . ' </li> '; } if (tribe_has_venue($event_id)) { $venue_id = tribe_get_venue_id($event_id); echo ' <li class="venue-name"> <strong>' . tribe_get_venue_label_singular() . ': </strong> <a href="' . get_edit_post_link($venue_id) . '" title="' . esc_html__('Edit Venue', 'the-events-calendar') . '">' . tribe_get_venue($event_id) . '</a> </li> '; } }
/** * Returns the placeholder HTML needed to embed a map within a page and * additionally enqueues supporting scripts, etc. * * @param int $post_id ID of the pertinent event or venue * @param int $width * @param int $height * @param bool $force_load add the map even if no address data can be found * * @return string */ public function get_map($post_id, $width, $height, $force_load) { $this->get_ids($post_id); // Bail if either the venue or event couldn't be determined if (!tribe_is_venue($this->venue_id) && !tribe_is_event($this->event_id)) { return apply_filters('tribe_get_embedded_map', ''); } $this->form_address(); if (empty($this->address) && !$force_load) { return apply_filters('tribe_get_embedded_map', ''); } $this->embedded_maps[] = array('address' => $this->address, 'title' => tribe_get_venue($this->venue_id)); end($this->embedded_maps); $index = key($this->embedded_maps); // Generate the HTML used to "house" the map ob_start(); tribe_get_template_part('modules/map', null, array('index' => $index, 'width' => null === $width ? apply_filters('tribe_events_single_map_default_width', '100%') : $width, 'height' => null === $height ? apply_filters('tribe_events_single_map_default_height', '350px') : $height)); $this->setup_scripts(); do_action('tribe_events_map_embedded', $index, $this->venue_id); return apply_filters('tribe_get_embedded_map', ob_get_clean()); }
/** * Fetch and return required events. * @param array $atts shortcode attributes * @return string shortcode output */ public function ecs_fetch_events($atts) { /** * Check if events calendar plugin method exists */ if (!function_exists('tribe_get_events')) { return; } global $wp_query, $post; $output = ''; $atts = shortcode_atts(array('cat' => '', 'month' => '', 'limit' => 5, 'eventdetails' => 'true', 'time' => null, 'past' => null, 'venue' => 'false', 'author' => null, 'message' => sprintf(__('There are no upcoming %s at this time.', 'tribe-events-calendar'), tribe_get_event_label_plural()), 'key' => 'End Date', 'order' => 'ASC', 'viewall' => 'false', 'excerpt' => 'false', 'thumb' => 'false', 'thumbwidth' => '', 'thumbheight' => '', 'contentorder' => 'title, thumbnail, excerpt, date, venue', 'event_tax' => ''), $atts, 'ecs-list-events'); // Category if ($atts['cat']) { if (strpos($atts['cat'], ",") !== false) { $atts['cats'] = explode(",", $atts['cat']); $atts['cats'] = array_map('trim', $atts['cats']); } else { $atts['cats'] = $atts['cat']; } $atts['event_tax'] = array('relation' => 'OR', array('taxonomy' => 'tribe_events_cat', 'field' => 'name', 'terms' => $atts['cats']), array('taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => $atts['cats'])); } // Past Event $meta_date_compare = '>='; $meta_date_date = date('Y-m-d'); if ($atts['time'] == 'past' || !empty($atts['past'])) { $meta_date_compare = '<'; } // Key if (str_replace(' ', '', trim(strtolower($atts['key']))) == 'startdate') { $atts['key'] = '_EventStartDate'; } else { $atts['key'] = '_EventEndDate'; } // Date $atts['meta_date'] = array(array('key' => $atts['key'], 'value' => $meta_date_date, 'compare' => $meta_date_compare, 'type' => 'DATETIME')); // Specific Month if ($atts['month'] == 'current') { $atts['month'] = date('Y-m'); } if ($atts['month']) { $month_array = explode("-", $atts['month']); $month_yearstr = $month_array[0]; $month_monthstr = $month_array[1]; $month_startdate = date($month_yearstr . "-" . $month_monthstr . "-1"); $month_enddate = date($month_yearstr . "-" . $month_monthstr . "-t"); $atts['meta_date'] = array(array('key' => $atts['key'], 'value' => array($month_startdate, $month_enddate), 'compare' => 'BETWEEN', 'type' => 'DATETIME')); } $posts = get_posts(array('post_type' => 'tribe_events', 'posts_per_page' => $atts['limit'], 'tax_query' => $atts['event_tax'], 'meta_key' => $atts['key'], 'orderby' => 'meta_value', 'author' => $atts['author'], 'order' => $atts['order'], 'meta_query' => array($atts['meta_date']))); if ($posts) { $output .= '<ul class="ecs-event-list">'; $atts['contentorder'] = explode(',', $atts['contentorder']); foreach ($posts as $post) { setup_postdata($post); $li_classes = 'ecs-event'; $start_date = tribe_get_start_date($post, false, 'Y-m-d'); $today = date('Y-m-d', current_time('timestamp')); $tomorrow = date('Y-m-d', strtotime('tomorrow', current_time('timestamp'))); if ($start_date == $today) { $li_classes .= ' ecs-today'; } else { if ($start_date == $tomorrow) { $li_classes .= ' ecs-tomorrow'; } } $output .= '<li class="' . $li_classes . '">'; // Put Values into $output foreach ($atts['contentorder'] as $contentorder) { switch (trim($contentorder)) { case 'title': $output .= '<h4 class="entry-title summary">' . '<a href="' . tribe_get_event_link() . '" rel="bookmark">' . apply_filters('ecs_event_list_title', get_the_title(), $atts) . '</a> </h4>'; break; case 'thumbnail': if (self::isValid($atts['thumb'])) { $thumbWidth = is_numeric($atts['thumbwidth']) ? $atts['thumbwidth'] : ''; $thumbHeight = is_numeric($atts['thumbheight']) ? $atts['thumbheight'] : ''; if (!empty($thumbWidth) && !empty($thumbHeight)) { $output .= get_the_post_thumbnail($post->ID, array($thumbWidth, $thumbHeight)); } else { $size = !empty($thumbWidth) && !empty($thumbHeight) ? array($thumbWidth, $thumbHeight) : 'medium'; if ($thumb = get_the_post_thumbnail($post->ID, $size)) { $output .= '<a href="' . tribe_get_event_link() . '">'; $output .= $thumb; $output .= '</a>'; } } } break; case 'excerpt': if (self::isValid($atts['excerpt'])) { $excerptLength = is_numeric($atts['excerpt']) ? $atts['excerpt'] : 100; $output .= '<p class="ecs-excerpt">' . self::get_excerpt($excerptLength) . '</p>'; } break; case 'date': if (self::isValid($atts['eventdetails'])) { $output .= '<span class="duration time">' . apply_filters('ecs_event_list_details', tribe_events_event_schedule_details(), $atts) . '</span>'; } break; case 'venue': if (self::isValid($atts['venue'])) { $output .= '<span class="duration venue">' . apply_filters('ecs_event_list_venue', ' <em>at</em> ' . tribe_get_venue(), $atts) . '</span>'; } break; } } $output .= '</li>'; } $output .= '</ul>'; if (self::isValid($atts['viewall'])) { $output .= '<span class="ecs-all-events"><a href="' . apply_filters('ecs_event_list_viewall_link', tribe_get_events_link(), $atts) . '" rel="bookmark">' . translate(apply_filters('ecs_event_list_viewall_text', 'View All Events', $atts), 'tribe-events-calendar') . '</a></span>'; } } else { //No Events were Found $output .= translate($atts['message'], 'tribe-events-calendar'); } // endif wp_reset_query(); return $output; }
* creating a venue for user submitted events. * * This is ALSO used in the Venue 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/venue.php * * @package TribeCommunityEvents * @since 2.1 * @author Modern Tribe Inc. * */ if (!defined('ABSPATH')) { die('-1'); } $venue_name = tribe_get_venue(); $venue_phone = tribe_get_phone(); $venue_address = tribe_get_address(); $venue_city = tribe_get_city(); $venue_province = tribe_get_province(); $venue_state = tribe_get_state(); $venue_country = tribe_get_country(); $venue_zip = tribe_get_zip(); if (!tribe_get_venue_id() && tribe_get_option('defaultValueReplace')) { $venue_phone = empty($venue_phone) ? tribe_get_option('eventsDefaultPhone') : $venue_phone; $venue_address = empty($venue_address) ? tribe_get_option('eventsDefaultAddress') : $venue_address; $venue_city = empty($venue_city) ? tribe_get_option('eventsDefaultCity') : $venue_city; $venue_state = empty($venue_state) ? tribe_get_option('eventsDefaultState') : $venue_state; $venue_province = empty($venue_province) ? tribe_get_option('eventsDefaultProvince') : $venue_province; $venue_country = empty($venue_country) ? tribe_get_option('defaultCountry') : $venue_country; $venue_zip = empty($venue_zip) ? tribe_get_option('eventsDefaultZip') : $venue_zip;
?> " value="<?php echo esc_attr($instance['venue_ID']); ?> "> <?php foreach ($venues as $venue) { ?> <option value="<?php echo esc_attr($venue->ID); ?> " <?php selected($venue->ID == $instance['venue_ID']); ?> > <?php echo tribe_get_venue($venue->ID); ?> </option> <?php } ?> </select> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('count')); ?> "><?php esc_html_e('Number of events to show:', 'tribe-events-calendar-pro'); ?> </label>
<dd class="vcard author"><span class="fn url"><?php echo tribe_get_organizer(); ?> </span></dd> </div><!-- end .row --> <?php } ?> <?php if (tribe_get_venue()) { ?> <div class="row"> <dt>Location:</dt> <dd><?php echo tribe_get_venue(get_the_ID(), true); ?> </dd> </div> <?php } ?> <?php if (tribe_get_organizer_phone()) { ?> <div class="row"> <dt>Phone:</dt> <dd><?php echo tribe_get_organizer_phone(); ?>
function dt_sc_events($atts, $content = null) { if (!function_exists('dt_events_list') && dttheme_is_plugin_active('the-events-calendar/the-events-calendar.php')) { extract(shortcode_atts(array('limit' => '-1', 'carousel' => ''), $atts)); global $post; $out = ''; $firstcnt = 2; $post_thumbnail = 'blogcourse-three-column'; $tpl_default_settings = get_post_meta(get_the_ID(), '_tpl_default_settings', TRUE); $tpl_default_settings = is_array($tpl_default_settings) ? $tpl_default_settings : array(); $page_layout = array_key_exists("layout", $tpl_default_settings) ? $tpl_default_settings['layout'] : "content-full-width"; if ($page_layout == 'with-left-sidebar' || $page_layout == 'with-right-sidebar') { $post_thumbnail .= '-single-sidebar'; } elseif ($page_layout == 'both-sidebar') { $post_thumbnail .= '-both-sidebar'; } if ($carousel == 'true') { $html_tag = 'li'; } else { $html_tag = 'div'; } $all_events = tribe_get_events(array('eventDisplay' => 'all', 'posts_per_page' => $limit)); $cnt = 0; foreach ($all_events as $post) { setup_postdata($post); $temp_class = $firstcls = ''; if ($carousel != 'true') { $no = $cnt + 1; if ($no % $firstcnt == 1) { $firstcls = ' first'; } } $out .= '<' . $html_tag . ' class="dt-sc-one-half column ' . $firstcls . '" id="post-' . get_the_ID() . '">'; $out .= '<div class="dt-sc-event-container">'; $out .= '<div class="dt-sc-event-thumb">'; $out .= '<a href="' . get_permalink() . '" title="' . get_the_title() . '">'; if (has_post_thumbnail()) { $attr = array('title' => get_the_title()); $out .= get_the_post_thumbnail($post->ID, $post_thumbnail, $attr); } else { $out .= '<img src="http://placehold.it/1170x895&text=Image" alt="' . get_the_title() . '" />'; } $out .= '</a>'; if (tribe_get_cost($post->ID) != '') { $currency_symbol = tribe_get_event_meta($post->ID, '_EventCurrencySymbol', true); if (!$currency_symbol) { $currency_symbol = tribe_get_option('defaultCurrencySymbol', '$'); } $currency_position = tribe_get_event_meta($post->ID, '_EventCurrencyPosition', true); $out .= '<span class="event-price">'; if ($currency_position == 'suffix') { $out .= tribe_get_cost($post->ID) . $currency_symbol; } else { $out .= $currency_symbol . tribe_get_cost($post->ID); } $out .= '</span>'; } $out .= '</div>'; $out .= '<div class="dt-sc-event-content">'; $out .= '<h2><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>'; $out .= '<div class="dt-sc-event-meta">'; $out .= '<p> <i class="fa fa-calendar-o"> </i>' . tribe_get_start_date($post->ID, false, 'M Y @ h a') . ' - ' . tribe_get_end_date($post->ID, false, 'M Y @ h a') . ' </p>'; $venue_id = tribe_get_venue_id($post->ID); if (isset($venue_id) && $venue_id > 0) { $url = esc_url(get_permalink($venue_id)); $venue_name = tribe_get_venue($post->ID); $out .= '<p> <i class="fa fa-map-marker"> </i>'; $out .= '<a href="' . $url . '">' . $venue_name . '</a>'; $out .= ', ' . tribe_get_country($post->ID); if (tribe_get_map_link() != '') { $out .= '<a href="' . tribe_get_map_link() . '" title="' . $venue_name . '" target="_blank">' . __(' + Google Map ', 'dt_themes') . '</a>'; } $out .= '</p>'; } $out .= '</div>'; $out .= '</div>'; $out .= '</div>'; $out .= '</' . $html_tag . '>'; $cnt++; } if ($carousel == 'true') { return '<div class="dt-sc-events-carousel-wrapper"><ul class="dt-sc-events-carousel">' . $out . '</ul><div class="carousel-arrows"><a class="events-prev" href=""></a><a class="events-next" href=""></a></div></div>'; } else { return $out; } } else { return ''; } }
</div> <?php } else { ?> <div><?php _e('All Day', 'church-event'); ?> </div> <?php } ?> <div>@ <?php if (class_exists('Tribe__Events__Pro__Templates__Single_Venue')) { tribe_get_venue_link($event->ID, true); } else { echo tribe_get_venue($event->ID); } ?> </div> </div> <?php if (!empty($read_more_text)) { ?> <a href="<?php tribe_event_link($event); ?> " title="<?php esc_attr($read_more_text); ?> " class="button button-border accent1 hover-accent1"><span class="btext"><?php echo $read_more_text;
<a href="<?php echo esc_url(tribe_get_events_link()); ?> " rel="bookmark"><?php printf(__('← Back to %s', 'tribe-events-calendar-pro'), tribe_get_event_label_plural()); ?> </a> </p> <div class="tribe-events-venue-meta tribe-clearfix"> <!-- Venue Title --> <?php do_action('tribe_events_single_venue_before_title'); ?> <h2 class="tribe-venue-name"><?php echo tribe_get_venue($venue_id); ?> </h2> <?php do_action('tribe_events_single_venue_after_title'); ?> <?php if (tribe_embed_google_map() && tribe_address_exists()) { ?> <!-- Venue Map --> <div class="tribe-events-map-wrap"> <?php echo tribe_get_embedded_map($venue_id, '100%', '200px'); ?> </div><!-- .tribe-events-map-wrap -->
function swsctp_class_column_mod() { if (class_exists('Jigsaw')) { Jigsaw::add_column('tribe_events', 'Instructor(s)', function ($post_id) { $tribe_events_inst1 = get_post_meta($post_id, '_tribe_events_inst1', TRUE); $tribe_events_inst2 = get_post_meta($post_id, '_tribe_events_inst2', TRUE); $tribe_events_inst3 = get_post_meta($post_id, '_tribe_events_inst3', TRUE); $tribe_events_inst1_stat = get_post_meta($post_id, '_tribe_events_inst1_stat', TRUE); $tribe_events_inst2_stat = get_post_meta($post_id, '_tribe_events_inst2_stat', TRUE); $tribe_events_inst3_stat = get_post_meta($post_id, '_tribe_events_inst3_stat', TRUE); $user_data1 = get_userdata($tribe_events_inst1); $user_data2 = get_userdata($tribe_events_inst2); $user_data3 = get_userdata($tribe_events_inst3); if ($user_data1->last_name !== null) { echo "<span class='tribe_inst {$tribe_events_inst1_stat}'>" . $user_data1->last_name . ", " . $user_data1->first_name . "</span>"; if ($user_data2->last_name !== null) { echo "<br><span class='tribe_inst {$tribe_events_inst2_stat}'>" . $user_data2->last_name . ", " . $user_data2->first_name . "</span>"; if ($user_data3->last_name !== null) { echo "<br><span class='tribe_inst {$tribe_events_inst3_stat}'>" . $user_data3->last_name . ", " . $user_data3->first_name . "</span>"; } } } else { echo "None Assigned"; } }, 2); Jigsaw::add_column('tribe_events', 'Status', function ($post_id) { $tribe_events_status = get_post_meta($post_id, '_tribe_events_status', TRUE); if ($tribe_events_status == "scheduled") { $status = "Scheduled"; } else { if ($tribe_events_status == "cancelled") { $status = "Cancelled"; } else { if ($tribe_events_status == "completed") { $status = "Completed"; } } } echo $status; }, 3); Jigsaw::add_column('tribe_events', 'Class Date', function ($post_id) { $class_date = tribe_get_start_date($post_id); echo $class_date; }, 4); Jigsaw::add_column('tribe_events', 'Location', function ($post_id) { $venue = tribe_get_venue($post_id); $location = tribe_get_full_address($post_id, true); echo $venue . "<br>" . $location; }, 5); Jigsaw::add_column('tribe_events', 'Date Added', function ($post_id) { $pfx_date = get_the_date('m/d/Y', $post_id); echo $pfx_date; }, 10); Jigsaw::remove_column('tribe_events', 'comments'); Jigsaw::remove_column('tribe_events', 'author'); Jigsaw::remove_column('tribe_events', 'feature'); Jigsaw::remove_column('tribe_events', 'image'); Jigsaw::remove_column('tribe_events', 'thumb'); Jigsaw::remove_column('tribe_events', 'thumbnail'); Jigsaw::remove_column('tribe_events', 'date'); Jigsaw::remove_column('tribe_events', 'start-date'); Jigsaw::remove_column('tribe_events', 'end-date'); Jigsaw::remove_column('tribe_events', 'tags'); } }
var myOptions = { zoom: <?php echo tribe_get_option('embedGoogleMapsZoom', '10'); ?> , center: event_address, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("tribe-events-gmap"), myOptions); var marker = new google.maps.Marker( { map: map, title: <?php echo json_encode(tribe_get_venue($postId)); ?> , position: event_address } ); } function codeAddress(address) { var geocoder= new google.maps.Geocoder(); var address = address || <?php echo json_encode($address); ?> ; geocoder.geocode( { 'address': address },
echo $post->post_title; ?> </a></h2> <?php if (tribe_get_cost()) { ?> <span class="tribe-mini-calendar-event-cost"><?php echo tribe_get_cost(null, true); ?> </span> <div class="tribe-events-divider ">|</div> <?php } ?> <?php echo tribe_events_event_schedule_details(); ?> <?php if (tribe_get_venue()) { ?> <div class="tribe-mini-calendar-event-venue"> <?php echo tribe_get_venue_link($post->ID); ?> </div> <?php } ?> </div> </div>
/** * Fetch and return required events. * @param array $atts shortcode attributes * @return string shortcode output */ public function ecs_fetch_events($atts) { /** * Check if events calendar plugin method exists */ if (!function_exists('tribe_get_events')) { return; } global $wp_query, $post; $output = ''; $atts = shortcode_atts(apply_filters('ecs_shortcode_atts', array('cat' => '', 'month' => '', 'limit' => 5, 'eventdetails' => 'true', 'time' => null, 'past' => null, 'venue' => 'false', 'author' => null, 'message' => 'There are no upcoming events at this time.', 'key' => 'End Date', 'order' => 'ASC', 'viewall' => 'false', 'excerpt' => 'false', 'thumb' => 'false', 'thumbwidth' => '', 'thumbheight' => '', 'contentorder' => apply_filters('ecs_default_contentorder', 'title, thumbnail, excerpt, date, venue', $atts), 'event_tax' => ''), $atts), $atts, 'ecs-list-events'); // Category if ($atts['cat']) { if (strpos($atts['cat'], ",") !== false) { $atts['cats'] = explode(",", $atts['cat']); $atts['cats'] = array_map('trim', $atts['cats']); } else { $atts['cats'] = $atts['cat']; } $atts['event_tax'] = array('relation' => 'OR', array('taxonomy' => 'tribe_events_cat', 'field' => 'name', 'terms' => $atts['cats']), array('taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => $atts['cats'])); } // Past Event $meta_date_compare = '>='; $meta_date_date = current_time('Y-m-d H:i:s'); if ($atts['time'] == 'past' || !empty($atts['past'])) { $meta_date_compare = '<'; } // Key if (str_replace(' ', '', trim(strtolower($atts['key']))) == 'startdate') { $atts['key'] = '_EventStartDate'; } else { $atts['key'] = '_EventEndDate'; } // Date $atts['meta_date'] = array(array('key' => $atts['key'], 'value' => $meta_date_date, 'compare' => $meta_date_compare, 'type' => 'DATETIME')); // Specific Month if ($atts['month'] == 'current') { $atts['month'] = date('Y-m'); } if ($atts['month']) { $month_array = explode("-", $atts['month']); $month_yearstr = $month_array[0]; $month_monthstr = $month_array[1]; $month_startdate = date("Y-m-d", strtotime($month_yearstr . "-" . $month_monthstr . "-01")); $month_enddate = date("Y-m-01", strtotime("+1 month", strtotime($month_startdate))); $atts['meta_date'] = array(array('key' => $atts['key'], 'value' => array($month_startdate, $month_enddate), 'compare' => 'BETWEEN', 'type' => 'DATETIME')); } $posts = tribe_get_events(apply_filters('ecs_get_events_args', array('post_status' => 'publish', 'hide_upcoming' => true, 'posts_per_page' => $atts['limit'], 'tax_query' => $atts['event_tax'], 'meta_key' => $atts['key'], 'orderby' => 'meta_value', 'author' => $atts['author'], 'order' => $atts['order'], 'meta_query' => array($atts['meta_date'])), $atts)); if ($posts) { $output .= apply_filters('ecs_start_tag', '<ul class="ecs-event-list">', $atts); $atts['contentorder'] = explode(',', $atts['contentorder']); foreach ($posts as $post) { setup_postdata($post); $output .= apply_filters('ecs_event_start_tag', '<li class="ecs-event">', $atts, $post); // Put Values into $output foreach (apply_filters('ecs_event_contentorder', $atts['contentorder'], $atts, $post) as $contentorder) { switch (trim($contentorder)) { case 'title': $output .= apply_filters('ecs_event_title_tag_start', '<h4 class="entry-title summary">', $atts, $post) . '<a href="' . tribe_get_event_link() . '" rel="bookmark">' . apply_filters('ecs_event_list_title', get_the_title(), $atts, $post) . '</a>' . apply_filters('ecs_event_title_tag_end', '</h4>', $atts, $post); break; case 'thumbnail': if (self::isValid($atts['thumb'])) { $thumbWidth = is_numeric($atts['thumbwidth']) ? $atts['thumbwidth'] : ''; $thumbHeight = is_numeric($atts['thumbheight']) ? $atts['thumbheight'] : ''; if (!empty($thumbWidth) && !empty($thumbHeight)) { $output .= apply_filters('ecs_event_thumbnail', get_the_post_thumbnail(get_the_ID(), apply_filters('ecs_event_thumbnail_size', array($thumbWidth, $thumbHeight), $atts, $post)), $atts, $post); } else { if ($thumb = get_the_post_thumbnail(get_the_ID(), apply_filters('ecs_event_thumbnail_size', 'medium', $atts, $post))) { $output .= apply_filters('ecs_event_thumbnail_link_start', '<a href="' . tribe_get_event_link() . '">', $atts, $post); $output .= apply_filters('ecs_event_thumbnail', $thumb, $atts, $post); $output .= apply_filters('ecs_event_thumbnail_link_end', '</a>', $atts, $post); } } } break; case 'excerpt': if (self::isValid($atts['excerpt'])) { $excerptLength = is_numeric($atts['excerpt']) ? $atts['excerpt'] : 100; $output .= apply_filters('ecs_event_excerpt_tag_start', '<p class="ecs-excerpt">', $atts, $post) . apply_filters('ecs_event_excerpt', self::get_excerpt($excerptLength), $atts, $post) . apply_filters('ecs_event_excerpt_tag_end', '</p>', $atts, $post); } break; case 'date': if (self::isValid($atts['eventdetails'])) { $output .= apply_filters('ecs_event_date_tag_start', '<span class="duration time">', $atts, $post) . apply_filters('ecs_event_list_details', tribe_events_event_schedule_details(), $atts, $post) . apply_filters('ecs_event_date_tag_end', '</span>', $atts, $post); } break; case 'venue': if (self::isValid($atts['venue'])) { $output .= apply_filters('ecs_event_venue_tag_start', '<span class="duration venue">', $atts, $post) . apply_filters('ecs_event_venue_at_tag_start', '<em> ', $atts, $post) . apply_filters('ecs_event_venue_at_text', __('at', 'the-events-calendar-shortcode'), $atts, $post) . apply_filters('ecs_event_venue_at_tag_end', ' </em>', $atts, $post) . apply_filters('ecs_event_list_venue', tribe_get_venue(), $atts, $post) . apply_filters('ecs_event_venue_tag_end', '</span>', $atts, $post); } break; case 'date_thumb': if (self::isValid($atts['eventdetails'])) { $output .= apply_filters('ecs_event_date_thumb', '<div class="date_thumb"><div class="month">' . tribe_get_start_date(null, false, 'M') . '</div><div class="day">' . tribe_get_start_date(null, false, 'j') . '</div></div>', $atts, $post); } break; default: $output .= apply_filters('ecs_event_list_output_custom', '', trim($contentorder), $atts, $post); } } $output .= apply_filters('ecs_event_end_tag', '</li>', $atts, $post); } $output .= apply_filters('ecs_end_tag', '</ul>', $atts); if (self::isValid($atts['viewall'])) { $output .= apply_filters('ecs_view_all_events_tag_start', '<span class="ecs-all-events">', $atts) . '<a href="' . apply_filters('ecs_event_list_viewall_link', tribe_get_events_link(), $atts) . '" rel="bookmark">' . translate('View All Events', 'tribe-events-calendar') . '</a>'; $output .= apply_filters('ecs_view_all_events_tag_end', '</span>'); } } else { //No Events were Found $output .= apply_filters('ecs_no_events_found_message', translate($atts['message'], 'tribe-events-calendar'), $atts); } // endif wp_reset_query(); return $output; }
/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $atts = shortcode_atts(array('categories' => "", 'items' => "3", 'paginate' => "no"), $atts, $this->config['shortcode']); $output = ""; $posts = $this->query_entries($atts); $entries = $posts->posts; if (class_exists('Tribe__Events__Pro__Main')) { $ecp = Tribe__Events__Pro__Main::instance(); $ecp->disable_recurring_info_tooltip(); } if (!empty($entries)) { global $post; $default_id = $post->ID; $output .= "<div class='av-upcoming-events " . $meta['el_class'] . "'>"; foreach ($entries as $entry) { $class = "av-upcoming-event-entry"; $image = get_the_post_thumbnail($entry->ID, 'square', array('class' => 'av-upcoming-event-image')); $class .= !empty($image) ? " av-upcoming-event-with-image" : " av-upcoming-event-without-image"; $title = get_the_title($entry->ID); $link = get_permalink($entry->ID); $post->ID = $entry->ID; //temp set of the post id so that tribe fetches the correct price symbol $price = tribe_get_cost($entry->ID, true); $venue = tribe_get_venue($entry->ID); $post->ID = $default_id; $output .= "<a href='{$link}' class='{$class}'>"; if ($image) { $output .= $image; } $output .= "<span class='av-upcoming-event-data'>"; $output .= "<h4 title='av-upcoming-event-title'>{$title}</h4>"; $output .= "<span class='av-upcoming-event-meta'>"; $output .= "<span class='av-upcoming-event-schedule'>" . tribe_events_event_schedule_details($entry) . "</span>"; if ($price) { $output .= "<span class='av-upcoming-event-cost'>{$price}</span>"; } if ($price && $venue) { $output .= " - "; } if ($venue) { $output .= "<span class='av-upcoming-event-venue'>{$venue}</span>"; } $output .= apply_filters('avf_upcoming_event_extra_data', "", $entry); $output .= "</span>"; $output .= "</span>"; $output .= "</a>"; } if ($atts['paginate'] == "yes" && ($avia_pagination = avia_pagination($posts->max_num_pages, 'nav'))) { $output .= "<div class='pagination-wrap pagination-" . Tribe__Events__Main::POSTTYPE . "'>{$avia_pagination}</div>"; } $output .= "</div>"; } if (class_exists('Tribe__Events__Pro__Main')) { // Re-enable recurring event info $ecp->enable_recurring_info_tooltip(); } return $output; }
?> <div class="time"><?php _e('All Day', 'church-event'); ?> </div> <?php } ?> <?php } ?> <?php if (class_exists('Tribe__Events__Pro__Templates__Single_Venue')) { tribe_get_venue_link($post->ID, true); } else { echo tribe_get_venue($post->ID); } ?> <br> <?php echo Tribe__Events__Main::instance()->fullAddress(); ?> </div> <?php if (tribe_get_cost()) { ?> <div class="wpv-single-event-schedule-block cost"> <?php echo wpv_shortcode_icon(array('name' => 'exit3')); ?> <?php
/** * @deprecated */ function sp_get_venue($postId = null) { _deprecated_function(__FUNCTION__, '2.0', 'tribe_get_venue()'); return tribe_get_venue($postId); }
/** * Get the venue name * * @param int $meta_id * @return string */ public static function venue_name($meta_id) { global $_tribe_meta_factory; $post_id = get_the_ID(); $name = tribe_get_venue($post_id); $venue_name = empty($name) ? '' : Tribe_Meta_Factory::template($_tribe_meta_factory->meta[$meta_id]['label'], $name, $meta_id); return apply_filters('tribe_event_meta_venue_name', $venue_name, $meta_id); }
?> <h1 class="page-title visually-hidden">Welcome to Seniors Outdoors!</h1> <div class="page-content"> <section class="featured"> <?php $found = false; $wp_query = new WP_Query('post_type=tribe_events'); if ($wp_query->have_posts()) { while ($wp_query->have_posts()) { $wp_query->the_post(); if (has_term('featured-event', 'tribe_events_cat') and !$found) { $other_info = get_field('other_info'); $venue = tribe_get_venue(); $found = true; ?> <h2 class="event-title purple-dark"><?php the_title(); ?> </h2> <p class="single-space"><?php echo $venue; ?> </p> <p><?php echo the_event_start_date(null, FALSE, 'l, F j'); ?> </p>
/** * Displays the saved venue * Used in the settings screen * * @author jkudish * @since 2.0.5 * @return void */ function tribe_display_saved_venue() { $current_venue_id = tribe_get_option('eventsDefaultVenueID', 'none'); $current_venue = $current_venue_id != 'none' && $current_venue_id != 0 && $current_venue_id ? tribe_get_venue($current_venue_id) : __('No default set', 'tribe-events-calendar-pro'); echo '<p class="tribe-field-indent tribe-field-description description">' . sprintf(__('The current default venue is: %s', 'tribe-events-calendar-pro'), '<strong>' . $current_venue . '</strong>') . '</p>'; }
/** * Venue Link * * Returns or display the event Venue Name with a link to the venue * * @param int $postId Can supply either event id or venue 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 * * @return string Venue if $display is set to false, void if it's set to true. */ function tribe_get_venue_link($postId = null, $full_link = true) { $ven_id = tribe_get_venue_id($postId); $url = esc_url_raw(get_permalink($ven_id)); if ($full_link) { $name = tribe_get_venue($ven_id); $attr_title = the_title_attribute(array('post' => $ven_id, 'echo' => false)); $link = !empty($url) && !empty($name) ? '<a href="' . esc_url($url) . '" title="' . $attr_title . '"">' . $name . '</a>' : false; } else { $link = $url; } return apply_filters('tribe_get_venue_link', $link, $postId, $full_link, $url); }
$website = tribe_get_venue_website_link(); ?> <div class="widget tribe-events-meta-group tribe-events-meta-group-venue"> <h3 class="widget-title special font-size-sm separator_align_left tribe-events-single-section-title"> <span><?php echo tribe_get_venue_label_singular(); ?> </span> </h3> <div class="widget-content"> <dl> <?php do_action('tribe_events_single_meta_venue_section_start'); ?> <dd class="author fn org"> <?php echo tribe_get_venue(); ?> </dd> <div class="clearfix"></div> <?php // Do we have an address? $address = tribe_address_exists() ? '<address class="tribe-events-address">' . tribe_get_full_address() . '</address>' : ''; // Do we have a Google Map link to display? $gmap_link = tribe_show_google_map_link() ? tribe_get_map_link_html() : ''; $gmap_link = apply_filters('tribe_event_meta_venue_address_gmap', $gmap_link); // Display if appropriate if (!empty($address)) { echo '<dd class="location">' . "{$address} {$gmap_link} </dd>"; echo '<div class="clearfix"></div>'; } ?>
<td class="tribe-events-event-meta-desc"><?php _e('Venue:', 'tribe-events-calendar'); ?> </td> <td class="tribe-events-event-meta-value" itemprop="name"> <?php if (class_exists('TribeEventsPro')) { ?> <?php tribe_get_venue_link(get_the_ID(), class_exists('TribeEventsPro')); ?> <?php } else { ?> <?php echo tribe_get_venue(get_the_ID()); ?> <?php } ?> </td> </tr> <?php } ?> <?php $phone = tribe_get_phone(); if (!empty($phone)) { ?> <tr> <td class="tribe-events-event-meta-desc"><?php