Event Calendar WD – Responsive Event Calendar plugin - Version 1.1.48

Version Description

  • Fixed: Compatibility with PHP 8.
  • Fixed: Compatibility with Filters add-on.
  • Fixed: Saving shortcode options.
Download this release

Release Info

Developer 10web
Plugin Icon 128x128 Event Calendar WD – Responsive Event Calendar plugin
Version 1.1.48
Comparing to
See all releases

Code changes from version 1.1.47 to 1.1.48

css/style.css CHANGED
@@ -31,7 +31,9 @@
31
  height: 85px;
32
  color:#fff;
33
  }
34
-
 
 
35
  .ecwd-url{
36
  margin-bottom: 5px;
37
  }
31
  height: 85px;
32
  color:#fff;
33
  }
34
+ .calendar_widget_content .calendar-head {
35
+ color:#000;
36
+ }
37
  .ecwd-url{
38
  margin-bottom: 5px;
39
  }
ecwd.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Event Calendar WD
4
  * Plugin URI: https://10web.io/plugins/wordpress-event-calendar/
5
  * Description: Event Calendar WD is an easy event management and planning tool with advanced features.
6
- * Version: 1.1.47
7
  * Author: 10Web
8
  * Author URI: https://10web.io/plugins/
9
  * Text Domain: event-calendar-wd
3
  * Plugin Name: Event Calendar WD
4
  * Plugin URI: https://10web.io/plugins/wordpress-event-calendar/
5
  * Description: Event Calendar WD is an easy event management and planning tool with advanced features.
6
+ * Version: 1.1.48
7
  * Author: 10Web
8
  * Author URI: https://10web.io/plugins/
9
  * Text Domain: event-calendar-wd
ecwd_class.php CHANGED
@@ -1,11 +1,5 @@
1
  <?php
