Event Calendar WD – Responsive Event Calendar plugin - Version 1.0.22

Version Description

Added: Ajaxed themes support
Fixed: Next month link issue
Changed: More events dialog
Added: Support/rate us messages

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Event Calendar WD – Responsive Event Calendar plugin
Version 1.0.22
Comparing to
See all releases

Code changes from version 1.0.21 to 1.0.22

css/admin/notices.css ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ecwd-admin-notice {
2
+ background: #fff;
3
+ border-top: 4px;
4
+ display: block;
5
+ min-height: 68px;
6
+ padding: 10px 40px 10px 125px;
7
+ position: relative;
8
+ }
9
+ .ecwd-admin-notice a {
10
+ color: #10738B;
11
+ }
12
+ .ecwd-notice-logo {
13
+ clear: both;
14
+ content: "";
15
+ display: block;
16
+ background-image: url("https://d27sb3x2z8tu4g.cloudfront.net/images/productlogos/CalendarWD.png?1433338742");
17
+ background-size: 108px 107px;
18
+ background-repeat: no-repeat;
19
+ background-position: 0 45%;
20
+ width: 125px;
21
+ position: absolute;
22
+ top: 0;
23
+ bottom: 0;
24
+ left: 5px;
25
+ }
26
+ .ecwd-admin-notice > .dashicons {
27
+ color: #424242;
28
+ position: absolute;
29
+ right: 20px;
30
+ top: 40%;
31
+ }
32
+ .ecwd-notice-title {
33
+ font-size: 24px;
34
+ margin: 0;
35
+ }
36
+ .ecwd-notice-body {
37
+ font-weight: normal;
38
+ margin: 5px 0;
39
+ }
40
+ .ecwd-notice-body:after {
41
+ clear: both;
42
+ content: "";
43
+ display: block;
44
+ }
45
+ .ecwd-notice-body li {
46
+ float: left;
47
+ margin-right: 20px;
48
+ }
49
+ .ecwd-notice-body .dashicons {
50
+ font-size: 17px;
51
+ }
52
+ .ecwd-blue {
53
+ color: #10738B;
54
+ }
css/style.css CHANGED
@@ -2154,7 +2154,7 @@ a.ecwd-google-plus{
2154
  position: absolute;
2155
  top: 12px;
2156
  font-size: 18px;
2157
- left: 13px;
2158
  line-height: 19px;
2159
  color: #676767;
2160
  }
@@ -2219,11 +2219,7 @@ a.ecwd-google-plus{
2219
  background: #fff;
2220
  border: 1px solid #CFD7DE;
2221
  }
2222
- .ecwd-modal:target {
2223
- opacity:1;
2224
- display: block;
2225
- pointer-events: auto;
2226
- }
2227
  .ecwd-modal .modal-header {
2228
  margin: 0 0 1px 0 !important;
2229
  padding: 0 0 1px 0;
2154
  position: absolute;
2155
  top: 12px;
2156
  font-size: 18px;
2157
+ right: 13px;
2158
  line-height: 19px;
2159
  color: #676767;
2160
  }
2219
  background: #fff;
2220
  border: 1px solid #CFD7DE;
2221
  }
2222
+
 
 
 
 
2223
  .ecwd-modal .modal-header {
2224
  margin: 0 0 1px 0 !important;
2225
  padding: 0 0 1px 0;
ecwd.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Event Calendar WD
4
  * Plugin URI: https://web-dorado.com/products/wordpress-event-calendar-wd.html
5
  * Description: Event Calendar WD is an easy event management and planning tool with advanced features.
6
- * Version: 1.0.21
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
3
  * Plugin Name: Event Calendar WD
4
  * Plugin URI: https://web-dorado.com/products/wordpress-event-calendar-wd.html
5
  * Description: Event Calendar WD is an easy event management and planning tool with advanced features.
6
+ * Version: 1.0.22
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
ecwd_admin_class.php CHANGED
@@ -6,13 +6,15 @@
6
  class ECWD_Admin {
7
 
8
  protected static $instance = null;
9
- protected $version = '1.0.21';
10
  protected $ecwd_page = null;
 
11
 
12
  private function __construct() {
13
  $plugin = ECWD::get_instance();
14
  $this->prefix = $plugin->get_prefix();
15
  $this->version = $plugin->get_version();
 
16
  add_filter( 'plugin_action_links_' . plugin_basename( plugin_dir_path( __FILE__ ) . $this->prefix . '.php' ), array(
17
  $this,
18
  'add_action_links'
@@ -33,8 +35,12 @@ class ECWD_Admin {
33
  }
34
  //add_filter( 'auto_update_plugin', array($this, 'ecwd_update'), 10, 2 );
35
 
36
- //Wed Dorado Logo
37
  add_action( 'admin_notices', array( $this, 'create_logo_to_head' ) );
 
 
 
 
38
  }
39
 
40
 
@@ -265,7 +271,12 @@ class ECWD_Admin {
265
  }
266
 
267
  wp_localize_script( $this->prefix . '-admin-scripts', 'params', $params );
268
- wp_localize_script($this->prefix . '-public',$this->prefix .'_plugin_url' , ECWD_URL);
 
 
 
 
 
269
  wp_enqueue_script( $this->prefix . '-admin-scripts' );
270
 
271
  }
@@ -386,6 +397,31 @@ class ECWD_Admin {
386
  }
387
  }
388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  /**
390
  * Set Web Dorado Logo in admin pages
391
  */
@@ -393,7 +429,7 @@ class ECWD_Admin {
393
  global $pagenow, $post;
394
 
395
  if ( $this->ecwd_page() ) { ?>
396
- <div style="float:right; width: 100%; text-align: right;clear:both;">
397
  <a href="https://web-dorado.com/files/fromEventCalendarWD.php" target="_blank"
398
  style="text-decoration:none;box-shadow: none;">
399
  <img src="<?php echo plugins_url( '/assets/pro.png', __FILE__ ); ?>" border="0"
6
  class ECWD_Admin {
7
 
8
  protected static $instance = null;
9
+ protected $version = '1.0.22';
10
  protected $ecwd_page = null;
11
+ protected $notices = null;
12
 
13
  private function __construct() {
14
  $plugin = ECWD::get_instance();
15
  $this->prefix = $plugin->get_prefix();
16
  $this->version = $plugin->get_version();
17
+ $this->notices = new ECWD_Notices();
18
  add_filter( 'plugin_action_links_' . plugin_basename( plugin_dir_path( __FILE__ ) . $this->prefix . '.php' ), array(
19
  $this,
20
  'add_action_links'
35
  }
36
  //add_filter( 'auto_update_plugin', array($this, 'ecwd_update'), 10, 2 );
37
 
38
+ //Web Dorado Logo
39
  add_action( 'admin_notices', array( $this, 'create_logo_to_head' ) );
40
+ // Runs the admin notice ignore function incase a dismiss button has been clicked
41
+ add_action( 'admin_init', array( $this, 'admin_notice_ignore' ) );
42
+ add_action( 'admin_notices', array($this, 'ecwd_admin_notices') );
43
+
44
  }
45
 
46
 
271
  }
272
 
273
  wp_localize_script( $this->prefix . '-admin-scripts', 'params', $params );
274
+ wp_localize_script( ECWD_PLUGIN_PREFIX . '-public', 'ecwd', array(
275
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
276
+ 'ajaxnonce' => wp_create_nonce( ECWD_PLUGIN_PREFIX . '_ajax_nonce' ),
277
+ 'loadingText' => __( 'Loading...', 'ecwd' ),
278
+ 'plugin_url' => ECWD_URL
279
+ ) );
280
  wp_enqueue_script( $this->prefix . '-admin-scripts' );
281
 
282
  }
397
  }
398
  }
399
 
400
+ /********ECWD notices************/
401
+ function ecwd_admin_notices( ) {
402
+ // Notices filter and run the notices function.
403
+
404
+ $admin_notices = apply_filters( 'ecwd_admin_notices', array() );
405
+ $this->notices->admin_notice( $admin_notices );
406
+
407
+ }
408
+
409
+
410
+
411
+
412
+ // Ignore function that gets ran at admin init to ensure any messages that were dismissed get marked
413
+ public function admin_notice_ignore() {
414
+ $slug = ( isset( $_GET['ecwd_admin_notice_ignore'] ) ) ? $_GET['ecwd_admin_notice_ignore'] : '';
415
+ if ( isset($_GET['ecwd_admin_notice_ignore']) && current_user_can( 'manage_options' ) ) {
416
+ $admin_notices_option = get_option( 'ecwd_admin_notice', array() );
417
+ $admin_notices_option[ $_GET[ 'ecwd_admin_notice_ignore' ] ][ 'dismissed' ] = 1;
418
+ update_option( 'ecwd_admin_notice', $admin_notices_option );
419
+ $query_str = remove_query_arg( 'ecwd_admin_notice_ignore' );
420
+ wp_redirect( $query_str );
421
+ exit;
422
+ }
423
+ }
424
+
425
  /**
426
  * Set Web Dorado Logo in admin pages
427
  */
429
  global $pagenow, $post;
430
 
431
  if ( $this->ecwd_page() ) { ?>
432
+ <div style="width: 100%; text-align: right;clear:both;">
433
  <a href="https://web-dorado.com/files/fromEventCalendarWD.php" target="_blank"
434
  style="text-decoration:none;box-shadow: none;">
435
  <img src="<?php echo plugins_url( '/assets/pro.png', __FILE__ ); ?>" border="0"
ecwd_class.php CHANGED
@@ -6,7 +6,7 @@
6
  */
7
  class ECWD {
8
 
9
- protected $version = '1.0.21';
10
  protected $plugin_name = 'event-calendar-wd';
11
  protected $prefix = 'ecwd';
12
  protected static $instance = null;
@@ -38,7 +38,11 @@ class ECWD {
38
  if ( ! defined( 'ECWD_PLUGIN_NAME' ) ) {
39
  define( 'ECWD_PLUGIN_NAME', $this->plugin_name );
40
  }
41
-
 
 
 
 
42
  }
43
 
44
 
@@ -92,9 +96,12 @@ class ECWD {
92
  $default_timezone = self::isValidTimezone( @ini_get( 'date.timezone' ) ) ? ini_get( 'date.timezone' ) : 'Europe/Berlin';
93
  $timezone = ( isset( $ecwd_options['time_zone'] ) && self::isValidTimezone( $ecwd_options['time_zone'] ) ) ? $ecwd_options['time_zone'] : $default_timezone;
94
  date_default_timezone_set( $timezone );
 
 
95
  include_once( 'includes/ecwd-functions.php' );
96
  include_once( 'includes/ecwd-event-class.php' );
97
  include_once( 'includes/ecwd-display-class.php' );
 
98
  include_once( 'views/widgets.php' );
99
  }
100
 
@@ -104,7 +111,7 @@ class ECWD {
104
  public function enqueue_scripts() {
105
  global $wp_scripts, $post;
106
  $map_included = false;
107
- if($post->post_type == 'ecwd_event'){
108
  if ( isset( $wp_scripts->registered ) && $wp_scripts->registered ) {
109
  foreach ( $wp_scripts->registered as $wp_script ) {
110
  if ( $wp_script->src && ( strpos( $wp_script->src, 'maps.googleapis.com' ) || strpos( $wp_script->src, 'maps.google.com' ) ) !== false ) {
@@ -127,7 +134,12 @@ class ECWD {
127
  'jquery-ui-draggable',
128
  'masonry'
129
  ), $this->version, true );
130
- wp_localize_script($this->prefix . '-public',$this->prefix .'_plugin_url' , ECWD_URL);
 
 
 
 
 
131
  }
132
 
133
  /*
6
  */
7
  class ECWD {
8
 
9
+ protected $version = '1.0.20';
10
  protected $plugin_name = 'event-calendar-wd';
11
  protected $prefix = 'ecwd';
12
  protected static $instance = null;
38
  if ( ! defined( 'ECWD_PLUGIN_NAME' ) ) {
39
  define( 'ECWD_PLUGIN_NAME', $this->plugin_name );
40
  }
41
+ if(! defined( 'ECWD_URL' ) ){
42
+ define ('ECWD_URL',plugins_url(plugin_basename(dirname(__FILE__))));
43
+ }if(! defined( 'ECWD_VERSION' ) ){
44
+ define ('ECWD_VERSION', $this->version);
45
+ }
46
  }
47
 
48
 
96
  $default_timezone = self::isValidTimezone( @ini_get( 'date.timezone' ) ) ? ini_get( 'date.timezone' ) : 'Europe/Berlin';
97
  $timezone = ( isset( $ecwd_options['time_zone'] ) && self::isValidTimezone( $ecwd_options['time_zone'] ) ) ? $ecwd_options['time_zone'] : $default_timezone;
98
  date_default_timezone_set( $timezone );
99
+ include_once('includes/ecwd-notices-class.php');
100
+ require_once('includes/notices.php');
101
  include_once( 'includes/ecwd-functions.php' );
102
  include_once( 'includes/ecwd-event-class.php' );
103
  include_once( 'includes/ecwd-display-class.php' );
104
+
105
  include_once( 'views/widgets.php' );
106
  }
107
 
111
  public function enqueue_scripts() {
112
  global $wp_scripts, $post;
113
  $map_included = false;
114
+ if($post->post_type == 'ecwd_event' || $post->post_type == 'ecwd_venue'){
115
  if ( isset( $wp_scripts->registered ) && $wp_scripts->registered ) {
116
  foreach ( $wp_scripts->registered as $wp_script ) {
117
  if ( $wp_script->src && ( strpos( $wp_script->src, 'maps.googleapis.com' ) || strpos( $wp_script->src, 'maps.google.com' ) ) !== false ) {
134
  'jquery-ui-draggable',
135
  'masonry'
136
  ), $this->version, true );
137
+ wp_localize_script( ECWD_PLUGIN_PREFIX . '-public', 'ecwd', array(
138
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
139
+ 'ajaxnonce' => wp_create_nonce( ECWD_PLUGIN_PREFIX . '_ajax_nonce' ),
140
+ 'loadingText' => __( 'Loading...', 'ecwd' ),
141
+ 'plugin_url' => ECWD_URL
142
+ ) );
143
  }
144
 
145
  /*
includes/calendar-class.php CHANGED
@@ -742,7 +742,7 @@ class Calendar {
742
  global $cal_ID;
743
  $html = '';
744
 
745
- $next = $this->calcDate( $this->year . '-' . $this->month . '-' . $this->day, '+1', 'month' );
746
  $next_date = '';
747
  $dateparam = $next['year'] . '-' . $next['month'] . '-' . $next['day'];
748
  if ( $this->displaytype == 'day' ) {
@@ -1100,10 +1100,10 @@ class Calendar {
1100
 
1101
  if ( $i > 2 && $this->displaytype !== 'mini' ) {
1102
  $content .= '<li class="ecwd-calendar-more-event">
1103
- <span class="ecwd-calendar-event-add"><a href="#more_events_' . $date . '">' . __( 'More events', 'ecwd' ) . '</a></span>
1104
  <div id="more_events_' . $date . '" class="ecwd-modal">
1105
  <div class="ecwd-excluded-events ">
1106
- <a href="#ecwd-close" title="Close" class="ecwd-close"><i class="fa fa-times"></i></a>
1107
  <div class="modal-header">
1108
  <h4 class="modal-title">' . date( $this->dateformat, strtotime( $date ) ) . '</h4>
1109
  </div>
742
  global $cal_ID;
743
  $html = '';
744
 
745
+ $next = $this->calcDate( $this->year . '-' . $this->month . '-1', '+ 1', 'month' );
746
  $next_date = '';
747
  $dateparam = $next['year'] . '-' . $next['month'] . '-' . $next['day'];
748
  if ( $this->displaytype == 'day' ) {
1100
 
1101
  if ( $i > 2 && $this->displaytype !== 'mini' ) {
1102
  $content .= '<li class="ecwd-calendar-more-event">
1103
+ <span class="ecwd-calendar-event-add"><a href="#" class="more_events_link" div-id="more_events_' . $date . '">' . __( 'More events', 'ecwd' ) . '</a></span>
1104
  <div id="more_events_' . $date . '" class="ecwd-modal">
1105
  <div class="ecwd-excluded-events ">
1106
+ <a href="#" title="Close" class="ecwd-more-events-close"><i class="fa fa-times"></i></a>
1107
  <div class="modal-header">
1108
  <h4 class="modal-title">' . date( $this->dateformat, strtotime( $date ) ) . '</h4>
1109
  </div>
includes/ecwd-functions.php CHANGED
@@ -5,7 +5,8 @@ function ecwd_print_calendar( $calendar_ids, $display = 'mini', $args = array(),
5
  wp_localize_script( ECWD_PLUGIN_PREFIX . '-public', 'ecwd', array(
6
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
7
  'ajaxnonce' => wp_create_nonce( ECWD_PLUGIN_PREFIX . '_ajax_nonce' ),
8
- 'loadingText' => __( 'Loading...', 'ecwd' )
 
9
  ) );
10
 
11
  $defaults = array(
@@ -115,6 +116,7 @@ function ecwd_print_calendar( $calendar_ids, $display = 'mini', $args = array(),
115
 
116
  $markup .= '</div>';
117
  }
 
118
 
119
  return $markup;
120
  }
5
  wp_localize_script( ECWD_PLUGIN_PREFIX . '-public', 'ecwd', array(
6
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
7
  'ajaxnonce' => wp_create_nonce( ECWD_PLUGIN_PREFIX . '_ajax_nonce' ),
8
+ 'loadingText' => __( 'Loading...', 'ecwd' ),
9
+ 'plugin_url' => ECWD_URL
10
  ) );
11
 
12
  $defaults = array(
116
 
117
  $markup .= '</div>';
118
  }
119
+ $markup .= '<script id="ecwd_script_handler" type="text/javascript">if(typeof ecwd_js_init_call=="object"){ecwd_js_init_call = new ecwd_js_init();}</script>';
120
 
121
  return $markup;
122
  }
includes/ecwd-notices-class.php ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: lusinda
5
+ * Date: 8/28/15
6
+ * Time: 10:48 AM
7
+ */
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ /**
13
+ * ECWD_Notices Class
14
+ *
15
+ */
16
+ class ECWD_Notices {
17
+ static $instance;
18
+
19
+ public static function instance() {
20
+ if ( ! isset( self::$instance ) ) {
21
+ self::$instance = new ECWD_Notices();
22
+ }
23
+
24
+ return self::$instance;
25
+ }
26
+
27
+ public $notice_spam = 0;
28
+ public $notice_spam_max = 1;
29
+
30
+ // Basic actions to run
31
+ public function __construct() {
32
+
33
+ // Runs the admin notice ignore function incase a dismiss button has been clicked
34
+ add_action( 'admin_init', array( $this, 'admin_notice_ignore' ) );
35
+
36
+ // Runs the admin notice temp ignore function incase a temp dismiss link has been clicked
37
+ add_action( 'admin_init', array( $this, 'admin_notice_temp_ignore' ) );
38
+
39
+ }
40
+
41
+ // Checks to ensure notices aren't disabled and the user has the correct permissions.
42
+ public function ecwd_admin_notice() {
43
+
44
+ $ecwd_settings = get_option( 'ecwd_admin_notice' );
45
+ if ( ! isset( $ecwd_settings['disable_admin_notices'] ) || ( isset( $ecwd_settings['disable_admin_notices'] ) && $ecwd_settings['disable_admin_notices'] == 0 ) ) {
46
+ if ( current_user_can( 'manage_options' ) ) {
47
+ return true;
48
+ }
49
+ }
50
+
51
+ return false;
52
+
53
+ }
54
+
55
+ // Primary notice function that can be called from an outside function sending necessary variables
56
+ public function admin_notice( $admin_notices ) {
57
+
58
+ // Check options
59
+ if ( ! $this->ecwd_admin_notice() ) {
60
+ return false;
61
+ }
62
+
63
+ foreach ( $admin_notices as $slug => $admin_notice ) {
64
+ // Call for spam protection
65
+ if ( $this->anti_notice_spam() ) {
66
+ return false;
67
+ }
68
+
69
+ // Check for proper page to display on
70
+ if ( isset( $admin_notices[ $slug ]['pages'] ) && is_array( $admin_notices[ $slug ]['pages'] ) ) {
71
+ if ( ! $this->admin_notice_pages( $admin_notices[ $slug ]['pages'] ) ) {
72
+ return false;
73
+ }
74
+ }
75
+ // Check for required fields
76
+ if ( ! $this->required_fields( $admin_notices[ $slug ] ) ) {
77
+ // Get the current date then set start date to either passed value or current date value and add interval
78
+ $current_date = current_time( "n/j/Y" );
79
+ $start = ( isset( $admin_notices[ $slug ]['start'] ) ? $admin_notices[ $slug ]['start'] : $current_date );
80
+ $start = date( "n/j/Y", strtotime( $start ) );
81
+ $date_array = explode( '/', $start );
82
+ $interval = ( isset( $admin_notices[ $slug ]['int'] ) ? $admin_notices[ $slug ]['int'] : 0 );
83
+ $date_array[1] += $interval;
84
+ $start = date( "n/j/Y", mktime( 0, 0, 0, $date_array[0], $date_array[1], $date_array[2] ) );
85
+
86
+ // This is the main notices storage option
87
+ $admin_notices_option = get_option( 'ecwd_admin_notice', array() );
88
+ // Check if the message is already stored and if so just grab the key otherwise store the message and its associated date information
89
+ if ( ! array_key_exists( $slug, $admin_notices_option ) ) {
90
+ $admin_notices_option[ $slug ]['start'] = $start;
91
+ $admin_notices_option[ $slug ]['int'] = $interval;
92
+ update_option( 'ecwd_admin_notice', $admin_notices_option );
93
+ }
94
+
95
+ // Sanity check to ensure we have accurate information
96
+ // New date information will not overwrite old date information
97
+ $admin_display_check = ( isset( $admin_notices_option[ $slug ]['dismissed'] ) ? $admin_notices_option[ $slug ]['dismissed'] : 0 );
98
+
99
+ $admin_display_start = ( isset( $admin_notices_option[ $slug ]['start'] ) ? $admin_notices_option[ $slug ]['start'] : $start );
100
+ $admin_display_interval = ( isset( $admin_notices_option[ $slug ]['int'] ) ? $admin_notices_option[ $slug ]['int'] : $interval );
101
+ $admin_display_msg = ( isset( $admin_notices[ $slug ]['msg'] ) ? $admin_notices[ $slug ]['msg'] : '' );
102
+ $admin_display_title = ( isset( $admin_notices[ $slug ]['title'] ) ? $admin_notices[ $slug ]['title'] : '' );
103
+ $admin_display_link = ( isset( $admin_notices[ $slug ]['link'] ) ? $admin_notices[ $slug ]['link'] : '' );
104
+ $output_css = false;
105
+
106
+ // Ensure the notice hasn't been hidden and that the current date is after the start date
107
+ if ($admin_display_check == 0 && strtotime( $admin_display_start ) <= strtotime( $current_date )) {
108
+
109
+ // Get remaining query string
110
+ $query_str = esc_url( add_query_arg( 'ecwd_admin_notice_ignore', $slug ) );
111
+
112
+ // Admin notice display output
113
+ echo '<div class="update-nag ecwd-admin-notice">';
114
+ echo '<div class="ecwd-notice-logo"></div>';
115
+ echo ' <p class="ecwd-notice-title">';
116
+ echo $admin_display_title;
117
+ echo ' </p>';
118
+ echo ' <p class="ecwd-notice-body">';
119
+ echo $admin_display_msg;
120
+ echo ' </p>';
121
+ echo '<ul class="ecwd-notice-body ecwd-blue">
122
+ ' . $admin_display_link . '
123
+ </ul>';
124
+ echo '<a href="' . $query_str . '" class="dashicons dashicons-dismiss"></a>';
125
+ echo '</div>';
126
+
127
+ $this->notice_spam += 1;
128
+ $output_css = true;
129
+ }
130
+ if ( $output_css ) {
131
+ wp_enqueue_style( 'ecwd-admin-notices', ECWD_URL .'/css/admin/notices.css?ecwd_ver=' . ECWD_VERSION );
132
+ }
133
+ }
134
+ }
135
+ }
136
+
137
+ // Spam protection check
138
+ public function anti_notice_spam() {
139
+
140
+ if ( $this->notice_spam >= $this->notice_spam_max ) {
141
+ return true;
142
+ }
143
+
144
+ return false;
145
+ }
146
+
147
+ // Ignore function that gets ran at admin init to ensure any messages that were dismissed get marked
148
+ public function admin_notice_ignore() {
149
+
150
+ // If user clicks to ignore the notice, update the option to not show it again
151
+ if ( isset( $_GET['ecwd_admin_notice_ignore'] ) ) {
152
+
153
+ $admin_notices_option = get_option( 'ecwd_admin_notice', array() );
154
+ $admin_notices_option[ $_GET['ecwd_admin_notice_ignore'] ]['dismissed'] = 1;
155
+ update_option( 'ecwd_admin_notice', $admin_notices_option );
156
+ $query_str = remove_query_arg( 'ecwd_admin_notice_ignore' );
157
+ wp_redirect( $query_str );
158
+ exit;
159
+ }
160
+ }
161
+
162
+ // Temp Ignore function that gets ran at admin init to ensure any messages that were temp dismissed get their start date changed
163
+ public function admin_notice_temp_ignore() {
164
+
165
+ // If user clicks to temp ignore the notice, update the option to change the start date - default interval of 14 days
166
+ if ( isset( $_GET['ecwd_admin_notice_temp_ignore'] ) ) {
167
+
168
+ $admin_notices_option = get_option( 'ecwd_admin_notice', array() );
169
+
170
+ $current_date = current_time( "n/j/Y" );
171
+ $date_array = explode( '/', $current_date );
172
+ $interval = ( isset( $_GET['ecwd_int'] ) ? $_GET['ecwd_int'] : 14 );
173
+ $date_array[1] += $interval;
174
+ $new_start = date( "n/j/Y", mktime( 0, 0, 0, $date_array[0], $date_array[1], $date_array[2] ) );
175
+
176
+ $admin_notices_option[ $_GET['ecwd_admin_notice_temp_ignore'] ]['start'] = $new_start;
177
+ $admin_notices_option[ $_GET['ecwd_admin_notice_temp_ignore'] ]['dismissed'] = 0;
178
+ update_option( 'ecwd_admin_notice', $admin_notices_option );
179
+ $query_str = remove_query_arg( array( 'ecwd_admin_notice_temp_ignore', 'ecwd_int' ) );
180
+ wp_redirect( $query_str );
181
+ exit;
182
+ }
183
+ }
184
+
185
+ public function admin_notice_pages( $pages ) {
186
+
187
+ foreach ( $pages as $key => $page ) {
188
+ if ( is_array( $page ) ) {
189
+ if ( isset( $_GET['page'] ) && $_GET['page'] == $page[0] && isset( $_GET['tab'] ) && $_GET['tab'] == $page[1] ) {
190
+ return true;
191
+ }
192
+ } else {
193
+ if ( $page == 'all' ) {
194
+ return true;
195
+ }
196
+ if ( get_current_screen()->id === $page ) {
197
+ return true;
198
+ }
199
+ if ( isset( $_GET['page'] ) && $_GET['page'] == $page ) {
200
+ return true;
201
+ }
202
+ }
203
+
204
+ return false;
205
+ }
206
+ }
207
+
208
+ // Required fields check
209
+ public function required_fields( $fields ) {
210
+ if ( ! isset( $fields['msg'] ) || ( isset( $fields['msg'] ) && empty( $fields['msg'] ) ) ) {
211
+ return true;
212
+ }
213
+
214
+ if ( ! isset( $fields['title'] ) || ( isset( $fields['title'] ) && empty( $fields['title'] ) ) ) {
215
+ return true;
216
+ }
217
+
218
+ return false;
219
+ }
220
+
221
+ // Special parameters function that is to be used in any extension of this class
222
+ public function special_parameters( $admin_notices ) {
223
+ // Intentionally left blank
224
+ }
225
+
226
+ }
227
+
includes/notices.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: lusinda
5
+ * Date: 8/27/15
6
+ * Time: 7:05 PM
7
+ */
8
+ if ( ! defined( 'ABSPATH' ) ) exit;
9
+
10
+
11
+
12
+ function ecwd_admin_notices( $notices ) {
13
+
14
+ $two_week_review_ignore = add_query_arg( array( 'ecwd_admin_notice_ignore' => 'two_week_review' ) );
15
+ $two_week_review_temp = add_query_arg( array( 'ecwd_admin_notice_temp_ignore' => 'two_week_review', 'int' => 14 ) );
16
+ $notices['two_week_review'] = array(
17
+ 'title' => __( 'Leave A Review?', 'ecwd' ),
18
+ 'msg' => __( 'We hope you\'ve enjoyed using Event Calendar WD! Would you consider leaving us a review on WordPress.org?', 'ecwd' ),
19
+ 'link' => '<li><span class="dashicons dashicons-external"></span><a href="http://wordpress.org/support/view/plugin-reviews/event-calendar-wd?filter=5" target="_blank">' . __( 'Sure! I\'d love to!', 'ecwd' ) . '</a></li>
20
+ <li> <span class="dashicons dashicons-smiley"></span><a href="' . $two_week_review_ignore . '"> ' . __( 'I\'ve already left a review', 'ecwd' ) . '</a></li>
21
+ <li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $two_week_review_temp . '">' . __( 'Maybe Later' ,'ecwd' ) . '</a></li>
22
+ <li><span class="dashicons dashicons-dismiss"></span><a href="' . $two_week_review_ignore . '">' . __( 'Never show again' ,'ecwd' ) . '</a></li>',
23
+
24
+ 'int' => 14
25
+ );
26
+
27
+
28
+ return $notices;
29
+ }
30
+
31
+ add_filter( 'ecwd_admin_notices', 'ecwd_admin_notices' );
32
+
js/scripts.js CHANGED
@@ -4,15 +4,19 @@
4
  * Public JS functions
5
  */
6
 
7
-
 
 
 
8
  (function ($){
9
-
 
10
  if(jQuery('#ecwd-calendar-main-css').length == 0){
11
  jQuery("<link/>", {
12
  id: 'ecwd-calendar-main-css',
13
  rel: "stylesheet",
14
  type: "text/css",
15
- href: ecwd_plugin_url+'/css/calendar.css?ver=1'
16
  }).appendTo("head");
17
  }
18
  var cwidth = jQuery(".calendar_main .ecwd_calendar").width();
@@ -35,14 +39,12 @@
35
  doMasonry();
36
  }, 1);
37
 
38
- if (jQuery('.ecwd_map_div').length > 0) {
39
- showMap();
40
- }
41
  jQuery('.ecwd_reset_filters').click(function () {
42
  jQuery(this).closest('.ecwd_filters').find('input:checkbox').attr('checked', false);
43
  });
44
 
45
- jQuery('body').on('click', '.ecwd_calendar_prev_next .next, .ecwd_calendar_prev_next .previous, .ecwd_calendar .type, .cpage, .current-month a, .ecwd_filter, .ecwd_reset_filters', function (e) {
46
  var days = jQuery('input[name="ecwd_weekdays[]"]:checked').map(function () {
47
  return this.value;
48
  }).get();
@@ -107,26 +109,20 @@
107
  ecwd_nonce: ecwd.ajaxnonce
108
  }, function (data) {
109
  $(main_div).find('div.ecwd_calendar').replaceWith(data);
110
- showMiniCalendarEventOnHover();
111
- showFullCalendarEventOnHover();
112
- upcomingEventsSlider();
113
- showWidgetEventDesc();
114
- calendarFullResponsive();
115
- show_filters(main_div);
116
- showFilterSliderArrow();
117
- createSearchForm();
118
- if ($('.ecwd_map_div').length > 0) {
119
- showMap();
120
- }
121
- if ($('.ecwd-poster-board').length > 0) {
122
- doMasonry();
123
- }
124
-
125
  });
126
  e.stopPropagation();
127
  });
128
 
129
-
 
 
 
 
 
 
 
 
130
  function createSearchForm() {
131
  var scinpt = document.getElementById("ecwd-search-submit");
132
  if (scinpt !== null) {
@@ -194,22 +190,6 @@
194
  ecwd_nonce: ecwd.ajaxnonce
195
  }, function (data) {
196
  $(main_div).find('div.ecwd_calendar').replaceWith(data);
197
- showMiniCalendarEventOnHover();
198
- showFullCalendarEventOnHover();
199
- upcomingEventsSlider();
200
- showWidgetEventDesc();
201
- calendarFullResponsive();
202
- show_filters(main_div);
203
- showFilterSliderArrow();
204
- createSearchForm();
205
- if ($('.ecwd_map_div').length > 0) {
206
- showMap();
207
- }
208
- if ($('.ecwd-poster-board').length > 0) {
209
- doMasonry();
210
- }
211
-
212
-
213
  });
214
  jQuery('.ecwd-search-submit').blur();
215
  }
@@ -219,7 +199,7 @@
219
 
220
  var ulEvent, day;
221
  var ulEventFull, dayFull;
222
- jQuery('body').on('click', 'div.ecwd_calendar .has-events', function (e) {
223
  dayFull = jQuery(this).attr('data-date').split('-');
224
  dayFull = dayFull[2];
225
  ulEventFull = jQuery(this).find('ul.events');
@@ -281,20 +261,8 @@
281
  jQuery('.ecwd-show-map-span').click(function () {
282
  jQuery('.ecwd-show-map').show();
283
  });
284
-
285
-
286
- jQuery(window).resize(function () {
287
- jQuery(".ecwd-poster-board").masonry("reload");
288
- view_click = 0;
289
- cwidth = jQuery(".ecwd_calendar").width();
290
- jQuery('.ecwd_calendar').find('.ecwd-events-day-details').html('');
291
- upcomingEventsSlider();
292
- calendarFullResponsive();
293
- show_filters();
294
- showFilterSliderArrow();
295
-
296
- });
297
-
298
  function doMasonry() {
299
  var $container = jQuery('.ecwd-poster-board');
300
  if($container.length && jQuery('.ecwd-poster-board').find('.ecwd-poster-item').length>0) {
@@ -631,7 +599,13 @@
631
 
632
  }
633
 
634
- function showMap() {
 
 
 
 
 
 
635
  var maps = [];
636
  jQuery(".ecwd_map_div").each(function (k, v) {
637
  maps[k] = this;
@@ -694,7 +668,19 @@
694
  });
695
 
696
  });
697
-
698
  }
699
-
700
- }(jQuery));
 
 
 
 
 
 
 
 
 
 
 
 
4
  * Public JS functions
5
  */
6
 
7
+ if(typeof ecwd_js_init_call !="object")
8
+ var ecwd_js_init_call;
9
+ if(typeof ecwd_js_init !="function")
10
+ var ecwd_js_init;
11
  (function ($){
12
+ ecwd_js_init = function () {
13
+ ecwd_eventsOff();
14
  if(jQuery('#ecwd-calendar-main-css').length == 0){
15
  jQuery("<link/>", {
16
  id: 'ecwd-calendar-main-css',
17
  rel: "stylesheet",
18
  type: "text/css",
19
+ href: ecwd.plugin_url+'/css/calendar.css?ver=1'
20
  }).appendTo("head");
21
  }
22
  var cwidth = jQuery(".calendar_main .ecwd_calendar").width();
39
  doMasonry();
40
  }, 1);
41
 
42
+
 
 
43
  jQuery('.ecwd_reset_filters').click(function () {
44
  jQuery(this).closest('.ecwd_filters').find('input:checkbox').attr('checked', false);
45
  });
46
 
47
+ jQuery('.ecwd_calendar_prev_next .next, .ecwd_calendar_prev_next .previous, .ecwd_calendar .type, .cpage, .current-month a, .ecwd_filter, .ecwd_reset_filters').on('click', function (e) {
48
  var days = jQuery('input[name="ecwd_weekdays[]"]:checked').map(function () {
49
  return this.value;
50
  }).get();
109
  ecwd_nonce: ecwd.ajaxnonce
110
  }, function (data) {
111
  $(main_div).find('div.ecwd_calendar').replaceWith(data);
112
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  });
114
  e.stopPropagation();
115
  });
116
 
117
+ jQuery('.ecwd_calendar .more_events_link').on('click',function(){
118
+ jQuery('.ecwd_calendar #'+jQuery(this).attr('div-id')).show().css({'opacity':'1','pointer-events': 'auto'});
119
+ return false;
120
+ });
121
+ jQuery('.ecwd_calendar .ecwd-more-events-close .fa').on('click',function(){
122
+ jQuery(this).closest('.ecwd-modal').hide().css({'opacity':'0','pointer-events': 'none'});
123
+ return false;
124
+ });
125
+
126
  function createSearchForm() {
127
  var scinpt = document.getElementById("ecwd-search-submit");
128
  if (scinpt !== null) {
190
  ecwd_nonce: ecwd.ajaxnonce
191
  }, function (data) {
192
  $(main_div).find('div.ecwd_calendar').replaceWith(data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  });
194
  jQuery('.ecwd-search-submit').blur();
195
  }
199
 
200
  var ulEvent, day;
201
  var ulEventFull, dayFull;
202
+ jQuery('div.ecwd_calendar .has-events').on('click', function (e) {
203
  dayFull = jQuery(this).attr('data-date').split('-');
204
  dayFull = dayFull[2];
205
  ulEventFull = jQuery(this).find('ul.events');
261
  jQuery('.ecwd-show-map-span').click(function () {
262
  jQuery('.ecwd-show-map').show();
263
  });
264
+
265
+
 
 
 
 
 
 
 
 
 
 
 
 
266
  function doMasonry() {
267
  var $container = jQuery('.ecwd-poster-board');
268
  if($container.length && jQuery('.ecwd-poster-board').find('.ecwd-poster-item').length>0) {
599
 
600
  }
601
 
602
+ this.showMap = function () {
603
+ if (typeof google == 'undefined' || typeof google.maps == "undefined") {
604
+ var script = document.createElement('script');
605
+ script.type = 'text/javascript';
606
+ script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&callback=ecwd_js_init_call.showMap';
607
+ document.body.appendChild(script);
608
+ }else{
609
  var maps = [];
610
  jQuery(".ecwd_map_div").each(function (k, v) {
611
  maps[k] = this;
668
  });
669
 
670
  });
671
+ }
672
  }
673
+ if (jQuery('.ecwd_map_div').length > 0) {
674
+ this.showMap();
675
+ }
676
+ }
677
+ ecwd_js_init_call = new ecwd_js_init();
678
+ }(jQuery));
679
+ function ecwd_eventsOff(){
680
+ jQuery(".calendar_main").find("*").off();
681
+ jQuery(".calendar_main").children().off();
682
+ }
683
+
684
+ jQuery(window).resize(function () {
685
+ ecwd_js_init_call = new ecwd_js_init();
686
+ });
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-event-calendar-wd.html
4
  Tags: calendar, calendars, event, event calendar, event manager, events calendar, calendar widget, event registration, event management,events, agenda, holiday calendar , scheduling, free calendar, Calender, upcoming events , event widget , event list, calendar localization, Organizer, editorial calendar, Interactive Calendar, news calendar, meeting , appointment, event tracking, event organizer, upcoming events widget, event page, event bookings, recurring, recurring events, conference, date, dates, schedule, times, venue, AJAX, responsive, shortcode, seminar, summit
5
  Requires at least: 3.9
6
  Tested up to: 4.3
7
- Stable tag: 1.0.21
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -130,14 +130,20 @@ After downloading the ZIP file of the Event Calendar WD plugin,
130
 
131
  == Changelog ==
132
 
 
 
 
 
 
 
133
  = 1.0.21 =
134
- Fixed: JS error in widgets page
135
 
136
  = 1.0.20 =
137
- Fixed: Show event url issue
138
- Added: "noindex, nofollow" to calendar links
139
- Added: Open pop in new tab option
140
- Added: Japanese support
141
 
142
  = 1.0.19 =
143
  Minor bug fixed
@@ -157,7 +163,7 @@ Added: Show the repeat rate in event page option
157
  Added: Show AM/PM option
158
 
159
  = 1.0.14 =
160
- Fixed: Conflict with Avada theme
161
  Added: Date to events link
162
 
163
  = 1.0.13 =
@@ -167,21 +173,21 @@ Changed: Calendar Add-ons page
167
  Changed: Calendar Add-ons page
168
 
169
  = 1.0.10 =
170
- Added: Organizers and venues archive page order option
171
- Added: Show categories and tags in event page option
172
  Fixed: Featured image sizes in widget
173
 
174
  = 1.0.9 =
175
- Fixed: Show google maps conflict with other plugins
176
- Fixed: Geolocation bug
177
  Fixed: Save organizer featured image issue
178
 
179
  = 1.0.8 =
180
- Changed: Event page
181
- Added: Portuguese language
182
 
183
  = 1.0.7 =
184
- New: Related events slider
185
  New: Enable/disable rewrite rule option
186
 
187
  = 1.0.6 =
@@ -189,7 +195,7 @@ Changed: Removed Add Venue link
189
  Fixed: Delete event from calendar page issue
190
 
191
  = 1.0.5 =
192
- New: Events Filters in backend
193
  Fixed: Bug in shortcode
194
 
195
  = 1.0.4 =
4
  Tags: calendar, calendars, event, event calendar, event manager, events calendar, calendar widget, event registration, event management,events, agenda, holiday calendar , scheduling, free calendar, Calender, upcoming events , event widget , event list, calendar localization, Organizer, editorial calendar, Interactive Calendar, news calendar, meeting , appointment, event tracking, event organizer, upcoming events widget, event page, event bookings, recurring, recurring events, conference, date, dates, schedule, times, venue, AJAX, responsive, shortcode, seminar, summit
5
  Requires at least: 3.9
6
  Tested up to: 4.3
7
+ Stable tag: 1.0.22
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
130
 
131
  == Changelog ==
132
 
133
+ = 1.0.22 =
134
+ Added: Ajaxed themes support
135
+ Fixed: Next month link issue
136
+ Changed: More events dialog
137
+ Added: Support/rate us messages
138
+
139
  = 1.0.21 =
140
+ Fixed: JS error in widgets page
141
 
142
  = 1.0.20 =
143
+ Fixed: Show event url issue
144
+ Added: "noindex, nofollow" to calendar links
145
+ Added: Open pop in new tab option
146
+ Added: Japanese support
147
 
148
  = 1.0.19 =
149
  Minor bug fixed
163
  Added: Show AM/PM option
164
 
165
  = 1.0.14 =
166
+ Fixed: Conflict with Avada theme
167
  Added: Date to events link
168
 
169
  = 1.0.13 =
173
  Changed: Calendar Add-ons page
174
 
175
  = 1.0.10 =
176
+ Added: Organizers and venues archive page order option
177
+ Added: Show categories and tags in event page option
178
  Fixed: Featured image sizes in widget
179
 
180
  = 1.0.9 =
181
+ Fixed: Show google maps conflict with other plugins
182
+ Fixed: Geolocation bug
183
  Fixed: Save organizer featured image issue
184
 
185
  = 1.0.8 =
186
+ Changed: Event page
187
+ Added: Portuguese language
188
 
189
  = 1.0.7 =
190
+ New: Related events slider
191
  New: Enable/disable rewrite rule option
192
 
193
  = 1.0.6 =
195
  Fixed: Delete event from calendar page issue
196
 
197
  = 1.0.5 =
198
+ New: Events Filters in backend
199
  Fixed: Bug in shortcode
200
 
201
  = 1.0.4 =
views/ecwd-venue-content.php CHANGED
@@ -199,3 +199,4 @@ echo $content;
199
  <?php } ?>
200
 
201
  </div>
 
199
  <?php } ?>
200
 
201
  </div>
202
+ <script id="ecwd_script_handler" type="text/javascript">if(typeof ecwd_js_init_call=="object"){ecwd_js_init_call = new ecwd_js_init();}</script>
views/single-event.php CHANGED
@@ -551,5 +551,5 @@ get_header();
551
  <?php endwhile; ?>
552
 
553
  </div>
554
-
555
  <?php get_footer(); ?>
551
  <?php endwhile; ?>
552
 
553
  </div>
554
+ <script id="ecwd_script_handler" type="text/javascript">if(typeof ecwd_js_init_call=="object"){ecwd_js_init_call = new ecwd_js_init();}</script>
555
  <?php get_footer(); ?>