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'); }
- ?>
- <div id="tribe-events-content" class="upcoming">
- <?php if(!tribe_is_day()): // day view doesn't have a grid ?>
- <div id='tribe-events-calendar-header' class="clearfix">
- <span class='tribe-events-calendar-buttons'>
- <a class='tribe-events-button-on' href='<?php echo tribe_get_listview_link(); ?>'><?php _e('Event List', 'tribe-events-calendar')?></a>
- <a class='tribe-events-button-off' href='<?php echo tribe_get_gridview_link(); ?>'><?php _e('Calendar', 'tribe-events-calendar')?></a>
- </span>
- </div><!--tribe-events-calendar-header-->
- </div>
- <?php endif; ?>
- <div id="tribe-events-loop" class="tribe-events-events post-list clearfix">
- <?php if (have_posts()) :
- $current_month = false;
- $current_day = false;
- ?>
- <table class="striped" width="100%" border="0" cellspacing="0" cellpadding="0">
- <?php
- if(!is_tax()) {
- query_posts(array(
- 'eventDisplay'=>'month',
- 'post_type'=>'tribe_events',
- 'tax_query'=>array(
- array(
- 'taxonomy' => 'tribe_events_cat',
- 'field' => 'id',
- 'terms' => 88,
- 'operator' => 'NOT IN'
- )
- )
- ));
- }
- while ( have_posts() ) : the_post(); ?>
- <?php if ( !$current_month || tribe_get_start_date(null, false, "F") != $current_month) : ?>
- <tr><th colspan="3"><?php echo tribe_get_start_date(null, false, "F Y"); ?></th></tr>
- <?php
- endif; // If current month
- $current_month = tribe_get_start_date(null, false, "F");
- ?>
- <?php if ( !$current_day || tribe_get_start_date(null, false, "F j, Y") != $current_day) : ?>
- <tr <?php post_class("newdate ".$odd_even) ?>>
- <td width="60"><?php echo tribe_get_start_date(null, false, "M j"); ?></td>
- <?php else : ?>
- <tr <?php post_class($odd_even) ?>>
- <td width="60"></td>
- <?php endif;
- $current_day = tribe_get_start_date(null, false, "F j, Y");
- ?>
- <td width="120"><?php
- if(!strpos(tribe_get_start_date(),':')) {
- echo "All day";
- } else {
- echo str_replace(":00", "", tribe_get_start_date(null, false, "g:i a"));
- if (tribe_get_start_date() !== tribe_get_end_date() ) {
- echo " - " . str_replace(":00", "", tribe_get_end_date(null, false, "g:i a"));
- }
- }?>
- </td>
- <td><?php the_title('<a href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a>'); ?> - <?php echo tribe_get_venue(); ?></td>
- </tr>
- <?php
- endwhile;// posts ?>
- </table>
- <?php else :?>
- <?php
- if ( is_tax( $tribe_ecp->get_event_taxonomy() ) ) {
- $cat = get_term_by( 'slug', get_query_var('term'), $tribe_ecp->get_event_taxonomy() );
- $is_cat_message = sprintf(__(' listed under %s; check out past events for this category or the full calendar',$tribe_ecp->pluginDomain),$cat->name);
- }
- ?>
- <?php if(tribe_is_upcoming()){ ?>
- <?php _e('No upcoming events.', $tribe_ecp->pluginDomain);
- echo $is_cat_message ;?>
- <?php }elseif(tribe_is_past()){ ?>
- <?php _e('No previous events.', $tribe_ecp->pluginDomain);
- echo $is_cat_message ?>
- <?php } ?>
- <?php endif; ?>
- <?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; ?>
- </div><!-- #tribe-events-loop -->
- <div id="tribe-events-nav-below" class="tribe-events-nav clearfix">
- <div class="tribe-events-nav-previous"><?php
- // Display Previous Page Navigation
- if( tribe_is_upcoming() && get_previous_posts_link() ) : ?>
- <?php previous_posts_link( '<span>'.__('← Previous Events', 'tribe-events-calendar').'</span>' ); ?>
- <?php elseif( tribe_is_upcoming() && !get_previous_posts_link( ) ) : ?>
- <a href='<?php echo tribe_get_past_link(); ?>'><span><?php _e('← Previous Events', 'tribe-events-calendar' ); ?></span></a>
- <?php elseif( tribe_is_past() && get_next_posts_link( ) ) : ?>
- <?php next_posts_link( '<span>'.__('← Previous Events', 'tribe-events-calendar').'</span>' ); ?>
- <?php endif; ?>
- </div>
- <div class="tribe-events-nav-next"><?php
- // Display Next Page Navigation
- if( tribe_is_upcoming() && get_next_posts_link( ) ) : ?>
- <?php next_posts_link( '<span>'.__('Next Events →', 'tribe-events-calendar').'</span>' ); ?>
- <?php elseif( tribe_is_past() && get_previous_posts_link( ) ) : ?>
- <?php previous_posts_link( '<span>'.__('Next Events →', 'tribe-events-calendar').'</span>' ); // a little confusing but in 'past view' to see newer events you want the previous page ?>
- <?php elseif( tribe_is_past() && !get_previous_posts_link( ) ) : ?>
- <a href='<?php echo tribe_get_upcoming_link(); ?>'><span><?php _e('Next Events →', 'tribe-events-calendar'); ?></span></a>
- <?php endif; ?>
- </div>
- </div>
- <?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; ?>
Advertisement
Add Comment
Please, Sign In to add comment