Events Manager - Version 5.6.4

Version Description

  • fixed WP FullCalendar (versions using FC 2.x library) not showing events outside current month
  • fixed long events not showing on last day in WP FullCalendar
  • fixed event category and tag pages 404ing when slugs match taxonomy slugs and these pages aren't parents of events page
  • fixed image upload buttons not working properly on category add/edit pages
Download this release

Release Info

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

Code changes from version 5.6.3 to 5.6.4

classes/em-calendar.php CHANGED
@@ -16,8 +16,19 @@ class EM_Calendar extends EM_Object {
16
$original_args = $args;
17
$args = self::get_default_search($args);
18
$full = $args['full']; //For ZDE, don't delete pls
19
- $month = $args['month'];
20
- $year = $args['year'];
21
$long_events = $args['long_events'];
22
$limit = $args['limit']; //limit arg will be used per day and not for events search
23
16
$original_args = $args;
17
$args = self::get_default_search($args);
18
$full = $args['full']; //For ZDE, don't delete pls
19
+ //figure out what month to look for, if we need to
20
+ if( empty($args['month']) && is_array($args['scope']) ){
21
+ //if a scope is supplied, figure out the month/year we're after, which will be between these two dates.
22
+ $scope_start = strtotime($args['scope'][0]);
23
+ $scope_end = strtotime($args['scope'][1]);
24
+ $scope_middle = $scope_start + ($scope_end - $scope_start)/2;
25
+ $month = $args['month'] = date('n', $scope_middle);
26
+ $year = $args['year'] = date('Y', $scope_middle);
27
+ }else{
28
+ //if month/year supplied, we use those or later on default to current month/year
29
+ $month = $args['month'];
30
+ $year = $args['year'];
31
+ }
32
$long_events = $args['long_events'];
33
$limit = $args['limit']; //limit arg will be used per day and not for events search
34
classes/em-categories-taxonomy.php CHANGED
@@ -31,7 +31,7 @@ class EM_Categories_Taxonomy{
31
32
public static function admin_init(){
33
global $pagenow;
34
- if($pagenow == 'edit-tags.php' && !empty($_GET['taxonomy']) && $_GET['taxonomy'] == EM_TAXONOMY_CATEGORY){
35
wp_enqueue_style( 'farbtastic' );
36
wp_enqueue_style( 'thickbox' );
37
31
32
public static function admin_init(){
33
global $pagenow;
34
+ if( ($pagenow == 'edit-tags.php' || $pagenow == 'term.php') && !empty($_GET['taxonomy']) && $_GET['taxonomy'] == EM_TAXONOMY_CATEGORY){
35
wp_enqueue_style( 'farbtastic' );
36
wp_enqueue_style( 'thickbox' );
37
classes/em-permalinks.php CHANGED
@@ -159,6 +159,22 @@ if( !class_exists('EM_Permalinks') ){
159
}
160
}
161
}
162
$em_rules = apply_filters('em_rewrite_rules_array_events', $em_rules, $events_slug);
163
//make sure there's no page with same name as archives, that should take precedence as it can easily be deleted wp admin side
164
$em_query = new WP_Query(array('pagename'=>EM_POST_TYPE_EVENT_SLUG));
159
}
160
}
161
}
162
+ //Check the event category and tags pages, because if we're overriding the pages and they're not within the Events page hierarchy it may 404
163
+ //if taxonomy base permalink is same as page permalink
164
+ foreach( array('tags','categories') as $taxonomy_name ){
165
+ if( get_option('dbem_'.$taxonomy_name.'_enabled') ){
166
+ $taxonomy_page_id = get_option ( 'dbem_'.$taxonomy_name.'_page' );
167
+ $taxonomy_page = get_post($taxonomy_page_id);
168
+ if( is_object($taxonomy_page) ){
169
+ //we are using a categories page, so we add it to permalinks if it's not a parent of the events page
170
+ if( !is_object($events_page) || !in_array($events_page->ID, get_post_ancestors($taxonomy_page_id)) ){
171
+ $taxonomy_slug = urldecode(preg_replace('/\/#x2F;', '', str_replace( trailingslashit(home_url()), '', get_permalink($taxonomy_page_id)) ));
172
+ $taxonomy_slug = ( !empty($taxonomy_slug) ) ? trailingslashit($taxonomy_slug) : $taxonomy_slug;
173
+ $em_rules[trim($taxonomy_slug,'/').'/?#x27;] = 'index.php?pagename='.trim($taxonomy_slug,'/') ;
174
+ }
175
+ }
176
+ }
177
+ }
178
$em_rules = apply_filters('em_rewrite_rules_array_events', $em_rules, $events_slug);
179
//make sure there's no page with same name as archives, that should take precedence as it can easily be deleted wp admin side
180
$em_query = new WP_Query(array('pagename'=>EM_POST_TYPE_EVENT_SLUG));
em-wpfc.php CHANGED
@@ -134,10 +134,14 @@ function wpfc_em_ajax() {
134
$_REQUEST['month'] = false; //no need for these two, they are the original month and year requested
135
$_REQUEST['year'] = false;
136
137
- //get the year and month to show, which would be the month/year between start and end request params
138
- $scope = $_REQUEST['start'] .','. $_REQUEST['end'];
139
140
- $args = array ('scope'=>$scope, 'owner'=>false, 'status'=>1, 'orderby'=>'event_start_time, event_name'); //since wpfc handles date sorting we only care about time and name ordering here
141
$args['number_of_weeks'] = 6; //WPFC always has 6 weeks
142
$limit = $args['limit'] = get_option('wpfc_limit',3);
143
$args['long_events'] = ( isset($_REQUEST['long_events']) && $_REQUEST['long_events'] == 0 ) ? 0:1; //long events are enabled, unless explicitly told not to in the shortcode
@@ -201,7 +205,15 @@ function wpfc_em_ajax() {
201
}
202
if( $event_day_counts[$date] <= $limit ){
203
$title = $EM_Event->output(get_option('dbem_emfc_full_calendar_event_format', '#_EVENTNAME'), 'raw');
204
- $event_array = array ("title" => $title, "color" => $color, 'textColor'=>$textColor, 'borderColor'=>$borderColor, "start" => date('Y-m-d\TH:i:s', $EM_Event->start), "end" => date('Y-m-d\TH:i:s', $EM_Event->end), "url" => $EM_Event->get_permalink(), 'post_id' => $EM_Event->post_id, 'event_id' => $EM_Event->event_id, 'allDay' => $EM_Event->event_all_day == true );
205
if( $args['long_events'] == 0 ) $event_array['end'] = $event_array['start']; //if long events aren't wanted, make the end date same as start so it shows this way on the calendar
206
$events[] = apply_filters('wpfc_events_event', $event_array, $EM_Event);
207
$event_ids[] = $EM_Event->event_id;
134
$_REQUEST['month'] = false; //no need for these two, they are the original month and year requested
135
$_REQUEST['year'] = false;
136
137
+ //get the month/year between the start/end dates and feed these to EM
138
+ $scope_start = strtotime(substr($_REQUEST['start'],0,10));
139
+ $scope_end = strtotime(substr($_REQUEST['end'],0,10));
140
+ $scope_middle = $scope_start + ($scope_end - $scope_start)/2;
141
+ $month = date('n', $scope_middle);
142
+ $year = date('Y', $scope_middle);
143
144
+ $args = array ('month'=>$month, 'year'=>$year, 'owner'=>false, 'status'=>1, 'orderby'=>'event_start_time, event_name'); //since wpfc handles date sorting we only care about time and name ordering here
145
$args['number_of_weeks'] = 6; //WPFC always has 6 weeks
146
$limit = $args['limit'] = get_option('wpfc_limit',3);
147
$args['long_events'] = ( isset($_REQUEST['long_events']) && $_REQUEST['long_events'] == 0 ) ? 0:1; //long events are enabled, unless explicitly told not to in the shortcode
205
}
206
if( $event_day_counts[$date] <= $limit ){
207
$title = $EM_Event->output(get_option('dbem_emfc_full_calendar_event_format', '#_EVENTNAME'), 'raw');
208
+ $allDay = $EM_Event->event_all_day == true;
209
+ if( $allDay ){
210
+ $start_date = date('Y-m-d\TH:i:s', $EM_Event->start);
211
+ $end_date = date('Y-m-d\T00:00:00', $EM_Event->end + (60*60*24)); //on all day events the end date/time is next day of end date at 00:00:00 - see end attribute on http://fullcalendar.io/docs/event_data/Event_Object/
212
+ }else{
213
+ $start_date = date('Y-m-d\TH:i:s', $EM_Event->start);
214
+ $end_date = date('Y-m-d\TH:i:s', $EM_Event->end);
215
+ }
216
+ $event_array = array ("title" => $title, "color" => $color, 'textColor'=>$textColor, 'borderColor'=>$borderColor, "start" => $start_date, "end" => $end_date, "url" => $EM_Event->get_permalink(), 'post_id' => $EM_Event->post_id, 'event_id' => $EM_Event->event_id, 'allDay' => $allDay );
217
if( $args['long_events'] == 0 ) $event_array['end'] = $event_array['start']; //if long events aren't wanted, make the end date same as start so it shows this way on the calendar
218
$events[] = apply_filters('wpfc_events_event', $event_array, $EM_Event);
219
$event_ids[] = $EM_Event->event_id;
events-manager.php CHANGED
@@ -1,7 +1,7 @@
1
<?php
2
/*
3
Plugin Name: Events Manager
4
- Version: 5.6.3
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
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
includes/js/categories-admin.js CHANGED
@@ -40,6 +40,7 @@ jQuery(document).ready(function($) {
40
if (formfield != null) {
41
fileurl = $('img',html).attr('src');
42
$('#category-image').val(fileurl);
43
//get the attachment id if possible
44
var fileIdClass = $('img',html).attr('class');
45
var pattern = /wp\-image\-[0-9]+/;
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]+/;
includes/langs/events-manager-fr_FR.po ADDED
@@ -0,0 +1,5984 @@