2
-
3
- /**
4
- * ECWD
5
- *
6
- */
7
  class ECWD {
8
-
9
  protected $plugin_name = 'event-calendar-wd';
10
  protected $prefix = 'ecwd';
11
  protected static $instance = null;
@@ -498,20 +492,6 @@ class ECWD {
498
 
499
  public static function ecwd_date( $format, $time = '' ) {
500
  $time = !empty($time) ? $time : time();
501
- return date($format, intval($time)); // temporary
502
- // global $ecwd_options;
503
- // $tz = $ecwd_options['time_zone'];
504
- // if ( empty($tz) || !self::isValidTimezone($tz) ) {
505
- // $tz = 'Europe/London';
506
- // $wp_timezone = self::wp_timezone_string();
507
- // $pattern = '/^UTC(\-|\+).*/i';
508
- // if ( preg_match($pattern, $wp_timezone) ) {
509
- // $tz = self::generate_timezone_string_from_utc_offset( $wp_timezone );
510
- // }
511
- // }
512
- // $dt = new DateTime("now", new DateTimeZone($tz));
513
- // $dt->setTimestamp($time);
514
-
515
- // return $dt->format($format);
516
  }
517
  }
1
  <?php
 
 
 
 
 
2
  class ECWD {
 
3
  protected $plugin_name = 'event-calendar-wd';
4
  protected $prefix = 'ecwd';
5
  protected static $instance = null;
492
 
493
  public static function ecwd_date( $format, $time = '' ) {
494
  $time = !empty($time) ? $time : time();
495
+ return date($format, intval($time));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
496
  }
497
  }
includes/calendar-class.php CHANGED
@@ -83,7 +83,7 @@
83
 
84
 
85
  // types: mini,full,list,mini-list,(default=full)
86
- public function __construct ($type = 'full', $date = '', $staticdisplaytype = false, $widget = 0, $limit = false, $page = 1, $displays = null, $filters = null, $event_search = 'yes', $ecwd_views = array(), $preview) {
87
  // static displaytype
88
  add_filter('format_content', 'wptexturize');
89
  add_filter('format_content', 'convert_smilies');
@@ -238,7 +238,7 @@
238
  return $html;
239
  }
240
 
241
- public function add_terms ($type = 'categories', $terms) {
242
  if (is_array($terms)) {
243
  $this->$type = $terms;
244
  }
83
 
84
 
85
  // types: mini,full,list,mini-list,(default=full)
86
+ public function __construct ($type = 'full', $date = '', $staticdisplaytype = false, $widget = 0, $limit = false, $page = 1, $displays = null, $filters = null, $event_search = 'yes', $ecwd_views = array(), $preview = false) {
87
  // static displaytype
88
  add_filter('format_content', 'wptexturize');
89
  add_filter('format_content', 'convert_smilies');
238
  return $html;
239
  }
240
 
241
+ public function add_terms ($type = 'categories', $terms = array()) {
242
  if (is_array($terms)) {
243
  $this->$type = $terms;
244
  }
includes/ecwd-cpt-class.php CHANGED
@@ -1410,7 +1410,6 @@ class ECWD_Cpt {
1410
  }
1411
 
1412
  public function save_categories_metas($term_id) {
1413
- //var_dump($_POST); die;
1414
  if (isset($_POST[$this->tax])) {
1415
 
1416
  $t_id = $term_id;
1410
  }
1411
 
1412
  public function save_categories_metas($term_id) {
 
1413
  if (isset($_POST[$this->tax])) {
1414
 
1415
  $t_id = $term_id;
includes/ecwd-functions.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
-
3
- //if (!defined())
4
  function ecwd_print_calendar($calendar_ids, $display = 'mini', $args = array(), $widget = false, $ajax = false, $ecwd_views = array(), $preview = false) {
5
 
6
  if(extension_loaded('calendar') === false){
@@ -132,6 +130,59 @@ function ecwd_print_calendar($calendar_ids, $display = 'mini', $args = array(),
132
  return do_shortcode($markup);
133
  }
134
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  /**
136
  * AJAX function change calendar months
137
  */
@@ -221,9 +272,6 @@ function ecwd_ajax_list() {
221
  $ids = esc_html($_POST[ECWD_PLUGIN_PREFIX . '_event_ids']);
222
  $title_text = esc_html($_POST[ECWD_PLUGIN_PREFIX . '_title_text']);
223
  $sort = esc_html($_POST[ECWD_PLUGIN_PREFIX . '_sort']);
224
- //$paging = esc_html($_POST[ECWD_PLUGIN_PREFIX.'_paging']);
225
- //$paging_interval = esc_html($_POST[ECWD_PLUGIN_PREFIX.'_paging_interval']);
226
- //$paging_direction = esc_html($_POST[ECWD_PLUGIN_PREFIX.'_paging_direction']);
227
  $start_offset = esc_html($_POST[ECWD_PLUGIN_PREFIX . '_start_offset']);
228
  $paging_type = esc_html($_POST[ECWD_PLUGIN_PREFIX . '_paging_type']);
229
 
1
  <?php
 
 
2
  function ecwd_print_calendar($calendar_ids, $display = 'mini', $args = array(), $widget = false, $ajax = false, $ecwd_views = array(), $preview = false) {
3
 
4
  if(extension_loaded('calendar') === false){
130
  return do_shortcode($markup);
131
  }
132
 
133
+ /**
134
+ * Validate data.
135
+ *
136
+ * @param $value
137
+ * @param $esc_html
138
+ */
139
+ function validate_data($value, $key, $callback) {
140
+ $value = stripslashes($value);
141
+ if (!empty($callback) && function_exists($callback)) {
142
+ $value = $callback($value);
143
+ }
144
+ }
145
+
146
+ function ecwd_get($key, $default_value = '', $callback = 'sanitize_text_field', $type = 'DEFAULT') {
147
+ switch ($type) {
148
+ case 'REQUEST' :
149
+ if (isset($_REQUEST[$key])) {
150
+ $value = $_REQUEST[$key];
151
+ }
152
+ break;
153
+ case 'DEFAULT' :
154
+ case 'POST' :
155
+ if (isset($_POST[$key])) {
156
+ $value = $_POST[$key];
157
+ }
158
+ if ( 'POST' === $type ) break;
159
+ case 'GET' :
160
+ if (isset($_GET[$key])) {
161
+ $value = $_GET[$key];
162
+ }
163
+ break;
164
+ }
165
+ if ( !isset($value) ) {
166
+ if( $default_value === NULL ) {
167
+ return NULL;
168
+ } else {
169
+ $value = $default_value;
170
+ }
171
+ }
172
+
173
+ if( is_bool($value) ) {
174
+ return $value;
175
+ }
176
+
177
+ if (is_array($value)) {
178
+ // $callback should be third parameter of the validate_data function, so there is need to add unused second parameter to validate_data function.
179
+ array_walk_recursive($value, 'validate_data', $callback);
180
+ }
181
+
182
+
183
+ return $value;
184
+ }
185
+
186
  /**
187
  * AJAX function change calendar months
188
  */
272
  $ids = esc_html($_POST[ECWD_PLUGIN_PREFIX . '_event_ids']);
273
  $title_text = esc_html($_POST[ECWD_PLUGIN_PREFIX . '_title_text']);
274
  $sort = esc_html($_POST[ECWD_PLUGIN_PREFIX . '_sort']);
 
 
 
275
  $start_offset = esc_html($_POST[ECWD_PLUGIN_PREFIX . '_start_offset']);
276
  $paging_type = esc_html($_POST[ECWD_PLUGIN_PREFIX . '_paging_type']);
277
 
includes/ecwd-shortcodes.php CHANGED
@@ -20,61 +20,65 @@ function ecwd_shortcode($attr) {
20
  return "";
21
  }
22
 
23
- $attr = shortcode_atts(array(
24
- 'id' => null,
25
- 'page_items' => '5',
26
- 'event_search' => 'yes',
27
- 'display' => 'full',
28
- 'displays' => null,
29
- 'filters' => null,
30
- 'calendar_start_date' => null
31
- ), $attr);
32
-
33
- // If no ID is specified then return
34
- if (empty($attr['id'])) {
35
- return;
36
- }
37
 
38
- $type = (isset($attr['type']) && $attr['type'] === 'mini') ? 'mini' : 'full';//for gutenberg
39
 
40
  $ecwd_displays_list = array('none',$type,"list","week","day");
41
 
42
  //for gutenberg
43
  if($type === 'mini'){
44
- $displays = str_replace('full', 'mini', $attr['displays']);
45
  }else{
46
- $displays = str_replace('mini', 'full', $attr['displays']);
47
  }
 
48
  $ecwd_displays = explode(",",$displays);
 
49
 
50
  foreach ($ecwd_displays as $ecwd_key => $ecwd_display_name){
51
  if(!in_array($ecwd_display_name ,$ecwd_displays_list)){
52
  $ecwd_displays[$ecwd_key] = $type;
53
  }
54
  }
55
- //for gutenberg
56
- $display = $ecwd_displays[0];
57
  $displays = implode(",",$ecwd_displays);
58
- if(get_post_status($attr['id']) === "private" && !current_user_can('read_private_posts')){
 
59
  return;
60
  }
61
 
62
  $args = array('displays'=>$displays, 'filters'=>$attr['filters'], 'page_items'=>$attr['page_items'], 'event_search'=>$attr['event_search']);
63
- if($attr['calendar_start_date'] !== null){
64
- $attr['calendar_start_date'] = strtotime($attr['calendar_start_date']);
65
- if($attr['calendar_start_date'] === false || $attr['calendar_start_date'] === -1){
66
- $attr['calendar_start_date'] = null;
67
- }
68
- }
69
-
70
- if($attr['calendar_start_date'] !== null){
71
- $args['date'] = ECWD::ecwd_date('Y-m-d',$attr['calendar_start_date']);
72
  }
73
-
74
- $calendar_ids = explode(',', str_replace(' ', '', $attr['id']));
75
- array_walk( $calendar_ids, function ( &$value ) { $value = ( int ) $value; } );
76
- $result = ecwd_print_calendar($calendar_ids, $display, $args);
77
- return $result;
 
 
 
 
 
 
78
  }
79
 
80
  add_shortcode(ECWD_PLUGIN_PREFIX, ECWD_PLUGIN_PREFIX.'_shortcode');
20
  return "";
21
  }
22
 
23
+ extract(shortcode_atts(array(
24
+ 'id' => null,
25
+ 'page_items' => '5',
26
+ 'event_search' => 'yes',
27
+ 'display' => 'full',
28
+ 'displays' => null,
29
+ 'filters' => null,
30
+ 'calendar_start_date' => null
31
+ ), $attr, ECWD_PLUGIN_PREFIX.'_calendar'));
32
+
33
+ // If no ID is specified then return
34
+ if ( empty($attr['id']) ) {
35
+ return;
36
+ }
37
 
38
+ $type = (isset($attr['type']) && $attr['type'] === 'mini') ? 'mini' : 'full';
39
 
40
  $ecwd_displays_list = array('none',$type,"list","week","day");
41
 
42
  //for gutenberg
43
  if($type === 'mini'){
44
+ $displays = str_replace('full', 'mini', $displays);
45
  }else{
46
+ $displays = str_replace('mini', 'full', $displays);
47
  }
48
+
49
  $ecwd_displays = explode(",",$displays);
50
+ $display = $ecwd_displays[0];
51
 
52
  foreach ($ecwd_displays as $ecwd_key => $ecwd_display_name){
53
  if(!in_array($ecwd_display_name ,$ecwd_displays_list)){
54
  $ecwd_displays[$ecwd_key] = $type;
55
  }
56
  }
57
+
 
58
  $displays = implode(",",$ecwd_displays);
59
+
60
+ if ( get_post_status($attr['id']) === "private" && !current_user_can('read_private_posts') ){
61
  return;
62
  }
63
 
64
  $args = array('displays'=>$displays, 'filters'=>$attr['filters'], 'page_items'=>$attr['page_items'], 'event_search'=>$attr['event_search']);
65
+
66
+ if ( $calendar_start_date !== null ) {
67
+ $calendar_start_date = strtotime($calendar_start_date);
68
+ if($calendar_start_date === false || $calendar_start_date === -1){
69
+ $calendar_start_date = null;
 
 
 
 
70
  }
71
+ }
72
+
73
+ if ( $calendar_start_date !== null ) {
74
+ $args['date'] = ECWD::ecwd_date('Y-m-d',$calendar_start_date);
75
+ }
76
+
77
+ $calendar_ids = explode(',', str_replace(' ', '', $id));
78
+
79
+ array_walk( $calendar_ids, function ( &$value ) { $value = ( int ) $value; } );
80
+ $result = ecwd_print_calendar($calendar_ids, $display, $args);
81
+ return $result;
82
  }
83
 
84
  add_shortcode(ECWD_PLUGIN_PREFIX, ECWD_PLUGIN_PREFIX.'_shortcode');
js/scripts.js CHANGED
@@ -1,15 +1,13 @@
1
- /* global jQuery, ecwd, ecwd_calendar */
2
-
3
- /**
4
- * Public JS functions
5
- */
6
  var functions_interval;
7
 
8
- if (typeof ecwd_js_init_call != "object")
9
  var ecwd_js_init_call;
10
- if (typeof ecwd_js_init != "function")
 
11
  var ecwd_js_init;
12
- (function ($) {
 
 
13
  ecwd_js_init = function () {
14
  ecwd_eventsOff();
15
  if (jQuery('#ecwd-calendar-main-css').length == 0) {
@@ -135,10 +133,10 @@ if (typeof ecwd_js_init != "function")
135
  ecwd_date_filter: date,
136
  ecwd_nonce: ecwd.ajaxnonce
137
  }, function (data) {
138
- $(main_div).find('div.ecwd_calendar').replaceWith(data);
139
- $(main_div).find('.ecwd_loader').hide();
140
- if ($('.ecwd_open_event_popup').length > 0) {
141
- $('.ecwd_open_event_popup').css({
142
  'cursor': 'pointer'
143
  });
144
  }
@@ -215,7 +213,7 @@ if (typeof ecwd_js_init != "function")
215
  ecwd_calendar_search:1,//not filter
216
  ecwd_nonce: ecwd.ajaxnonce
217
  }, function (data) {
218
- $(main_div).find('div.ecwd_calendar').replaceWith(data);
219
  });
220
  jQuery('.ecwd-search-submit').blur();
221
  }
@@ -230,9 +228,9 @@ if (typeof ecwd_js_init != "function")
230
  dayFull = jQuery(this).attr('data-date').split('-');
231
  dayFull = dayFull[2];
232
  ulEventFull = jQuery(this).find('ul.events');
233
- if (parseInt(jQuery(this).closest('.ecwd_calendar').width()) <= 300 || parseInt(jQuery(window).width()) <= 768 || jQuery(this).closest('.ecwd_calendar').hasClass('ecwd-widget-mini') || $(this).closest('.ecwd_calendar').hasClass('ecwd-page-mini')) {
234
  if (dayFull == jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').attr('data-dayNumber')
235
- && jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').is(':empty') == false) {
236
  jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').html('');
237
  } else {
238
  showEvent(ulEventFull, this);
@@ -246,19 +244,19 @@ if (typeof ecwd_js_init != "function")
246
  var obj = el;
247
  if (el.length > 1) {
248
  el.each(function () {
249
- if ($(this).hasClass('more_events')) {
250
- obj = $(this);
251
  return;
252
  }
253
  });
254
  }
255
- $(calendar).closest('.ecwd_calendar').find('.ecwd-events-day-details').html(obj.find('.event-details').clone().css('display', 'block'));
256
- } else if (el.parent().parent().parent().parent().attr('class').indexOf("mini") != -1) {
257
- $(calendar).closest('.ecwd_calendar').find('.ecwd-events-day-details').html(el.clone());
258
  }
259
- $(calendar).closest('.ecwd_calendar').find('.ecwd-events-day-details').find('li').each(function(){
260
- $(this).css('background','none');
261
-
262
  });
263
  add_single_events_popup();
264
  }
@@ -308,76 +306,76 @@ if (typeof ecwd_js_init != "function")
308
 
309
  function showFilterSliderArrow() {
310
  var li_position, li_width, last_child;
311
- $(".calendar_main:not([class^='ecwd_widget'] .calendar_main) .ecwd_calendar_view_tabs").each(function (key, element) {
312
- var cwidth = $(element).closest('.ecwd_calendar').outerWidth();
313
  if (cwidth == 0)
314
  cwidth = 600;
315
- if ($(this).find('.ecwd-search').length != 0)
316
  var ecwd_calendar_view_tabs_width = parseInt(cwidth) - 50;
317
  else
318
  var ecwd_calendar_view_tabs_width = parseInt(cwidth);
319
- if (parseInt(jQuery('body').width()) <= 768 || $(".calendar_full_content .ecwd_calendar").width() < 600) {
320
  var ecwd_calendar_view_visible_count = parseInt(ecwd_calendar_view_tabs_width / 110);
321
- } else if (parseInt(jQuery('body').width()) <= 500 || $(".calendar_full_content .ecwd_calendar").width() < 400) {
322
  var ecwd_calendar_view_visible_count = parseInt(ecwd_calendar_view_tabs_width / 90);
323
  } else {
324
  var ecwd_calendar_view_visible_count = parseInt(ecwd_calendar_view_tabs_width / 150);
325
  }
326
- $(element).find('.filter-container').width(ecwd_calendar_view_tabs_width);
327
- $(element).find('ul li').each(function (keyli, elementli) {
328
- if ($(elementli).hasClass('ecwd-selected-mode')) {
329
  li_position = keyli;
330
- li_width = $(elementli).outerWidth();
331
  }
332
  });
333
- if ($(element).find(".filter-arrow-right").css("display") == "block" || last_child == 1)
334
- $(element).find('.filter-container ul li').width((ecwd_calendar_view_tabs_width - 30) / ecwd_calendar_view_visible_count);
335
  else
336
- $(element).find('.filter-container ul li').width((ecwd_calendar_view_tabs_width) / ecwd_calendar_view_visible_count);
337
- var ecwd_view_item_width = $(element).find('.filter-container ul li').eq(0).innerWidth() - 1;
338
- if (!(ecwd_calendar_view_tabs_width < ecwd_view_item_width * parseInt($(element).find('.filter-container ul li').length) && !($(element).find("ul li:last-child").hasClass("ecwd-selected-mode"))))
339
- $(element).find('.filter-arrow-right').hide();
340
- if (ecwd_calendar_view_tabs_width < ecwd_view_item_width * parseInt($(element).find('.filter-container ul li').length) && !($(element).find("ul li:last-child").hasClass("ecwd-selected-mode"))) {
341
- $(element).find('.filter-arrow-right').show();
342
- } else if ($(element).find("ul li:last-child").hasClass("ecwd-selected-mode")) {
343
  last_child = 1;
344
  }
345
  if (ecwd_calendar_view_visible_count <= li_position && li_position != 0) {
346
- $(element).find('ul li').css({left: "-" + ((li_position + 1 - ecwd_calendar_view_visible_count) * ecwd_view_item_width) + "px"});
347
- $(element).find('.filter-arrow-left').show();
348
  } else
349
- $(element).find('ul li').css({left: "0px"});
350
  });
351
 
352
- $('.ecwd_calendar_view_tabs .filter-arrow-right').click(function () {
353
- var view_filter_width = $(this).parent().find('ul li').eq(0).outerWidth();
354
- var cwidth = $(this).closest('.ecwd_calendar').outerWidth();
355
  if (cwidth == 0)
356
  cwidth = 600;
357
- if ($(this).find('.ecwd-search').length != 0)
358
  var view_filter_container_width = parseInt(cwidth) - 50;
359
  else
360
  var view_filter_container_width = parseInt(cwidth);
361
- var view_filter_count = parseInt($(this).parent().find('ul li').length);
362
- $(this).parent().find('.filter-arrow-left').show();
363
- if (parseInt($(this).parent().find('ul li').css('left')) <= -((view_filter_width * view_filter_count) - view_filter_container_width) + view_filter_width)
364
- $(this).hide();
365
- if (click && view_filter_container_width < view_filter_width * view_filter_count && parseInt($(this).parent().find('ul li').css('left')) >= -(view_filter_width * (view_filter_count) - view_filter_container_width)) {
366
  click = 0;
367
- $(this).parent().find('ul li').animate({left: "-=" + view_filter_width}, 400, function () {
368
  click = 1
369
  });
370
  }
371
  });
372
- $('.ecwd_calendar_view_tabs .filter-arrow-left').click(function () {
373
- var view_filter_width = $(this).parent().find('ul li').eq(0).outerWidth();
374
- if ($(this).parent().find('.filter-arrow-right').css('display') == 'none')
375
- $(this).parent().find('.filter-arrow-right').show();
376
- if (parseInt($(this).parent().find('ul li').css('left')) == -view_filter_width)
377
- $(this).hide();
378
- if (click && parseInt($(this).parent().find('ul li').css('left')) < 0) {
379
  click = 0;
380
- $(this).parent().find('ul li').animate({left: "+=" + view_filter_width}, 400, function () {
381
  click = 1
382
  });
383
  }
@@ -603,17 +601,12 @@ if (typeof ecwd_js_init != "function")
603
  });
604
  jQuery(".month-name").show();
605
  }
606
- jQuery('.ecwd_filter_item').each(function () {
607
- jQuery(this).find('.ecwd_filter_heading').click(function () {
608
- if (jQuery(this).hasClass('open')) {
609
- jQuery(this).next().slideUp(400);
610
- jQuery(this).removeClass('open');
611
- } else {
612
- jQuery(this).next().slideDown(400);
613
- jQuery(this).addClass('open');
614
- }
615
- });
616
  });
 
617
  }, 100);
618
 
619
  function show_filters(main_div) {
@@ -650,7 +643,7 @@ if (typeof ecwd_js_init != "function")
650
  }
651
  }
652
 
653
- }
654
  this.showMap = function () {
655
  if (ecwd.gmap_key == "") {
656
  jQuery(".ecwd_map_div").each(function (k, v) {
@@ -665,7 +658,7 @@ if (typeof ecwd_js_init != "function")
665
 
666
  if (typeof google == 'undefined' || typeof google.maps == "undefined") {
667
  var script = document.createElement('script');
668
- script.type = 'text/javascript';
669
  script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&callback=ecwd_js_init_call.showMap&key='+ecwd.gmap_key;
670
  document.body.appendChild(script);
671
  } else {
@@ -724,7 +717,7 @@ if (typeof ecwd_js_init != "function")
724
  events: {
725
  click: function (marker, event, context) {
726
  var map = jQuery(maps[k]).gmap3("get"),
727
- infowindow = jQuery(maps[k]).gmap3({get: {name: "infowindow"}});
728
  if (infowindow) {
729
  infowindow.open(map, marker);
730
  infowindow.setContent(context.data);
@@ -740,16 +733,10 @@ if (typeof ecwd_js_init != "function")
740
 
741
  }
742
  },
743
- //autofit: {maxZoom: zoom}
744
  });
745
-
746
  });
747
  }
748
  }
749
- // $('#ecwd_back_link').on('click', function (e) {
750
- // e.preventDefault();
751
- // window.history.back();
752
- // });
753
 
754
  if (jQuery('.ecwd_map_div').length > 0) {
755
  this.showMap();
@@ -757,7 +744,8 @@ if (typeof ecwd_js_init != "function")
757
  }
758
 
759
  ecwd_js_init_call = new ecwd_js_init();
760
- }(jQuery));
 
761
  function ecwd_eventsOff() {
762
  jQuery(".calendar_main,.ecwd-event,.ecwd-organizer,.ecwd-venue").find("*").off();
763
  jQuery(".calendar_main,.ecwd-event,.ecwd-organizer,.ecwd-venue").children().off();
 
 
 
 
 
1
  var functions_interval;
2
 
3
+ if (typeof ecwd_js_init_call != "object") {
4
  var ecwd_js_init_call;
5
+ }
6
+ if (typeof ecwd_js_init != "function") {
7
  var ecwd_js_init;
8
+ }
9
+
10
+ jQuery(function () {
11
  ecwd_js_init = function () {
12
  ecwd_eventsOff();
13
  if (jQuery('#ecwd-calendar-main-css').length == 0) {
133
  ecwd_date_filter: date,
134
  ecwd_nonce: ecwd.ajaxnonce
135
  }, function (data) {
136
+ jQuery(main_div).find('div.ecwd_calendar').replaceWith(data);
137
+ jQuery(main_div).find('.ecwd_loader').hide();
138
+ if (jQuery('.ecwd_open_event_popup').length > 0) {
139
+ jQuery('.ecwd_open_event_popup').css({
140
  'cursor': 'pointer'
141
  });
142
  }
213
  ecwd_calendar_search:1,//not filter
214
  ecwd_nonce: ecwd.ajaxnonce
215
  }, function (data) {
216
+ jQuery(main_div).find('div.ecwd_calendar').replaceWith(data);
217
  });
218
  jQuery('.ecwd-search-submit').blur();
219
  }
228
  dayFull = jQuery(this).attr('data-date').split('-');
229
  dayFull = dayFull[2];
230
  ulEventFull = jQuery(this).find('ul.events');
231
+ if (parseInt(jQuery(this).closest('.ecwd_calendar').width()) <= 300 || parseInt(jQuery(window).width()) <= 768 || jQuery(this).closest('.ecwd_calendar').hasClass('ecwd-widget-mini') || jQuery(this).closest('.ecwd_calendar').hasClass('ecwd-page-mini')) {
232
  if (dayFull == jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').attr('data-dayNumber')
233
+ && jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').is(':empty') == false) {
234
  jQuery(this).closest('.ecwd_calendar').find('.ecwd-events-day-details').html('');
235
  } else {
236
  showEvent(ulEventFull, this);
244
  var obj = el;
245
  if (el.length > 1) {
246
  el.each(function () {
247
+ if (jQuery(this).hasClass('more_events')) {
248
+ obj = jQuery(this);
249
  return;
250
  }
251
  });
252
  }
253
+ jQuery(calendar).closest('.ecwd_calendar').find('.ecwd-events-day-details').html(obj.find('.event-details').clone().css('display', 'block'));
254
+ } else if (el.parent().parent().parent().parent().attr('class').indexOf("mini") != -1) {
255
+ jQuery(calendar).closest('.ecwd_calendar').find('.ecwd-events-day-details').html(el.clone());
256
  }
257
+ jQuery(calendar).closest('.ecwd_calendar').find('.ecwd-events-day-details').find('li').each(function(){
258
+ jQuery(this).css('background','none');
259
+
260
  });
261
  add_single_events_popup();
262
  }
306
 
307
  function showFilterSliderArrow() {
308
  var li_position, li_width, last_child;
309
+ jQuery(".calendar_main:not([class^='ecwd_widget'] .calendar_main) .ecwd_calendar_view_tabs").each(function (key, element) {
310
+ var cwidth = jQuery(element).closest('.ecwd_calendar').outerWidth();
311
  if (cwidth == 0)
312
  cwidth = 600;
313
+ if (jQuery(this).find('.ecwd-search').length != 0)
314
  var ecwd_calendar_view_tabs_width = parseInt(cwidth) - 50;
315
  else
316
  var ecwd_calendar_view_tabs_width = parseInt(cwidth);
317
+ if (parseInt(jQuery('body').width()) <= 768 || jQuery(".calendar_full_content .ecwd_calendar").width() < 600) {
318
  var ecwd_calendar_view_visible_count = parseInt(ecwd_calendar_view_tabs_width / 110);
319
+ } else if (parseInt(jQuery('body').width()) <= 500 || jQuery(".calendar_full_content .ecwd_calendar").width() < 400) {
320
  var ecwd_calendar_view_visible_count = parseInt(ecwd_calendar_view_tabs_width / 90);
321
  } else {
322
  var ecwd_calendar_view_visible_count = parseInt(ecwd_calendar_view_tabs_width / 150);
323
  }
324
+ jQuery(element).find('.filter-container').width(ecwd_calendar_view_tabs_width);
325
+ jQuery(element).find('ul li').each(function (keyli, elementli) {
326
+ if (jQuery(elementli).hasClass('ecwd-selected-mode')) {
327
  li_position = keyli;
328
+ li_width = jQuery(elementli).outerWidth();
329
  }
330
  });
331
+ if (jQuery(element).find(".filter-arrow-right").css("display") == "block" || last_child == 1)
332
+ jQuery(element).find('.filter-container ul li').width((ecwd_calendar_view_tabs_width - 30) / ecwd_calendar_view_visible_count);
333
  else
334
+ jQuery(element).find('.filter-container ul li').width((ecwd_calendar_view_tabs_width) / ecwd_calendar_view_visible_count);
335
+ var ecwd_view_item_width = jQuery(element).find('.filter-container ul li').eq(0).innerWidth() - 1;
336
+ if (!(ecwd_calendar_view_tabs_width < ecwd_view_item_width * parseInt(jQuery(element).find('.filter-container ul li').length) && !(jQuery(element).find("ul li:last-child").hasClass("ecwd-selected-mode"))))
337
+ jQuery(element).find('.filter-arrow-right').hide();
338
+ if (ecwd_calendar_view_tabs_width < ecwd_view_item_width * parseInt(jQuery(element).find('.filter-container ul li').length) && !(jQuery(element).find("ul li:last-child").hasClass("ecwd-selected-mode"))) {
339
+ jQuery(element).find('.filter-arrow-right').show();
340
+ } else if (jQuery(element).find("ul li:last-child").hasClass("ecwd-selected-mode")) {
341
  last_child = 1;
342
  }
343
  if (ecwd_calendar_view_visible_count <= li_position && li_position != 0) {
344
+ jQuery(element).find('ul li').css({left: "-" + ((li_position + 1 - ecwd_calendar_view_visible_count) * ecwd_view_item_width) + "px"});
345
+ jQuery(element).find('.filter-arrow-left').show();
346
  } else
347
+ jQuery(element).find('ul li').css({left: "0px"});
348
  });
349
 
350
+ jQuery('.ecwd_calendar_view_tabs .filter-arrow-right').click(function () {
351
+ var view_filter_width = jQuery(this).parent().find('ul li').eq(0).outerWidth();
352
+ var cwidth = jQuery(this).closest('.ecwd_calendar').outerWidth();
353
  if (cwidth == 0)
354
  cwidth = 600;
355
+ if (jQuery(this).find('.ecwd-search').length != 0)
356
  var view_filter_container_width = parseInt(cwidth) - 50;
357
  else
358
  var view_filter_container_width = parseInt(cwidth);
359
+ var view_filter_count = parseInt(jQuery(this).parent().find('ul li').length);
360
+ jQuery(this).parent().find('.filter-arrow-left').show();
361
+ if (parseInt(jQuery(this).parent().find('ul li').css('left')) <= -((view_filter_width * view_filter_count) - view_filter_container_width) + view_filter_width)
362
+ jQuery(this).hide();
363
+ if (click && view_filter_container_width < view_filter_width * view_filter_count && parseInt(jQuery(this).parent().find('ul li').css('left')) >= -(view_filter_width * (view_filter_count) - view_filter_container_width)) {
364
  click = 0;
365
+ jQuery(this).parent().find('ul li').animate({left: "-=" + view_filter_width}, 400, function () {
366
  click = 1
367
  });
368
  }
369
  });
370
+ jQuery('.ecwd_calendar_view_tabs .filter-arrow-left').click(function () {
371
+ var view_filter_width = jQuery(this).parent().find('ul li').eq(0).outerWidth();
372
+ if (jQuery(this).parent().find('.filter-arrow-right').css('display') == 'none')
373
+ jQuery(this).parent().find('.filter-arrow-right').show();
374
+ if (parseInt(jQuery(this).parent().find('ul li').css('left')) == -view_filter_width)
375
+ jQuery(this).hide();
376
+ if (click && parseInt(jQuery(this).parent().find('ul li').css('left')) < 0) {
377
  click = 0;
378
+ jQuery(this).parent().find('ul li').animate({left: "+=" + view_filter_width}, 400, function () {
379
  click = 1
380
  });
381
  }
601
  });
602
  jQuery(".month-name").show();
603
  }
604
+
605
+ /* Open/close Filter's tabs on click */
606
+ jQuery( '.ecwd_filter_item' ).unbind().click(function () {
607
+ jQuery(this).find(".ecwd_filter_checkboxes").slideToggle( "slow" );
 
 
 
 
 
 
608
  });
609
+
610
  }, 100);
611
 
612
  function show_filters(main_div) {
643
  }
644
  }
645
 
646
+ }
647
  this.showMap = function () {
648
  if (ecwd.gmap_key == "") {
649
  jQuery(".ecwd_map_div").each(function (k, v) {
658
 
659
  if (typeof google == 'undefined' || typeof google.maps == "undefined") {
660
  var script = document.createElement('script');
661
+ script.type = 'text/javascript';
662
  script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&callback=ecwd_js_init_call.showMap&key='+ecwd.gmap_key;
663
  document.body.appendChild(script);
664
  } else {
717
  events: {
718
  click: function (marker, event, context) {
719
  var map = jQuery(maps[k]).gmap3("get"),
720
+ infowindow = jQuery(maps[k]).gmap3({get: {name: "infowindow"}});
721
  if (infowindow) {
722
  infowindow.open(map, marker);
723
  infowindow.setContent(context.data);
733
 
734
  }
735
  },
 
736
  });
 
737
  });
738
  }
739
  }
 
 
 
 
