Advertisement
cosmocanuck

search-event-list.php

Oct 22nd, 2015
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. <?php
  2. /**
  3. * Event Search: Standard List
  4. *
  5. * The template is used for displaying the results of the event search [event_search] shortcode
  6. *
  7. * For a documentation of available functions (outputting dates, venue details etc) see http://wp-event-organiser.com/documentation/function-reference/
  8. *
  9. * **************** NOTICE: *****************
  10. *
  11. * @package Event Organiser Pro (plug-in)
  12. * @since 1.0
  13. */
  14. global $eo_event_loop;
  15.  
  16. //Date % Time format for events
  17. $date_format = get_option( 'date_format' );
  18. $time_format = get_option( 'time_format' );
  19.  
  20. ?>
  21.  
  22. <?php if ( $eo_event_loop->have_posts() ): ?>
  23.  
  24. <?php if ( $eo_event_loop->max_num_pages > 1 ) :
  25. //See http://codex.wordpress.org/Function_Reference/paginate_links
  26. $big = 999999999; // need an unlikely integer
  27. echo paginate_links( array(
  28. 'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
  29. 'current' => max( 1, get_query_var( 'paged' ) ),
  30. 'total' => $eo_event_loop->max_num_pages
  31. ) );
  32. endif; ?>
  33.  
  34. <?php while ( $eo_event_loop->have_posts() ): $eo_event_loop->the_post(); ?>
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. <div class="<?php echo esc_attr(implode(' ',$eo_event_classes)); ?>" >
  46.  
  47.  
  48. <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
  49.  
  50. <?php
  51. $image_ids = get_post_meta($post->ID, 'poster');
  52.  
  53. foreach ($image_ids as $image)
  54. {
  55. $myupload = get_post($image);
  56. echo wp_get_attachment_image( $image, 'poster-thumb' );
  57. }
  58. ?>
  59.  
  60.  
  61. </a>
  62.  
  63. <h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_title(); ?></a></h2>
  64.  
  65.  
  66. <!-- List date/dates of film -->
  67.  
  68. <?php
  69. $occurrences = eo_get_the_occurrences_of( get_the_ID() );
  70. $movieDates = array();
  71. foreach( $occurrences as $occurrence_id => $occurrence ) {
  72. $movieDates[] = $occurrence['start']->format('l, F jS, Y \a\t g:i A');
  73. }
  74. echo '<strong>' . implode( ' / ', $movieDates ) . '</strong>';
  75. ?>
  76.  
  77.  
  78. <?php $now = new DateTime( 'now', eo_get_blog_timezone() );
  79. if( $now <= eo_get_schedule_last( DATETIMEOBJ ) ) {
  80. $readMoreText = '<strong>More info / Buy tickets</strong>';
  81. } else {
  82. $readMoreText = "More info";
  83. } ?>
  84.  
  85. <?php echo apply_filters('the_excerpt',get_the_excerpt().'&nbsp;<a href="'.get_permalink().'">' . $readMoreText . '</a>'); ?>
  86.  
  87.  
  88.  
  89. </div>
  90. <div class="clear" style="clear:both;"></div>
  91.  
  92.  
  93.  
  94.  
  95.  
  96. <?php endwhile; ?>
  97.  
  98. <?php if ( $eo_event_loop->max_num_pages > 1 ) :
  99. //See http://codex.wordpress.org/Function_Reference/paginate_links
  100. $big = 999999999; // need an unlikely integer
  101. echo paginate_links( array(
  102. 'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
  103. 'current' => max( 1, get_query_var( 'paged' ) ),
  104. 'total' => $eo_event_loop->max_num_pages
  105. ) );
  106. endif; ?>
  107.  
  108. <?php elseif ( ! empty( $eo_event_loop_args['no_events'] ) ): ?>
  109.  
  110. <ul id="<?php echo esc_attr( $id );?>" class="<?php echo esc_attr( $classes );?>" >
  111. <li class="eo-no-events" > <?php echo $eo_event_loop_args['no_events']; ?> </li>
  112. </ul>
  113.  
  114. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement