Skip to content

Instantly share code, notes, and snippets.

@Apina
Last active March 1, 2016 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Apina/65d8ed21addf4c067e41 to your computer and use it in GitHub Desktop.
Save Apina/65d8ed21addf4c067e41 to your computer and use it in GitHub Desktop.
EE available spaces modification - a quick and dirty mod to change what is shown for available spaces in the event_list_display.php and the registration_page_display.php files. The existing references to the available spaces will need to be commented out/removed.
<?php
$new_available_spaces = get_number_of_attendees_reg_limit($event_id, 'available_spaces'); //Gets a count of the available spaces
$display_spaces_text = '';
if ($new_available_spaces == '0') { $display_spaces_text = 'No places'; }
elseif ($new_available_spaces <= '10') { $display_spaces_text = 'Final few'; }
elseif ($new_available_spaces > '10' && $new_available_spaces <= '49') { $display_spaces_text = 'Some places'; }
elseif ($new_available_spaces > '49') { $display_spaces_text = $new_available_spaces; }
elseif ($new_available_spaces === 'Unlimited') { $display_spaces_text = 'Unlimited'; }
echo "<strong>Remaining Spaces: </strong>" . $display_spaces_text;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment