Advertisement
Guest User

Untitled

a guest
Dec 5th, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.80 KB | None | 0 0
  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. <?php if(!tribe_is_day()): // day view doesn't have a grid ?>
  15. <div id='tribe-events-calendar-header' class="clearfix">
  16. <span class='tribe-events-calendar-buttons'>
  17. <a class='tribe-events-button-on' href='<?php echo tribe_get_listview_link(); ?>'><?php _e('Event List', 'tribe-events-calendar'); ?></a>
  18. <a class='tribe-events-button-off' href='<?php echo tribe_get_gridview_link(); ?>'><?php _e('Calendar', 'tribe-events-calendar'); ?></a>
  19. </span>
  20.  
  21. </div><!--tribe-events-calendar-header-->
  22. <?php endif; ?>
  23. <div id="tribe-events-nav-below" class="tribe-events-nav clearfix">
  24.  
  25. <div class="tribe-events-nav-previous"><?php
  26. // Display Previous Page Navigation
  27. if( tribe_is_upcoming() && get_previous_posts_link() ) : ?>
  28. <?php previous_posts_link( '<span>'.__('&laquo; Previous Events', 'tribe-events-calendar').'</span>' ); ?>
  29. <?php elseif( tribe_is_upcoming() && !get_previous_posts_link( ) ) : ?>
  30. <a href='<?php echo tribe_get_past_link(); ?>'><span><?php _e('&laquo; Previous Events', 'tribe-events-calendar' ); ?></span></a>
  31. <?php elseif( tribe_is_past() && get_next_posts_link( ) ) : ?>
  32. <?php next_posts_link( '<span>'.__('&laquo; Previous Events', 'tribe-events-calendar').'</span>' ); ?>
  33. <?php endif; ?>
  34. </div>
  35.  
  36. <div class="tribe-events-nav-next"><?php
  37. // Display Next Page Navigation
  38. if( tribe_is_upcoming() && get_next_posts_link( ) ) : ?>
  39. <?php next_posts_link( '<span>'.__('Next Events &raquo;', 'tribe-events-calendar').'</span>' ); ?>
  40. <?php elseif( tribe_is_past() && get_previous_posts_link( ) ) : ?>
  41. <?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 ?>
  42. <?php elseif( tribe_is_past() && !get_previous_posts_link( ) ) : ?>
  43. <a href='<?php echo tribe_get_upcoming_link(); ?>'><span><?php _e('Next Events &raquo;', 'tribe-events-calendar'); ?></span></a>
  44. <?php endif; ?>
  45. </div>
  46.  
  47. </div>
  48. <div id="tribe-events-loop" class="tribe-events-events post-list clearfix">
  49.  
  50. <?php if (have_posts()) : ?>
  51. <?php $hasPosts = true; $first = true; ?>
  52. <?php while ( have_posts() ) : the_post(); ?>
  53. <?php global $more; $more = false; ?>
  54. <div id="post-<?php the_ID(); ?>" <?php post_class('tribe-events-event clearfix'); ?> itemscope itemtype="http://schema.org/Event">
  55. <?php if ( tribe_is_new_event_day() && !tribe_is_day() && !tribe_is_multiday() ) : ?>
  56. <h4 class="event-day"><?php echo tribe_get_start_date( null, false ); ?></h4>
  57. <?php endif; ?>
  58. <?php if( !tribe_is_day() && tribe_is_multiday() ) : ?>
  59. <h4 class="event-day"><?php echo tribe_get_start_date( null, false ); ?> – <?php echo tribe_get_end_date( null, false ); ?></h4>
  60. <?php endif; ?>
  61. <?php if ( tribe_is_day() && $first ) : $first = false; ?>
  62. <h4 class="event-day"><?php echo tribe_event_format_date(strtotime(get_query_var('eventDate')), false); ?></h4>
  63. <?php endif; ?>
  64. <?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>'); ?>
  65. <div class="entry-content tribe-events-event-entry" itemprop="description">
  66. <?php if (has_excerpt ()): ?>
  67. <?php the_excerpt(); ?>
  68. <?php else: ?>
  69. <?php the_content(); ?>
  70. <?php endif; ?>
  71. </div> <!-- End tribe-events-event-entry -->
  72.  
  73. <div class="tribe-events-event-list-meta" itemprop="location" itemscope itemtype="http://schema.org/Place">
  74. <table cellspacing="0">
  75. <?php if (tribe_is_multiday() || !tribe_get_all_day()): ?>
  76. <tr>
  77. <td class="tribe-events-event-meta-desc"><?php _e('Start:', 'tribe-events-calendar'); ?></td>
  78. <td class="tribe-events-event-meta-value" itemprop="startDate" content="<?php echo tribe_get_start_date(); ?>"><?php echo tribe_get_start_date(); ?></td>
  79. </tr>
  80. <tr>
  81. <td class="tribe-events-event-meta-desc"><?php _e('End:', 'tribe-events-calendar'); ?></td>
  82. <td class="tribe-events-event-meta-value" itemprop="endDate" content="<?php echo tribe_get_end_date(); ?>"><?php echo tribe_get_end_date(); ?></td>
  83. </tr>
  84. <?php else: ?>
  85. <tr>
  86. <td class="tribe-events-event-meta-desc"><?php _e('Date:', 'tribe-events-calendar'); ?></td>
  87. <td class="tribe-events-event-meta-value" itemprop="startDate" content="<?php echo tribe_get_start_date(); ?>"><?php echo tribe_get_start_date(); ?></td>
  88. </tr>
  89. <?php endif; ?>
  90.  
  91. <?php
  92. $venue = tribe_get_venue();
  93. if ( !empty( $venue ) ) :
  94. ?>
  95. <tr>
  96. <td class="tribe-events-event-meta-desc"><?php _e('Venue:', 'tribe-events-calendar'); ?></td>
  97. <td class="tribe-events-event-meta-value" itemprop="name">
  98. <?php if( class_exists( 'TribeEventsPro' ) ): ?>
  99. <?php tribe_get_venue_link( get_the_ID(), class_exists( 'TribeEventsPro' ) ); ?>
  100. <?php else: ?>
  101. <?php echo tribe_get_venue( get_the_ID() ); ?>
  102. <?php endif; ?>
  103. </td>
  104. </tr>
  105. <?php endif; ?>
  106. <?php
  107. $phone = tribe_get_phone();
  108. if ( !empty( $phone ) ) :
  109. ?>
  110. <tr>
  111. <td class="tribe-events-event-meta-desc"><?php _e('Phone:', 'tribe-events-calendar'); ?></td>
  112. <td class="tribe-events-event-meta-value" itemprop="telephone"><?php echo $phone; ?></td>
  113. </tr>
  114. <?php endif; ?>
  115. <?php if (tribe_address_exists( get_the_ID() ) ) : ?>
  116. <tr>
  117. <td class="tribe-events-event-meta-desc"><?php _e('Address:', 'tribe-events-calendar'); ?><br />
  118. <?php if( get_post_meta( get_the_ID(), '_EventShowMapLink', true ) == 'true' ) : ?>
  119. <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>
  120. <?php endif; ?></td>
  121. <td class="tribe-events-event-meta-value"><?php echo tribe_get_full_address( get_the_ID() ); ?></td>
  122. </tr>
  123. <?php endif; ?>
  124. <?php
  125. $cost = tribe_get_cost();
  126. if ( !empty( $cost ) ) :
  127. ?>
  128. <tr>
  129. <td class="tribe-events-event-meta-desc"><?php _e('Cost:', 'tribe-events-calendar'); ?></td>
  130. <td class="tribe-events-event-meta-value" itemprop="price"><?php echo $cost; ?></td>
  131. </tr>
  132. <?php endif; ?>
  133. </table>
  134. </div>
  135. </div> <!-- End post -->
  136. <?php endwhile;// posts ?>
  137. <?php else :?>
  138. <div class="tribe-events-no-entry">
  139. <?php
  140. $tribe_ecp = TribeEvents::instance();
  141. if ( is_tax( $tribe_ecp->get_event_taxonomy() ) ) {
  142. $cat = get_term_by( 'slug', get_query_var('term'), $tribe_ecp->get_event_taxonomy() );
  143. if( tribe_is_upcoming() ) {
  144. $is_cat_message = sprintf(__(' listed under %s. Check out past events for this category or view the full calendar.','tribe-events-calendar'),$cat->name);
  145. } else if( tribe_is_past() ) {
  146. $is_cat_message = sprintf(__(' listed under %s. Check out upcoming events for this category or view the full calendar.','tribe-events-calendar'),$cat->name);
  147. }
  148. }
  149. ?>
  150. <?php if(tribe_is_day()): ?>
  151. <?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')))); ?>
  152. <?php endif; ?>
  153.  
  154. <?php if(tribe_is_upcoming()){ ?>
  155. <?php _e('No upcoming events', 'tribe-events-calendar');
  156. echo !empty($is_cat_message) ? $is_cat_message : "."; ?>
  157.  
  158. <?php }elseif(tribe_is_past()){ ?>
  159. <?php _e('No previous events' , 'tribe-events-calendar');
  160. echo !empty($is_cat_message) ? $is_cat_message : "."; ?>
  161. <?php } ?>
  162. </div>
  163. <?php endif; ?>
  164.  
  165.  
  166. </div><!-- #tribe-events-loop -->
  167. <div id="tribe-events-nav-below" class="tribe-events-nav clearfix">
  168.  
  169. <div class="tribe-events-nav-previous"><?php
  170. // Display Previous Page Navigation
  171. if( tribe_is_upcoming() && get_previous_posts_link() ) : ?>
  172. <?php previous_posts_link( '<span>'.__('&laquo; Previous Events', 'tribe-events-calendar').'</span>' ); ?>
  173. <?php elseif( tribe_is_upcoming() && !get_previous_posts_link( ) ) : ?>
  174. <a href='<?php echo tribe_get_past_link(); ?>'><span><?php _e('&laquo; Previous Events', 'tribe-events-calendar' ); ?></span></a>
  175. <?php elseif( tribe_is_past() && get_next_posts_link( ) ) : ?>
  176. <?php next_posts_link( '<span>'.__('&laquo; Previous Events', 'tribe-events-calendar').'</span>' ); ?>
  177. <?php endif; ?>
  178. </div>
  179.  
  180. <div class="tribe-events-nav-next"><?php
  181. // Display Next Page Navigation
  182. if( tribe_is_upcoming() && get_next_posts_link( ) ) : ?>
  183. <?php next_posts_link( '<span>'.__('Next Events &raquo;', 'tribe-events-calendar').'</span>' ); ?>
  184. <?php elseif( tribe_is_past() && get_previous_posts_link( ) ) : ?>
  185. <?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 ?>
  186. <?php elseif( tribe_is_past() && !get_previous_posts_link( ) ) : ?>
  187. <a href='<?php echo tribe_get_upcoming_link(); ?>'><span><?php _e('Next Events &raquo;', 'tribe-events-calendar'); ?></span></a>
  188. <?php endif; ?>
  189. </div>
  190.  
  191. </div>
  192. <?php if ( !empty($hasPosts) && function_exists('tribe_get_ical_link') ): ?>
  193. <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>
  194. <?php endif; ?>
  195. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement