Events Manager 5.5
Posted on August 14, 2013
It has been almost two months since our last release, which must be one of the longest periods lately between releases. However, since we never really stop working on things, the more time between releases the more to expect and this update we have a few treats for you!
One major reason for this delay is because of changes that occurred in the templates folder and allowing time for people to test out the dev version and new templates. It is inevitable that many of these improvements have required changes to our template files. We try not to modify these template files in order to make them more upgrade-safe, however it sometimes gets to a point where changes are necessary to push the plugin to new levels.
New Features in 5.5
Aside from a ton of bug fixes and minor improvements, we have a few new features to show off:
New Ticket Restriction Options and Admin User Interface
We’ve added some cool new restriction options to individual tickets, which include:
- Restriction of ticket availability to specific user roles
- Tickets can be restricted to only Guests (non-logged-in users)
- Tickets can now be made available between specific times within a day
- You can now put a cap on how many spaces between all tickets that can be made in a single booking
These three options provide a new slew of possibilities. Most notably, sites using Events Manager in combination with membership plugins like s2Member can now offer discounted ticket prices to members and further differentiate those prices by membership level!
Alongside these new features (and partially due to these new features), we’ve revamped part of the ticket creation interface to remove dependency on the jQuery UI dialog script that ships with WordPress, which sometimes created conflicts with other themes and plugins (even though in theory we should be allowed to make use of this library).
Instead, we now use inline forms which will allow us and you to add more features to these ticket options in the future if need be. You’ll also notice that some less-common ticket options are now tucked into a collapsible advanced options section to save on space.
We’re still not done yet with this section, we’re intending on adding some more styling to the tickets section as part of a bigger style overhaul, however this lays down the groundwork.
New Search Form
The most significant change you’ll notice is the search form. We’ve revamped the search form so that it now works for location searches, makes use of AJAX features, and comes with a fancy new style and layout! Here’s a sneak peak, which you can also check out on our demo site:
You can still configure the form to include/exclude fields as before, and even more in your settings page. If you still prefer the old style, or you have made customizations to the search forms in the past, we still provide backward compatibility.
Moreover, you can now use shortcodes and provide arguments to build your own custom form outside of the Events page which can also display results without skipping to the main events page using our new AJAX feature!
GeoLocation : Search near a specific location
You’ll notice in the screenshot above that we now allow you to search near a specific location. We’ve also added new search attributes near (coordinates), near_unit (km or mi) and near_distance (search radius) which you can use within your shortcode or template tags.
The search form comes with a neat autocompletion ‘Search Near’ field which makes use of the super-fast google places library. This is a free service so there’s no need for API keys or signing up for access, it just works out the box.
This is only the first step in Geo searching capabilities and the work done here has opened our eyes to lots of potential directions we can take with this. As time passes we’ll evaluate the role of Geo searching within Events Manager and develop even more useful features surrounding this concept of local events.
You can now add the same search form above to your locations list page by visiting Settings > Pages > Location List/Archives and enabling the search form. Additionally, you can also add location search forms to your site by using shortcode [location_search_form] . Yay!
AJAX searches and pagination!
This feature is currently turned off by default, and will be phased in as default in an upcoming release (so if you don’t want AJAX ever, set the line below to false instead of true). Add this line to your wp-config.php file:
And power the search form and pagination with AJAX, preventing reloading of the whole page each time a search or page change is done!
Additionally, you can enable ajax in individual event/location/category/tag lists or location/event search forms by supplying ajax=”1″ into the shortcode.
Custom Styling Flags
The search form is the first part of the plugin that’ll see a little styling love in the coming months. One of the great things about Events Manager is that it imposes minimal CSS rules and uses clean HTML structures to enable designers the possibility of easily overriding our styles as well as enabling the plugin to integrate with different theme style structures. We don’t intend on changing that (or at least changing it without giving you the option not to!)
However, in many cases (especially for the more CSS/HTML-challenged users among us) it’d be great to have a default style that prevents themes from adding unwanted padding and other rules that result in unsightly content.
Therefore, we’ve added various styling options that will add CSS classes to various elements on the website which we will eventually make use of to add some more styling. We’ll still strive to maintain a ‘minimalist’ approach so that the interface remains simple and clean, but hopefully will provide a more unified style.
We’re intending on adding some basic styles to:
- Event/Location admin pages
- Booking admin pages
- Events/Locations/Categories/Tags single and list pages
- Event booking forms
These styling option will be located in the Settings > General > Styling Options section, and whilst still don’t have associated CSS rules, they’re there so you know about it.
Improved Calendar Performance
Okay, so this isn’t really a feature, but it’s worth a quick mention. Users running hundreds and thousands of events per month will have noticed very sluggish calendars. We’ve made some significant improvements to the overall logic used to obtain information for that calendar month, and you should notice significant improvements when loading these pages and also switching from month to month.
Changes to Templates
We’ve taken as much care as possible to make these backwards compatible so if you don’t change your templates you shouldn’t experience any broken pages, although you’ll be missing out on our new features!
We hope that this won’t include more changes to the templates, we’ve held off on publishing a dev version until now so we had time to make those changes in one go.
Reduced to one line, which includes the em_bookings_admin() function
Now uses the function $EM_Ticket->is_displayable() to determine whether or not to show a ticket (which is takes the new ticket restrictions above into account).
Changed h4 titles into h3 titles, removed the code at the bottom of the file which includes the code for the ticket dialog box (which is now deprecated)
removed google map code and loading it from a template file, added classes to table rows
forms/event/bookings.php (major change)
- Converted bolded titles into h4 tags,
- added maximum spaces per booking option
- changed overall structure of multiple tickets to accommodate the new inline ticket editor
- fixed a potential XSS vulnerability
fixed minor php warning triggered under certain circumstances
Converted h4 titles into h3 titles, added class names to each section, added escaping/sanitization to various output
removed google map code and loading it from a template file, added classes to table rows
forms/ticket-form.php and forms/tickets-form.php
Both are now deprecated and load the file forms/event/bookings-ticket-form.php instead
Added optional class flag for future styling possibilities
Removed looping of events which prevent more than the maximum number of events per day to be listed, now displays all events in the day (which already contains the maximum number of events) and shows a more linked based on a count of events.
templates/events-search.php (major changes)
- restructured HTML
- individual search fields are now split up as individual templates in the templates/search folder
- display of fields controlled by arguments passed on to template via $args
- various fields into ‘advanced’ section which can be collapsed by default to save space
- added div with em-search-ajax class so if $arg[‘ajax’] is passed on results are loaded via AJAX without sending users to events page
- minor change between 184.108.40.206 and 220.127.116.11 – changed the new search button element to be IE7 compatible
These files have been drastically simplified so that they only contain 4 lines! These include $args filter for you to hook into, a wrapping div element (for our custom styling flags above), and the relevant output function such as EM_Events::output(). We’ll include events-list.php with it’s own section:
Aside from removing extra unnecessary code that should be handled by the core plugin and not templates, we’ve made some significant changes to this template. It now consists of 4 lines like the other list.php templates!
- removed the inclusion of the search form template (now included separately)
- overridden templates that include the search form the old way shouldn’t have a problem, we changed the name of the option which includes search forms and removed the old one.
- moved grouped event lists out of this template into the new templates/events-list-grouped.php template
moved div.em-locations-map-coords into the map container div.em-location-map-container
rewritten to accomodate the new Google autocompleter
Let us know what you think!
Drop us a line below if you have any thoughts about the new updates. If you have problems with the new update or spot any bugs, please use our pro or free forums instead and mention you’re running the dev version so we can help you debug it.
Last but not least, here’s a list of changes which you’ll find in the readme.txt
- fixed different versions of http/https maps js libraries being called
- added performance improvements to calendar queries and generation, speeding up calendars with many events per month
- added Reunion to countries list
- added more meaningful text to settings page to clarify booking pages
- added link to profile page to avoid confusion with admin test emails
- fixed php warning in my bookings page bottom pagination
- changed booking ticket editor forms and removed the jQuery UI Dialog in favour of inline forms
- added guest-only ticket option
- added member role restriction options to tickets
- changed jQuery datepicker to have a -100 +10 year range
- added numeric check to ticket spaces during get_post
- added public class flags for event/location/booking admin and my bookings pages,
- changed – consolidated generation of all “my bookings” pages to go via em-template-tags.php functions
- changed – removed my bookings page being generated via events page if no page defined (you should now define a page or use the shortcode)
- changed all listing shortcdodes and template tags to use relevant list template if no specific format supplied
- improved event list/search ajax JS
- added AJAX capabilities to search forms and event/location/category/tag lists with pagination
- added data attribute support for pagination links when AJAX is enabled
- changed – revamped the search form styling and structure
- added location page search form and shortcode/template tags
- fixed pagination bug when searching events/locations with text
- fixed EM_Mailer fatal error bug
- fixed strpos() warning on em_get_locations
- improved efficiency of grouped events list
- added bookings_open and bookings_closed conditional event placeholders
- added CSS flags to templates for future stying possibilities to event/location pages and lists, tag lists, category lists, booking forms and front-end admin areas
- changed search form and pagination AJAX php to use wp_ajax_ actions
- moved pagination functionality into extendable EM_Object::get_pagination_links for use in *::output() functions
- moved EM_Events::get_post_search() into EM_Object::get_post_search() to allow sharing with other objects using search forms
- moved display code for em_get_events_list_grouped function contents into EM_Events::output_grouped()
- changed EM_Events and EM_Locations into ‘static’-only classes (function scoping will follow eventually)
- changed scopes of EM_Object::get_post_search and EM_Object::get_pagination_links to static
- added near, near_unit and near_distance search arguments for coordinate-based searches
- added geographical searching and Google places autocomplete service
- added more search form options to settings page
- removed page number and list number definitions from within list templates
- changed various templates, detailed below:
- changed booking ticket template by unifying forms/ticket-form(s).php into forms/event/bookings-ticket-form.php
- changed forms/bookingform/tickets-list.php to account for displaying guest and role-restricted tickets
- removed inline JS from forms/event/bookings.php template
- removed inclusion of forms/tickets-form.php from forms/event-editor.php
- added inline js from forms/event-editor.php to JS file
- moved em-tickets-form div ID to cover just tickets and event-rsvp-options covers the rest,
- unbolded labels and made headings h4 in bookings section of forms/event/bookings.php
- changed h4 to h3 in event-editor.php and location-editor.php templates
- removed search form inclusion on templates/events-list.php and is now included separately
- added wrapper class to templates/events-list.php layout for future styling
- moved grouped events out of events-list.php into events-list-grouped.php template
- fixed/added sanitization to EM_Ticket::get_post to prevent potential xss,
- fixed/added escaping to booking form template
- fixed recurrences not updating category in main site of MS Global installs
- fixed overriding the_content for valid items in a loop when on tag and category pages
- removed global $EM_Location from locations admin list template
- fixed the em_maps_location_hook js hook not being triggered event/location admin pages
- fixed php warning when creating events with no location info
- fixed some untranslated text
- added parsing of placeholders on single event and location page titles (useful in SEO plugins)
- lowered priority of wp_footer js to 20 (from 10)
- moved WP FullCalendar integration code into EM (and loaded only if needed)
- updated Swedish, German and French language files
- added Chinese Simplified (Taiwan)
- updated POT file
- simplified inclusion of event post type in search results
- set priority of save_post for events/locations to 1
- added preemptive validation during wp_insert_post_data which immediately makes it a draft before any saving is done
- fixed php warning in bookings admin table
- added per-event tax rate function and corresponding em_event_get_tax_rate filter
- improved map loading JS and now can be used in ajax searches
- changed templates/map-global.php – moved coordinates div into container div
- added js em_maps_loaded and em_ajax_search events
- updated jQuery – changed instances of .attr(‘checked’) to .prop(‘checked’) or .is(‘:checked’)
- changed location forms to have consistent id and class structure (id to be deprecated)
- changed CSS for location forms to uses classes not ids
- added templates/forms/map-container.php
- changed location form templates to call a seperate/single map template
- fixed inconsistencies with set_status functions in EM_Events and EM_Location objects
- added deregistration of em script on BP messages page to avoid autocompleter clashes
- fixed WPDB::escape() usage and replaced with esc_sql()
- fixed duplicating events not copying excerpt and tags
- fixed capabilities not being saved for bbPress 2.2+ roles
- fixed featured image on event/location submission – now only showing delete checkbox if image exists
- changed #_ATTENDEESPENDINGLIST so it includes any booking statuses that reserve a space