예제 #1
2
 public final function generate_attendees_PDF($tickets_list)
 {
     $this->load_pdf_libraries();
     $pdf = new FPDF();
     $ecp = TribeEvents::instance();
     $pdf->AddFont('OpenSans', '', 'opensans.php');
     $pdf->AddFont('SteelFish', '', 'steelfish.php');
     $pdf->SetTitle('EventTicket');
     $pdf->SetAuthor('The Events Calendar');
     $pdf->SetCreator('The Events Calendar');
     $defaults = array('event_id' => 0, 'ticket_name' => '', 'holder_name' => '', 'order_id' => '', 'ticket_id' => '', 'security_code' => '');
     foreach ($tickets_list as $ticket) {
         $ticket = wp_parse_args($ticket, $defaults);
         $event = get_post($ticket['event_id']);
         $venue_id = tribe_get_venue_id($event->ID);
         $venue = !empty($venue_id) ? get_post($venue_id)->post_title : '';
         $address = tribe_get_address($event->ID);
         $zip = tribe_get_zip($event->ID);
         $state = tribe_get_stateprovince($event->ID);
         $city = tribe_get_city($event->ID);
         $pdf->AddPage();
         $pdf->SetDrawColor(28, 166, 205);
         $pdf->SetFillColor(28, 166, 205);
         $pdf->Rect(15, 10, 180, 34, 'F');
         $pdf->SetTextColor(255);
         $pdf->SetFont('OpenSans', '', 10);
         $pdf->SetXY(30, 15);
         $pdf->Write(5, __('EVENT NAME:', 'tribe-events-calendar'));
         $pdf->SetXY(30, 28);
         $pdf->SetFont('SteelFish', '', 53);
         $title = strtoupper(utf8_decode($event->post_title));
         $size = 53;
         while ($pdf->GetStringWidth($title) > 151) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $title);
         $pdf->SetTextColor(41);
         $pdf->SetFont('OpenSans', '', 10);
         $pdf->SetXY(30, 50);
         $pdf->Write(5, __('TICKET HOLDER:', 'tribe-events-calendar'));
         $pdf->SetXY(104, 50);
         $pdf->Write(5, __('LOCATION:', 'tribe-events-calendar'));
         $pdf->SetFont('SteelFish', '', 30);
         $pdf->SetXY(30, 59);
         $holder = strtoupper(utf8_decode($ticket['holder_name']));
         $size = 30;
         while ($pdf->GetStringWidth($holder) > 70) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $holder);
         $pdf->SetXY(104, 59);
         $venue = strtoupper(utf8_decode($venue));
         $size = 30;
         while ($pdf->GetStringWidth($venue) > 70) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $venue);
         $pdf->SetXY(104, 71);
         $address = strtoupper(utf8_decode($address));
         $size = 30;
         while ($pdf->GetStringWidth($address) > 70) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $address);
         $pdf->SetXY(104, 83);
         $address2 = array($city, $state, $zip);
         $address2 = array_filter($address2);
         $address2 = join(', ', $address2);
         $address2 = strtoupper(utf8_decode($address2));
         $size = 30;
         while ($pdf->GetStringWidth($address2) > 70) {
             $size--;
             $pdf->SetFontSize($size);
         }
         $pdf->Write(5, $address2);
         $pdf->Line(15, 97, 195, 97);
         $pdf->SetFont('OpenSans', '', 10);
         $pdf->SetXY(30, 105);
         $pdf->Write(5, __('ORDER:', 'tribe-events-calendar'));
         $pdf->SetXY(80, 105);
         $pdf->Write(5, __('TICKET:', 'tribe-events-calendar'));
         $pdf->SetXY(120, 105);
         $pdf->Write(5, __('VERIFICATION:', 'tribe-events-calendar'));
         $pdf->SetFont('SteelFish', '', 53);
         $pdf->SetXY(30, 118);
         $pdf->Write(5, $ticket['order_id']);
         $pdf->SetXY(80, 118);
         $pdf->Write(5, $ticket['ticket_id']);
         $pdf->SetXY(120, 118);
         $pdf->Write(5, $ticket['security_code']);
         $pdf->Rect(15, 135, 180, 15, 'F');
         $pdf->SetTextColor(255);
         $pdf->SetFont('OpenSans', '', 10);
         $pdf->SetXY(30, 140);
         $pdf->Write(5, get_bloginfo('name'));
         $pdf->SetXY(104, 140);
         $pdf->Write(5, get_home_url());
     }
     $upload_path = wp_upload_dir();
     $upload_url = $upload_path['url'];
     $upload_path = $upload_path['path'];
     $filename = wp_unique_filename($upload_path, sanitize_file_name(md5(time())) . '.pdf');
     $upload_path = trailingslashit($upload_path) . $filename;
     $upload_url = trailingslashit($upload_url) . $filename;
     $pdf->Output($upload_path, 'F');
     return array($upload_path, $upload_url);
 }
 function wpv_tribe_single_gmap()
 {
     $the_id = tribe_get_venue_id($GLOBALS['wpv_single_event_id']);
     $the_address = Tribe__Events__Main::instance()->fullAddressString($the_id);
     if (get_post_meta($GLOBALS['wpv_single_event_id'], '_EventShowMap', true) == '1') {
         echo WPV_Gmap::shortcode(array('address' => $the_address, 'height' => 500, 'html' => $the_address, 'popup' => true, 'scrollwheel' => false));
     }
 }
    /**
     * 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>
			';
        }
    }
예제 #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;
 }
예제 #5
0
 /**
  * Google Map Embed
  *
  * Returns an embedded google maps for an event
  *
  * @param string $postId 
  * @param int $width 
  * @param int $height
  * @param bool $force_load If true, then load the map even if an address is not provided.
  * @return string An iframe pulling http://maps.google.com/ for this event
  * @since 2.0
  */
 function tribe_get_embedded_map($postId = null, $width = '', $height = '', $force_load = false)
 {
     $postId = TribeEvents::postIdHelper($postId);
     if (!tribe_is_venue($postId) && !tribe_is_event($postId)) {
         return false;
     }
     $postId = tribe_is_venue($postId) ? $postId : tribe_get_venue_id($postId);
     $locationMetaSuffixes = array('address', 'city', 'state', 'province', 'zip', 'country');
     $toUrlEncode = "";
     foreach ($locationMetaSuffixes as $val) {
         $metaVal = call_user_func('tribe_get_' . $val);
         if ($metaVal) {
             $toUrlEncode .= $metaVal . " ";
         }
     }
     if ($toUrlEncode) {
         $address = $toUrlEncode;
     } else {
         $address = null;
     }
     if (!$height) {
         $height = tribe_get_option('embedGoogleMapsHeight', '350');
     }
     if (!$width) {
         $width = tribe_get_option('embedGoogleMapsWidth', '100%');
     }
     if ($address || $force_load) {
         ob_start();
         include TribeEvents::instance()->pluginPath . 'admin-views/event-map.php';
         $google_map = ob_get_contents();
         ob_get_clean();
         return $google_map;
     } else {
         return '';
     }
 }
 /**
  * Generates and returns a set of classes for the current day
  *
  * @param  string $classes = ''
  *
  * @return string Classes
  */
 public function event_classes($classes = '')
 {
     $day = self::get_current_day();
     if (!isset($day['events'])) {
         return $classes;
     }
     $post = $day['events']->post;
     // Get our wrapper classes (for event categories, organizer, venue, and defaults)
     $classes = array();
     $tribe_cat_slugs = tribe_get_event_cat_slugs($post->ID);
     foreach ($tribe_cat_slugs as $tribe_cat_slug) {
         $classes[] = 'tribe-events-category-' . $tribe_cat_slug;
     }
     $classes = array_merge($classes, get_post_class('', $post->ID));
     if ($venue_id = tribe_get_venue_id($post->ID)) {
         $classes[] = 'tribe-events-venue-' . $venue_id;
     }
     foreach (tribe_get_organizer_ids($post->ID) as $organizer_id) {
         $classes[] = 'tribe-events-organizer-' . $organizer_id;
     }
     if ($day['events']->current_post + 1 == $day['events']->post_count) {
         $classes[] = 'tribe-events-last';
     }
     return $classes;
 }
예제 #7
0
			<h3 title="Click to toggle"><?php 
_e('Event Summary', 'tribe-events-calendar');
?>
</h3>



			<table class="eventtable ticket_list">
				<tr>
					<td width="33%" valign="top">
						<?php 
echo sprintf('<h4>%s</h4>', esc_html(__('Event Details', 'tribe-events-calendar')));
echo sprintf('<strong>%s </strong> %s', esc_html(__('Start Date / Time:', 'tribe-events-calendar')), tribe_get_start_date($event_id, false, get_option('date_format') . ' ' . get_option('time_format')));
echo "<br/>";
echo sprintf('<strong>%s </strong> %s', esc_html(__('End Date / Time:', 'tribe-events-calendar')), tribe_get_end_date($event_id, false, get_option('date_format') . ' ' . get_option('time_format')));
$venue_id = tribe_get_venue_id($event_id);
if (!empty($venue_id)) {
    $venue = get_post($venue_id);
}
if (!empty($venue)) {
    echo "<br/>";
    echo sprintf('<strong>%s </strong> %s', esc_html(__('Venue:', 'tribe-events-calendar')), esc_html($venue->post_title));
    $phone = get_post_meta($venue_id, '_VenuePhone', true);
    if (!empty($phone)) {
        echo "<br/>";
        echo sprintf('<strong>%s </strong> %s', esc_html(__('Phone:', 'tribe-events-calendar')), esc_html($phone));
    }
    $website = get_post_meta($venue_id, '_VenueURL', true);
    if (!empty($website)) {
        echo "<br/>";
        echo sprintf('<strong>%s </strong> <a target="_blank" href="%s">%s</a>', esc_html(__('Website:', 'tribe-events-calendar')), esc_url($website), esc_html($website));
예제 #8
0
 /**
  * Get the link for the venue website.
  *
  * @param null $post_id
  * @param null $label
  *
  * @return string Formatted link to the venue website
  */
 function tribe_get_venue_website_link($post_id = null, $label = null)
 {
     $post_id = tribe_get_venue_id($post_id);
     $url = tribe_get_event_meta($post_id, '_VenueURL', true);
     if (!empty($url)) {
         $label = is_null($label) ? $url : $label;
         if (!empty($url)) {
             $parseUrl = parse_url($url);
             if (empty($parseUrl['scheme'])) {
                 $url = "http://{$url}";
             }
         }
         $html = sprintf('<a href="%s" target="%s">%s</a>', esc_url($url), apply_filters('tribe_get_venue_website_link_target', 'self'), apply_filters('tribe_get_venue_website_link_label', $label));
     } else {
         $html = '';
     }
     return apply_filters('tribe_get_venue_website_link', $html);
 }
 protected function get_ids($post_id)
 {
     $post_id = $post_id = Tribe__Events__Main::postIdHelper($post_id);
     $this->event_id = tribe_is_event($post_id) ? $post_id : 0;
     $this->venue_id = tribe_is_venue($post_id) ? $post_id : tribe_get_venue_id($post_id);
 }
예제 #10
0
 /**
  * @deprecated
  */
 function sp_has_venue($postId = null)
 {
     _deprecated_function(__FUNCTION__, '2.0', 'tribe_get_venue_id()');
     return tribe_get_venue_id($postId);
 }
 /**
  * Generates the array of markers to pin the events in the Google Map embed in the map view
  *
  * @param $events
  *
  * @return array
  */
 private function generate_markers($events)
 {
     $markers = array();
     foreach ($events as $event) {
         $venue_id = tribe_get_venue_id($event->ID);
         $lat = get_post_meta($venue_id, self::LAT, true);
         $lng = get_post_meta($venue_id, self::LNG, true);
         $address = tribe_get_address($event->ID);
         $title = $event->post_title;
         $link = get_permalink($event->ID);
         // replace commas with decimals in case they were saved with the european number format
         $lat = str_replace(',', '.', $lat);
         $lng = str_replace(',', '.', $lng);
         $markers[] = array('lat' => $lat, 'lng' => $lng, 'title' => $title, 'address' => $address, 'link' => $link, 'venue_id' => $venue_id, 'event_id' => $event->ID);
     }
     return $markers;
 }
예제 #12
0
 /**
  * Returns the venue website URL related to the current post or for the optionally
  * specified post.
  *
  * @param int|null $post_id
  *
  * @return string
  */
 function tribe_get_venue_website_url($post_id = null)
 {
     return (string) tribe_get_event_meta(tribe_get_venue_id($post_id), '_VenueURL', true);
 }
*/
// the query
global $post;
$venues = tribe_get_venues();
?>
<h2>Venues</h2>
<?php 
foreach ($venues as $post) {
    setup_postdata($post);
    ?>

	<p><?php 
    the_title();
    ?>
:  <?php 
    echo tribe_get_venue_id();
    ?>
</p>

	<?php 
}
$organizers = tribe_get_organizers();
?>
<h2>Organizers</h2>
<?php 
foreach ($organizers as $post) {
    setup_postdata($post);
    ?>

	<p><?php 
    the_title();
/**
 * Return Venue Description
 *
 * @param int|null $venue_id (optional)
 * @return string
 * @author Peter Chester
 * @since 3.1
 */
function tribe_community_events_get_venue_description($venue_id = null)
{
    $venue_id = tribe_get_venue_id($venue_id);
    $description = $venue_id > 0 ? get_post($venue_id)->post_content : null;
    return apply_filters('tribe_get_venue_description', $description);
}
예제 #15
0
 /**
  * css event wrapper classes used during loop
  *
  * @since  3.0
  * @author tim@imaginesimplicty.com
  * @return void
  */
 function event_classes()
 {
     if (self::$loop_type == 'allday') {
         $event = self::get_allday_event();
     } else {
         $event = self::get_hourly_event();
     }
     // Get our wrapper classes (for event categories, organizer, venue, and defaults)
     echo 'hentry vevent type-tribe_events post-' . $event->ID, ' tribe-clearfix ';
     // we need to adjust on behalf of weekly span scripts
     $day_span_length = $event->days_between + 1;
     if ($day_span_length > 0) {
         echo 'tribe-dayspan' . $day_span_length . ' ';
     }
     // if we have a venue add the class
     if ($venue_id = tribe_get_venue_id($event->ID)) {
         'tribe-events-venue-' . $venue_id . ' ';
     }
     // if we have an organizer add the class
     if ($organizer_id = tribe_get_organizer_id($event->ID)) {
         $classes[] = 'tribe-events-organizer-' . $organizer_id . ' ';
     }
     // add classes for all assigned categories
     $tribe_cat_slugs = tribe_get_event_cat_slugs($event->ID);
     foreach ($tribe_cat_slugs as $tribe_cat_slug) {
         echo 'tribe-events-category-' . $tribe_cat_slug . ' ';
     }
     if (self::$loop_type == 'hourly' && strtotime(self::$prior_event_date->EventStartDate) < strtotime($event->EventStartDate)) {
         echo 'tribe-event-overlap ';
     }
     self::$prior_event_date->EventStartDate = $event->EventStartDate;
 }
 /**
  * Generates the array of markers to pin the events in the Google Map embed in the map view
  *
  * @param $events
  *
  * @return array
  */
 private function generate_markers($events)
 {
     $markers = array();
     foreach ($events as $event) {
         $venue_id = tribe_get_venue_id($event->ID);
         $lat = get_post_meta($venue_id, self::LAT, true);
         $lng = get_post_meta($venue_id, self::LNG, true);
         $address = tribe_get_address($event->ID);
         $title = $event->post_title;
         $link = get_permalink($event->ID);
         $markers[] = array('lat' => $lat, 'lng' => $lng, 'title' => $title, 'address' => $address, 'link' => $link);
     }
     return $markers;
 }
예제 #17
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);
 }
예제 #18
0
						<?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>

						<?php 
예제 #19
0
파일: venue.php 프로젝트: mpaskew/isc-dev
 /**
  * Venue Phone Number
  *
  * Returns the venue phone number
  *
  * @param int $postId Can supply either event id or venue id, if none specified, current post is used
  * @return string Phone number
  * @since 2.0
  */
 function tribe_get_phone($postId = null)
 {
     $postId = tribe_get_venue_id($postId);
     $output = esc_html(tribe_get_event_meta($postId, '_VenuePhone', true));
     return $output;
 }
예제 #20
0
 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 '';
     }
 }