740
 
741
  if (jQuery('.ecwd_map_div').length > 0) {
742
  this.showMap();
744
  }
745
 
746
  ecwd_js_init_call = new ecwd_js_init();
747
+ });
748
+
749
  function ecwd_eventsOff() {
750
  jQuery(".calendar_main,.ecwd-event,.ecwd-organizer,.ecwd-venue").find("*").off();
751
  jQuery(".calendar_main,.ecwd-event,.ecwd-organizer,.ecwd-venue").children().off();
migration.php CHANGED
@@ -15,12 +15,6 @@ function migrate_data() {
15
  $ecwdcalendar_event_category_tbl = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "ecwdcalendar_event_category");
16
  $ecwdcalendar_calendar_theme_tbl = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "ecwdcalendar_theme");
17
  $ecwdcalendar_calendar_widget_theme_tbl = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "ecwdcalendar_widget_theme");
18
-
19
-
20
-
21
-
22
-
23
- //var_dump($ecwdcalendar_calendar_theme_tbl);
24
 
25
  //calendars migration
26
  for ($i = 0; $i < count($ecwdcalendar_calendar_tbl); ++$i) {
15
  $ecwdcalendar_event_category_tbl = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "ecwdcalendar_event_category");
16
  $ecwdcalendar_calendar_theme_tbl = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "ecwdcalendar_theme");
