Advertisement
Konark

modules\single-event.php

Aug 23rd, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.19 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Single Event Template for Widgets
  4.  *
  5.  * This template is used to render single events for both the calendar and advanced
  6.  * list widgets, facilitating a common appearance for each as standard.
  7.  *
  8.  * You can override this template in your own theme by creating a file at
  9.  * [your-theme]/tribe-events/widgets/modules/single-widget.php
  10.  *
  11.  * @package TribeEventsCalendarPro
  12.  *
  13.  * @cmsmasters_package  Petrovich
  14.  * @cmsmasters_version  1.0.0
  15.  *
  16.  */
  17.  
  18.  
  19. $mini_cal_event_atts = tribe_events_get_widget_event_atts();
  20.  
  21. $postDate = tribe_events_get_widget_event_post_date();
  22.  
  23. $organizer_ids = tribe_get_organizer_ids();
  24. $multiple_organizers = count( $organizer_ids ) > 1;
  25. ?>
  26. <div class="tribe-mini-calendar-event event-<?php esc_attr_e( $mini_cal_event_atts['current_post'] ); ?> <?php esc_attr_e( $mini_cal_event_atts['class'] ); ?>">
  27.     <div class="cmsmasters_event_date">
  28.         <div class="cmsmasters_event_date_inner">
  29.             <span class="cmsmasters_event_day_mon"><?php echo tribe_get_start_date(null, false, 'd.m'); ?></span>
  30.             <span class="cmsmasters_event_year"><?php echo tribe_get_start_date(null, false, 'Y'); ?></span>
  31.         </div>
  32.     </div>
  33.     <div class="tribe-events-list-widget-content-wrap">
  34.         <?php do_action( 'tribe_events_list_widget_before_the_event_title' ); ?>
  35.  
  36.         <h3 class="entry-title summary">
  37.             <a href="<?php echo esc_url( tribe_get_event_link() ); ?>" rel="bookmark"><?php the_title(); ?></a>
  38.         </h3>
  39.  
  40.         <?php do_action( 'tribe_events_list_widget_after_the_event_title' ); ?>
  41.  
  42.         <?php do_action( 'tribe_events_list_widget_before_the_meta' ) ?>
  43.        
  44.         <div class="cmsmasters_widget_event_info">
  45.             <div class="duration cmsmasters_theme_icon_time">
  46.                 <?php echo tribe_events_event_schedule_details(); ?>
  47.             </div>
  48.             <?php if ( isset( $cost ) && $cost && tribe_get_cost() != '' ) { ?>
  49.                 <div class="tribe-events-event-cost cmsmasters_theme_icon_money">
  50.                     <?php echo tribe_get_cost( null, true ); ?>
  51.                 </div>
  52.             <?php } ?>
  53.            
  54.             <div class="vcard adr location cmsmasters_widget_event_venue_info_loc">
  55.             <?php
  56.                 if (
  57.                     ( isset( $venue ) && $venue && tribe_get_venue() != '' ) ||
  58.                     ( isset( $address ) && $address && tribe_get_address() != '' ) ||
  59.                     ( isset( $city ) && $city && tribe_get_city() != '' ) ||
  60.                     ( isset( $region ) && $region && tribe_get_region() != '' ) ||
  61.                     ( isset( $zip ) && $zip && tribe_get_zip() != '' ) ||
  62.                     ( isset( $country ) && $country && tribe_get_country() != '' )
  63.                 ) {
  64.             ?>
  65.                 <div class="cmsmasters_widget_event_venue_info cmsmasters_theme_icon_user_address">
  66.                     <?php if ( isset( $venue ) && $venue && tribe_get_venue() != '' ): ?>
  67.                         <span class="tribe-events-venue"><?php echo tribe_get_venue_link(); ?></span>
  68.                     <?php endif ?>
  69.  
  70.                     <?php if ( isset( $address ) && $address && tribe_get_address() != '' ): ?>
  71.                         <span class="tribe-street-address"><?php echo tribe_get_address(); ?></span>
  72.                     <?php endif ?>
  73.  
  74.                     <?php if ( isset( $city ) && $city && tribe_get_city() != '' ): ?>
  75.                         <span class="tribe-events-locality"><?php echo tribe_get_city(); ?></span>
  76.                     <?php endif ?>
  77.  
  78.                     <?php if ( isset( $region ) && $region && tribe_get_region() != '' ): ?>
  79.                         <span class="tribe-events-region"><?php echo tribe_get_region(); ?></span>
  80.                     <?php endif ?>
  81.  
  82.                     <?php if ( isset( $zip ) && $zip && tribe_get_zip() != '' ): ?>
  83.                         <span class="tribe-events-postal-code"><?php echo tribe_get_zip(); ?></span>
  84.                     <?php endif ?>
  85.  
  86.                     <?php if ( isset( $country ) && $country && tribe_get_country() != '' ): ?>
  87.                         <span class="tribe-country-name"><?php echo tribe_get_country(); ?></span>
  88.                     <?php endif ?>
  89.                 </div>
  90.             <?php
  91.                 }
  92.                
  93.                
  94.                 if (
  95.                     ( isset( $organizer ) && $organizer && ! empty( $organizer_ids ) ) ||
  96.                     ( isset( $phone ) && $phone && tribe_get_phone() != '' )
  97.                 ) {
  98.             ?>
  99.                 <div class="cmsmasters_widget_event_venue_loc cmsmasters_theme_icon_person">
  100.                     <?php if ( ! empty( $organizer_ids ) ): ?>
  101.                         <span class="tribe-events-organizer">
  102.                             <?php
  103.                             $organizer_links = array();
  104.                             foreach ( $organizer_ids as $organizer_id ) {
  105.                                 if ( ! $organizer_id ) {
  106.                                     continue;
  107.                                 }
  108.  
  109.                                 $organizer_links[] = tribe_get_organizer_link( $organizer_id, true );
  110.                             }// end foreach
  111.  
  112.                             $and = _x( 'and', 'list separator for final two elements', 'tribe-events-calendar-pro' );
  113.                             if ( 1 == count( $organizer_links ) ) {
  114.                                 echo $organizer_links[0];
  115.                             }// end if
  116.                             elseif ( 2 == count( $organizer_links ) ) {
  117.                                 echo $organizer_links[0] . ' ' . esc_html( $and ) . ' ' . $organizer_links[1];
  118.                             }// end elseif
  119.                             else {
  120.                                 $last_organizer = array_pop( $organizer_links );
  121.  
  122.                                 echo implode( ', ', $organizer_links );
  123.                                 echo esc_html( ', ' . $and . ' ' );
  124.                                 echo $last_organizer;
  125.                             }// end else
  126.                             ?>
  127.                         </span>
  128.                     <?php endif ?>
  129.  
  130.                     <?php if ( isset( $phone ) && $phone && tribe_get_phone() != '' ) { ?>
  131.                         <span class="tribe-events-tel"><?php echo tribe_get_phone(); ?></span>
  132.                     <?php } ?>
  133.                 </div>
  134.                 <?php } ?>
  135.             </div>
  136.         </div>
  137.        
  138.         <?php do_action( 'tribe_events_list_widget_after_the_meta' ) ?>
  139.     </div>
  140. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement