Guest User

minicalendar single-event.php

a guest
Aug 13th, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. <?php
  2.  
  3. global $post, $wp_query;
  4.  
  5. $class = "";
  6. if ( $wp_query->current_post == 1 ) {
  7. $class = ' first ';
  8. }
  9. if ( $wp_query->current_post+1 == $wp_query->post_count ) {
  10. $class .= ' last ';
  11. }
  12.  
  13. $startDate = strtotime( $post->EventStartDate );
  14. $endDate = strtotime( $post->EventEndDate );
  15. $today = time();
  16.  
  17. /* If the event starts way in the past or ends way in the future, let's show today's date */
  18. if ( $today > $startDate && $today < $endDate )
  19. $postDate = $today; else
  20. $postDate = $startDate;
  21.  
  22. /* If the user clicked in a particular day, let's show that day as the event date, even if the event spans a few days */
  23. if ( defined( "DOING_AJAX" ) && DOING_AJAX && isset( $_POST['action'] ) && $_POST['action'] == 'tribe-mini-cal-day' )
  24. $postDate = strtotime( $_POST["eventDate"] );
  25. ?>
  26.  
  27. <div class="tribe-mini-calendar-event event-<?php echo $wp_query->current_post;?><?php echo $class;?>">
  28. <div class="list-date">
  29. <span
  30. class="list-dayname"><?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date( 'D', $postDate ), $postDate, $class ); ?></span>
  31. <span
  32. class="list-daynumber"><?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_daynumber', date( 'd', $postDate ), $postDate, $class ); ?></span>
  33. </div>
  34. <div class="list-info">
  35. <h2><a href="<?php echo tribe_get_unslashed_event_link(); ?>"><?php echo $post->post_title; ?></a></h2>
  36. <?php if ( tribe_get_cost() ) { ?>
  37. <span class="tribe-mini-calendar-event-cost"><?php echo tribe_get_cost( null, true ); ?></span>
  38. <div class="tribe-events-divider ">|</div>
  39. <?php } ?>
  40. <?php echo tribe_events_event_schedule_details(); ?>
  41. <?php if ( tribe_get_venue() ) { ?>
  42. <div class="tribe-mini-calendar-event-venue">
  43. <?php echo tribe_get_venue_link( $post->ID ); ?>
  44. </div>
  45. <?php } ?>
  46. </div>
  47. </div>
Advertisement
Add Comment
Please, Sign In to add comment