예제 #21
0
 /**
  * Generates the array of markers to pin the events in the Google Map embed in the map view
  *
  * @param $events
  *
  * @return array
  */
 public function generate_markers($events)
 {
     $markers = array();
     // let's track which recurrence venues have already been marked
     $already_marked = array();
     foreach ($events as $event) {
         $venue_id = tribe_get_venue_id($event->ID);
         $lat = get_post_meta($venue_id, self::LAT, true);
         $lng = get_post_meta($venue_id, self::LNG, true);
         $address = tribe_get_address($event->ID);
         $title = $event->post_title;
         $link = get_permalink($event->ID);
         // let's keep track of the post ID/address combos that we've set markers for. If we get a
         // duplicate (a recurrence post with the same address), let's skip it.
         $location_id_hash = md5($address . ($event->post_parent ? $event->post_parent : $event->ID));
         if (!empty($already_marked[$location_id_hash])) {
             continue;
         }
         $already_marked[$location_id_hash] = true;
         // replace commas with decimals in case they were saved with the european number format
         $lat = str_replace(',', '.', $lat);
         $lng = str_replace(',', '.', $lng);
         $markers[] = array('lat' => $lat, 'lng' => $lng, 'title' => $title, 'address' => $address, 'link' => $link, 'venue_id' => $venue_id, 'event_id' => $event->ID);
     }
     return $markers;
 }
