Advertisement
Guest User

event-list-display

a guest
Nov 13th, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.26 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.  
  25. <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">
  26.    
  27.     <h2 id="event_title-<?php echo $first_event_instance['event_id']?>" class="event_title">
  28.             <?php echo stripslashes_deep($first_event_instance['event_name'])?></h2>
  29.    
  30.     <div>
  31.     <?php echo $event_meta['event_thumbnail_url'];?>
  32.     </div>     
  33.            
  34.     <?php if (count($events_group) > 1) :
  35.             //Show short descriptions
  36.             if ($first_event_excerpt != '' && isset($org_options['display_short_description_in_event_list']) && $org_options['display_short_description_in_event_list'] == 'Y') { ?>
  37.                  <p><?php echo stripslashes_deep(wpautop($first_event_excerpt)); ?></p>
  38.         <?php }?>
  39.        
  40.         <script type="text/javascript">
  41.             $jaer = jQuery.noConflict();
  42.         </script>
  43.        
  44.         <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>
  45.         <div class="date_picker" id="date_picker_<?php echo $first_event_instance['event_id']?>">
  46.             <h6 style="margin-top:20px; top:-4px"><?php _e('Please Select a Date', 'event_espresso'); ?></h6>
  47.            
  48.             <ul>
  49.                 <?php foreach ($events_group as $e) :
  50.                     $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.
  51.                     echo '<li>';
  52.                     if ($num_attendees >= $e['reg_limit']) :
  53.                         echo '<span class="error">';
  54.                     else :
  55.                         echo '<a href="'.$e['registration_url'].'">';
  56.                     endif;
  57.                     if ($e['start_date'] != $e['end_date']) :
  58.                         echo event_date_display($e['start_date'], 'F j, Y').'–'.event_date_display($e['end_date'], 'F j, Y');
  59.                     else :
  60.                         echo event_date_display($e['start_date'], 'l, F j, Y');
  61.                     endif;
  62.                     if ($num_attendees >= $e['reg_limit']) :
  63.                         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>';
  64.                     else :
  65.                         echo '</a>';
  66.                     endif;
  67.                     echo '</li>';
  68.                 endforeach; ?>
  69.             </ul>
  70.            
  71.         </div>
  72.        
  73.     <?php else : ?>
  74.        
  75.         <h6><?php echo event_date_display($events_group[0]['start_date'], get_option('date_format'));
  76.             if ($events_group[0]['start_date'] != $events_group[0]['end_date']) :
  77.             echo '–'.event_date_display($events_group[0]['end_date'], get_option('date_format'));
  78.             endif; ?>
  79.         </h6>
  80.        
  81.         <?php //Show short descriptions
  82.             if ($first_event_excerpt != '' && isset($org_options['display_short_description_in_event_list']) && $org_options['display_short_description_in_event_list'] == 'Y') { ?>
  83.                  <p><?php echo stripslashes_deep(wpautop($first_event_excerpt)); ?></p>
  84.         <?php }?>
  85.         <?php $num_attendees = get_number_of_attendees_reg_limit($first_event_instance['event_id'], 'num_attendees'); ?>
  86.         <?php if ($num_attendees >= $events_group[0]['reg_limit']) : ?>
  87.            
  88.             <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>
  89.            
  90.         <?php else : ?>
  91.            
  92.             <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>
  93.        
  94.         <?php endif; ?>
  95.     <?php endif; ?>
  96.  
  97. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement