Project

General

Profile

Feature #5347 » single-event.php

Alex Hills, 2016-03-21 08:09 AM

 
1
<?php
2
/**
3
* Customized Single Event view for MESTC theme
4
* 
5
* A single event.  This displays the event title, description, meta, and 
6
* optionally, the Google map for the event.
7
*
8
*/
9

    
10
// Don't load directly
11
if ( !defined('ABSPATH') ) { die('-1'); }
12
?>
13
<h2 class="tribe-events-single-event-title entry-title <?php 
14
	//  grab the categories and print them out with a space seperating them
15
	$tribe_categories = tribe_get_event_cat_slugs();
16
		foreach ( $tribe_categories as $tribe_category ) {
17
			echo $tribe_category;
18
			echo " ";
19
		}
20
	?>">
21
<?php the_title();?>
22
</h2>
23

    
24

    
25
<span class="back"><a href="<?php echo tribe_get_events_link(); ?>"><?php _e('&laquo; Back to Events', 'tribe-events-calendar'); ?></a></span>				
26
<?php
27
	$gmt_offset = (get_option('gmt_offset') >= '0' ) ? ' +' . get_option('gmt_offset') : " " . get_option('gmt_offset');
28
 	$gmt_offset = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $gmt_offset );
29
 	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 } ?>
30
<div id="tribe-events-event-meta" itemscope itemtype="http://schema.org/Event">
31
	<dl class="column date-column">
32
		<?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?>
33
			<dt class="event-label event-label-start"><?php _e('Start:', 'tribe-events-calendar') ?></dt> 
34
			<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(NULL,true,'M j, Y'); ?></dd>
35
			<dt class="event-label event-label-end"><?php _e('End:', 'tribe-events-calendar') ?></dt>
36
			<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(NULL,true,'M j, Y');  ?></dd>						
37
		<?php } else { ?>
38
			<dt class="event-label event-label-date"><?php _e('Date:', 'tribe-events-calendar') ?></dt> 
39
			<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>
40
		<?php } ?>	
41
    </dl>
42
    <dl class="column venue-cost-column">
43
    	<?php if ( tribe_get_cost() ) : ?>
44
			<dt class="event-label event-label-cost"><?php _e('Cost:', 'tribe-events-calendar') ?></dt>
45
			<dd itemprop="price" class="event-meta event-meta-cost"><?php echo tribe_get_cost(); ?></dd>
46
		<?php endif; ?>
47
		<?php if(tribe_get_venue()) : ?>
48
		<dt class="event-label event-label-venue"><?php _e('Venue:', 'tribe-events-calendar') ?></dt> 
49
		<dd itemprop="name" class="event-meta event-meta-venue">
50
			<?php if( class_exists( 'TribeEventsPro' ) ): ?>
51
				<?php tribe_get_venue_link( get_the_ID(), class_exists( 'TribeEventsPro' ) ); ?>
52
			<?php else: ?>
53
				<?php echo tribe_get_venue( get_the_ID() ) ?>
54
			<?php endif; ?>
55
		</dd>
56
		<?php endif; ?>
57
    </dl>
58
    <dl class="column category-column">
59
		<?php tribe_meta_event_cats(); ?>
60
	</dl>
61
  
62
   	<?php if( function_exists('tribe_the_custom_fields') && tribe_get_custom_fields( get_the_ID() ) ): ?>
63
	  	<?php tribe_the_custom_fields( get_the_ID() ); ?>
64
	<?php endif; ?>
65
</div>
66
<?php if( tribe_embed_google_map( get_the_ID() ) ) : ?>
67
<?php if( tribe_address_exists( get_the_ID() ) ) { echo tribe_get_embedded_map(); } ?>
68
<?php endif; ?>
69
<div class="entry">
70
	<div class="summary"><?php the_content() ?></div>
71
	<?php if (function_exists('tribe_get_ticket_form') && tribe_get_ticket_form()) { tribe_get_ticket_form(); } ?>		
72
</div>
73
<div class="social-button-container">
74
	<div class="share_top_text">Share this post on:</div>
75
	<div class="SocialCustomMenu">
76
	    <a class="scmTwitter" href="http://twitter.com/home/?status=<?php the_title();?> - <?php echo wp_get_shortlink();?> via @kenmata "title="Tweet this!" target="_blank">Twitter</a>
77
	    <a class="scmFacebook" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?> - <?php echo wp_get_shortlink();?> "title="Share on Facebook!" target="_blank">Facebook</a>
78
	    <a class="scmGoogleplus" href="https://plus.google.com/share?url=<?php the_permalink();?> -  <?php echo wp_get_shortlink();?> "title="Share on Google +!" target="_blank">Google +</a>
79
	    <?php if( function_exists('tribe_get_single_ical_link') ): ?>
80
   <a class="ical single" href="<?php echo tribe_get_single_ical_link(); ?>"><?php _e('iCal Import', 'tribe-events-calendar'); ?></a>
81
<?php endif; ?>
82
<?php if( function_exists('tribe_get_gcal_link') ): ?>
83
   <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>
84
<?php endif; ?>
85
	</div>
86
</div>
87

    
88
<div class="navlink previous"><?php tribe_previous_event_link();?></div>
89

    
90
<div class="navlink next"><?php tribe_next_event_link();?></div>
91
<div style="clear:both"></div>
(3-3/3)