예제 #22
0
			<?php 
$count = 0;
$break = '';
foreach ($tickets as $ticket) {
    $count++;
    if ($count == 2) {
        $break = 'page-break-before: always !important;';
    }
    $event = get_post($ticket['event_id']);
    $header_id = Tribe__Events__Tickets__Tickets_Pro::instance()->get_header_image_id($ticket['event_id']);
    $header_img = false;
    if (!empty($header_id)) {
        $header_img = wp_get_attachment_image_src($header_id, 'full');
    }
    $venue_id = tribe_get_venue_id($event->ID);
    if (!empty($venue_id)) {
        $venue = get_post($venue_id);
    }
    $venue_name = $venue_phone = $venue_address = $venue_city = $venue_web = '';
    if (!empty($venue)) {
        $venue_name = $venue->post_title;
        $venue_phone = get_post_meta($venue_id, '_VenuePhone', true);
        $venue_address = get_post_meta($venue_id, '_VenueAddress', true);
        $venue_city = get_post_meta($venue_id, '_VenueCity', true);
        $venue_web = get_post_meta($venue_id, '_VenueURL', true);
    }
    ?>

			<table class="content" align="center" width="620" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" style="margin:0 auto; padding:0;<?php 
    echo $break;
예제 #23
0
파일: slide.php 프로젝트: aguidetta/Enduris
 /**
  * Process event calendar tags
  */
 private function process_the_events_calendar_tags($content)
 {
     if (!function_exists('tribe_get_start_date')) {
         return $content;
     }
     // The Events Calendar
     $event_date_format = get_option('date_format');
     $event_time_format = get_option('time_format');
     $event_all_day = get_post_meta(get_the_ID(), '_EventAllDay', true);
     $event_start_date = tribe_get_start_date(get_the_ID(), false, $event_date_format);
     $event_start_time = tribe_get_start_date(get_the_ID(), false, $event_time_format);
     $event_end_date = tribe_get_end_date(get_the_ID(), false, $event_date_format);
     $event_end_time = tribe_get_end_date(get_the_ID(), false, $event_time_format);
     $separator = apply_filters("metaslider_tribe_separator", " - ");
     if ($event_all_day) {
         if ($event_start_date == $event_end_date) {
             $event_string = $event_start_date;
         } else {
             $event_string = $event_start_date . $separator . $event_end_date;
         }
     } else {
         if ($event_start_date == $event_end_date) {
             $event_string = $event_start_date . " " . $event_start_time . $separator . $event_end_time;
         } else {
             $event_string = $event_start_date . $separator . $event_end_date;
         }
     }
     $content = str_replace("{event_date}", $event_string, $content);
     $content = str_replace("{event_start_date}", $event_start_date, $content);
     $content = str_replace("{event_start_time}", $event_start_time, $content);
     $content = str_replace("{event_end_time}", $event_end_time, $content);
     $content = str_replace("{event_end_date}", $event_end_date, $content);
     $content = str_replace("{event_address}", tribe_get_address(get_the_ID()), $content);
     $content = str_replace("{event_city}", tribe_get_city(get_the_ID()), $content);
     $content = str_replace("{event_country}", tribe_get_country(get_the_ID()), $content);
     $content = str_replace("{event_full_address}", tribe_get_full_address(get_the_ID()), $content);
     $content = str_replace("{event_phone}", tribe_get_phone(get_the_ID()), $content);
     $content = str_replace("{event_province}", tribe_get_province(get_the_ID()), $content);
     $content = str_replace("{event_region}", tribe_get_region(get_the_ID()), $content);
     $content = str_replace("{event_state}", tribe_get_state(get_the_ID()), $content);
     $content = str_replace("{event_stateprovince}", tribe_get_stateprovince(get_the_ID()), $content);
     $content = str_replace("{event_venue}", tribe_get_venue(get_the_ID()), $content);
     $content = str_replace("{event_venue_id}", tribe_get_venue_id(get_the_ID()), $content);
     $content = str_replace("{event_venue_link}", tribe_get_venue_link(get_the_ID(), false), $content);
     $content = str_replace("{event_zip}", tribe_get_zip(get_the_ID()), $content);
     return $content;
 }
예제 #24
0
파일: general.php 프로젝트: TMBR/johnjohn
 /**
  * Prints out or returns classes on an event wrapper
  *
  * @category Events
  * @param $event |0 post id or object
  * @param $echo  |true
  *
  * @return void or string
  **/
 function tribe_events_event_classes($event = 0, $echo = true)
 {
     global $post, $wp_query;
     // May be called when the global $post object does not exist - ie during ajax loads of various views
     // ... creating a dummy object allows the method to proceed semi-gracefully (interim measure only)
     //If $post object doesn't exist and an $event_id wasn't specified, then use a dummy object
     if (is_a('WP_Post', $event)) {
         $event_id = $event->ID;
     } elseif ($event !== 0) {
         $event_id = $event;
     } else {
         $event_id = $post->ID;
     }
     if (!$event_id) {
         return '';
     }
     $classes = array('hentry', 'vevent', 'type-tribe_events', 'post-' . $event_id, 'tribe-clearfix');
     $tribe_cat_slugs = tribe_get_event_cat_slugs($event_id);
     foreach ($tribe_cat_slugs as $tribe_cat_slug) {
         if (!empty($tribe_cat_slug)) {
             $classes[] = 'tribe-events-category-' . $tribe_cat_slug;
         }
     }
     if ($venue_id = tribe_get_venue_id($event_id)) {
         $classes[] = 'tribe-events-venue-' . $venue_id;
     }
     if ($organizer_id = tribe_get_organizer_id($event_id)) {
         $classes[] = 'tribe-events-organizer-' . $organizer_id;
     }
     // added first class for css
     if ($wp_query->current_post == 0 && !tribe_is_day()) {
         $classes[] = 'tribe-events-first';
     }
     // added last class for css
     if ($wp_query->current_post == $wp_query->post_count - 1) {
         $classes[] = 'tribe-events-last';
     }
     $classes = apply_filters('tribe_events_event_classes', $classes);
     if ($echo) {
         echo implode(' ', $classes);
     } else {
         return implode(' ', $classes);
     }
 }
예제 #25
0
    /**
     * 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
        }
    }
 /**
  * Add classes to events on this view
  *
  * @return array
  * @author Jessica Yazbek
  * @since 3.0
  **/
 public function event_classes($classes)
 {
     global $post, $wp_query;
     $classes = array_merge($classes, array('hentry', 'vevent', 'type-tribe_events', 'post-' . $post->ID, 'tribe-clearfix'));
     $tribe_cat_slugs = tribe_get_event_cat_slugs($post->ID);
     foreach ($tribe_cat_slugs as $tribe_cat_slug) {
         $classes[] = 'tribe-events-category-' . $tribe_cat_slug;
     }
     if ($venue_id = tribe_get_venue_id($post->ID)) {
         $classes[] = 'tribe-events-venue-' . $venue_id;
     }
     if ($organizer_id = tribe_get_organizer_id($post->ID)) {
         $classes[] = 'tribe-events-organizer-' . $organizer_id;
     }
     // added first class for css
     if ($wp_query->current_post == 0 && !tribe_is_day()) {
         $classes[] = 'tribe-events-first';
     }
     // added last class for css
     if ($wp_query->current_post == $wp_query->post_count - 1) {
         $classes[] = 'tribe-events-last';
     }
     return $classes;
 }
예제 #27
0
파일: venue.php 프로젝트: donwea/nhap.org
 * @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;
}
if (!isset($event)) {
    $event = null;
}
?>

