Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The TEC template for a list of events. This includes the Past Events and Upcoming Events views
- * as well as those same views filtered to a specific category.
- *
- * You can customize this view by putting a replacement file of the same name (list.php) in the events/ directory of your theme.
- */
- // Don't load directly
- if ( !defined('ABSPATH') ) { die('-1'); }
- global $wootickets_pricing;
- global $wootickets_no_show;
- $wootickets_no_show = true;
- ?>
- <div id="tribe-events-content" class="upcoming">
- <div id="tribe-events-loop" class="tribe-events-events post-list clearfix">
- <?php if (have_posts()) : ?>
- <?php $hasPosts = true; $first = true; ?>
- <?php while ( have_posts() ) : the_post(); ?>
- <?php global $more; $more = false; ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class('tribe-events-event clearfix'); ?> itemscope itemtype="http://schema.org/Event">
- <?php if ( tribe_is_new_event_day() && !tribe_is_day() && !tribe_is_multiday() ) : ?>
- <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>
- <?php endif; ?>
- <?php if( !tribe_is_day() && tribe_is_multiday() ) : ?>
- <h4 class="event-day"><?php echo tribe_get_start_date( null, false ); ?> – <?php echo tribe_get_end_date( null, false ); ?></h4>
- <?php endif; ?>
- <?php if ( tribe_is_day() && $first ) : $first = false; ?>
- <h4 class="event-day"><?php echo tribe_event_format_date(strtotime(get_query_var('eventDate')), false); ?></h4>
- <?php endif; ?>
- <div class="entry-content tribe-events-event-entry" itemprop="description">
- <?php if (has_excerpt ()): ?>
- <?php the_excerpt(); ?>
- <?php else: ?>
- <?php the_content(); ?>
- <?php endif; ?>
- <a style="margin-top: 20px;" href="<?php echo tribe_get_event_link() ?>">More Info</a>
- </div> <!-- End tribe-events-event-entry -->
- <div class="tribe-events-event-list-meta" itemprop="location" itemscope itemtype="http://schema.org/Place">
- <table cellspacing="0">
- <?php if (tribe_is_multiday() || !tribe_get_all_day()): ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Start:', 'tribe-events-calendar'); ?></td>
- <td class="tribe-events-event-meta-value" itemprop="startDate" content="<?php echo tribe_get_start_date(); ?>"><?php echo tribe_get_start_date(); ?></td>
- </tr>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('End:', 'tribe-events-calendar'); ?></td>
- <td class="tribe-events-event-meta-value" itemprop="endDate" content="<?php echo tribe_get_end_date(); ?>"><?php echo tribe_get_end_date(); ?></td>
- </tr>
- <?php else: ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Date:', 'tribe-events-calendar'); ?></td>
- <td class="tribe-events-event-meta-value" itemprop="startDate" content="<?php echo tribe_get_start_date(); ?>"><?php echo tribe_get_start_date(); ?></td>
- </tr>
- <?php endif; ?>
- <?php
- $venue = tribe_get_venue();
- if ( !empty( $venue ) ) :
- ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Venue:', 'tribe-events-calendar'); ?></td>
- <td class="tribe-events-event-meta-value" itemprop="name">
- <?php if( class_exists( 'TribeEventsPro' ) ): ?>
- <?php tribe_get_venue_link( get_the_ID(), class_exists( 'TribeEventsPro' ) ); ?>
- <?php else: ?>
- <?php echo tribe_get_venue( get_the_ID() ); ?>
- <?php endif; ?>
- </td>
- </tr>
- <?php endif; ?>
- <?php
- //$phone = tribe_get_phone();
- //if ( !empty( $phone ) ) :
- ?>
- <!-- <tr>
- <td class="tribe-events-event-meta-desc"><?php //_e('Phone:', 'tribe-events-calendar'); ?></td>
- <td class="tribe-events-event-meta-value" itemprop="telephone"><?php //echo $phone; ?></td>
- </tr> -->
- <?php //endif; ?>
- <!-- Lets try grabbing the City -->
- <?php
- $city = tribe_get_city();
- if ( !empty( $city ) ) :
- ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('City :', 'tribe-events-calendar'); ?></td>
- <td class="tribe-events-event-meta-value" itemprop="city"><?php echo $city; ?></td>
- </tr>
- <?php endif; ?>
- <!-- tribe_get_city -->
- <?php if (tribe_address_exists( get_the_ID() ) ) : ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Address:', 'tribe-events-calendar'); ?><br />
- <?php if( get_post_meta( get_the_ID(), '_EventShowMapLink', true ) == 'true' ) : ?>
- <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>
- <?php endif; ?></td>
- <td class="tribe-events-event-meta-value"><?php echo tribe_get_full_address( get_the_ID() ); ?></td>
- </tr>
- <?php endif; ?>
- <?php
- $cost = tribe_get_cost();
- if ( !empty( $cost ) ) :
- ?>
- <tr>
- <td class="tribe-events-event-meta-desc"><?php _e('Cost:', 'tribe-events-calendar'); ?></td>
- <td class="tribe-events-event-meta-value" itemprop="price"> <?php
- the_content();
- tribe_get_ticket_form();
- $price_differential = max($wootickets_pricing) > min($wootickets_pricing);
- if (count($wootickets_pricing) === 1 or !price_differential) {
- $price = woocommerce_price($wootickets_pricing[0]);
- echo "Tickets cost $price";
- }
- elseif (count($wootickets_pricing) > 1) {
- $from = woocommerce_price(min($wootickets_pricing));
- $to = woocommerce_price(max($wootickets_pricing));
- echo "Tickets from $from – $to";
- }
- ?></td>
- </tr>
- <?php endif; ?>
- <tr>
- <td colspan="2"><a class="proceed-btn-orange" href="<?php echo tribe_get_event_link() ?>">Book</a></td>
- </tr>
- </table>
- </div>
- </div> <!-- End post -->
- <?php endwhile;// posts ?>
- <?php else :?>
- <div class="tribe-events-no-entry">
- <?php
- $tribe_ecp = TribeEvents::instance();
- if ( is_tax( $tribe_ecp->get_event_taxonomy() ) ) {
- $cat = get_term_by( 'slug', get_query_var('term'), $tribe_ecp->get_event_taxonomy() );
- if( tribe_is_upcoming() ) {
- $is_cat_message = sprintf(__(' listed under %s. Check out past events for this category or view the full calendar.','tribe-events-calendar'),$cat->name);
- } else if( tribe_is_past() ) {
- $is_cat_message = sprintf(__(' listed under %s. Check out upcoming events for this category or view the full calendar.','tribe-events-calendar'),$cat->name);
- }
- }
- ?>
- <?php if(tribe_is_day()): ?>
- <?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')))); ?>
- <?php endif; ?>
- <?php if(tribe_is_upcoming()){ ?>
- <?php _e('No upcoming events', 'tribe-events-calendar');
- echo !empty($is_cat_message) ? $is_cat_message : "."; ?>
- <?php }elseif(tribe_is_past()){ ?>
- <?php _e('No previous events' , 'tribe-events-calendar');
- echo !empty($is_cat_message) ? $is_cat_message : "."; ?>
- <?php } ?>
- </div>
- <?php endif; ?>
- </div><!-- #tribe-events-loop -->
- <?php if ( !empty($hasPosts) && function_exists('tribe_get_ical_link') ): ?>
- <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>
- <?php endif; ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement