View difference between Paste ID: ccjfc365 and xQUmW5Rd
SHOW: | | - or go back to the newest paste.
1
<?php
2
/**
3
* The TEC template for a list of events. This includes the Past Events and Upcoming Events views 
4
* as well as those same views filtered to a specific category.
5
*
6
* You can customize this view by putting a replacement file of the same name (list.php) in the events/ directory of your theme.
7
*/
8
9
// Don't load directly
10
if ( !defined('ABSPATH') ) { die('-1'); }
11
12
?>
13
<div id="tribe-events-content" class="upcoming">
14
15
	<?php if(!tribe_is_day()): // day view doesn't have a grid ?>
16
		<div id='tribe-events-calendar-header' class="clearfix">
17
		<span class='tribe-events-calendar-buttons'> 
18
			<a class='tribe-events-button-on' href='<?php echo tribe_get_listview_link(); ?>'><?php _e('Event List', 'tribe-events-calendar'); ?></a>
19
			<a class='tribe-events-button-off' href='<?php echo tribe_get_gridview_link(); ?>'><?php _e('Calendar', 'tribe-events-calendar'); ?></a>
20
		</span>
21
22
		</div><!--tribe-events-calendar-header-->
23
	<?php endif; ?>
24
	<div id="tribe-events-loop" class="tribe-events-events post-list clearfix">
25
	
26
	<?php if (have_posts()) : ?>
27
	<?php $hasPosts = true; $first = true; ?>
28
	<?php while ( have_posts() ) : the_post(); ?>
29
		<?php global $more; $more = false; ?>
30
		<div id="post-<?php the_ID(); ?>" <?php post_class('tribe-events-event clearfix'); ?> itemscope itemtype="http://schema.org/Event">
31
32
        
33
<div class="list-content <?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) { ?>with-thumb<?php } ?>">
34
35-
	<?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) { ?>
35+
36-
		<div class="list-thumbnail">
36+
37-
			<?php the_post_thumbnail('thumbnail'); ?>	
37+
38
			<?php if( !tribe_is_day() && tribe_is_multiday() ) : ?>
39-
	<?php } ?>
39+
40
			<?php endif; ?>
41
			<?php if ( tribe_is_day() && $first ) : $first = false; ?>
42
				<h4 class="event-day"><?php echo tribe_event_format_date(strtotime(get_query_var('eventDate')), false); ?></h4>
43
			<?php endif; ?>
44
			<?php the_title('<h2 class="entry-title" itemprop="name"><a href="' . tribe_get_event_link() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a></h2>'); ?>
45
			<div class="entry-content tribe-events-event-entry" itemprop="description">
46
47
			<?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) { ?>
48
				<div class="list-thumbnail">
49
					<?php the_post_thumbnail('thumbnail'); ?>	
50
				</div>
51
			<?php } ?>
52
53
				<?php if (has_excerpt ()): ?>
54
					<?php the_excerpt(); ?>
55
				<?php else: ?>
56
					<?php the_content(); ?>
57
				<?php endif; ?>
58
			</div> <!-- End tribe-events-event-entry -->
59
60
			<div class="tribe-events-event-list-meta" itemprop="location" itemscope itemtype="http://schema.org/Place">
61
				<table cellspacing="0">
62
					<?php if (tribe_is_multiday() || !tribe_get_all_day()): ?>
63
					<tr>
64
						<td class="tribe-events-event-meta-desc"><?php _e('Start:', 'tribe-events-calendar'); ?></td>
65
						<td class="tribe-events-event-meta-value" itemprop="startDate" content="<?php echo tribe_get_start_date(); ?>"><?php echo tribe_get_start_date(); ?></td>
66
					</tr>
67
					<tr>
68
						<td class="tribe-events-event-meta-desc"><?php _e('End:', 'tribe-events-calendar'); ?></td>
69
						<td class="tribe-events-event-meta-value" itemprop="endDate" content="<?php echo tribe_get_end_date(); ?>"><?php echo tribe_get_end_date(); ?></td>
70
					</tr>
71
					<?php else: ?>
72
					<tr>
73
						<td class="tribe-events-event-meta-desc"><?php _e('Date:', 'tribe-events-calendar'); ?></td>
74
						<td class="tribe-events-event-meta-value" itemprop="startDate" content="<?php echo tribe_get_start_date(); ?>"><?php echo tribe_get_start_date(); ?></td>
75
					</tr>
76
					<?php endif; ?>
77
78
					<?php
79
						$venue = tribe_get_venue();
80
						if ( !empty( $venue ) ) :
81
					?>
82
					<tr>
83
						<td class="tribe-events-event-meta-desc"><?php _e('Venue:', 'tribe-events-calendar'); ?></td>
84
						<td class="tribe-events-event-meta-value" itemprop="name">
85
							<?php if( class_exists( 'TribeEventsPro' ) ): ?>
86
								<?php tribe_get_venue_link( get_the_ID(), class_exists( 'TribeEventsPro' ) ); ?>
87
							<?php else: ?>
88
								<?php echo tribe_get_venue( get_the_ID() ); ?>
89
							<?php endif; ?>
90
						</td>
91
					</tr>
92
					<?php endif; ?>
93
					<?php
94
						$phone = tribe_get_phone();
95
						if ( !empty( $phone ) ) :
96
					?>
97
					<tr>
98
						<td class="tribe-events-event-meta-desc"><?php _e('Phone:', 'tribe-events-calendar'); ?></td>
99
						<td class="tribe-events-event-meta-value" itemprop="telephone"><?php echo $phone; ?></td>
100
					</tr>
101
					<?php endif; ?>
102
					<?php if (tribe_address_exists( get_the_ID() ) ) : ?>
103
					<tr>
104
						<td class="tribe-events-event-meta-desc"><?php _e('Address:', 'tribe-events-calendar'); ?><br />
105
						<?php if( get_post_meta( get_the_ID(), '_EventShowMapLink', true ) == 'true' ) : ?>
106
							<a class="gmap" itemprop="maps" href="<?php echo tribe_get_map_link(); ?>" title="Click to view a Google Map" target="_blank"><?php _e('Google Map', 'tribe-events-calendar' ); ?></a>
107
						<?php endif; ?></td>
108
						<td class="tribe-events-event-meta-value"><?php echo tribe_get_full_address( get_the_ID() ); ?></td>
109
					</tr>
110
					<?php endif; ?>
111
					<?php
112
						$cost = tribe_get_cost();
113
						if ( !empty( $cost ) ) :
114
					?>
115
					<tr>
116
						<td class="tribe-events-event-meta-desc"><?php _e('Cost:', 'tribe-events-calendar'); ?></td>
117
						<td class="tribe-events-event-meta-value" itemprop="price"><?php echo $cost; ?></td>
118
					 </tr>
119
					<?php endif; ?>
120
				</table>
121
			</div>
122
</div><!-- End list-content -->
123
</div> <!-- End post -->
124
	<?php endwhile;// posts ?>
125
	<?php else :?>
126
		<div class="tribe-events-no-entry">
127
		<?php 
128
			$tribe_ecp = TribeEvents::instance();
129
			if ( is_tax( $tribe_ecp->get_event_taxonomy() ) ) {
130
				$cat = get_term_by( 'slug', get_query_var('term'), $tribe_ecp->get_event_taxonomy() );
131
				if( tribe_is_upcoming() ) {
132
					$is_cat_message = sprintf(__(' listed under %s. Check out past events for this category or view the full calendar.','tribe-events-calendar'),$cat->name);
133
				} else if( tribe_is_past() ) {
134
					$is_cat_message = sprintf(__(' listed under %s. Check out upcoming events for this category or view the full calendar.','tribe-events-calendar'),$cat->name);
135
				}
136
			}
137
		?>
138
		<?php if(tribe_is_day()): ?>
139
			<?php printf( __('No events scheduled for <strong>%s</strong>. Please try another day.', 'tribe-events-calendar'), date_i18n('F d, Y', strtotime(get_query_var('eventDate')))); ?>
140
		<?php endif; ?>
141
142
		<?php if(tribe_is_upcoming()){ ?>
143
			<?php _e('No upcoming events', 'tribe-events-calendar');
144
			echo !empty($is_cat_message) ? $is_cat_message : "."; ?>
145
146
		<?php }elseif(tribe_is_past()){ ?>
147
			<?php _e('No previous events' , 'tribe-events-calendar');
148
			echo !empty($is_cat_message) ? $is_cat_message : "."; ?>
149
		<?php } ?>
150
		</div>
151
	<?php endif; ?>
152
153
154
	</div><!-- #tribe-events-loop -->
155
	<div id="tribe-events-nav-below" class="tribe-events-nav clearfix">
156
157
		<div class="tribe-events-nav-previous"><?php 
158
		// Display Previous Page Navigation
159
		if( tribe_is_upcoming() && get_previous_posts_link() ) : ?>
160
			<?php previous_posts_link( '<span>'.__('&laquo; Previous Events', 'tribe-events-calendar').'</span>' ); ?>
161
		<?php elseif( tribe_is_upcoming() && !get_previous_posts_link( ) ) : ?>
162
			<a href='<?php echo tribe_get_past_link(); ?>'><span><?php _e('&laquo; Previous Events', 'tribe-events-calendar' ); ?></span></a>
163
		<?php elseif( tribe_is_past() && get_next_posts_link( ) ) : ?>
164
			<?php next_posts_link( '<span>'.__('&laquo; Previous Events', 'tribe-events-calendar').'</span>' ); ?>
165
		<?php endif; ?>
166
		</div>
167
168
		<div class="tribe-events-nav-next"><?php
169
		// Display Next Page Navigation
170
		if( tribe_is_upcoming() && get_next_posts_link( ) ) : ?>
171
			<?php next_posts_link( '<span>'.__('Next Events &raquo;', 'tribe-events-calendar').'</span>' ); ?>
172
		<?php elseif( tribe_is_past() && get_previous_posts_link( ) ) : ?>
173
			<?php previous_posts_link( '<span>'.__('Next Events &raquo;', 'tribe-events-calendar').'</span>' ); // a little confusing but in 'past view' to see newer events you want the previous page ?>
174
		<?php elseif( tribe_is_past() && !get_previous_posts_link( ) ) : ?>
175
			<a href='<?php echo tribe_get_upcoming_link(); ?>'><span><?php _e('Next Events &raquo;', 'tribe-events-calendar'); ?></span></a>
176
		<?php endif; ?>
177
		</div>
178
179
	</div>
180
	<?php if ( !empty($hasPosts) && function_exists('tribe_get_ical_link') ): ?>
181
		<a title="<?php esc_attr_e('iCal Import', 'tribe-events-calendar'); ?>" class="ical" href="<?php echo tribe_get_ical_link(); ?>"><?php _e('iCal Import', 'tribe-events-calendar'); ?></a>
182
	<?php endif; ?>
183
</div>