<!-- Venue -->
<div class="tribe-events-community-details eventForm bubble" id="event_venue">
예제 #28
0
<?php

/**
 * Single Event Meta (Venue) Template
 *
 * Override this template in your own theme by creating a file at:
 * [your-theme]/tribe-events/modules/meta/venue.php
 *
 * @package TribeEventsCalendar
 */
if (!tribe_get_venue_id()) {
    return;
}
$phone = tribe_get_phone();
$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();
?>
$time_range_separator = tribe_get_option('timeRangeSeparator', ' - ');
$start_datetime = tribe_get_start_date();
$start_date = tribe_get_start_date(null, false);
$start_time = tribe_get_start_date(null, false, $time_format);
$start_ts = tribe_get_start_date(null, false, Tribe__Events__Date_Utils::DBDATEFORMAT);
$end_datetime = tribe_get_end_date();
$end_date = tribe_get_end_date(null, false);
$end_time = tribe_get_end_date(null, false, $time_format);
$end_ts = tribe_get_end_date(null, false, Tribe__Events__Date_Utils::DBDATEFORMAT);
$cost = tribe_get_formatted_cost();
$website = tribe_get_event_website_link();
?>


<div class="<?php 
if (tribe_get_venue_id() == 0) {
    echo 'col-md-12';
} else {
    echo 'col-md-6';
}
?>
 tribe-events-meta-group tribe-events-meta-group-details">
	<div class="horizontal-line-holder">
		<h3 class="tribe-events-single-section-title"> <?php 
_e('Details', 'tribe-events-calendar');
?>
 </h3>
	</div>
	<dl>

		<?php