17
  $ecwdcalendar_calendar_widget_theme_tbl = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "ecwdcalendar_widget_theme");
 
 
 
 
 
 
18
 
19
  //calendars migration
20
  for ($i = 0; $i < count($ecwdcalendar_calendar_tbl); ++$i) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: calendar, date, event, event calendar, events, events calendar, meeting, o
4
  Requires at least: 4.6
5
  Tested up to: 5.8
6
  Requires PHP: 5.4
7
- Stable tag: 1.1.47
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -345,6 +345,11 @@ After downloading the ZIP file of the Event Calendar WD plugin,
345
  Event Calendar WD plugin optionally embeds Google Maps on front end to display events on the map. Embedded Google Maps behave in the exact same way as if visitor has opened Google Maps site. Google may collect data about visitors, use cookies and tracking, included their logged-in experience interaction with Google platform. Google Maps are regulated under terms of Google privacy policy https://policies.google.com/privacy. The plugin asks for your consent to collect site administrator’s email address and site URL to offer customer support, deals and discounts on premium products and more.
346
 
347
  == Changelog ==
 
 
 
 
 
348
  = 1.1.47 =
349
  * Fixed: PHP notices and warnings.
350
  * Fixed: Minor bugs with share functionality.
4
  Requires at least: 4.6
5
  Tested up to: 5.8
6
  Requires PHP: 5.4
7
+ Stable tag: 1.1.48
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
345
  Event Calendar WD plugin optionally embeds Google Maps on front end to display events on the map. Embedded Google Maps behave in the exact same way as if visitor has opened Google Maps site. Google may collect data about visitors, use cookies and tracking, included their logged-in experience interaction with Google platform. Google Maps are regulated under terms of Google privacy policy https://policies.google.com/privacy. The plugin asks for your consent to collect site administrator’s email address and site URL to offer customer support, deals and discounts on premium products and more.
346
 
347
  == Changelog ==
348
+ = 1.1.48 =
349
+ * Fixed: Compatibility with PHP 8.
350
+ * Fixed: Compatibility with Filters add-on.
351
+ * Fixed: Saving shortcode options.
352
+
353
  = 1.1.47 =
354
  * Fixed: PHP notices and warnings.
355
  * Fixed: Minor bugs with share functionality.
views/ecwd-venue-content.php CHANGED
@@ -50,7 +50,6 @@ $args = array(
50
  );
51
  $ecwd_events = get_posts($args);
52
 
53
- //var_dump($ecwd_events);
54
  foreach ($ecwd_events as $ecwd_event) {
55
 
56
  $term_metas = '';
50
  );
51
  $ecwd_events = get_posts($args);
52
 
 
53
  foreach ($ecwd_events as $ecwd_event) {
54
 
55
  $term_metas = '';
views/widgets.php CHANGED
@@ -82,10 +82,6 @@ class ECWD_Widget extends WP_Widget {
82
  'widget_theme' => (!isset($instance['theme']) || $instance['theme'] == "calendar_theme") ? null : $instance['theme']
83
  );
84
 
85
- // if( 'list-grouped' == $instance['display_type'] ) {
86
- // $args['grouped'] = 1;
87
- // }
88
- //echo $instance['display_type'].'------------<br />';
89
  $markup = ecwd_print_calendar($calendar_ids, $instance['display_type'], $args, true);
90
 
91
  echo $markup;
82
  'widget_theme' => (!isset($instance['theme']) || $instance['theme'] == "calendar_theme") ? null : $instance['theme']
83
  );
84
 
 
 
 
 
85
  $markup = ecwd_print_calendar($calendar_ids, $instance['display_type'], $args, true);
86
 
87
  echo $markup;