Advertisement
BakerMan

Modified list.php tpl (TEC2.x+WT1.0.1) show sold out

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