/**
  * 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;
 }
Example #2
0
 /**
  * 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;
 }
    /**
     * 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>
			';
        }
    }
Example #4
0
 /**
  * Fetches the JSON-LD data for this type of object
  *
  * @param  int|WP_Post|null $post The post/event
  * @param  array  $args
  * @return array
  */
 public function get_data($posts = null, $args = array())
 {
     $posts = $posts instanceof WP_Post ? array($posts) : (array) $posts;
     $return = array();
     foreach ($posts as $i => $post) {
         $data = parent::get_data($post, $args);
         // If we have an Empty data we just skip
         if (empty($data)) {
             continue;
         }
         // Fetch first key
         $post_id = key($data);
         // Fetch first Value
         $data = reset($data);
         $event_tz_string = get_post_meta($post_id, '_EventTimezone', true);
         $tz_mode = tribe_get_option('tribe_events_timezone_mode', 'event');
         $tz_string = $event_tz_string && $tz_mode === 'event' ? $event_tz_string : Tribe__Events__Timezones::wp_timezone_string();
         $data->startDate = Tribe__Events__Timezones::to_utc(tribe_get_start_date($post_id, true, Tribe__Date_Utils::DBDATETIMEFORMAT), $tz_string, 'c');
         $data->endDate = Tribe__Events__Timezones::to_utc(tribe_get_end_date($post_id, true, Tribe__Date_Utils::DBDATETIMEFORMAT), $tz_string, 'c');
         if (tribe_has_venue($post_id)) {
             $venue_id = tribe_get_venue_id($post_id);
             $venue_data = Tribe__Events__JSON_LD__Venue::instance()->get_data($venue_id);
             $data->location = reset($venue_data);
         }
         if (tribe_has_organizer($post_id)) {
             $organizer_id = tribe_get_organizer_id($post_id);
             $organizer_data = Tribe__Events__JSON_LD__Organizer::instance()->get_data($organizer_id);
             $data->organizer = reset($organizer_data);
         }
         $price = tribe_get_cost($post_id);
         $price = $this->normalize_price($price);
         if ('' !== $price) {
             // Manually Include the Price for non Event Tickets
             $data->offers = (object) array('@type' => 'Offer', 'price' => $price, 'url' => $data->url);
         }
         $return[$post_id] = $data;
     }
     return $return;
 }
Example #5
0
						<strong><?php 
esc_html_e('Start Date / Time:', 'the-events-calendar');
?>
</strong>
						<?php 
echo tribe_get_start_date($event_id, false, tribe_get_datetime_format(true));
?>
						<br />

						<strong><?php 
esc_html_e('End Date / Time:', 'the-events-calendar');
?>
</strong>
						<?php 
echo tribe_get_end_date($event_id, false, tribe_get_datetime_format(true));
if (tribe_has_venue($event_id)) {
    $venue_id = tribe_get_venue_id($event_id);
    ?>

							<div class="venue-name">
								<strong><?php 
    echo tribe_get_venue_label_singular();
    ?>
: </strong>
								<?php 
    echo tribe_get_venue($event_id);
    ?>
							</div>

							<div class="venue-address">
								<strong><?php 
    /**
     * Injects event meta data into the Attendees report
     */
    public function event_details_top($event_id)
    {
        if (Tribe__Events__Main::POSTTYPE !== get_post_type($event_id)) {
            return;
        }
        $url = null;
        if (tribe_has_venue($event_id)) {
            $venue_id = tribe_get_venue_id($event_id);
            $url = get_post_meta($venue_id, '_VenueURL', true);
            if ($url) {
                $url_path = @parse_url($url, PHP_URL_PATH);
                $display_url = @parse_url($url, PHP_URL_HOST);
                $display_url .= empty($url_path) && $url_path !== '/' ? '/&hellip;' : '';
                $display_url = apply_filters('tribe_venue_display_url', $display_url, $url, $venue_id);
            }
        }
        ?>
		<li>
			<strong><?php 
        esc_html_e('Start Date / Time:', 'event-tickets');
        ?>
</strong>
			<?php 
        echo tribe_get_start_date($event_id, false, tribe_get_datetime_format(true));
        ?>
		</li>

		<li>
			<strong><?php 
        esc_html_e('End Date / Time:', 'event-tickets');
        ?>
</strong>
			<?php 
        echo tribe_get_end_date($event_id, false, tribe_get_datetime_format(true));
        ?>
		</li>
		<?php 
        if (tribe_has_venue($event_id)) {
            ?>

			<li class="venue-name">
				<strong><?php 
            echo tribe_get_venue_label_singular();
            ?>
: </strong>
				<a href="<?php 
            echo get_edit_post_link($venue_id);
            ?>
" title="<?php 
            esc_html_e('Edit Venue', 'the-events-calendar');
            ?>
"><?php 
            echo tribe_get_venue($event_id);
            ?>
</a>
			</li>

			<li class="venue-address">
				<strong><?php 
            _e('Address:', 'the-events-calendar');
            ?>
 </strong>
				<?php 
            echo tribe_get_full_address($venue_id);
            ?>
			</li>

			<?php 
            if ($phone = tribe_get_phone($venue_id)) {
                ?>
				<li class="venue-phone">
					<strong><?php 
                echo esc_html(__('Phone:', 'the-events-calendar'));
                ?>
 </strong>
					<?php 
                echo esc_html($phone);
                ?>
				</li>
				<?php 
            }
            //end if
            if ($url) {
                ?>
				<li class="venue-url">
					<strong><?php 
                echo esc_html(__('Website:', 'the-events-calendar'));
                ?>
 </strong>
					<a target="_blank" href="<?php 
                echo esc_url($url);
                ?>
">
						<?php 
                echo esc_html($display_url);
                ?>
					</a>
				</li>
				<?php 
            }
            //end if
        }
    }
 if (get_post_meta($post->ID, 'furu_youtube', $single = true)) {
     $url = get_post_meta($post->ID, 'furu_youtube', $single = true);
     $url = $url ? str_replace("watch?", "", $url) : "";
     $url = $url ? preg_replace($replaceWords, "v/", $url) : "";
 }
 $taxonomy = strip_tags(get_the_term_list($post->ID, 'loctype'));
 $postId = $post->ID;
 $addressw = tribe_get_full_address([$includeVenueName = false]);
 $addresser = trim(preg_replace('/\\s\\s+/', '', $addressw));
 $addressers = preg_replace('/<\\/span>/', ' ', $addresser);
 $addressees = preg_replace('/<\\/abbr>/', ' ', $addressers);
 $coords = getCoordinatesFromAddress('105 Covington Street , Panama City Beach , FL 32408 United States');
 $lat = $coords->results[0]->geometry->location->lat;
 $long = $coords->results[0]->geometry->location->lng;
 $fullco = $lat . ',' . $long;
 if (tribe_has_venue()) {
     $results["places"][$key]["name"] = get_the_title();
     $results["places"][$key]["photo"] = sp_get_image();
     $results["places"][$key]["desc"] = get_the_excerpt();
     $results["places"][$key]["cater"] = 'events';
     $results["places"][$key]["coords"] = $fullco;
     $results["places"][$key]["permalink"] = get_post_meta($post->ID, 'cebo_outbound', $single = true);
     $results["places"][$key]["address"] = get_post_meta($post->ID, 'cebo_phone', $single = true);
     $results["places"][$key]["video"] = $url != null ? '<object style="height: 390px; width: 640px"><param name="movie" value="' . $url . '"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="' . $url . '" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="360"></object>' : null;
     $results["places"][$key]["deal"] = get_post_meta($post->ID, 'furu_hotdeal', $single = true);
     while ($img <= 20) {
         if (sp_get_image($img)) {
             $results["places"][$key]["images"][$img]["src"] = sp_get_image($img);
             $img++;
         } else {
             break;
						<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);
            }
        }
        ?>
						</td>

						<td><?php 
        echo TribeEventsAdminList::custom_columns('events-cats', $post->ID, false);
        ?>
</td>
Example #9
0
 /**
  * Gets the venue name and address on a single line
  *
  * @param int $event_id Event ID
  * @param boolean $link Whether or not to wrap the text in a venue link
  *
  * @return string
  */
 function tribe_get_venue_single_line_address($event_id, $link = true)
 {
     $venue = null;
     if (tribe_has_venue($event_id)) {
         $venue_id = tribe_get_venue_id($event_id);
         $venue_name = tribe_get_venue($event_id);
         $venue_url = tribe_get_venue_link($event_id, false);
         $venue_address = array('city' => tribe_get_city($event_id), 'stateprovince' => tribe_get_stateprovince($event_id), 'zip' => tribe_get_zip($event_id));
         /**
          * Filters the parts of a venue address
          *
          * @var array Array of address parts
          * @var int Event ID
          */
         $venue_address = apply_filters('tribe_events_venue_single_line_address_parts', $venue_address, $event_id);
         // get rid of blank elements
         $venue_address = array_filter($venue_address);
         $venue = $venue_name;
         $separator = _x(', ', 'Address separator', 'the-events-calendar');
         if ($venue_address) {
             $venue .= $separator . implode($separator, $venue_address);
         }
         if ($link && $venue_url) {
             $attr_title = the_title_attribute(array('post' => $venue_id, 'echo' => false));
             $venue = '<a href="' . esc_url($venue_url) . '" title="' . $attr_title . '">' . $venue . '</a>';
         }
     }
     /**
      * Filters the venue single-line address
      *
      * @var string Venue address line
      * @var int Event ID
      * @var boolean Whether or not the venue should be linked
      */
     return apply_filters('tribe_events_get_venue_single_line_address', $venue, $event_id, $link);
 }
Example #10
0
						<li>
							<strong><?php 
    esc_html_e('End Date / Time:', 'event-tickets');
    ?>
</strong>
							<?php 
    echo tribe_get_end_date($event_id, false, tribe_get_datetime_format(true));
    ?>
						</li>
					<?php 
}
?>

					<?php 
if (function_exists('tribe_has_venue') && tribe_has_venue($event_id)) {
    ?>

						<li class="venue-name">
							<strong><?php 
    echo tribe_get_venue_label_singular();
    ?>
: </strong>
							<a href="<?php 
    echo get_edit_post_link($venue_id);
    ?>
" title="<?php 
    esc_html_e('Edit Venue', 'event-tickets');
    ?>
"><?php 
    echo tribe_get_venue($event_id);