Advertisement
Semblance

even_list_display.php

Nov 20th, 2012
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.13 KB | None | 0 0
  1. <?php
  2. //This is the event list template page.
  3. //This is a template file for displaying an event lsit on a page.
  4. //There should be a copy of this file in your wp-content/uploads/espresso/ folder.
  5. /*
  6. * use the following shortcodes in a page or post:
  7. * [EVENT_LIST]
  8. * [EVENT_LIST limit=1]
  9. * [EVENT_LIST show_expired=true]
  10. * [EVENT_LIST show_deleted=true]
  11. * [EVENT_LIST show_secondary=true]
  12. * [EVENT_LIST show_recurrence=true]
  13. * [EVENT_LIST category_identifier=your_category_identifier]
  14. *
  15. * Example:
  16. * [EVENT_LIST limit=5 show_recurrence=true category_identifier=your_category_identifier]
  17. *
  18. */
  19. $first_event_instance = $events_group[0];
  20. $first_event_excerpt = array_shift(explode('<!--more-->', html_entity_decode($first_event_instance['event_desc'])));
  21.  
  22. ?>
  23.  
  24. <div id="event_data-<?php echo $first_event_instance['event_id']?>" class="event_data subpage_excerpt r <?php echo $css_class; ?> <?php echo $category_identifier; ?> event-data-display event-list-display event-display-boxes ui-widget">
  25.    
  26.     <h3 id="event_title-<?php echo $first_event_instance['event_id']?>" class="event_title ui-widget-header ui-corner-top">
  27.    
  28.             <?php echo stripslashes_deep($first_event_instance['event_name'])?></h3>
  29.            
  30.         <div class="event-thumb"
  31.             <img src="<?php echo $first_event_instance['event_meta']['event_thumbnail_url']?>" />
  32.         </div> 
  33.     <div class="event-data-display ui-widget-content ui-corner-bottom">
  34.    
  35.     <?php if ( $event->event_cost != '0.00' ) { ?>
  36.                  <p id="p_event_price-<?php echo $event_id ?>" class="event_price"><span class="section-title"><?php  echo __('Price: ', 'event_espresso'); ?></span> <?php echo  $org_options['currency_symbol'].$event->event_cost; ?></p>
  37.             <?php } else { ?>
  38.                 <p id="p_event_price-<?php echo $event_id ?>" class="event_price"><?php echo __('Free Event', 'event_espresso'); ?></p>
  39.             <?php } ?>
  40.            
  41.             <p id="available_spaces-<?php echo $event_id ?>" class="spaces-available"><span class="section-title"><?php _e('Available Spaces:', 'event_espresso') ?></span> <?php echo get_number_of_attendees_reg_limit($event_id, 'available_spaces') ?></p>
  42.    
  43.     <?php if (count($events_group) > 1) :
  44.             //Show short descriptions
  45.             if ($first_event_excerpt != '' && isset($org_options['display_short_description_in_event_list']) && $org_options['display_short_description_in_event_list'] == 'Y') { ?>
  46.                  <p><?php echo espresso_format_content($first_event_excerpt); ?></p>
  47.         <?php }?>
  48.        
  49.         <script type="text/javascript">
  50.             $jaer = jQuery.noConflict();
  51.         </script>
  52.        
  53.         <p><a href="#" onClick="$jaer('#date_picker_<?php echo $first_event_instance['event_id']?>').slideDown('slow');$jaer(this).parent().slideUp('slow');return false;" class="register_date" id="register_date_<?php echo $first_event_instance['event_id']?>">Register Now</a></p>
  54.         <div class="date_picker" id="date_picker_<?php echo $first_event_instance['event_id']?>">
  55.             <h6 style="margin-top:20px; top:-4px"><?php _e('Please Select a Date', 'event_espresso'); ?></h6>
  56.            
  57.             <ul>
  58.                 <?php foreach ($events_group as $e) :
  59.                     $num_attendees = get_number_of_attendees_reg_limit($e['event_id'], 'num_attendees');//Get the number of attendees. Please visit http://eventespresso.com/forums/?p=247 for available parameters for the get_number_of_attendees_reg_limit() function.
  60.                     echo '<li>';
  61.                     if ($num_attendees >= $e['reg_limit']) :
  62.                         echo '<span class="error">';
  63.                     else :
  64.                         echo '<a href="'.$e['registration_url'].'">';
  65.                     endif;
  66.                     if ($e['start_date'] != $e['end_date']) :
  67.                         echo event_date_display($e['start_date'], 'F j, Y').'–'.event_date_display($e['end_date'], 'F j, Y');
  68.                     else :
  69.                         echo event_date_display($e['start_date'], 'l, F j, Y');
  70.                     endif;
  71.                     if ($num_attendees >= $e['reg_limit']) :
  72.                         echo ' Sold Out</span> <a href="'.get_option('siteurl').'/?page_id='.$e['event_page_id'].'&e_reg=register&event_id='.$e['overflow_event_id'].'&name_of_event='.stripslashes_deep($e['event_name']).'">'.__('(Join Waiting List)').'</a>';
  73.                     else :
  74.                         echo '</a>';
  75.                     endif;
  76.                     echo '</li>';
  77.                 endforeach; ?>
  78.             </ul>
  79.            
  80.        
  81.         </div>
  82.     <?php else : ?>
  83.        
  84.         <h6><?php echo event_date_display($events_group[0]['start_date'], get_option('date_format'));
  85.             if ($events_group[0]['start_date'] != $events_group[0]['end_date']) :
  86.             echo '–'.event_date_display($events_group[0]['end_date'], get_option('date_format'));
  87.             endif; ?>
  88.         </h6>
  89.        
  90.         <?php //Show short descriptions
  91.             if ($first_event_excerpt != '' && isset($org_options['display_short_description_in_event_list']) && $org_options['display_short_description_in_event_list'] == 'Y') { ?>
  92.                  <p><?php echo stripslashes_deep(wpautop($first_event_excerpt)); ?></p>
  93.         <?php }?>
  94.         <?php $num_attendees = get_number_of_attendees_reg_limit($first_event_instance['event_id'], 'num_attendees'); ?>
  95.         <?php if ($num_attendees >= $events_group[0]['reg_limit']) : ?>
  96.            
  97.             <p><span class="error">Sold Out</span> <a href="<?php echo get_option('siteurl')?>/?page_id=<?php echo $first_event_instance['event_page_id']?>&e_reg=register&event_id=<?php echo $first_event_instance['overflow_event_id']?>&name_of_event=<?php echo stripslashes_deep($first_event_instance['event_name'])?>" title="<?php echo stripslashes_deep($first_event_instance['event_name'])?>"><?php _e('Join Waiting List', 'event_espresso'); ?></a></p>
  98.            
  99.         <?php else : ?>
  100.            
  101.             <p><a href="<?php echo $first_event_instance['registration_url']; ?>" title="<?php echo stripslashes_deep($first_event_instance['event_name'])?>"><?php _e('Register Now', 'event_espresso'); ?></a></p>
  102.        
  103.         <?php endif; ?>
  104.     <?php endif; ?>
  105.    
  106.    
  107.    
  108. </div>
  109. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement