Guest User

Untitled

a guest
Jan 25th, 2012
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.46 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. </div>
  24.     <?php endif; ?>
  25.     <div id="tribe-events-loop" class="tribe-events-events post-list clearfix">
  26.    
  27.     <?php if (have_posts()) :
  28.          $current_month = false;
  29.          $current_day = false;
  30.     ?>
  31.     <table class="striped" width="100%" border="0" cellspacing="0" cellpadding="0">
  32.     <?php
  33.     if(!is_tax()) {
  34.         query_posts(array(
  35.             'eventDisplay'=>'month',
  36.             'post_type'=>'tribe_events',
  37.             'tax_query'=>array(
  38.                 array(
  39.                     'taxonomy' => 'tribe_events_cat',
  40.                     'field' => 'id',
  41.                     'terms' => 88,
  42.                     'operator' => 'NOT IN'
  43.                 )
  44.             )
  45.         ));
  46.     }
  47.    
  48.     while ( have_posts() ) : the_post(); ?>
  49.             <?php if ( !$current_month || tribe_get_start_date(null, false, "F") != $current_month) : ?>
  50.                 <tr><th colspan="3"><?php echo tribe_get_start_date(null, false, "F Y"); ?></th></tr>
  51.             <?php
  52.                 endif; // If current month
  53.                 $current_month = tribe_get_start_date(null, false, "F");
  54.             ?>
  55.             <?php if ( !$current_day || tribe_get_start_date(null, false, "F j, Y") != $current_day) : ?>
  56.                 <tr <?php post_class("newdate ".$odd_even) ?>>
  57.                     <td width="60"><?php echo tribe_get_start_date(null, false, "M j"); ?></td>
  58.             <?php else : ?>
  59.                 <tr <?php post_class($odd_even) ?>>
  60.                     <td  width="60"></td>
  61.             <?php endif;
  62.                 $current_day = tribe_get_start_date(null, false, "F j, Y");
  63.             ?>
  64.                     <td width="120"><?php
  65.                         if(!strpos(tribe_get_start_date(),':')) {
  66.                             echo "All day";
  67.                         } else {
  68.                             echo str_replace(":00", "", tribe_get_start_date(null, false, "g:i a"));
  69.                             if (tribe_get_start_date() !== tribe_get_end_date() ) {
  70.                                 echo " - " . str_replace(":00", "", tribe_get_end_date(null, false, "g:i a"));
  71.                             }
  72.                         }?>            
  73.                     </td>
  74.                     <td><?php the_title('<a href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a>'); ?> - <?php echo tribe_get_venue(); ?></td>
  75.                 </tr>
  76.         <?php          
  77.         endwhile;// posts ?>
  78.         </table>
  79.         <?php else :?>
  80.             <?php
  81.                 if ( is_tax( $tribe_ecp->get_event_taxonomy() ) ) {
  82.                     $cat = get_term_by( 'slug', get_query_var('term'), $tribe_ecp->get_event_taxonomy() );
  83.                     $is_cat_message = sprintf(__(' listed under %s; check out past events for this category or the full calendar',$tribe_ecp->pluginDomain),$cat->name);
  84.                 }
  85.             ?>
  86.  
  87.             <?php if(tribe_is_upcoming()){ ?>
  88.                 <?php _e('No upcoming events.', $tribe_ecp->pluginDomain);
  89.                 echo $is_cat_message ;?>
  90.  
  91.             <?php }elseif(tribe_is_past()){ ?>
  92.                 <?php _e('No previous events.', $tribe_ecp->pluginDomain);
  93.                 echo $is_cat_message ?>
  94.             <?php } ?>
  95.         <?php endif; ?>
  96.         <?php if(tribe_is_day()): ?>
  97.             <?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')))); ?>
  98.         <?php endif; ?>
  99.  
  100.     </div><!-- #tribe-events-loop -->
  101.     <div id="tribe-events-nav-below" class="tribe-events-nav clearfix">
  102.  
  103.         <div class="tribe-events-nav-previous"><?php
  104.         // Display Previous Page Navigation
  105.         if( tribe_is_upcoming() && get_previous_posts_link() ) : ?>
  106.             <?php previous_posts_link( '<span>'.__('&larr; Previous Events', 'tribe-events-calendar').'</span>' ); ?>
  107.         <?php elseif( tribe_is_upcoming() && !get_previous_posts_link( ) ) : ?>
  108.             <a href='<?php echo tribe_get_past_link(); ?>'><span><?php _e('&larr; Previous Events', 'tribe-events-calendar' ); ?></span></a>
  109.         <?php elseif( tribe_is_past() && get_next_posts_link( ) ) : ?>
  110.             <?php next_posts_link( '<span>'.__('&larr; Previous Events', 'tribe-events-calendar').'</span>' ); ?>
  111.         <?php endif; ?>
  112.         </div>
  113.  
  114.         <div class="tribe-events-nav-next"><?php
  115.         // Display Next Page Navigation
  116.         if( tribe_is_upcoming() && get_next_posts_link( ) ) : ?>
  117.             <?php next_posts_link( '<span>'.__('Next Events &rarr;', 'tribe-events-calendar').'</span>' ); ?>
  118.         <?php elseif( tribe_is_past() && get_previous_posts_link( ) ) : ?>
  119.             <?php previous_posts_link( '<span>'.__('Next Events &rarr;', 'tribe-events-calendar').'</span>' ); // a little confusing but in 'past view' to see newer events you want the previous page ?>
  120.         <?php elseif( tribe_is_past() && !get_previous_posts_link( ) ) : ?>
  121.             <a href='<?php echo tribe_get_upcoming_link(); ?>'><span><?php _e('Next Events &rarr;', 'tribe-events-calendar'); ?></span></a>
  122.         <?php endif; ?>
  123.         </div>
  124.  
  125.     </div>
  126.     <?php if ( !empty($hasPosts) && function_exists('tribe_get_ical_link') ): ?>
  127.         <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>
  128.     <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment