Events Manager - Version 5.6.5

Version Description

  • added option to add Google Maps API key
  • fixed category image uploader not working properly on some specific setups
  • fixed display issues of first/last names mixing middle names in booking admin tables under no-user mode
  • fixed #_TAGSLUG not being parsed
  • fixed blank space in email triggering validation errors when booking
  • fixed 'view bookings' ticket link pointing to back-end when on front-end
Download this release

Release Info

Developer netweblogic
Plugin Icon 128x128 Events Manager
Version 5.6.5
Comparing to
See all releases

Code changes from version 5.6.4 to 5.6.5

admin/settings/tabs/formats.php CHANGED
@@ -442,6 +442,7 @@
442
  <?php _e ( 'No' ); ?> <input name="dbem_gmap_is_active" type="radio" value="0" <?php echo ($gmap_is_active) ? '':"checked='checked'"; ?> /><br />
443
  <em><?php _e ( 'Check this option to enable Goggle Map integration.', 'events-manager')?></em>
444
  </td>
 
445
  <?php em_options_input_text(__('Default map width','events-manager'), 'dbem_map_default_width', sprintf(__('Can be in form of pixels or a percentage such as %s or %s.', 'events-manager'), '<code>100%</code>', '<code>100px</code>')); ?>
446
  <?php em_options_input_text(__('Default map height','events-manager'), 'dbem_map_default_height', sprintf(__('Can be in form of pixels or a percentage such as %s or %s.', 'events-manager'), '<code>100%</code>', '<code>100px</code>')); ?>
447
  </tr>
442
  <?php _e ( 'No' ); ?> <input name="dbem_gmap_is_active" type="radio" value="0" <?php echo ($gmap_is_active) ? '':"checked='checked'"; ?> /><br />
443
  <em><?php _e ( 'Check this option to enable Goggle Map integration.', 'events-manager')?></em>
444
  </td>
445
+ <?php em_options_input_text(__('Google Maps API Browser Key','events-manager'), 'dbem_google_maps_browser_key', sprintf(__('Google Maps require an API key, please see our %s page for instructions on obtaining one.', 'events-manager'), sprintf('<a href="http://wp-events-plugin.com/documentation/google-maps/api-key/">%s</a>', __('documentation','events-manager')))); ?>
446
  <?php em_options_input_text(__('Default map width','events-manager'), 'dbem_map_default_width', sprintf(__('Can be in form of pixels or a percentage such as %s or %s.', 'events-manager'), '<code>100%</code>', '<code>100px</code>')); ?>
447
  <?php em_options_input_text(__('Default map height','events-manager'), 'dbem_map_default_height', sprintf(__('Can be in form of pixels or a percentage such as %s or %s.', 'events-manager'), '<code>100%</code>', '<code>100px</code>')); ?>
448
  </tr>
classes/em-booking.php CHANGED
@@ -616,10 +616,28 @@ class EM_Booking extends EM_Object{
616
  }
617
  }
618
  $this->person->user_email = ( !empty($this->booking_meta['registration']['user_email']) ) ? $this->booking_meta['registration']['user_email']:$this->person->user_email;
 
619
  if( !empty($this->booking_meta['registration']['user_name']) ){
620
- $name_string = explode(' ',$this->booking_meta['registration']['user_name']);
621
- $this->booking_meta['registration']['first_name'] = array_shift($name_string);
622
- $this->booking_meta['registration']['last_name'] = implode(' ', $name_string);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
623
  }
624
  $this->person->user_firstname = ( !empty($this->booking_meta['registration']['first_name']) ) ? $this->booking_meta['registration']['first_name']:__('Guest User','events-manager');
625
  $this->person->first_name = $this->person->user_firstname;
@@ -645,7 +663,7 @@ class EM_Booking extends EM_Object{
645
  $registration = true;
646
  if( empty($this->booking_meta['registration']) ) $this->booking_meta['registration'] = array();
647
  // Check the e-mail address
648
- $user_email = stripslashes($_REQUEST['user_email']); //apostrophes will not be allowed otherwise
649
  if ( $user_email == '' ) {
650
  $registration = false;
651
  $this->add_error(__( '<strong>ERROR</strong>: Please type your e-mail address.', 'events-manager') );
616
  }
617
  }
618
  $this->person->user_email = ( !empty($this->booking_meta['registration']['user_email']) ) ? $this->booking_meta['registration']['user_email']:$this->person->user_email;
619
+ //if a full name is given, overwrite the first/last name values IF they are also not defined
620
  if( !empty($this->booking_meta['registration']['user_name']) ){
621
+ if( !empty($this->booking_meta['registration']['first_name']) ){
622
+ //first name is defined, so we remove it from full name in case we need the rest for surname
623
+ $last_name = trim(str_replace($this->booking_meta['registration']['first_name'], '', $this->booking_meta['registration']['user_name']));
624
+ //if last name isn't defined, provide the rest of the name minus the first name we just removed
625
+ if( empty($this->booking_meta['registration']['last_name']) ){
626
+ $this->booking_meta['registration']['last_name'] = $last_name;
627
+ }
628
+ }else{
629
+ //no first name defined, check for last name and act accordingly
630
+ if( !empty($this->booking_meta['registration']['last_name']) ){
631
+ //we do opposite of above, remove last name from full name and use the rest as first name
632
+ $first_name = trim(str_replace($this->booking_meta['registration']['last_name'], '', $this->booking_meta['registration']['user_name']));
633
+ $this->booking_meta['registration']['first_name'] = $first_name;
634
+ }else{
635
+ //no defined first or last name, so we use the name and take first string for first name, second part for surname
636
+ $name_string = explode(' ',$this->booking_meta['registration']['user_name']);
637
+ $this->booking_meta['registration']['first_name'] = array_shift($name_string);
638
+ $this->booking_meta['registration']['last_name'] = implode(' ', $name_string);
639
+ }
640
+ }
641
  }
642
  $this->person->user_firstname = ( !empty($this->booking_meta['registration']['first_name']) ) ? $this->booking_meta['registration']['first_name']:__('Guest User','events-manager');
643
  $this->person->first_name = $this->person->user_firstname;
663
  $registration = true;
664
  if( empty($this->booking_meta['registration']) ) $this->booking_meta['registration'] = array();
665
  // Check the e-mail address
666
+ $user_email = trim(stripslashes($_REQUEST['user_email'])); //apostrophes will not be allowed otherwise
667
  if ( $user_email == '' ) {
668
  $registration = false;
669
  $this->add_error(__( '<strong>ERROR</strong>: Please type your e-mail address.', 'events-manager') );
classes/em-event.php CHANGED
@@ -195,7 +195,7 @@ class EM_Event extends EM_Object{
195
  var $post_date;
196
  var $post_date_gmt;
197
  var $post_title;
198
- var $post_excerpt;
199
  var $post_status;
200
  var $comment_status;
201
  var $ping_status;
195
  var $post_date;
196
  var $post_date_gmt;
197
  var $post_title;
198
+ var $post_excerpt = '';
199
  var $post_status;
200
  var $comment_status;
201
  var $ping_status;
classes/em-location.php CHANGED
@@ -73,7 +73,7 @@ class EM_Location extends EM_Object {
73
  var $post_date;
74
  var $post_date_gmt;
75
  var $post_title;
76
- var $post_excerpt;
77
  var $post_status;
78
  var $comment_status;
79
  var $ping_status;
@@ -318,6 +318,9 @@ class EM_Location extends EM_Object {
318
  }else{
319
  $post_array['post_status'] = 'draft';
320
  }
 
 
 
321
  //Anonymous submission
322
  if( !is_user_logged_in() && get_option('dbem_events_anonymous_submissions') && empty($this->location_id) ){
323
  $post_array['post_author'] = get_option('dbem_events_anonymous_user');
73
  var $post_date;
74
  var $post_date_gmt;
75
  var $post_title;
76
+ var $post_excerpt = '';
77
  var $post_status;
78
  var $comment_status;
79
  var $ping_status;
318
  }else{
319
  $post_array['post_status'] = 'draft';
320
  }
321
+ if( !empty($this->force_status) ){
322
+ $post_array['post_status'] = $this->force_status;
323
+ }
324
  //Anonymous submission
325
  if( !is_user_logged_in() && get_option('dbem_events_anonymous_submissions') && empty($this->location_id) ){
326
  $post_array['post_author'] = get_option('dbem_events_anonymous_user');
classes/em-tag.php CHANGED
@@ -120,6 +120,9 @@ class EM_Tag extends EM_Object {
120
  case '#_TAGID':
121
  $replace = $this->term_id;
122
  break;
 
 
 
123
  case '#_TAGLINK':
124
  case '#_TAGURL':
125
  $link = $this->get_url();
120
  case '#_TAGID':
121
  $replace = $this->term_id;
122
  break;
123
+ case '#_TAGSLUG':
124
+ $replace = $this->slug;
125
+ break;
126
  case '#_TAGLINK':
127
  case '#_TAGURL':
128
  $link = $this->get_url();
em-functions.php CHANGED
@@ -354,7 +354,7 @@ function em_booking_add_registration( $EM_Booking ){
354
  $registration = true;
355
  if( ((!is_user_logged_in() && get_option('dbem_bookings_anonymous')) || EM_Bookings::is_registration_forced()) && !get_option('dbem_bookings_registration_disable') ){
356
  //find random username - less options for user, less things go wrong
357
- $user_email = stripslashes($_REQUEST['user_email']); //otherwise may fail validation
358
  $username_root = explode('@', wp_kses_data($user_email));
359
  $username_root = $username_rand = sanitize_user($username_root[0], true);
360
  while( username_exists($username_rand) ) {
354
  $registration = true;
355
  if( ((!is_user_logged_in() && get_option('dbem_bookings_anonymous')) || EM_Bookings::is_registration_forced()) && !get_option('dbem_bookings_registration_disable') ){
356
  //find random username - less options for user, less things go wrong
357
+ $user_email = trim(stripslashes($_REQUEST['user_email'])); //otherwise may fail validation
358
  $username_root = explode('@', wp_kses_data($user_email));
359
  $username_root = $username_rand = sanitize_user($username_root[0], true);
360
  while( username_exists($username_rand) ) {
em-install.php CHANGED
@@ -569,6 +569,7 @@ function em_add_options() {
569
  'dbem_ical_location_format' => "#_LOCATION",
570
  //Google Maps
571
  'dbem_gmap_is_active'=> 1,
 
572
  'dbem_map_default_width'=> '400px', //eventually will use %
573
  'dbem_map_default_height'=> '300px',
574
  'dbem_location_baloon_format' => '<strong>#_LOCATIONNAME</strong><br/>#_LOCATIONADDRESS - #_LOCATIONTOWN<br/><a href="#_LOCATIONPAGEURL">'.__('Events', 'events-manager').'</a>',
569
  'dbem_ical_location_format' => "#_LOCATION",
570
  //Google Maps
571
  'dbem_gmap_is_active'=> 1,
572
+ 'dbem_google_maps_browser_key'=> '',
573
  'dbem_map_default_width'=> '400px', //eventually will use %
574
  'dbem_map_default_height'=> '300px',
575
  'dbem_location_baloon_format' => '<strong>#_LOCATIONNAME</strong><br/>#_LOCATIONADDRESS - #_LOCATIONTOWN<br/><a href="#_LOCATIONPAGEURL">'.__('Events', 'events-manager').'</a>',
events-manager.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Events Manager
4
- Version: 5.6.4
5
  Plugin URI: http://wp-events-plugin.com
6
  Description: Event registration and booking management for WordPress. Recurring events, locations, google maps, rss, ical, booking registration and more!
7
  Author: Marcus Sykes
@@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
  */
29
 
30
  // Setting constants
31
- define('EM_VERSION', 5.63); //self expanatory
32
  define('EM_PRO_MIN_VERSION', 2.392); //self expanatory
33
  define('EM_PRO_MIN_VERSION_CRITICAL', 2.377); //self expanatory
34
  define('EM_DIR', dirname( __FILE__ )); //an absolute path to this directory
@@ -320,6 +320,10 @@ class EM_Scripts_and_Styles {
320
  'show24hours' => get_option('dbem_time_24h'),
321
  'is_ssl' => is_ssl(),
322
  );
 
 
 
 
323
  //debug mode
324
  if( defined('WP_DEBUG') && WP_DEBUG ) $em_localized_js['ui_css'] = plugins_url('includes/css/jquery-ui.css', __FILE__);
325
  //booking-specific stuff
1
  <?php
2
  /*
3
  Plugin Name: Events Manager
4
+ Version: 5.6.5
5
  Plugin URI: http://wp-events-plugin.com
6
  Description: Event registration and booking management for WordPress. Recurring events, locations, google maps, rss, ical, booking registration and more!
7
  Author: Marcus Sykes
28
  */
29
 
30
  // Setting constants
31
+ define('EM_VERSION', 5.64); //self expanatory
32
  define('EM_PRO_MIN_VERSION', 2.392); //self expanatory
33
  define('EM_PRO_MIN_VERSION_CRITICAL', 2.377); //self expanatory
34
  define('EM_DIR', dirname( __FILE__ )); //an absolute path to this directory
320
  'show24hours' => get_option('dbem_time_24h'),
321
  'is_ssl' => is_ssl(),
322
  );
323
+ //maps api key
324
+ if( get_option('dbem_gmap_is_active') && get_option('dbem_google_maps_browser_key') ){
325
+ $em_localized_js['google_maps_api'] = get_option('dbem_google_maps_browser_key');
326
+ }
327
  //debug mode
328
  if( defined('WP_DEBUG') && WP_DEBUG ) $em_localized_js['ui_css'] = plugins_url('includes/css/jquery-ui.css', __FILE__);
329
  //booking-specific stuff
includes/js/admin-settings.js CHANGED
@@ -24,7 +24,7 @@ jQuery(document).ready(function($){
24
  open_close.text(EM.open_text);
25
  });
26
  $('.nav-tab-wrapper .nav-tab').click(function(){
27
- $('.nav-tab-wrapper .nav-tab').removeClass('nav-tab-active');
28
  $(this).addClass('nav-tab-active');
29
  });
30
  var navUrl = document.location.toString();
24
  open_close.text(EM.open_text);
25
  });
26
  $('.nav-tab-wrapper .nav-tab').click(function(){
27
+ $('.nav-tab-wrapper .nav-tab').removeClass('nav-tab-active').blur();
28
  $(this).addClass('nav-tab-active');
29
  });
30
  var navUrl = document.location.toString();
includes/js/categories-admin.js CHANGED
@@ -38,11 +38,12 @@ jQuery(document).ready(function($) {
38
  var fileurl;
39
 
40
  if (formfield != null) {
41
- fileurl = $('img',html).attr('src');
 
42
  $('#category-image').val(fileurl);
43
  $('#category-image-img img').attr('src', fileurl);
44
  //get the attachment id if possible
45
- var fileIdClass = $('img',html).attr('class');
46
  var pattern = /wp\-image\-[0-9]+/;
47
  var fileIdFull = pattern.exec(fileIdClass);
48
  if( fileIdFull[0] != '' ){
38
  var fileurl;
39
 
40
  if (formfield != null) {
41
+ var img = $(html).find('img');
42
+ fileurl = img.attr('src');
43
  $('#category-image').val(fileurl);
44
  $('#category-image-img img').attr('src', fileurl);
45
  //get the attachment id if possible
46
+ var fileIdClass = img.attr('class');
47
  var pattern = /wp\-image\-[0-9]+/;
48
  var fileIdFull = pattern.exec(fileIdClass);
49
  if( fileIdFull[0] != '' ){
includes/js/events-manager.js CHANGED
@@ -826,7 +826,11 @@ function em_maps_load(){
826
  script.type = "text/javascript";
827
  script.id = "google-maps";
828
  var proto = (EM.is_ssl) ? 'https:' : 'http:';
829
- script.src = proto + '//maps.google.com/maps/api/js?v=3.23&libraries=places&callback=em_maps';
 
 
 
 
830
  document.body.appendChild(script);
831
  }else if( typeof google === 'object' && typeof google.maps === 'object' && !em_maps_loaded ){
832
  em_maps();
826
  script.type = "text/javascript";
827
  script.id = "google-maps";
828
  var proto = (EM.is_ssl) ? 'https:' : 'http:';
829
+ if( typeof EM.google_maps_api !== 'undefined' ){
830
+ script.src = proto + '//maps.google.com/maps/api/js?v=3.24&libraries=places&callback=em_maps&key='+EM.google_maps_api;
831
+ }else{
832
+ script.src = proto + '//maps.google.com/maps/api/js?v=3.24&libraries=places&callback=em_maps';
833
+ }
834
  document.body.appendChild(script);
835
  }else if( typeof google === 'object' && typeof google.maps === 'object' && !em_maps_loaded ){
836
  em_maps();
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://wp-events-plugin.com
4
  Tags: bookings, buddypress, calendar, event, event management, events, google maps, maps, locations, registration, registration, tickets
5
  Text Domain: events-manager
6
  Requires at least: 3.5
7
- Tested up to: 4.5.1
8
- Stable tag: 5.6.4
9
 
10
  Fully featured event registration management including recurring events, locations management, calendar, Google map integration, booking management
11
 
@@ -99,6 +99,14 @@ See our [FAQ](http://wp-events-plugin.com/documentation/faq/) page, which is upd
99
  6. Manage attendees with various booking reports
100
 
101
  == Changelog ==
 
 
 
 
 
 
 
 
102
  = 5.6.4 =
103
  * fixed WP FullCalendar (versions using FC 2.x library) not showing events outside current month
104
  * fixed long events not showing on last day in WP FullCalendar
4
  Tags: bookings, buddypress, calendar, event, event management, events, google maps, maps, locations, registration, registration, tickets
5
  Text Domain: events-manager
6
  Requires at least: 3.5
7
+ Tested up to: 4.6
8
+ Stable tag: 5.6.5
9
 
10
  Fully featured event registration management including recurring events, locations management, calendar, Google map integration, booking management
11
 
99
  6. Manage attendees with various booking reports
100
 
101
  == Changelog ==
102
+ = 5.6.5 =
103
+ * added option to add Google Maps API key
104
+ * fixed category image uploader not working properly on some specific setups
105
+ * fixed display issues of first/last names mixing middle names in booking admin tables under no-user mode
106
+ * fixed #_TAGSLUG not being parsed
107
+ * fixed blank space in email triggering validation errors when booking
108
+ * fixed 'view bookings' ticket link pointing to back-end when on front-end
109
+
110
  = 5.6.4 =
111
  * fixed WP FullCalendar (versions using FC 2.x library) not showing events outside current month
112
  * fixed long events not showing on last day in WP FullCalendar
templates/forms/event/bookings.php CHANGED
@@ -65,7 +65,7 @@ global $EM_Event, $post, $allowedposttags, $EM_Ticket, $col_count;
65
  <?php if( count($EM_Ticket->get_bookings()->bookings) == 0 ): ?>
66
  | <a href="<?php bloginfo('wpurl'); ?>/wp-load.php" class="ticket-actions-delete"><?php esc_html_e('Delete','events-manager'); ?></a>
67
  <?php else: ?>
68
- | <a href="<?php echo EM_ADMIN_URL; ?>&amp;page=events-manager-bookings&ticket_id=<?php echo $EM_Ticket->ticket_id ?>"><?php esc_html_e('View Bookings','events-manager'); ?></a>
69
  <?php endif; ?>
70
  </div>
71
  </td>
65
  <?php if( count($EM_Ticket->get_bookings()->bookings) == 0 ): ?>
66
  | <a href="<?php bloginfo('wpurl'); ?>/wp-load.php" class="ticket-actions-delete"><?php esc_html_e('Delete','events-manager'); ?></a>
67
  <?php else: ?>
68
+ | <a href="<?php echo esc_url(add_query_arg('ticket_id', $EM_Ticket->ticket_id, $EM_Event->get_bookings_url())); ?>"><?php esc_html_e('View Bookings','events-manager'); ?></a>
69
  <?php endif; ?>
70
  </div>
71
  </td>