Guest User

Untitled

a guest
Jan 24th, 2014
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.69 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Single Event Template
  4.  * A single event. This displays the event title, description, meta, and
  5.  * optionally, the Google map for the event.
  6.  *
  7.  * Override this template in your own theme by creating a file at [your-theme]/tribe-events/single-event.php
  8.  *
  9.  * @package TribeEventsCalendar
  10.  * @since  2.1
  11.  * @author Modern Tribe Inc.
  12.  *
  13.  */
  14.  
  15. if ( !defined('ABSPATH') ) { die('-1'); }
  16.  
  17. $event_id = get_the_ID();
  18.  
  19. ?>
  20.  
  21. <div id="tribe-events-content" class="tribe-events-single">
  22.  
  23.     <p class="tribe-events-back"><a href="<?php echo tribe_get_events_link() ?>"> <?php _e( '&laquo; All Events', 'tribe-events-calendar' ) ?></a></p>
  24.  
  25.     <!-- Notices -->
  26.     <?php tribe_events_the_notices() ?>
  27.  
  28.     <?php the_title( '<h2 class="tribe-events-single-event-title summary">', '</h2>' ); ?>
  29.  
  30.     <div class="tribe-events-schedule updated published tribe-clearfix">
  31.         <h3><?php echo tribe_events_event_schedule_details(); ?></h3>
  32.         <?php echo tribe_events_event_recurring_info_tooltip(); ?>
  33.         <?php  if ( tribe_get_cost() ) :  ?>
  34.             <span class="tribe-events-divider">|</span>
  35.             <span class="tribe-events-cost"><?php echo tribe_get_cost( null, true ) ?></span>
  36.         <?php endif; ?>
  37.     </div>
  38.  
  39.     <!-- Event header -->
  40.     <div id="tribe-events-header" <?php tribe_events_the_header_attributes() ?>>
  41.         <!-- Navigation -->
  42.         <h3 class="tribe-events-visuallyhidden"><?php _e( 'Event Navigation', 'tribe-events-calendar' ) ?></h3>
  43.         <ul class="tribe-events-sub-nav">
  44.             <li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link( '&laquo; %title%' ) ?></li>
  45.             <li class="tribe-events-nav-next"><?php tribe_the_next_event_link( '%title% &raquo;' ) ?></li>
  46.         </ul><!-- .tribe-events-sub-nav -->
  47.     </div><!-- #tribe-events-header -->
  48.  
  49.     <?php while ( have_posts() ) :  the_post(); ?>
  50.         <div id="post-<?php the_ID(); ?>" <?php post_class('vevent'); ?>>
  51.             <!-- Event featured image -->
  52.             <?php echo tribe_event_featured_image(); ?>
  53.  
  54.             <!-- Event content -->
  55.             <?php do_action( 'tribe_events_single_event_before_the_content' ) ?>
  56.             <div class="tribe-events-single-event-description tribe-events-content entry-content description">
  57.                 <?php the_content(); ?>
  58.             </div><!-- .tribe-events-single-event-description -->
  59.             <?php do_action( 'tribe_events_single_event_after_the_content' ) ?>
  60.  
  61.             <!-- Event meta -->
  62.  
  63. <?php
  64. $event_id = get_the_ID();
  65. $group_venue = apply_filters( 'tribe_events_single_event_the_meta_group_venue', false, $event_id );
  66. $html = '';
  67.  
  68.  
  69. $html .= '<div class="tribe-events-single-section tribe-events-event-meta tribe-clearfix">';
  70. // Event Details
  71. $html .= tribe_get_meta_group( 'tribe_event_details' );
  72.  
  73. // When there is no map show the venue info up top
  74. if ( ! $group_venue && ! tribe_embed_google_map( $event_id ) ) {
  75.     // Venue Details
  76.     $html .= tribe_get_meta_group( 'tribe_event_venue' );
  77.     $group_venue = false;
  78. } else if ( ! $group_venue && ! tribe_has_organizer( $event_id ) && tribe_address_exists( $event_id ) && tribe_embed_google_map( $event_id ) ) {
  79.     $html .= sprintf( '%s<div class="tribe-events-meta-group tribe-events-meta-group-gmap">%s</div>',
  80.         tribe_get_meta_group( 'tribe_event_venue' ),
  81.         tribe_get_meta( 'tribe_venue_map' )
  82.     );
  83.     $group_venue = false;
  84. } else {
  85.     $group_venue = true;
  86. }
  87.  
  88. // Organizer Details
  89. if ( tribe_has_organizer( $event_id ) ) {
  90.     $html .= tribe_get_meta_group( 'tribe_event_organizer' );
  91. }
  92.  
  93. //$html .= apply_filters( 'tribe_events_single_event_the_meta_addon', '', $event_id );
  94. $html .= '</div>';
  95.  
  96. if ( $group_venue ) {
  97.     // If there's a venue map and custom fields or organizer, show venue details in this seperate section
  98.     $venue_details = tribe_get_meta_group( 'tribe_event_venue' ) .
  99.         tribe_get_meta( 'tribe_venue_map' );
  100.  
  101.     if ( !empty($venue_details) ) {
  102.         $html .= apply_filters( 'tribe_events_single_event_the_meta_venue_row', sprintf( '<div class="tribe-events-single-section tribe-events-event-meta tribe-clearfix">%s</div>',
  103.             $venue_details
  104.         ) );
  105.     }
  106. }
  107.  
  108. echo $html;
  109. ?>
  110.  
  111.             </div><!-- .hentry .vevent -->
  112.         <?php if( get_post_type() == TribeEvents::POSTTYPE && tribe_get_option( 'showComments','no' ) == 'yes' ) { comments_template(); } ?>
  113.     <?php endwhile; ?>
  114.  
  115.     <!-- Event footer -->
  116.     <div id="tribe-events-footer">
  117.         <!-- Navigation -->
  118.         <!-- Navigation -->
  119.         <h3 class="tribe-events-visuallyhidden"><?php _e( 'Event Navigation', 'tribe-events-calendar' ) ?></h3>
  120.         <ul class="tribe-events-sub-nav">
  121.             <li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link( '&laquo; %title%' ) ?></li>
  122.             <li class="tribe-events-nav-next"><?php tribe_the_next_event_link( '%title% &raquo;' ) ?></li>
  123.         </ul><!-- .tribe-events-sub-nav -->
  124.     </div><!-- #tribe-events-footer -->
  125.  
  126. </div><!-- #tribe-events-content -->
Advertisement
Add Comment
Please, Sign In to add comment