Advertisement
Guest User

Modded List.php

a guest
Apr 23rd, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.26 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. global $wootickets_pricing;
  13. global $wootickets_no_show;
  14. $wootickets_no_show = true;
  15.  
  16. ?>
  17. <div id="tribe-events-content" class="upcoming">
  18.  
  19.  
  20.     <div id="tribe-events-loop" class="tribe-events-events post-list clearfix">
  21.    
  22.     <?php if (have_posts()) : ?>
  23.     <?php $hasPosts = true; $first = true; ?>
  24.     <?php while ( have_posts() ) : the_post(); ?>
  25.         <?php global $more; $more = false; ?>
  26.         <div id="post-<?php the_ID(); ?>" <?php post_class('tribe-events-event clearfix'); ?> itemscope itemtype="http://schema.org/Event">
  27.             <?php if ( tribe_is_new_event_day() && !tribe_is_day() && !tribe_is_multiday() ) : ?>
  28.                  <h2><?php echo tribe_get_start_date( null, false ); ?> - <?php the_title('<a href="' . tribe_get_event_link() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a>'); ?></h2>
  29.             <?php endif; ?>
  30.             <?php if( !tribe_is_day() && tribe_is_multiday() ) : ?>
  31.                 <h4 class="event-day"><?php echo tribe_get_start_date( null, false ); ?><?php echo tribe_get_end_date( null, false ); ?></h4>
  32.             <?php endif; ?>
  33.             <?php if ( tribe_is_day() && $first ) : $first = false; ?>
  34.                 <h4 class="event-day"><?php echo tribe_event_format_date(strtotime(get_query_var('eventDate')), false); ?></h4>
  35.             <?php endif; ?>
  36.            
  37.             <div class="entry-content tribe-events-event-entry" itemprop="description">
  38.                 <?php if (has_excerpt ()): ?>
  39.                     <?php the_excerpt(); ?>
  40.                 <?php else: ?>
  41.                     <?php the_content(); ?>
  42.                 <?php endif; ?>
  43.                 <a style="margin-top: 20px;" href="<?php echo tribe_get_event_link() ?>">More Info</a>
  44.             </div> <!-- End tribe-events-event-entry -->
  45.  
  46.             <div class="tribe-events-event-list-meta" itemprop="location" itemscope itemtype="http://schema.org/Place">
  47.                 <table cellspacing="0">
  48.                     <?php if (tribe_is_multiday() || !tribe_get_all_day()): ?>
  49.                     <tr>
  50.                         <td class="tribe-events-event-meta-desc"><?php _e('Start:', 'tribe-events-calendar'); ?></td>
  51.                         <td class="tribe-events-event-meta-value" itemprop="startDate" content="<?php echo tribe_get_start_date(); ?>"><?php echo tribe_get_start_date(); ?></td>
  52.                     </tr>
  53.                     <tr>
  54.                         <td class="tribe-events-event-meta-desc"><?php _e('End:', 'tribe-events-calendar'); ?></td>
  55.                         <td class="tribe-events-event-meta-value" itemprop="endDate" content="<?php echo tribe_get_end_date(); ?>"><?php echo tribe_get_end_date(); ?></td>
  56.                     </tr>
  57.                     <?php else: ?>
  58.                     <tr>
  59.                         <td class="tribe-events-event-meta-desc"><?php _e('Date:', 'tribe-events-calendar'); ?></td>
  60.                         <td class="tribe-events-event-meta-value" itemprop="startDate" content="<?php echo tribe_get_start_date(); ?>"><?php echo tribe_get_start_date(); ?></td>
  61.                     </tr>
  62.                     <?php endif; ?>
  63.  
  64.                     <?php
  65.                         $venue = tribe_get_venue();
  66.                         if ( !empty( $venue ) ) :
  67.                     ?>
  68.                     <tr>
  69.                         <td class="tribe-events-event-meta-desc"><?php _e('Venue:', 'tribe-events-calendar'); ?></td>
  70.                         <td class="tribe-events-event-meta-value" itemprop="name">
  71.                             <?php if( class_exists( 'TribeEventsPro' ) ): ?>
  72.                                 <?php tribe_get_venue_link( get_the_ID(), class_exists( 'TribeEventsPro' ) ); ?>
  73.                             <?php else: ?>
  74.                                 <?php echo tribe_get_venue( get_the_ID() ); ?>
  75.                             <?php endif; ?>
  76.                         </td>
  77.                     </tr>
  78.                     <?php endif; ?>
  79.                    
  80.                     <?php
  81.                         //$phone = tribe_get_phone();
  82.                         //if ( !empty( $phone ) ) :
  83.                     ?>
  84.                     <!-- <tr>
  85.                         <td class="tribe-events-event-meta-desc"><?php //_e('Phone:', 'tribe-events-calendar'); ?></td>
  86.                         <td class="tribe-events-event-meta-value" itemprop="telephone"><?php //echo $phone; ?></td>
  87.                     </tr> -->
  88.                     <?php //endif; ?>
  89.                    
  90.                     <!-- Lets try grabbing the City -->
  91.                    <?php
  92.                         $city = tribe_get_city();
  93.                         if ( !empty( $city ) ) :
  94.                     ?>
  95.                     <tr>
  96.                         <td class="tribe-events-event-meta-desc"><?php _e('City :', 'tribe-events-calendar'); ?></td>
  97.                         <td class="tribe-events-event-meta-value" itemprop="city"><?php echo $city; ?></td>
  98.                     </tr>
  99.                     <?php endif; ?>
  100.                     <!-- tribe_get_city -->
  101.                    
  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.                      
  112.                     <?php
  113.                         $cost = tribe_get_cost();
  114.                         if ( !empty( $cost ) ) :
  115.                     ?>
  116.                     <tr>
  117.                         <td class="tribe-events-event-meta-desc"><?php _e('Cost:', 'tribe-events-calendar'); ?></td>
  118.                         <td class="tribe-events-event-meta-value" itemprop="price"> <?php
  119.  the_content();
  120.                                                 tribe_get_ticket_form();
  121.                                                 $price_differential = max($wootickets_pricing) > min($wootickets_pricing);
  122.  
  123.                                                 if (count($wootickets_pricing) === 1 or !price_differential) {
  124.                                                         $price = woocommerce_price($wootickets_pricing[0]);
  125.                                                         echo "Tickets cost $price";
  126.                                                 }
  127.                                                 elseif (count($wootickets_pricing) > 1) {
  128.                                                         $from = woocommerce_price(min($wootickets_pricing));
  129.                                                         $to = woocommerce_price(max($wootickets_pricing));
  130.                                                         echo "Tickets from $from &ndash; $to";
  131.                                                 }
  132.                                         ?></td>
  133.                      </tr>
  134.                     <?php endif; ?>
  135.                    
  136.                     <tr>
  137.                     <td colspan="2"><a class="proceed-btn-orange" href="<?php echo tribe_get_event_link() ?>">Book</a></td>
  138.                     </tr>
  139.                 </table>
  140.             </div>
  141.         </div> <!-- End post -->
  142.     <?php endwhile;// posts ?>
  143.     <?php else :?>
  144.         <div class="tribe-events-no-entry">
  145.         <?php
  146.             $tribe_ecp = TribeEvents::instance();
  147.             if ( is_tax( $tribe_ecp->get_event_taxonomy() ) ) {
  148.                 $cat = get_term_by( 'slug', get_query_var('term'), $tribe_ecp->get_event_taxonomy() );
  149.                 if( tribe_is_upcoming() ) {
  150.                     $is_cat_message = sprintf(__(' listed under %s. Check out past events for this category or view the full calendar.','tribe-events-calendar'),$cat->name);
  151.                 } else if( tribe_is_past() ) {
  152.                     $is_cat_message = sprintf(__(' listed under %s. Check out upcoming events for this category or view the full calendar.','tribe-events-calendar'),$cat->name);
  153.                 }
  154.             }
  155.         ?>
  156.         <?php if(tribe_is_day()): ?>
  157.             <?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')))); ?>
  158.         <?php endif; ?>
  159.  
  160.         <?php if(tribe_is_upcoming()){ ?>
  161.             <?php _e('No upcoming events', 'tribe-events-calendar');
  162.             echo !empty($is_cat_message) ? $is_cat_message : "."; ?>
  163.  
  164.         <?php }elseif(tribe_is_past()){ ?>
  165.             <?php _e('No previous events' , 'tribe-events-calendar');
  166.             echo !empty($is_cat_message) ? $is_cat_message : "."; ?>
  167.         <?php } ?>
  168.         </div>
  169.     <?php endif; ?>
  170.  
  171.  
  172.     </div><!-- #tribe-events-loop -->
  173.    
  174.    
  175.     <?php if ( !empty($hasPosts) && function_exists('tribe_get_ical_link') ): ?>
  176.         <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>
  177.     <?php endif; ?>
  178. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement