Пример #1
0
 /**
  * Formatted Date
  *
  * Returns formatted date
  *
  * @category Events
  * @param string $date        String representing the datetime, assumed to be UTC (relevant if timezone conversion is used)
  * @param bool   $display_time If true shows date and time, if false only shows date
  * @param string $date_format  Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php)
  *
  * @return string
  */
 function tribe_format_date($date, $display_time = true, $date_format = '')
 {
     if (!Tribe__Date_Utils::is_timestamp($date)) {
         $date = strtotime($date);
     }
     if ($date_format) {
         $format = $date_format;
     } else {
         $date_year = date('Y', $date);
         $cur_year = date('Y', current_time('timestamp'));
         // only show the year in the date if it's not in the current year
         $with_year = $date_year == $cur_year ? false : true;
         if ($display_time) {
             $format = tribe_get_datetime_format($with_year);
         } else {
             $format = tribe_get_date_format($with_year);
         }
     }
     $date = date_i18n($format, $date);
     /**
      * Deprecated tribe_event_formatted_date in 4.0 in favor of tribe_formatted_date. Remove in 5.0
      */
     $date = apply_filters('tribe_event_formatted_date', $date, $display_time, $date_format);
     return apply_filters('tribe_formatted_date', $date, $display_time, $date_format);
 }
Пример #2
0
						<strong><?php 
_e('Start Date / Time:', 'tribe-events-calendar');
?>
</strong>
						<?php 
echo tribe_get_start_date($event_id, false, tribe_get_datetime_format(true));
?>
						<br />

						<strong><?php 
_e('End Date / Time:', 'tribe-events-calendar');
?>
</strong>
						<?php 
echo tribe_get_end_date($event_id, false, tribe_get_datetime_format(true));
?>

						<?php 
// venue
$venue_id = tribe_get_venue_id($event_id);
if (!empty($venue_id)) {
    $venue = get_post($venue_id);
}
if (!empty($venue)) {
    ?>
							<br />
							<strong>
								<?php 
    echo tribe_get_venue_label_singular();
    ?>
Пример #3
0
		<div id="filters-wrap" class="postbox">
			<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, tribe_get_datetime_format(true)));
echo "<br/>";
echo sprintf('<strong>%s </strong> %s', esc_html(__('End Date / Time:', 'tribe-events-calendar')), tribe_get_end_date($event_id, false, tribe_get_datetime_format(true)));
$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/>";
Пример #4
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
        }
    }
Пример #5
0
 /**
  * Formatted Date
  *
  * Returns formatted date
  *
  * @param string $date
  * @param bool   $displayTime If true shows date and time, if false only shows date
  * @param string $dateFormat  Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php)
  *
  * @return string
  */
 function tribe_event_format_date($date, $displayTime = true, $dateFormat = '')
 {
     if (!TribeDateUtils::isTimestamp($date)) {
         $date = strtotime($date);
     }
     if ($dateFormat) {
         $format = $dateFormat;
     } else {
         $date_year = date('Y', $date);
         $cur_year = date('Y', current_time('timestamp'));
         // only show the year in the date if it's not in the current year
         $with_year = $date_year == $cur_year ? false : true;
         if ($displayTime) {
             $format = tribe_get_datetime_format($with_year);
         } else {
             $format = tribe_get_date_format($with_year);
         }
     }
     $date = date_i18n($format, $date);
     return apply_filters('tribe_event_formatted_date', $date, $displayTime, $dateFormat);
 }