Guest User

Untitled

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