View difference between Paste ID: vnMRz7TY and XxpzsjBS
SHOW: | | - or go back to the newest paste.
1
<?php
2
/**
3
* A single event.  This displays the event title, description, meta, and 
4
* optionally, the Google map for the event.
5
*
6
* You can customize this view by putting a replacement file of the same name (single.php) in the events/ directory of your theme.
7
*/
8
9
// Don't load directly
10
if ( !defined('ABSPATH') ) { die('-1'); }
11
global $wootickets_pricing;
12
global $wootickets_no_show;
13
$wootickets_no_show = true;
14
?>
15
16
<span class="back"><a href="<?php echo tribe_get_events_link(); ?>"><?php _e('&laquo; Back to Events', 'tribe-events-calendar'); ?></a></span>				
17
<?php
18
	$gmt_offset = (get_option('gmt_offset') >= '0' ) ? ' +' . get_option('gmt_offset') : " " . get_option('gmt_offset');
19
 	$gmt_offset = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $gmt_offset );
20
 	if (strtotime( tribe_get_end_date(get_the_ID(), false, 'Y-m-d G:i') . $gmt_offset ) <= time() ) { ?><div class="event-passed"><?php  _e('This event has passed.', 'tribe-events-calendar'); ?></div><?php } ?>
21
<div id="tribe-events-event-meta" itemscope itemtype="http://schema.org/Event">
22
23
<div class="eventscolumns"> <!-- our own wrapper -->
24
	<dl class="column">
25
		<dt class="event-label event-label-name"><?php _e('Event:', 'tribe-events-calendar'); ?></dt>
26
		<dd itemprop="name" class="event-meta event-meta-name"><span class="summary"><?php the_title(); ?></span></dd>
27
		<?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?>
28
			<dt class="event-label event-label-start"><?php _e('Start:', 'tribe-events-calendar'); ?></dt> 
29
			<dd class="event-meta event-meta-start"><meta itemprop="startDate" content="<?php echo tribe_get_start_date( null, false, 'Y-m-d-h:i:s' ); ?>"/><?php echo tribe_get_start_date(); ?></dd>
30
			<dt class="event-label event-label-end"><?php _e('End:', 'tribe-events-calendar'); ?></dt>
31
			<dd class="event-meta event-meta-end"><meta itemprop="endDate" content="<?php echo tribe_get_end_date( null, false, 'Y-m-d-h:i:s' ); ?>"/><?php echo tribe_get_end_date(); ?></dd>						
32
		<?php } else { ?>
33
			<dt class="event-label event-label-date"><?php _e('Date:', 'tribe-events-calendar'); ?></dt> 
34
			<dd class="event-meta event-meta-date"><meta itemprop="startDate" content="<?php echo tribe_get_start_date( null, false, 'Y-m-d-h:i:s' ); ?>"/><?php echo tribe_get_start_date(); ?></dd>
35
		<?php } ?>
36
        
37
        <?php if(tribe_get_venue()) : ?>
38
		<dt class="event-label event-label-venue"><?php _e('Venue:', 'tribe-events-calendar'); ?></dt> 
39
		<dd itemprop="name" class="event-meta event-meta-venue">
40
			<?php if( class_exists( 'TribeEventsPro' ) ): ?>
41
				<?php tribe_get_venue_link( get_the_ID(), class_exists( 'TribeEventsPro' ) ); ?>
42
			<?php else: ?>
43
				<?php echo tribe_get_venue( get_the_ID() ); ?>
44
			<?php endif; ?>
45
		</dd>
46
		<?php endif; ?>
47
        
48
        
49
                   <!-- Lets try grabbing the Location City -->
50
                   <?php
51
				$city = tribe_get_city();
52
				if ( !empty( $city ) ) :
53
			?>
54
                    <dt class="event-label event-label-city"><?php _e('Location:', 'tribe-events-calendar'); ?></dt>
55
                    <dd itemprop="city" class="event-meta event-meta-venue">
56
						<?php echo $city; ?>
57
					</dd>
58
					<?php endif; ?>
59
                    <!-- tribe_get_city -->
60
                    
61
                    
62
           <?php if( tribe_address_exists( get_the_ID() ) ) : ?>
63
		<dt class="event-label event-label-address">
64
			<?php _e('Addressley:', 'tribe-events-calendar') ?><br />
65
			<?php if( tribe_show_google_map_link( get_the_ID() ) ) : ?>
66
				<a class="gmap" itemprop="maps" href="<?php echo tribe_get_map_link(); ?>" title="<?php _e('Click to view a Google Map', 'tribe-events-calendar'); ?>" target="_blank"><?php _e('Google Map', 'tribe-events-calendar' ); ?></a>
67
			<?php endif; ?>
68
		</dt>
69
			<dd class="event-meta event-meta-address">
70
			<?php echo tribe_get_full_address( get_the_ID() ); ?>
71
			</dd>
72
		<?php endif; ?>
73
        
74
       
75
		<dt class="event-label event-label-cost"><?php _e('Cost:', 'tribe-events-calendar'); ?></dt>
76
		<dd itemprop="price" class="event-meta event-meta-cost eventpricetable">
77
            
78
            	<?php
79
																tribe_get_ticket_form();
80
			$price_differential = max($wootickets_pricing) > min($wootickets_pricing);
81
			if (count($wootickets_pricing) === 1 or !price_differential) {
82
			$price = woocommerce_price($wootickets_pricing[0]);
83
			echo "$price";
84
			}
85
																elseif (count($wootickets_pricing) > 1) {
86
			$from = woocommerce_price(min($wootickets_pricing));
87
			$to = woocommerce_price(max($wootickets_pricing));
88
			echo "Tickets from $from &ndash; $to";
89
	        } ?>
90
                </dd>
91
		
92
        
93
      <!-- This should bring in ticket add-to-cart button - now in functions.php -->
94
      <?php add_to_cart_wooticket_btns() ?>
95
        
96
	
97
	</dl>
98
	<dl class="column last" itemprop="location" itemscope itemtype="http://schema.org/Place">
99
		<?php if( function_exists('tribe_the_custom_fields') && tribe_get_custom_fields( get_the_ID() ) ): ?>
100
	  	<?php tribe_the_custom_fields( get_the_ID() ); ?>
101
	<?php endif; ?>
102
<!-- </div> -->
103
<?php if( tribe_embed_google_map( get_the_ID() ) ) : ?>
104
<?php if( tribe_address_exists( get_the_ID() ) ) { echo tribe_get_embedded_map(); } ?>
105
<?php endif; ?>
106
	</dl>
107
  
108
          </div> <!-- eof of our own wrapper -->
109
  
110
   	</div>
111
    
112
<div class="entry-content">
113
	<?php
114
	if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {?>
115
		<?php the_post_thumbnail(); ?>
116
	<?php } ?>
117
	<div class="summary"><?php the_content(); ?></div>
118
	<?php // if (function_exists('tribe_get_ticket_form') && tribe_get_ticket_form()) { tribe_get_ticket_form(); } ?>		
119
  
120
</div>
121
<?php if( function_exists('tribe_get_single_ical_link') ): ?>
122
   <a class="ical single" href="<?php echo tribe_get_single_ical_link(); ?>"><?php _e('iCal Import', 'tribe-events-calendar'); ?></a>
123
<?php endif; ?>
124
<?php if( function_exists('tribe_get_gcal_link') ): ?>
125
   <a href="<?php echo tribe_get_gcal_link(); ?>" class="gcal-add" title="<?php _e('Add to Google Calendar', 'tribe-events-calendar'); ?>"><?php _e('+ Google Calendar', 'tribe-events-calendar'); ?></a>
126
<?php endif; ?>
127
128
<div style="clear:both"></div>