Advertisement
cw17s0n

single.php

Apr 26th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.83 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.  
  10. // Don't load directly
  11.  
  12.  
  13.  
  14. if ( !defined('ABSPATH') ) { die('-1'); }
  15. ?>
  16.                
  17.  
  18.  
  19.  
  20.  
  21.  
  22. <?php
  23.     $gmt_offset = (get_option('gmt_offset') >= '0' ) ? ' +' . get_option('gmt_offset') : " " . get_option('gmt_offset');
  24.     $gmt_offset = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $gmt_offset );
  25.     if (strtotime( tribe_get_end_date(get_the_ID(), false, 'Y-m-d G:i') . $gmt_offset ) <= time() ) { ?><div class="event-passed"><?php  _e('This event has passed.', 'tribe-events-calendar') ?></div><?php } ?>
  26. <div id="tribe-events-event-meta" itemscope itemtype="http://schema.org/Event">
  27.     <dl class="column">
  28.         <dt class="event-label event-label-name"><?php _e('Event:', 'tribe-events-calendar') ?></dt>
  29.         <dd itemprop="name" class="event-meta event-meta-name"><span class="summary"><?php the_title() ?></span></dd>
  30.         <?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?>
  31.             <dt class="event-label event-label-start"><?php _e('Start:', 'tribe-events-calendar') ?></dt>
  32.             <dd class="event-meta event-meta-start"><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>
  33.             <dt class="event-label event-label-end"><?php _e('End:', 'tribe-events-calendar') ?></dt>
  34.             <dd class="event-meta event-meta-end"><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>                    
  35.         <?php } else { ?>
  36.             <dt class="event-label event-label-date"><?php _e('Date:', 'tribe-events-calendar') ?></dt>
  37.             <dd class="event-meta event-meta-date"><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>
  38.         <?php } ?>
  39.         <?php if ( tribe_get_cost() ) : ?>
  40.             <dt class="event-label event-label-cost"><?php _e('Cost:', 'tribe-events-calendar') ?></dt>
  41.             <dd itemprop="price" class="event-meta event-meta-cost"><?php echo tribe_get_cost(); ?></dd>
  42.         <?php endif; ?>
  43.         <?php tribe_meta_event_cats(); ?>
  44.         <?php if ( tribe_get_organizer_link( get_the_ID(), false, false ) ) : ?>
  45.             <dt class="event-label event-label-organizer"><?php _e('Organizer:', 'tribe-events-calendar') ?></dt>
  46.             <dd class="vcard author event-meta event-meta-author"><span class="fn url"><?php echo tribe_get_organizer_link(); ?></span></dd>
  47.       <?php elseif (tribe_get_organizer()): ?>
  48.             <dt class="event-label event-label-organizer"><?php _e('Organizer:', 'tribe-events-calendar') ?></dt>
  49.             <dd class="vcard author event-meta event-meta-author"><span class="fn url"><?php echo tribe_get_organizer(); ?></span></dd>
  50.         <?php endif; ?>
  51.         <?php if ( tribe_get_organizer_phone() ) : ?>
  52.             <dt class="event-label event-label-organizer-phone"><?php _e('Phone:', 'tribe-events-calendar') ?></dt>
  53.             <dd itemprop="telephone" class="event-meta event-meta-phone"><?php echo tribe_get_organizer_phone(); ?></dd>
  54.         <?php endif; ?>
  55.         <?php if ( tribe_get_organizer_email() ) : ?>
  56.             <dt class="event-label event-label-email"><?php _e('Email:', 'tribe-events-calendar') ?></dt>
  57.             <dd itemprop="email" class="event-meta event-meta-email"><a href="mailto:<?php echo tribe_get_organizer_email(); ?>"><?php echo tribe_get_organizer_email(); ?></a></dd>
  58.         <?php endif; ?>
  59.         <dt class="event-label event-label-updated"><?php _e('Updated:', 'tribe-events-calendar') ?></dt>
  60.         <dd class="event-meta event-meta-updated"><span class="date updated"><?php the_date(); ?></span></dd>
  61.         <?php if ( class_exists('TribeEventsRecurrenceMeta') && function_exists('tribe_get_recurrence_text') && tribe_is_recurring_event() ) : ?>
  62.             <dt class="event-label event-label-schedule"><?php _e('Schedule:', 'tribe-events-calendar') ?></dt>
  63.          <dd class="event-meta event-meta-schedule"><?php echo tribe_get_recurrence_text(); ?>
  64.             <?php if( class_exists('TribeEventsRecurrenceMeta') && function_exists('tribe_all_occurences_link')): ?>(<a href='<?php tribe_all_occurences_link() ?>'>See all</a>)<?php endif; ?>
  65.          </dd>
  66.         <?php endif; ?>
  67.     </dl>
  68.     <dl class="column" itemprop="location" itemscope itemtype="http://schema.org/Place">
  69.         <?php if(tribe_get_venue()) : ?>
  70.         <dt class="event-label event-label-venue"><?php _e('Venue:', 'tribe-events-calendar') ?></dt>
  71.         <dd itemprop="name" class="event-meta event-meta-venue">
  72.             <?php if( class_exists( 'TribeEventsPro' ) ): ?>
  73.                 <?php tribe_get_venue_link( get_the_ID(), class_exists( 'TribeEventsPro' ) ); ?>
  74.             <?php else: ?>
  75.                 <?php echo tribe_get_venue( get_the_ID() ) ?>
  76.             <?php endif; ?>
  77.         </dd>
  78.         <?php endif; ?>
  79.         <?php if(tribe_get_phone()) : ?>
  80.         <dt class="event-label event-label-venue-phone"><?php _e('Phone:', 'tribe-events-calendar') ?></dt>
  81.             <dd itemprop="telephone" class="event-meta event-meta-venue-phone"><?php echo tribe_get_phone(); ?></dd>
  82.         <?php endif; ?>
  83.         <?php if( tribe_address_exists( get_the_ID() ) ) : ?>
  84.         <dt class="event-label event-label-address">
  85.             <?php _e('Address:', 'tribe-events-calendar') ?><br />
  86.             <?php if( tribe_show_google_map_link( get_the_ID() ) ) : ?>
  87.                 <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>
  88.             <?php endif; ?>
  89.         </dt>
  90.             <dd class="event-meta event-meta-address">
  91.             <?php echo tribe_get_full_address( get_the_ID() ); ?>
  92.             </dd>
  93.         <?php endif; ?>
  94.     </dl>
  95.  
  96.     <?php if( function_exists('tribe_the_custom_fields') && tribe_get_custom_fields( get_the_ID() ) ): ?>
  97.         <?php tribe_the_custom_fields( get_the_ID() ); ?>
  98.     <?php endif; ?>
  99. </div>
  100. <?php if( tribe_embed_google_map( get_the_ID() ) ) : ?>
  101. <?php if( tribe_address_exists( get_the_ID() ) ) { echo tribe_get_embedded_map(); } ?>
  102. <?php endif; ?>
  103. <div class="entry">
  104.     <?php
  105.     if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {?>
  106.         <?php the_post_thumbnail(); ?>
  107.     <?php } ?>
  108.     <div class="summary"><?php the_content() ?></div>
  109.     <?php if (function_exists('tribe_get_ticket_form') && tribe_get_ticket_form()) { tribe_get_ticket_form(); } ?>     
  110. </div>
  111. <?php if( function_exists('tribe_get_single_ical_link') ): ?>
  112.    <a class="ical single" href="<?php echo tribe_get_single_ical_link(); ?>"><?php _e('iCal Import', 'tribe-events-calendar'); ?></a>
  113. <?php endif; ?>
  114. <?php if( function_exists('tribe_get_gcal_link') ): ?>
  115.    <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>
  116. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement