Guest User

Tim's Code

a guest
Jan 24th, 2012
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.46 KB | None | 0 0
  1. <?php
  2. /**
  3. * A single event.  This displays the event title, description, meta, and
  4. * optionally, the Google map for the event.
  5. *
  6. * You can customize this view by putting a replacement file of the same name (single.php) in the events/ directory of your theme.
  7. */
  8.  
  9. // Don't load directly
  10. if ( !defined('ABSPATH') ) { die('-1'); }
  11.  
  12. ?>
  13. <span class="back"><a href="<?php echo tribe_get_events_link(); ?>"><?php _e('&laquo; Back to Events', 'tribe-events-calendar'); ?></a></span>                                                        
  14. <?php if (tribe_get_end_date() > time()  ) { ?><small><?php  _e('This event has passed.', 'tribe-events-calendar') ?></small> <?php } ?>
  15. <div id="tribe-events-event-meta" itemscope itemtype="http://schema.org/Event">
  16.                 <dl class="column">
  17.                                 <dt><?php _e('Event:', 'tribe-events-calendar') ?></dt>
  18.                                 <dd itemprop="name"><span class="summary"><?php the_title() ?></span></dd>
  19.                                 <?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?>
  20.                                                 <dt><?php _e('Start:', 'tribe-events-calendar') ?></dt>
  21.                                                 <dd><meta itemprop="startDate" content="<?php echo tribe_get_start_date( null, false, 'Y-m-d-h:i:s' ); ?>"/><?php echo tribe_get_start_date(); ?></dd>
  22.                                                 <dt><?php _e('End:', 'tribe-events-calendar') ?></dt>
  23.                                                 <dd><meta itemprop="endDate" content="<?php echo tribe_get_end_date( null, false, 'Y-m-d-h:i:s' ); ?>"/><?php echo tribe_get_end_date();  ?></dd>                                                                                          
  24.                                 <?php } else { ?>
  25.                                                 <dt><?php _e('Date:', 'tribe-events-calendar') ?></dt>
  26.                                                 <dd><meta itemprop="startDate" content="<?php echo tribe_get_start_date( null, false, 'Y-m-d-h:i:s' ); ?>"/><?php echo tribe_get_start_date(); ?></dd>
  27.                                 <?php } ?>
  28.                                 <?php if ( tribe_get_cost() ) : ?>
  29.                                                 <dt><?php _e('Cost:', 'tribe-events-calendar') ?></dt>
  30.                                                 <dd itemprop="price"><?php echo tribe_get_cost(); ?></dd>
  31.                                 <?php endif; ?>
  32.                                 <?php tribe_meta_event_cats(); ?>
  33.                                 <?php if ( tribe_get_organizer_link( get_the_ID(), false, false ) ) : ?>
  34.                                                 <dt><?php _e('Organizer:', 'tribe-events-calendar') ?></dt>
  35.                                                 <dd class="vcard author"><span class="fn url"><?php echo tribe_get_organizer_link(); ?></span></dd>
  36.       <?php elseif (tribe_get_organizer()): ?>
  37.                                                 <dt><?php _e('Organizer:', 'tribe-events-calendar') ?></dt>
  38.                                                 <dd class="vcard author"><span class="fn url"><?php echo tribe_get_organizer(); ?></span></dd>
  39.                                 <?php endif; ?>
  40.                                 <?php if ( tribe_get_organizer_phone() ) : ?>
  41.                                                 <dt><?php _e('Phone:', 'tribe-events-calendar') ?></dt>
  42.                                                 <dd itemprop="telephone"><?php echo tribe_get_organizer_phone(); ?></dd>
  43.                                 <?php endif; ?>
  44.                                 <?php if ( tribe_get_organizer_email() ) : ?>
  45.                                                 <dt><?php _e('Email:', 'tribe-events-calendar') ?></dt>
  46.                                                 <dd itemprop="email"><a href="mailto:<?php echo tribe_get_organizer_email(); ?>"><?php echo tribe_get_organizer_email(); ?></a></dd>
  47.                                 <?php endif; ?>
  48.                                 <dt><?php _e('Updated:', 'tribe-events-calendar') ?></dt>
  49.                                 <dd><span class="date updated"><?php the_date(); ?></span></dd>
  50.                                 <?php if ( class_exists('TribeEventsRecurrenceMeta') && function_exists('tribe_get_recurrence_text') && tribe_is_recurring_event() ) : ?>
  51.                                                 <dt><?php _e('Schedule:', 'tribe-events-calendar') ?></dt>
  52.          <dd><?php echo tribe_get_recurrence_text(); ?>
  53.             <?php if( class_exists('TribeEventsRecurrenceMeta') && function_exists('tribe_all_occurences_link')): ?>(<a href='<?php tribe_all_occurences_link() ?>'>See all</a>)<?php endif; ?>
  54.          </dd>
  55.                                 <?php endif; ?>
  56.                 </dl>
  57.                 <dl class="column" itemprop="location" itemscope itemtype="http://schema.org/Place">
  58.                                 <?php if(tribe_get_venue()) : ?>
  59.                                 <dt><?php _e('Venue:', 'tribe-events-calendar') ?></dt>
  60.                                 <dd itemprop="name">
  61.                                                 <?php if( class_exists( 'TribeEventsPro' ) ): ?>
  62.                                                                 <?php tribe_get_venue_link( get_the_ID(), class_exists( 'TribeEventsPro' ) ); ?>
  63.                                                 <?php else: ?>
  64.                                                                 <?php echo tribe_get_venue( get_the_ID() ) ?>
  65.                                                 <?php endif; ?>
  66.                                 </dd>
  67.                                 <?php endif; ?>
  68.                                 <?php if(tribe_get_phone()) : ?>
  69.                                 <dt><?php _e('Phone:', 'tribe-events-calendar') ?></dt>
  70.                                                 <dd itemprop="telephone"><?php echo tribe_get_phone(); ?></dd>
  71.                                 <?php endif; ?>
  72.                                 <?php if( tribe_address_exists( get_the_ID() ) ) : ?>
  73.                                 <dt>
  74.                                                 <?php _e('Address:', 'tribe-events-calendar') ?><br />
  75.                                                 <?php if( tribe_show_google_map_link( get_the_ID() ) ) : ?>
  76.                                                                 <a class="gmap" itemprop="maps" href="<?php echo tribe_get_map_link() ?>" title="<?php _e('Click to view a Google Map', 'tribe-events-calendar'); ?>" target="_blank"><?php _e('Google Map', 'tribe-events-calendar' ); ?></a>
  77.                                                 <?php endif; ?>
  78.                                 </dt>
  79.                                                 <dd>
  80.                                                 <?php echo tribe_get_full_address( get_the_ID() ); ?>
  81.                                                 </dd>
  82.                                 <?php endif; ?>
  83.                 </dl>
  84.  
  85.                 <?php if( function_exists('tribe_the_custom_fields') ): ?>
  86.                                 <?php echo tribe_the_custom_fields( get_the_ID() ); ?>
  87.                 <?php endif; ?>
  88. </div>
  89. <?php if( tribe_embed_google_map( get_the_ID() ) ) : ?>
  90. <?php if( tribe_address_exists( get_the_ID() ) ) { echo tribe_get_embedded_map(); } ?>
  91. <?php endif; ?>
  92. <div class="entry">
  93.                 <?php
  94.                 if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {?>
  95.                                 <?php the_post_thumbnail(); ?>
  96.                 <?php } ?>
  97.                 <div class="summary"><?php the_content() ?></div>
  98.                 if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {
  99. the_post_thumbnail();
  100. }
  101.                 <?php if (function_exists('tribe_get_ticket_form')) { tribe_get_ticket_form(); } ?>                        
  102. </div>
  103. <?php if( function_exists('tribe_get_single_ical_link') ): ?>
  104.    <a class="ical single" href="<?php echo tribe_get_single_ical_link(); ?>"><?php _e('iCal Import', 'tribe-events-calendar'); ?></a>
  105. <?php endif; ?>
  106. <?php if( function_exists('tribe_get_gcal_link') ): ?>
  107.    <a href="<?php echo tribe_get_gcal_link() ?>" class="gcal-add" title="<?php _e('Add to Google Calendar', 'tribe-events-calendar'); ?>"><?php _e('+ Google Calendar', 'tribe-events-calendar'); ?></a>
  108. <?php endif; ?>
  109.  
  110. <div class="navlink previous"><?php tribe_previous_event_link();?></div>
  111.  
  112. <div class="navlink next"><?php tribe_next_event_link();?></div>
  113. <div style="clear:both"></div>
Advertisement
Add Comment
Please, Sign In to add comment