Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created November 20, 2012 19:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/4120424 to your computer and use it in GitHub Desktop.
Save joshfeck/4120424 to your computer and use it in GitHub Desktop.
Adds number of available spaces next to each available event date. This block of code replaces the <ul> in the recurring event manager template's event_list_display.php
<ul>
<?php foreach ($events_group as $e) :
$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.
echo '<li>';
if ($num_attendees >= $e['reg_limit']) :
echo '<span class="error">';
else :
echo '<a href="'.$e['registration_url'].'">';
endif;
if ($e['start_date'] != $e['end_date']) :
echo event_date_display($e['start_date'], 'F j, Y').'–'.event_date_display($e['end_date'], 'F j, Y');
else :
echo event_date_display($e['start_date'], 'l, F j, Y');
endif;
if ($num_attendees >= $e['reg_limit']) :
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>';
else :
echo '</a>';
echo '&nbsp;Available spaces:&nbsp';
echo get_number_of_attendees_reg_limit($e['event_id'], 'available_spaces');
endif;
echo '</li>';
endforeach; ?>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment