Calendar by WD – Responsive Event Calendar - Version 1.5.61

Version Description

Fixed: Faster loading of pages. Synchronous requests in calendar frontend are removed
Changed: PHP 7.2 compatibility, create_function is not used anymore

Download this release

Release Info

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

Code changes from version 1.5.60 to 1.5.61

calendar.php CHANGED
@@ -3,74 +3,71 @@
3
  Plugin Name: Spider Event Calendar
4
  Plugin URI: https://web-dorado.com/products/wordpress-calendar.html
5
  Description: Spider Event Calendar is a highly configurable product which allows you to have multiple organized events. Spider Event Calendar is an extraordinary user friendly extension.
6
- Version: 1.5.60
7
  Author: WebDorado
8
  Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
11
- $wd_spider_calendar_version="1.5.60";
12
  // LANGUAGE localization.
13
- function sp_calendar_language_load() {
14
- load_plugin_textdomain('sp_calendar', FALSE, basename(dirname(__FILE__)) . '/languages');
15
  }
16
- add_action('init', 'sp_calendar_language_load');
17
 
 
18
  add_action('init', 'sp_cal_registr_some_scripts');
19
-
20
- function sp_cal_registr_some_scripts(){
21
  global $wd_spider_calendar_version;
22
  wp_register_script("Canlendar_upcoming", plugins_url("elements/calendar.js", __FILE__), array(), $wd_spider_calendar_version);
23
  wp_register_script("calendnar-setup_upcoming", plugins_url("elements/calendar-setup.js", __FILE__), array(), $wd_spider_calendar_version);
24
  wp_register_script("calenndar_function_upcoming", plugins_url("elements/calendar_function.js", __FILE__), array(), $wd_spider_calendar_version);
25
-
26
- if( isset($_GET['page']) && $_GET['page'] == "Uninstall_sp_calendar" ) {
27
- wp_enqueue_script("sp_calendar-deactivate-popup", plugins_url('wd/assets/js/deactivate_popup.js', __FILE__), array(), $wd_spider_calendar_version);
28
- $admin_data = wp_get_current_user();
29
-
30
- wp_localize_script( 'sp_calendar-deactivate-popup', 'sp_calendarWDDeactivateVars', array(
31
- "prefix" => "sp_calendar" ,
32
- "deactivate_class" => 'sp_calendar_deactivate_link',
33
- "email" => $admin_data->data->user_email,
34
- "plugin_wd_url" => "https://web-dorado.com/products/wordpress-calendar.html",
35
- ));
36
- }
37
-
38
  }
39
 
40
  // Include widget.
41
  require_once("widget_spider_calendar.php");
42
  require_once("spidercalendar_upcoming_events_widget.php");
43
- function current_page_url_sc() {
44
  if (is_home()) {
45
  $pageURL = site_url();
46
- }
47
- else {
48
  $pageURL = get_permalink();
49
  }
 
50
  return $pageURL;
51
  }
52
 
53
- function resolv_js_prob() {
54
  ?>
55
  <script>
56
  var xx_cal_xx = '&';
57
  </script>
58
  <?php
59
  }
60
- add_action('wp_head', 'resolv_js_prob');
61
 
62
- function spider_calendar_scripts() {
 
63
  wp_enqueue_script('jquery');
64
  wp_enqueue_script('thickbox', NULL, array('jquery'));
65
  wp_enqueue_style('thickbox.css', '/' . WPINC . '/js/thickbox/thickbox.css', NULL, '1.0');
66
  wp_enqueue_style('thickbox');
67
  }
68
- add_action('wp_enqueue_scripts', 'spider_calendar_scripts');
69
 
 
70
  $many_sp_calendar = 1;
71
- function spider_calendar_big($atts) {
72
  if (!isset($atts['default'])) {
73
- $atts['theme'] = 30;
74
  $atts['default'] = 'month';
75
  }
76
  extract(shortcode_atts(array(
@@ -82,141 +79,127 @@ function spider_calendar_big($atts) {
82
  if (!isset($atts['select'])) {
83
  $atts['select'] = 'month,list,day,week,';
84
  }
 
85
  return spider_calendar_big_front_end($id, $theme, $default, $select);
86
  }
87
- add_shortcode('Spider_Calendar', 'spider_calendar_big');
88
 
89
- function spider_calendar_big_front_end($id, $theme, $default, $select, $widget = 0) {
90
- require_once("front_end/frontend_functions.php");
 
91
  ob_start();
92
  global $many_sp_calendar;
93
  global $wpdb;
94
-
95
  if ($widget === 1) {
96
- $themes = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme));
97
- }
98
- else{
99
- $themes = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme));
100
- }
101
  $cal_width = $themes->width; ?>
102
- <input type="hidden" id="cal_width<?php echo $many_sp_calendar ?>" value="<?php echo $cal_width ?>" />
103
  <div id='bigcalendar<?php echo $many_sp_calendar ?>' class="wdc_calendar"></div>
104
- <script>
105
  var tb_pathToImage = "<?php echo plugins_url('images/loadingAnimation.gif', __FILE__) ?>";
106
  var tb_closeImage = "<?php echo plugins_url('images/tb-close.png', __FILE__) ?>"
107
- var randi;
108
- if (typeof showbigcalendar != 'function') {
109
  function showbigcalendar(id, calendarlink, randi, widget) {
110
- var xmlHttp;
111
- try {
112
- xmlHttp = new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
113
- }
114
- catch (e) {
115
- try {
116
- xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
117
- }
118
- catch (e) {
119
- try {
120
- xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
121
- }
122
- catch (e) {
123
- alert("No AJAX!?");
124
- return false;
125
- }
126
- }
127
- }
128
- xmlHttp.onreadystatechange = function () {
129
- if (xmlHttp.readyState == 4) {
130
- // document.getElementById(id).innerHTML = xmlHttp.responseText;
131
- jQuery('#' + id).html(xmlHttp.responseText);
132
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  }
134
- xmlHttp.open("GET", calendarlink, false);
135
- xmlHttp.send();
136
- jQuery(document).ready(function (){
137
- jQuery('#views_select').toggle(function () {
138
- jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
139
- jQuery('#views_select .arrow-down').addClass("show_arrow");
140
- jQuery('#views_select .arrow-right').removeClass("show_arrow");
141
- }, function () {
142
- jQuery('#drop_down_views').stop(true, true).slideUp(500);
143
- jQuery('#views_select .arrow-down').removeClass("show_arrow");
144
- jQuery('#views_select .arrow-right').addClass("show_arrow");
145
- });
146
- });
147
- if(widget!=1)
148
- {
149
- jQuery('drop_down_views').hide();
150
- var parent_width = document.getElementById('bigcalendar'+randi).parentNode.clientWidth;
151
- var calwidth= document.getElementById('cal_width'+randi).value;
152
- var responsive_width = (calwidth)/parent_width*100;
153
- document.getElementById('bigcalendar'+randi).setAttribute('style','width:'+responsive_width+'%;');
154
- jQuery('pop_table').css('height','100%');
155
- }
156
  var thickDims, tbWidth, tbHeight;
157
- jQuery(document).ready(function ($) {
158
- if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) { jQuery('body').addClass('ios_device'); }
159
- setInterval(function(){
160
- if(jQuery("body").hasClass("modal-open")) jQuery("html").addClass("thickbox_open");
161
- else jQuery("html").removeClass("thickbox_open");
162
- },500);
163
- thickDims = function () {
164
- var tbWindow = jQuery('#TB_window'), H = jQuery(window).height(), W = jQuery(window).width(), w, h;
 
 
165
  if (tbWidth) {
166
- if (tbWidth < (W - 90)) w = tbWidth; else w = W - 200;
167
  } else w = W - 200;
168
  if (tbHeight) {
169
- if (tbHeight < (H - 90)) h = tbHeight; else h = H - 200;
170
- } else h = H - 200;
171
  if (tbWindow.size()) {
172
  tbWindow.width(w).height(h);
173
  jQuery('#TB_iframeContent').width(w).height(h - 27);
174
- tbWindow.css({'margin-left':'-' + parseInt((w / 2), 10) + 'px'});
175
  if (typeof document.body.style.maxWidth != 'undefined')
176
- tbWindow.css({'top':(H - h) / 2, 'margin-top':'0'});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  }
178
- if(jQuery(window).width() < 768 ){
179
- var tb_left = parseInt((w / 2), 10) + 20;
180
- jQuery('#TB_window').css({"left": tb_left+ "px", "width": "90%", "margin-top": "-13%","height": "100%"})
181
- jQuery('#TB_window iframe').css({'height':'100%', 'width':'100%'});
182
- }
183
- else jQuery('#TB_window').css('left','50%');
184
- if (typeof popup_width_from_src != "undefined") {
185
- popup_width_from_src=jQuery('.thickbox-previewbigcalendar'+randi).attr('href').indexOf('tbWidth=');
186
- str=jQuery('.thickbox-previewbigcalendar'+randi).attr('href').substr(popup_width_from_src+8,150)
187
- find_amp=str.indexOf('&');
188
- width_orig=str.substr(0,find_amp);
189
- find_eq=str.indexOf('=');
190
- height_orig=str.substr(find_eq+1,5);
191
- jQuery('#TB_window').css({'max-width':width_orig+'px', 'max-height':height_orig+'px'});
192
- jQuery('#TB_window iframe').css('max-width',width_orig+'px');
193
- }
194
  };
195
  thickDims();
196
  jQuery(window).resize(function () {
197
- thickDims();
198
- });
199
  jQuery('a.thickbox-preview' + id).click(function () {
200
  tb_click.call(this);
201
- var alink = jQuery(this).parents('.available-theme').find('.activatelink'), link = '', href = jQuery(this).attr('href'), url, text;
202
- var reg_with = new RegExp(xx_cal_xx + "tbWidth=[0-9]+");
 
203
  if (tbWidth = href.match(reg_with))
204
  tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
205
  else
206
- tbWidth = jQuery(window).width() - 90;
207
  var reg_heght = new RegExp(xx_cal_xx + "tbHeight=[0-9]+");
208
  if (tbHeight = href.match(reg_heght))
209
  tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
210
  else
211
  tbHeight = jQuery(window).height() - 60;
212
- jQuery('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
213
- thickDims();
214
- return false;
215
  });
216
-
217
  });
218
  }
219
- }
220
  document.onkeydown = function (evt) {
221
  evt = evt || window.event;
222
  if (evt.keyCode == 27) {
@@ -226,21 +209,20 @@ if(widget!=1)
226
  <?php global $wpdb;
227
  $calendarr = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id='%d'", $id));
228
  $year = ($calendarr->def_year ? $calendarr->def_year : date("Y"));
229
- $month = ($calendarr->def_month ? $calendarr->def_month : date("m"));
230
-
231
  $date = $year . '-' . $month;
232
  if ($default == 'day') {
233
  $date .= '-' . date('d');
234
  }
235
  if ($default == 'week') {
236
- $date .= '-' . date('d');
237
- $d = new DateTime($date);
238
  $weekday = $d->format('w');
239
- $diff = ($weekday == 0 ? 6 : $weekday - 1);
240
  if ($widget === 1) {
241
  $theme_row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_widget_theme WHERE id='%d'", $theme));
242
- }
243
- else {
244
  $theme_row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_theme WHERE id='%d'", $theme));
245
  }
246
  $weekstart = $theme_row->week_start_day;
@@ -249,10 +231,10 @@ if(widget!=1)
249
  }
250
  $d->modify("-$diff day");
251
  $d->modify("-1 day");
252
- $prev_date = $d->format('Y-m-d');
253
- $prev_month = add_0((int) substr($prev_date, 5, 2) - 1);
254
- $this_month = add_0((int) substr($prev_date, 5, 2));
255
- $next_month = add_0((int) substr($prev_date, 5, 2) + 1);
256
  if ($next_month == '13') {
257
  $next_month = '01';
258
  }
@@ -262,8 +244,7 @@ if(widget!=1)
262
  }
263
  if ($widget === 1) {
264
  $default .= '_widget';
265
- }
266
- else {
267
  }
268
  ?> showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
269
  'action' => 'spiderbigcalendar_' . $default,
@@ -274,51 +255,53 @@ if(widget!=1)
274
  'months' => (($default == 'week' || $default == 'week_widget') ? $prev_month . ',' . $this_month . ',' . $next_month : ''),
275
  'many_sp_calendar' => $many_sp_calendar,
276
  'widget' => $widget,
277
- 'rand' => $many_sp_calendar,
278
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>');</script>
279
- <style>
280
- #TB_window iframe{
281
- background: <?php echo '#'.str_replace('#','',$themes->show_event_bgcolor); ?>;
282
- }
283
- </style>
284
  <?php
285
  $many_sp_calendar++;
286
  $calendar = ob_get_contents();
287
  ob_end_clean();
 
288
  return $calendar;
289
  }
290
 
291
- function convert_time($calendar_format, $old_time){
292
- if($calendar_format==0){
293
- if (strpos($old_time, 'AM') !== false || strpos($old_time, 'PM') !== false) {
294
- $row_time_12 = explode('-',$old_time);
295
- $row_time_24 = "";
296
- for($i=0; $i<count($row_time_12); $i++){
297
- $row_time_24 .= date("H:i", strtotime($row_time_12[$i])). "-";
298
- }
299
- if(substr($row_time_24, -1)=="-") $row_time = rtrim($row_time_24,'-');
300
- }
301
- else $row_time = $old_time;
302
- }
303
- else{
304
- if (strpos($old_time, 'AM') !== false || strpos($old_time, 'PM') !== false) $row_time = $old_time;
305
- else{
306
- $row_time_12 = "";
307
- $row_time_24 = explode('-',$old_time);
308
- for($i=0; $i<count($row_time_24); $i++){
309
- $row_time_12 .= date("g:iA", strtotime($row_time_24[$i])). "-";
310
- }
311
- if(substr($row_time_12, -1)=="-") $row_time = rtrim($row_time_12,'-');
312
- }
313
- }
314
- return $row_time;
 
315
  }
316
 
317
  // Quick edit.
318
  add_action('wp_ajax_spidercalendarinlineedit', 'spider_calendar_quick_edit');
319
  add_action('wp_ajax_spidercalendarinlineupdate', 'spider_calendar_quick_update');
320
  add_action('wp_ajax_upcoming', 'upcoming_widget');
321
- function spider_calendar_quick_update() {
322
  $current_user = wp_get_current_user();
323
  if ($current_user->roles[0] !== 'administrator') {
324
  echo 'You have no permission.';
@@ -327,57 +310,56 @@ function spider_calendar_quick_update() {
327
  global $wpdb;
328
  if (isset($_POST['calendar_id']) && isset($_POST['calendar_title']) && isset($_POST['us_12_format_sp_calendar']) && isset($_POST['default_year']) && isset($_POST['default_month'])) {
329
  $wpdb->update($wpdb->prefix . 'spidercalendar_calendar', array(
330
- 'title' => esc_sql(esc_html(stripslashes($_POST['calendar_title']))),
331
- 'time_format' => esc_sql(esc_html(stripslashes($_POST['us_12_format_sp_calendar']))),
332
- 'def_year' => esc_sql(esc_html(stripslashes($_POST['default_year']))),
333
- 'def_month' => esc_sql(esc_html(stripslashes($_POST['default_month']))),
334
- ), array('id' => esc_sql(esc_html(stripslashes($_POST['calendar_id'])))), array(
335
- '%s',
336
- '%d',
337
- '%s',
338
- '%s',
339
- ), array('%d'));
340
- $row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id='%d'", (int) $_POST['calendar_id']));
341
- $calendar_format = esc_sql(esc_html(stripslashes($_POST['us_12_format_sp_calendar'])));
342
-
343
- $events_list = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar='%d'", (int) $_POST['calendar_id']));
344
-
345
- for($i = 0; $i < count($events_list); $i++){
346
- if($events_list[$i]->time!=''){
347
- $wpdb->update($wpdb->prefix . 'spidercalendar_event', array(
348
- 'time' => convert_time($calendar_format, $events_list[$i]->time)
349
- ), array('id' => $events_list[$i]->id), array(
350
- '%s'
351
- ));
352
- }
353
- }
354
- ?>
355
- <td><?php echo $row->id; ?></td>
356
- <td class="post-title page-title column-title">
357
- <a title="Manage Events" class="row-title" href="admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=<?php echo $row->id; ?>"><?php echo $row->title; ?></a>
358
- <div class="row-actions">
359
  <span class="inline hide-if-no-js">
360
  <a href="#" class="editinline" onclick="show_calendar_inline(<?php echo $row->id; ?>)" title="Edit This Calendar Inline">Quick&nbsp;Edit</a> | </span>
361
- <span class="trash">
362
  <a class="submitdelete" title="Delete This Calendar" href="javascript:confirmation('admin.php?page=SpiderCalendar&task=remove_calendar&id=<?php echo $row->id; ?>','<?php echo $row->title; ?>')">Delete</a></span>
363
- </div>
364
- </td>
365
- <td><a href="admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=<?php echo $row->id; ?>">Manage events</a></td>
366
- <td><a href="admin.php?page=SpiderCalendar&task=edit_calendar&id=<?php echo $row->id; ?>" title="Edit This Calendar">Edit</a></td>
367
- <td><a <?php if (!$row->published)
368
- echo 'style="color:#C00"'; ?>
369
- href="admin.php?page=SpiderCalendar&task=published&id=<?php echo $row->id; ?>"><?php if ($row->published)
370
- echo "Yes";
371
- else echo "No"; ?></a></td>
372
- <?php
 
 
373
  die();
374
- }
375
- else {
376
  die();
377
  }
378
  }
379
 
380
- function spider_calendar_quick_edit() {
381
  $current_user = wp_get_current_user();
382
  if ($current_user->roles[0] !== 'administrator') {
383
  echo 'You have no permission.';
@@ -385,22 +367,22 @@ function spider_calendar_quick_edit() {
385
  }
386
  global $wpdb;
387
  if (isset($_POST['calendar_id'])) {
388
- $row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id='%d'", (int) $_POST['calendar_id']));
389
  ?>
390
- <td colspan="4" class="colspanchange">
391
- <fieldset class="inline-edit-col-left">
392
- <div style="float:left; width:100% " class="inline-edit-col">
393
- <h4>Quick Edit</h4>
394
- <label for="calendar_title"><span style="width:160px !important" class="title">Title: </span></label>
395
- <span class="input-text-wrap">
396
  <input type="text" style="width:150px !important" id="calendar_title" name="calendar_title" value="<?php echo $row->title; ?>" class="ptitle" value=""/>
397
  </span>
398
- <label for="def_year"><span class="title alignleft" style="width:160px !important">Default Year: </span></label>
399
- <span>
400
  <input type="text" name="def_year" id="def_year" style="width:150px;" value="<?php echo $row->def_year ?>"/>
401
  </span>
402
- <label for="def_month"><span class="title alignleft" style="width:160px !important">Default Month: </span></label>
403
- <span>
404
  <select id="def_month" name="def_month" style="width:150px;">
405
  <?php
406
  $month_array = array(
@@ -420,35 +402,36 @@ function spider_calendar_quick_edit() {
420
  );
421
  foreach ($month_array as $key => $def_month) {
422
  ?>
423
- <option <?php echo (($row->def_month == $key) ? 'selected="selected"' : '');?> value="<?php echo $key;?>"><?php echo $def_month;?></option>
424
  <?php
425
  }
426
  ?>
427
  </select>
428
  </span>
429
- <label for="time_format0"><span class="title alignleft" style="width:160px !important">Use 12 hours time format: </span></label>
430
- <span>
431
- <input style="margin-top:5px" type="radio" class="alignleft" name="time_format" id="time_format0" value="0" <?php if ($row->time_format == 0) echo 'checked="checked"'; ?> />
 
432
  <em style="margin:4px 5px 0 0" class="alignleft"> No </em>
433
- <input style="margin-top:5px" class="alignleft" type="radio" name="time_format" id="time_format1" value="1" <?php if ($row->time_format == 1) echo 'checked="checked"'; ?> />
 
434
  <em style="margin:4px 5px 0 0" class="alignleft"> Yes </em>
435
  </span>
436
- </div>
437
- </fieldset>
438
- <p class="submit inline-edit-save">
439
- <a accesskey="c" href="#" title="Cancel" onclick="cancel_qiucik_edit(<?php echo $row->id; ?>)" class="button-secondary cancel alignleft">Cancel</a>
440
- <input type="hidden" id="_inline_edit" name="_inline_edit" value="d8393e8662">
441
- <a accesskey="s" href="#" title="Update" onclick="updae_inline_sp_calendar(<?php echo "'" . $row->id . "'" ?>)" class="button-primary save alignright">Update</a>
442
- <input type="hidden" name="post_view" value="list">
443
- <input type="hidden" name="screen" value="edit-page">
444
- <span class="error" style="display:none"></span>
445
- <br class="clear">
446
- </p>
447
- </td>
448
- <?php
449
  die();
450
- }
451
- else {
452
  die();
453
  }
454
  }
@@ -456,39 +439,40 @@ function spider_calendar_quick_edit() {
456
  // Add editor new mce button.
457
  add_filter('mce_external_plugins', "sp_calendar_register");
458
  add_filter('mce_buttons', 'sp_calendar_add_button', 0);
459
-
460
  // Function for add new button.
461
- function sp_calendar_add_button($buttons) {
462
  array_push($buttons, "sp_calendar_mce");
 
463
  return $buttons;
464
  }
465
 
466
  // Function for registr new button.
467
- function sp_calendar_register($plugin_array) {
468
- $url = plugins_url('js/editor_plugin.js', __FILE__);
469
  $plugin_array["sp_calendar_mce"] = $url;
 
470
  return $plugin_array;
471
  }
472
 
473
- function spider_calendar_ajax_func() {
474
  ?>
475
  <script>
476
  var spider_calendar_ajax = '<?php echo admin_url("admin-ajax.php"); ?>';
477
  </script>
478
  <?php
479
  }
480
- add_action('admin_head', 'spider_calendar_ajax_func');
481
 
 
482
  // Function create in menu.
483
- function sp_calendar_options_panel() {
484
- if( get_option( "sp_calendar_subscribe_done" ) == 1 ){
485
- add_menu_page('Theme page title', 'Calendar', 'manage_options', 'SpiderCalendar', 'Manage_Spider_Calendar', plugins_url("images/calendar_menu.png", __FILE__));
486
  }
487
- $page_calendar = add_submenu_page('SpiderCalendar', 'Calendars', 'Calendars', 'manage_options', 'SpiderCalendar', 'Manage_Spider_Calendar');
488
  $page_event_category = add_submenu_page('SpiderCalendar', 'Event Category', 'Event Category', 'manage_options', 'spider_calendar_event_category', 'Manage_Spider_Category_Calendar');
489
- $page_theme = add_submenu_page('SpiderCalendar', 'Calendar Parameters', 'Calendar Themes', 'manage_options', 'spider_calendar_themes', 'spider_calendar_params');
490
- $page_widget_theme = add_submenu_page('SpiderCalendar', 'Calendar Parameters', 'Widget Themes', 'manage_options', 'spider_widget_calendar_themes', 'spider_widget_calendar_params');
491
- add_submenu_page('SpiderCalendar', 'Export', 'Export', 'manage_options', 'calendar_export', 'calendar_export');
492
  add_submenu_page('SpiderCalendar', 'Get Pro', 'Get Pro', 'manage_options', 'Spider_calendar_Licensing', 'Spider_calendar_Licensing');
493
  $page_uninstall = add_submenu_page('SpiderCalendar', 'Uninstall Spider Event Calendar', 'Uninstall Spider Event Calendar', 'manage_options', 'Uninstall_sp_calendar', 'Uninstall_sp_calendar'); // uninstall Calendar
494
  add_action('admin_print_styles-' . $page_theme, 'spider_calendar_themes_admin_styles_scripts');
@@ -500,38 +484,42 @@ function sp_calendar_options_panel() {
500
 
501
  }
502
 
503
- function Spider_calendar_Licensing() {
504
- global $wpdb;
505
  ?>
506
  <div style="width:95%">
507
- <p>This plugin is the non-commercial version of the Spider Event Calendar. Use of the calendar is free.<br />
508
- The only limitation is the use of the themes. If you want to use one of the 11 standard themes or create a new one that
509
- satisfies the needs of your web site, you are required to purchase a license.<br />
510
- Purchasing a license will add 12 standard themes and give possibility to edit the themes of the Spider Event Calendar.
 
 
511
  </p>
512
- <br /><br />
513
- <a href="https://web-dorado.com/files/fromSpiderCalendarWP.php" class="button-primary" target="_blank">Purchase a License</a>
514
- <br /><br /><br />
 
515
  <p>After the purchasing the commercial version follow this steps:</p>
516
  <ol>
517
  <li>Deactivate Spider Event Calendar Plugin</li>
518
  <li>Delete Spider Event Calendar Plugin</li>
519
  <li>Install the downloaded commercial version of the plugin</li>
520
- </ol>
521
  </div>
522
  <?php
523
  }
524
- function spider_widget_styles_scripts(){
 
525
  wp_enqueue_script('wp-color-picker');
526
- wp_enqueue_style( 'wp-color-picker' );
527
  }
528
 
529
- function spider_calendar_themes_admin_styles_scripts() {
530
  global $wd_spider_calendar_version;
531
  wp_enqueue_script("jquery");
532
  wp_enqueue_script("standart_themes", plugins_url('elements/theme_reset.js', __FILE__), array(), $wd_spider_calendar_version);
533
- wp_enqueue_script('wp-color-picker');
534
- wp_enqueue_style( 'wp-color-picker' );
535
  if (isset($_GET['task'])) {
536
  if ($_GET['task'] == 'edit_theme' || $_GET['task'] == 'add_theme' || $_GET['task'] == 'Apply') {
537
  wp_enqueue_style("parsetheme_css", plugins_url('style_for_cal/style_for_tables_cal.css', __FILE__), array(), $wd_spider_calendar_version);
@@ -540,12 +528,12 @@ function spider_calendar_themes_admin_styles_scripts() {
540
 
541
  }
542
 
543
- function spider_widget_calendar_themes_admin_styles_scripts() {
544
  global $wd_spider_calendar_version;
545
  wp_enqueue_script("jquery");
546
  wp_enqueue_script("standart_themes", plugins_url('elements/theme_reset_widget.js', __FILE__), array(), $wd_spider_calendar_version);
547
- wp_enqueue_script('wp-color-picker');
548
- wp_enqueue_style( 'wp-color-picker' );
549
  if (isset($_GET['task'])) {
550
  if ($_GET['task'] == 'edit_theme' || $_GET['task'] == 'add_theme' || $_GET['task'] == 'Apply') {
551
  wp_enqueue_style("parsetheme_css", plugins_url('style_for_cal/style_for_tables_cal.css', __FILE__), array(), $wd_spider_calendar_version);
@@ -553,32 +541,31 @@ function spider_widget_calendar_themes_admin_styles_scripts() {
553
  }
554
  }
555
 
556
- function spider_calendar_admin_styles_scripts() {
557
  global $wd_spider_calendar_version;
558
- wp_enqueue_script("Calendar", plugins_url("elements/calendar.js", __FILE__), array(), $wd_spider_calendar_version, FALSE);
559
- wp_enqueue_script("calendar-setup", plugins_url("elements/calendar-setup.js", __FILE__), array(), $wd_spider_calendar_version, FALSE);
560
- wp_enqueue_script("calendar_function", plugins_url("elements/calendar_function.js", __FILE__), array(), $wd_spider_calendar_version, FALSE);
561
- wp_enqueue_style("spcalendar-jos", plugins_url("elements/calendar-jos.css", __FILE__), array(), $wd_spider_calendar_version, FALSE);
562
-
563
- if( isset($_GET['page']) && $_GET['page'] == "Uninstall_sp_calendar" ) {
564
- wp_enqueue_style("sp_calendar_deactivate-css", plugins_url("wd/assets/css/deactivate_popup.css", __FILE__), array(), $wd_spider_calendar_version, FALSE);
565
  }
566
  }
567
 
568
- function spider_calendar_event_category_admin_styles_scripts(){
569
  global $wd_spider_calendar_version;
570
- wp_enqueue_script("Calendar", plugins_url("elements/calendar.js", __FILE__), array(), $wd_spider_calendar_version, FALSE);
571
- wp_enqueue_script("calendar-setup", plugins_url("elements/calendar-setup.js", __FILE__), array(), $wd_spider_calendar_version, FALSE);
572
- wp_enqueue_script('wp-color-picker');
573
- wp_enqueue_style( 'wp-color-picker' );
574
- wp_enqueue_style("spcalendar-jos", plugins_url("elements/calendar-jos.css", __FILE__), array(), $wd_spider_calendar_version, FALSE);
575
- }
576
 
577
  add_filter('admin_head', 'spide_ShowTinyMCE');
578
- function spide_ShowTinyMCE() {
579
- $screen = get_current_screen();
580
  $screen_id = $screen->id;
581
- if($screen_id=="toplevel_page_SpiderCalendar" || $screen_id=="calendar_page_spider_calendar_event_category" || $screen_id=="calendar_page_spider_calendar_themes" || $screen_id=="calendar_page_spider_widget_calendar_themes" || $screen_id=="calendar_page_calendar_export"|| $screen_id=="calendar_page_Uninstall_sp_calendar" || $screen_id=="calendar_page_overview_sp_calendar") {
582
  // conditions here
583
  wp_enqueue_script('common');
584
  wp_enqueue_script('jquery-color');
@@ -600,144 +587,141 @@ function spide_ShowTinyMCE() {
600
  }
601
 
602
  // Add menu.
603
- add_action( 'admin_menu', 'sp_calendar_options_panel' );
604
- add_action( 'init', "wd_spcal_init" );
605
-
606
-
607
- function wd_spcal_init(){
608
-
609
- if( !class_exists("DoradoWeb") ){
610
- require_once('wd/start.php');
611
- }
612
-
613
- global $sp_calendar_options;
614
- $sp_calendar_options = array (
615
- "prefix" => "sp_calendar",
616
- "wd_plugin_id" => 29,
617
- "plugin_title" => "Spider Calendar",
618
- "plugin_wordpress_slug" => "spider-event-calendar",
619
- "plugin_dir" => plugins_url('/', __FILE__),
620
- "plugin_main_file" => __FILE__,
621
- "description" => __('This is the best WordPress event Calendar plugin available in WordPress Directory.', 'sp_calendar'),
622
-
623
- // from web-dorado.com
624
- "plugin_features" => array(
625
- 0 => array(
626
- "title" => __("Responsive", "sp_calendar"),
627
- "description" => __("Spider Calendar plugin is fully responsive and mobile-ready. Thus a beautiful display on all types of devices and screens is guaranteed.", "sp_calendar"),
628
- ),
629
- 1 => array(
630
- "title" => __("Unlimited Calendars & Events", "sp_calendar"),
631
- "description" => __("The calendar plugin allows you to create as many calendars as you want and add unlimited number of events in each calendar. Customize the design of each calendar, create events for each calendar separately and show multiple calendars on one page.", "sp_calendar"),
632
- ),
633
- 2 => array(
634
- "title" => __("Event Categories", "sp_calendar"),
635
- "description" => __("You can assign categories to your events by adding titles, descriptions and category colors from the website admin panel. The plugin allows you customize the calendars to show events from all or just a few categories.", "sp_calendar"),
636
- ),
637
- 3 => array(
638
- "title" => __("Themes", "sp_calendar"),
639
- "description" => __("Choose among 17 different calendar themes to make sure the calendar fits perfectly with your website design. Add your own style to the themes by customizing almost everything or easily create your own theme.", "sp_calendar"),
640
- ),
641
- 4 => array(
642
- "title" => __("Repeat Events", "sp_calendar"),
643
- "description" => __("If you have events in your calendar that occur regularly you can choose to use the recurring events option. You can set the events to repeat daily, weekly, monthly, yearly on specific days of the week, specific days of the month or year.", "sp_calendar"),
644
- )
645
- ),
646
- // user guide from web-dorado.com
647
- "user_guide" => array(
648
- 0 => array(
649
- "main_title" => __("Creating/Editing Calendars", "sp_calendar"),
650
- "url" => "https://web-dorado.com/wordpress-spider-calendar/creating-editing-calendar.html",
651
- "titles" => array()
652
- ),
653
- 1 => array(
654
- "main_title" => __("Creating/Editing Events", "sp_calendar"),
655
- "url" => "https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html",
656
- "titles" => array()
657
- ),
658
- 2 => array(
659
- "main_title" => __("Adding Event Category", "sp_calendar"),
660
- "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-event-category.html",
661
- "titles" => array()
662
- ),
663
- 3 => array(
664
- "main_title" => __("Adding Themes", "sp_calendar"),
665
- "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-themes.html",
666
- "titles" => array(
667
- array(
668
- "title" => __("General Parameters", "sp_calendar"),
669
- "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-themes/general-parameters.html",
670
- ),
671
- array(
672
- "title" => __("Header Parameters", "sp_calendar"),
673
- "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-themes/header-parameters.html",
674
- ),
675
- array(
676
- "title" => __("Body Parameters", "sp_calendar"),
677
- "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-themes/body-parameters.html",
678
- ),
679
- array(
680
- "title" => __("Popup Window Parameters", "sp_calendar"),
681
- "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-themes/popup-window-parameters.html",
682
- ),
683
- array(
684
- "title" => __("Other Views Parameters of the Wordpress Calendar", "sp_calendar"),
685
- "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-themes/other-views-parameters.html",
686
- ),
687
- )
688
- ),
689
- 4 => array(
690
- "main_title" => __("Adding Themes for a widget view", "sp_calendar"),
691
- "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-widget-view-themes.html",
692
- "titles" => array(
693
- array(
694
- "title" => __("General Parameters", "sp_calendar"),
695
- "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-widget-view-themes/general-parameters.html",
696
- ),
697
- array(
698
- "title" => __("Popup Window Parameters", "sp_calendar"),
699
- "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-widget-view-themes/popup-window-parameters.html",
700
- ),
701
- array(
702
- "title" => __("Body Parameters", "sp_calendar"),
703
- "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-widget-view-themes/body-parameters.html",
704
- ),
705
- )
706
- ),
707
- 5 => array(
708
- "main_title" => __("Publishing the Created Calendar in a Page or a Post", "sp_calendar"),
709
- "url" => "https://web-dorado.com/wordpress-spider-calendar/publishing-calendar.html",
710
- "titles" => array()
711
- ),
712
- 6 => array(
713
- "main_title" => __("Publishing the Created Calendar in the Widget", "sp_calendar"),
714
- "url" => "https://web-dorado.com/wordpress-spider-calendar/publishing-calendar-in-widget.html",
715
- "titles" => array()
716
- ),
717
- 7 => array(
718
- "main_title" => __("Publishing the Upcoming Events widget", "sp_calendar"),
719
- "url" => "https://web-dorado.com/wordpress-spider-calendar/publishing-upcoming-events-widget.html",
720
- "titles" => array()
721
- ),
722
-
723
- ),
724
- "video_youtube_id" => "wDrMRAjhgHk", // e.g. https://www.youtube.com/watch?v=acaexefeP7o youtube id is the acaexefeP7o
725
- "overview_welcome_image" => null,
726
- "plugin_wd_url" => "https://web-dorado.com/products/wordpress-calendar.html",
727
- "plugin_wd_demo_link" => "http://wpdemo.web-dorado.com/spider-calendar/?_ga=1.67418517.523103993.1473155982",
728
- "plugin_wd_addons_link" => null,
729
- "plugin_wizard_link" => null,
730
- "after_subscribe" => admin_url('admin.php?page=overview_sp_calendar'), // this can be plagin overview page or set up page
731
- "plugin_menu_title" => "Calendar",
732
- "plugin_menu_icon" => plugins_url('/images/calendar_menu.png', __FILE__) ,
733
- "deactivate" => true,
734
- "subscribe" => true,
735
- "custom_post" => "SpiderCalendar", // if true => edit.php?post_type=contact
736
- "menu_capability" => "manage_options",
737
- "menu_position" => null,
738
-
739
- );
740
- dorado_web_init($sp_calendar_options);
741
  }
742
 
743
  require_once("functions_for_xml_and_ajax.php");
@@ -749,7 +733,6 @@ require_once("front_end/bigcalendarmonth_widget.php");
749
  require_once("front_end/bigcalendarweek_widget.php");
750
  require_once("front_end/bigcalendarlist_widget.php");
751
  require_once("front_end/bigcalendarday_widget.php");
752
-
753
  // Actions for popup and xmls.
754
  add_action('wp_ajax_spiderbigcalendar_day', 'big_calendar_day');
755
  add_action('wp_ajax_spiderbigcalendar_list', 'big_calendar_list');
@@ -774,15 +757,13 @@ add_action('wp_ajax_nopriv_spiderbigcalendar_day_widget', 'big_calendar_day_widg
774
  add_action('wp_ajax_nopriv_spidercalendarbig', 'spiderbigcalendar');
775
  add_action('wp_ajax_nopriv_spiderseemore', 'seemore');
776
  add_action('wp_ajax_nopriv_window', 'php_window');
777
-
778
-
779
  // Add style head.
780
- function add_button_style_calendar() {
781
  echo '<script>var wdplugin_url = "' . plugins_url('', __FILE__) . '";</script>';
782
  }
783
- add_action('admin_head', 'add_button_style_calendar');
784
 
785
- function Manage_Spider_Calendar() {
 
786
  global $wpdb;
787
  if (!function_exists('print_html_nav')) {
788
  require_once("nav_function/nav_html_func.php");
@@ -791,20 +772,17 @@ function Manage_Spider_Calendar() {
791
  require_once("calendar_functions.html.php"); // add functions for vive Spider_Video_Player
792
  if (isset($_GET["task"])) {
793
  $task = esc_html($_GET["task"]);
794
- }
795
- else {
796
  $task = "";
797
  }
798
  if (isset($_GET["id"])) {
799
- $id = (int) $_GET["id"];
800
- }
801
- else {
802
  $id = 0;
803
  }
804
  if (isset($_GET["calendar_id"])) {
805
- $calendar_id = (int) $_GET["calendar_id"];
806
- }
807
- else {
808
  $calendar_id = 0;
809
  }
810
  switch ($task) {
@@ -815,31 +793,29 @@ function Manage_Spider_Calendar() {
815
  add_spider_calendar();
816
  break;
817
  case 'published';
818
- $nonce_sp_cal = $_REQUEST['_wpnonce'];
819
- if (! wp_verify_nonce($nonce_sp_cal, 'nonce_sp_cal') )
820
- die("Are you sure you want to do this?");
821
  spider_calendar_published($id);
822
  show_spider_calendar();
823
  break;
824
  case 'Save':
825
  if (!$id) {
826
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
827
  apply_spider_calendar(-1);
828
- }
829
- else {
830
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
831
  apply_spider_calendar($id);
832
  }
833
  show_spider_calendar();
834
  break;
835
  case 'Apply':
836
  if (!$id) {
837
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
838
  apply_spider_calendar(-1);
839
  $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "spidercalendar_calendar");
840
- }
841
- else {
842
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
843
  apply_spider_calendar($id);
844
  }
845
  edit_spider_calendar($id);
@@ -848,7 +824,7 @@ function Manage_Spider_Calendar() {
848
  edit_spider_calendar($id);
849
  break;
850
  case 'remove_calendar':
851
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
852
  remove_spider_calendar($id);
853
  show_spider_calendar();
854
  break;
@@ -861,22 +837,20 @@ function Manage_Spider_Calendar() {
861
  break;
862
  case 'save_event':
863
  if ($id) {
864
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
865
  apply_spider_event($calendar_id, $id);
866
- }
867
- else {
868
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
869
  apply_spider_event($calendar_id, -1);
870
  }
871
  show_spider_event($calendar_id);
872
  break;
873
  case 'apply_event':
874
  if ($id) {
875
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
876
  apply_spider_event($calendar_id, $id);
877
- }
878
- else {
879
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
880
  apply_spider_event($calendar_id, -1);
881
  $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "spidercalendar_event");
882
  }
@@ -886,23 +860,23 @@ function Manage_Spider_Calendar() {
886
  edit_spider_event($calendar_id, $id);
887
  break;
888
  case 'remove_event':
889
- $nonce_sp_cal = $_REQUEST['_wpnonce'];
890
- if (! wp_verify_nonce($nonce_sp_cal, 'nonce_sp_cal') )
891
- die("Are you sure you want to do this?");
892
  remove_spider_event($calendar_id, $id);
893
  show_spider_event($calendar_id);
894
  break;
895
- case 'copy_event':
896
- $nonce_sp_cal = $_REQUEST['_wpnonce'];
897
- if (! wp_verify_nonce($nonce_sp_cal, 'nonce_sp_cal') )
898
- die("Are you sure you want to do this?");
899
  copy_spider_event($calendar_id, $id);
900
  show_spider_event($calendar_id);
901
  break;
902
  case 'published_event';
903
- $nonce_sp_cal = $_REQUEST['_wpnonce'];
904
- if (! wp_verify_nonce($nonce_sp_cal, 'nonce_sp_cal') )
905
- die("Are you sure you want to do this?");
906
  published_spider_event($calendar_id, $id);
907
  show_spider_event($calendar_id);
908
  break;
@@ -912,96 +886,84 @@ function Manage_Spider_Calendar() {
912
  }
913
  }
914
 
915
- function Manage_Spider_Category_Calendar(){
916
- require_once("calendar_functions.html.php");
917
- require_once("calendar_functions.php");
918
- if (!function_exists('print_html_nav')) {
919
  require_once("nav_function/nav_html_func.php");
920
  }
921
-
922
- global $wpdb;
923
  if (isset($_GET["task"])) {
924
  $task = esc_html($_GET["task"]);
925
- }
926
- else {
927
  $task = "";
928
- show_event_cat();
929
- return;
 
930
  }
931
  if (isset($_GET["id"])) {
932
- $id = (int) $_GET["id"];
933
- }
934
- else {
935
  $id = 0;
936
  }
937
-
938
- switch($task){
939
- case 'add_category':
940
- edit_event_category($id);
941
- break;
942
-
943
- case 'save_category_event':
944
- if(!$id){
945
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
946
- save_spider_category_event();
947
- $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "spidercalendar_event_category");
948
- }
949
- else
950
- {
951
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
952
- apply_spider_category_event($id);
953
- }
954
- show_event_cat();
955
- break;
956
-
957
- case 'apply_event_category':
958
- if (!$id) {
959
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
960
  save_spider_category_event();
961
  $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "spidercalendar_event_category");
 
 
 
962
  }
963
- else {
964
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
 
 
 
 
 
 
 
965
  apply_spider_category_event($id);
966
  }
967
  edit_event_category($id);
968
- break;
969
-
970
- case 'edit_event_category':
971
- //apply_spider_category_event();
972
- edit_event_category($id);
973
- break;
974
-
975
- case 'remove_event_category':
976
- check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
977
- remove_category_event($id);
978
- show_event_cat();
979
- break;
980
- case 'published':
981
- $nonce_sp_cal = $_REQUEST['_wpnonce'];
982
- if (! wp_verify_nonce($nonce_sp_cal, 'nonce_sp_cal') )
983
- die("Are you sure you want to do this?");
984
- spider_category_published($id);
985
- show_event_cat();
986
- break;
987
- }
988
 
989
  }
990
 
991
- function upcoming_widget(){
992
- require_once("calendar_functions.html.php");
993
- require_once("spidercalendar_upcoming_events_widget.php");
994
- require_once("calendar_functions.php");
995
- if (!function_exists('print_html_nav')) {
996
  require_once("nav_function/nav_html_func.php");
997
  }
998
-
999
- global $wpdb;
1000
-
1001
  spider_upcoming();
1002
  }
1003
 
1004
- function spider_widget_calendar_params() {
1005
  wp_enqueue_script('media-upload');
1006
  wp_admin_css('thickbox');
1007
  if (!function_exists('print_html_nav')) {
@@ -1011,8 +973,7 @@ function spider_widget_calendar_params() {
1011
  global $wpdb;
1012
  if (isset($_GET["task"])) {
1013
  $task = esc_html($_GET["task"]);
1014
- }
1015
- else {
1016
  $task = "";
1017
  }
1018
  switch ($task) {
@@ -1025,7 +986,7 @@ function spider_widget_calendar_params() {
1025
  }
1026
 
1027
  // Themes.
1028
- function spider_calendar_params() {
1029
  wp_enqueue_script('media-upload');
1030
  wp_admin_css('thickbox');
1031
  if (!function_exists('print_html_nav')) {
@@ -1035,8 +996,7 @@ function spider_calendar_params() {
1035
  global $wpdb;
1036
  if (isset($_GET["task"])) {
1037
  $task = esc_html($_GET["task"]);
1038
- }
1039
- else {
1040
  $task = "";
1041
  }
1042
  switch ($task) {
@@ -1048,70 +1008,70 @@ function spider_calendar_params() {
1048
  }
1049
  }
1050
 
1051
- function Uninstall_sp_calendar() {
1052
- global $wpdb, $sp_calendar_options;
1053
- if(!class_exists("DoradoWebConfig")){
1054
- require_once("wd/config.php");
1055
  }
1056
  $config = new DoradoWebConfig();
1057
- $config->set_options( $sp_calendar_options );
1058
- $deactivate_reasons = new DoradoWebDeactivate($config);
1059
- $deactivate_reasons->submit_and_deactivate();
1060
-
1061
  $base_name = plugin_basename('Spider_Calendar');
1062
  $base_page = 'admin.php?page=' . $base_name;
1063
- $mode = (isset($_GET['mode']) ? trim($_GET['mode']) : '');
1064
-
1065
  ?>
1066
- <?php upgrade_pro_sp(); ?>
1067
- <br />
1068
- <div class="goodbye-text">
1069
- Before uninstalling the plugin, please Contact our <a href="https://web-dorado.com/support/contact-us.html?source=spidercalendar" target= '_blank'>support team</a>. We'll do our best to help you out with your issue. We value each and every user and value what’s right for our users in everything we do.<br>
1070
- However, if anyway you have made a decision to uninstall the plugin, please take a minute to <a href="https://web-dorado.com/support/contact-us.html?source=spidercalendar" target= '_blank'>Contact us</a> and tell what you didn't like for our plugins further improvement and development. Thank you !!!
1071
- </div>
 
 
 
 
 
1072
  <?php
1073
  if (!empty($_POST['do'])) {
1074
  if ($_POST['do'] == "UNINSTALL Spider Event Calendar") {
1075
  check_admin_referer('Spider_Calendar uninstall');
1076
-
1077
- echo '<form id="message" class="updated fade">';
1078
- echo '<p>';
1079
- echo "Table '" . $wpdb->prefix . "spidercalendar_event' has been deleted.";
1080
- $wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_event");
1081
- echo '<font style="color:#000;">';
1082
- echo '</font><br />';
1083
- echo '</p>';
1084
- echo '<p>';
1085
- echo "Table '" . $wpdb->prefix . "spidercalendar_event_category' has been deleted.";
1086
- $wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_event_category");
1087
- echo '<font style="color:#000;">';
1088
- echo '</font><br />';
1089
- echo '</p>';
1090
- echo '<p>';
1091
- echo "Table '" . $wpdb->prefix . "spidercalendar_calendar' has been deleted.";
1092
- $wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_calendar");
1093
- echo '<font style="color:#000;">';
1094
- echo '</font><br />';
1095
- echo '</p>';
1096
- echo '<p>';
1097
- echo "Table '" . $wpdb->prefix . "spidercalendar_theme' has been deleted.";
1098
- $wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_theme");
1099
- echo '<font style="color:#000;">';
1100
- echo '</font><br />';
1101
- echo '</p>';
1102
- echo '<p>';
1103
- echo "Table '" . $wpdb->prefix . "spidercalendar_widget_theme' has been deleted.";
1104
- $wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_widget_theme");
1105
- echo '<font style="color:#000;">';
1106
- echo '</font><br />';
1107
- echo '</p>';
1108
- echo '</form>';
1109
- delete_option('sp_calendar_subscribe_done');
1110
-
1111
- $mode = 'end-UNINSTALL';
1112
  }
1113
  }
1114
-
1115
  switch ($mode) {
1116
  case 'end-UNINSTALL':
1117
  echo '<div class="wrap">';
@@ -1122,7 +1082,7 @@ function Uninstall_sp_calendar() {
1122
  // Main Page
1123
  default:
1124
  ?>
1125
- <form method="post" id="uninstall_form" action="<?php echo admin_url('admin.php?page=Uninstall_sp_calendar'); ?>">
1126
  <?php wp_nonce_field('Spider_Calendar uninstall'); ?>
1127
  <div class="wrap">
1128
  <div id="icon-Spider_Calendar" class="icon32"><br/></div>
@@ -1132,7 +1092,7 @@ function Uninstall_sp_calendar() {
1132
  </p>
1133
 
1134
  <p style="color: red">
1135
- <strong><?php echo'WARNING:'; ?></strong>
1136
  <?php echo 'Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.'; ?>
1137
  </p>
1138
 
@@ -1151,34 +1111,34 @@ function Uninstall_sp_calendar() {
1151
  <ol>
1152
  <?php
1153
  echo '<li>' . $wpdb->prefix . 'spidercalendar_event</li>' . "\n";
1154
- echo '<li>' . $wpdb->prefix . 'spidercalendar_event_category</li>' . "\n";
1155
  echo '<li>' . $wpdb->prefix . 'spidercalendar_calendar</li>' . "\n";
1156
- echo '<li>' . $wpdb->prefix . 'spidercalendar_theme</li>' . "\n";
1157
  echo '<li>' . $wpdb->prefix . 'spidercalendar_widget_theme</li>' . "\n";
1158
  ?>
1159
  </ol>
1160
  </td>
1161
  </tr>
1162
  </table>
1163
- <script>
1164
- function uninstall(){
1165
- jQuery(document).ready(function() {
1166
- if(jQuery('#uninstall_yes').is(':checked')){
1167
- var answer = confirm('<?php echo 'You Are About To Uninstall Spider Event Calendar From WordPress.\nThis Action Is Not Reversible.\n\n Choose [Cancel] To Stop, [OK] To Uninstall.'; ?>');
1168
-
1169
- if(answer)
1170
- jQuery("#uninstall_form").submit();
1171
- }
1172
- else
1173
- alert('To uninstall please check the box above.');
1174
-
1175
- });
1176
- }
1177
- </script>
1178
  <p style="text-align: center;">
1179
- <?php echo 'Do you really want to uninstall Spider Event Calendar?'; ?><br/><br/>
1180
- <input type="checkbox" value="yes" id="uninstall_yes" />&nbsp;<?php echo 'Yes'; ?><br/><br/>
1181
- <input type="hidden" name="do" value="UNINSTALL Spider Event Calendar" />
1182
  <input type="button" name="DODO" value="<?php echo 'UNINSTALL Spider Event Calendar'; ?>"
1183
  class="button-primary"
1184
  onclick="uninstall()"/>
@@ -1186,277 +1146,289 @@ function Uninstall_sp_calendar() {
1186
  </div>
1187
  </form>
1188
  <?php
1189
-
1190
  }
1191
  }
1192
 
1193
  add_action('init', 'spider_calendar_export');
1194
- function spider_calendar_export() {
1195
- if (isset($_POST['export_spider_calendar']) && $_POST['export_spider_calendar'] == 'Export') {
1196
- global $wpdb;
1197
- $tmp_folder = get_temp_dir();
1198
- $select_spider_categories = "SELECT * from " . $wpdb->prefix . "spidercalendar_event_category";
1199
- $spider_cats = $wpdb->get_results($select_spider_categories);
1200
- $cat_columns = array(
1201
- array('id', 'title', 'published', 'color', 'description')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1202
  );
1203
- if ($spider_cats) {
1204
- foreach ($spider_cats as $cat) {
1205
- $cat_columns[] = array(
1206
- $cat->id,
1207
- $cat->title,
1208
- $cat->published,
1209
- $cat->color,
1210
- $cat->description
1211
- );
1212
- }
1213
- }
1214
- $cat_handle = fopen($tmp_folder . '/sc_categories.csv', 'w+');
1215
- foreach ($cat_columns as $ar) {
1216
- if (fputcsv($cat_handle, $ar, ',') === FALSE) {
1217
- break;
1218
- }
1219
- }
1220
- @fclose($cat_handle);
1221
- $select_spider_calendars = "SELECT * from " . $wpdb->prefix . "spidercalendar_calendar";
1222
- $spider_calendars = $wpdb->get_results($select_spider_calendars);
1223
- $cal_columns = array(
1224
- array('id', 'title', 'published')
1225
- );
1226
- if ($spider_calendars) {
1227
- foreach ($spider_calendars as $cal) {
1228
- $cal_columns[] = array(
1229
- $cal->id,
1230
- $cal->title,
1231
- $cal->published
1232
- );
1233
- }
1234
- }
1235
- $cal_handle = fopen($tmp_folder . '/sc_calendars.csv', 'w+');
1236
- foreach ($cal_columns as $ar) {
1237
- if (fputcsv($cal_handle, $ar, ',') === FALSE) {
1238
- break;
1239
- }
1240
- }
1241
- @fclose($cal_handle);
1242
- $select_spider_events = "SELECT * from " . $wpdb->prefix . "spidercalendar_event";
1243
- $spider_events = $wpdb->get_results($select_spider_events);
1244
- $events_columns = array(
1245
- array('id', 'cal_id', 'start_date', 'end_date', 'title', 'cat_id',
1246
- 'time', 'text_for_date', 'userID', 'repeat_method', 'repeat', 'week',
1247
- 'month', 'month_type', 'monthly_list', 'month_week', 'year_month', 'published')
1248
  );
1249
- if ($spider_events) {
1250
- foreach ($spider_events as $ev) {
1251
- $events_columns[] = array(
1252
- $ev->id,
1253
- $ev->calendar,
1254
- $ev->date,
1255
- $ev->date_end,
1256
- $ev->title,
1257
- $ev->category,
1258
- $ev->time,
1259
- $ev->text_for_date,
1260
- $ev->userID,
1261
- $ev->repeat_method,
1262
- $ev->repeat,
1263
- $ev->week,
1264
- $ev->month,
1265
- $ev->month_type,
1266
- $ev->monthly_list,
1267
- $ev->month_week,
1268
- $ev->year_month,
1269
- $ev->published
1270
- );
1271
- }
1272
- }
1273
- $ev_handle = fopen($tmp_folder . '/sc_events.csv', 'w+');
1274
- foreach ($events_columns as $ar) {
1275
- if (fputcsv($ev_handle, $ar, ',') === FALSE) {
1276
- break;
1277
- }
1278
- }
1279
- @fclose($ev_handle);
1280
- $files = array(
1281
- 'sc_categories.csv',
1282
- 'sc_calendars.csv',
1283
- 'sc_events.csv'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1284
  );
1285
- $zip = new ZipArchive();
1286
- $tmp_file = tempnam('.', '');
1287
- if ($zip->open($tmp_file, ZIPARCHIVE::CREATE) === TRUE) {
1288
- foreach ($files as $file) {
1289
- if (file_exists($tmp_folder . $file)) {
1290
- $zip->addFile($tmp_folder . $file, $file);
1291
- }
1292
- }
1293
- $zip->close();
1294
- header("Content-type: application/zip; charset=utf-8");
1295
- header("Content-Disposition: attachment; filename=spider-event-calendar-export.zip");
1296
- header("Content-length: " . filesize($tmp_file));
1297
- header("Pragma: no-cache");
1298
- header("Expires: 0");
1299
- readfile($tmp_file);
1300
- }
1301
- foreach ($files as $file) {
1302
- @unlink($tmp_folder . $file);
 
 
1303
  }
 
 
 
 
 
 
 
 
 
 
 
1304
  }
 
1305
  }
1306
 
1307
-
1308
- function upgrade_pro_sp($text = false){
1309
- $page = isset($_GET["page"]) ? $_GET["page"] : "";
1310
- ?>
1311
- <div class="sp_calendar_upgrade wd-clear" >
1312
- <div class="wd-left">
1313
- <?php
1314
- switch($page){
1315
- case "SpiderCalendar":
1316
- ?>
1317
- <div style="font-size: 14px;">
1318
- <?php _e("This section allows you to create calendars.","sp_calendar");?>
1319
- <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-calendar.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
1320
- </div>
1321
- <?php
1322
- break;
1323
- case "spider_calendar_event_category":
1324
- ?>
1325
- <div style="font-size: 14px;">
1326
- <?php _e("This section allows you to create event categories.","sp_calendar");?>
1327
- <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/adding-event-category.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
1328
- </div>
1329
- <?php
1330
- break;
1331
- case "calendar_export":
1332
- ?>
1333
- <div style="font-size: 14px;">
1334
- <?php _e("This section will allow exporting Spider Calendar data for further import to Event Calendar WD.","sp_calendar");?>
1335
- <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/products/wordpress-event-calendar-wd.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
1336
- </div>
1337
- <?php
1338
- break;
1339
- case "Uninstall_sp_calendar":
1340
- ?>
1341
- <div style="font-size: 14px;">
1342
- <div class="page-banner uninstall-banner">
1343
- <div class="uninstall_icon">
1344
- </div>
1345
- <div class="logo-title">Uninstall Spider Calendar </div>
1346
- </div>
1347
- </div>
1348
- <?php
1349
- break;
1350
- }
1351
- ?>
 
 
 
 
 
 
 
1352
  </div>
1353
- <div class="wd-right">
1354
- <div class="wd-table">
1355
- <div class="wd-cell wd-cell-valign-middle">
1356
- <a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
1357
- <img src="<?php echo plugins_url('images/i_support.png', __FILE__); ?>" >
1358
- <?php _e("Support Forum", "sp_calendar"); ?>
1359
- </a>
1360
- </div>
1361
- <div class="wd-cell wd-cell-valign-middle">
1362
- <a href="https://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank">
1363
- <?php _e("UPGRADE TO PAID VERSION", "sp_calendar"); ?>
1364
- </a>
1365
- </div>
1366
- </div>
1367
-
1368
  </div>
 
 
1369
  </div>
1370
- <?php if($text){
 
1371
  ?>
1372
- <div class="wd-text-right wd-row" style="color: #15699F; font-size: 20px; margin-top:10px; padding:0px 15px;">
1373
- <?php echo sprintf(__("This is FREE version, Customizing %s is available only in the PAID version.","sp_calendar"), $text);?>
1374
- </div>
1375
  <?php
1376
- }
1377
 
1378
  }
1379
 
1380
- function calendar_export() {
1381
- ?>
1382
- <?php upgrade_pro_sp(); ?>
1383
- <form method="post" style="font-size: 14px; font-weight: bold;">
1384
- <input type='submit' value='Export' id="export_WD" name='export_spider_calendar' />
1385
- </form>
1386
- <style>
1387
- #export_div{
1388
- background: #fff;
1389
- border: 1px solid #e5e5e5;
1390
- -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04);
1391
- box-shadow: 0 1px 1px rgba(0,0,0,.04);
1392
- border-spacing: 0;
1393
- width: 65%;
1394
- clear: both;
1395
- margin: 0;
1396
- padding: 7px 7px 8px 10px;
1397
- margin: 20px 0 10px 0;
1398
- }
1399
-
1400
- #export_WD{
1401
- font-size: 13px;
1402
- padding: 7px 25px;
1403
- }
1404
- </style>
1405
- <?php
1406
- }
1407
 
 
 
 
 
 
 
 
1408
 
1409
  add_filter("plugin_row_meta", 'spidercal_add_plugin_meta_links', 10, 2);
 
1410
 
1411
- function spidercal_add_plugin_meta_links($meta_fields, $file){
1412
-
1413
- if(plugin_basename(__FILE__) == $file) {
1414
 
1415
  $meta_fields[] = "<a href='https://wordpress.org/support/plugin/spider-event-calendar/' target='_blank'>Support Forum</a>";
1416
  $meta_fields[] = "<a href='https://wordpress.org/support/plugin/spider-event-calendar/reviews#new-post' target='_blank' title='Rate'>
1417
- <i class='spidercal-rate-stars'>"
1418
- . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>"
1419
- . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>"
1420
- . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>"
1421
- . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>"
1422
- . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>"
1423
- . "</i></a>";
1424
-
1425
  $stars_color = "#ffb900";
1426
-
1427
- echo "<style>"
1428
- . ".spidercal-rate-stars{display:inline-block;color:" . $stars_color . ";position:relative;top:3px;}"
1429
- . ".spidercal-rate-stars svg{fill:" . $stars_color . ";}"
1430
- . ".spidercal-rate-stars svg:hover{fill:" . $stars_color . "}"
1431
- . ".spidercal-rate-stars svg:hover ~ svg{fill:none;}"
1432
- . "</style>";
1433
  }
1434
 
1435
  return $meta_fields;
1436
  }
1437
 
1438
- function spidercal_activate($networkwide){
1439
- if (function_exists('is_multisite') && is_multisite()) {
1440
- // Check if it is a network activation - if so, run the activation function for each blog id.
1441
- if ($networkwide) {
1442
- global $wpdb;
1443
- // Get all blog ids.
1444
- $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
1445
- foreach ($blogids as $blog_id) {
1446
- switch_to_blog($blog_id);
1447
- SpiderCalendar_activate();
1448
- restore_current_blog();
1449
- }
1450
- return;
1451
- }
1452
- }
1453
- SpiderCalendar_activate();
 
1454
  }
1455
 
1456
  // Activate plugin.
1457
- function SpiderCalendar_activate() {
1458
  global $wpdb;
1459
- $spider_event_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "spidercalendar_event` (
1460
  `id` int(11) NOT NULL AUTO_INCREMENT,
1461
  `calendar` int(11) NOT NULL,
1462
  `date` date NOT NULL,
@@ -1476,7 +1448,7 @@ function SpiderCalendar_activate() {
1476
  `published` int(11) NOT NULL,
1477
  PRIMARY KEY (`id`)
1478
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
1479
- $spider_calendar_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "spidercalendar_calendar` (
1480
  `id` int(11) NOT NULL AUTO_INCREMENT,
1481
  `title` varchar(255) NOT NULL,
1482
  `gid` varchar(255) NOT NULL,
@@ -1487,7 +1459,7 @@ function SpiderCalendar_activate() {
1487
  `published` tinyint(1) NOT NULL,
1488
  PRIMARY KEY (`id`)
1489
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
1490
- $spider_category_event_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "spidercalendar_event_category` (
1491
  `id` int(11) NOT NULL AUTO_INCREMENT,
1492
  `title` varchar(255) NOT NULL,
1493
  `published` tinyint(1) NOT NULL,
@@ -1501,59 +1473,56 @@ $spider_category_event_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix .
1501
  require_once "spider_calendar_update.php";
1502
  spider_calendar_chech_update();
1503
  }
1504
- register_activation_hook(__FILE__, 'spidercal_activate');
1505
 
 
1506
  if (!function_exists('spcal_bp_install_notice')) {
1507
 
1508
- if(get_option('wds_seo_notice_status')==='' || get_option('wds_seo_notice_status')==='1'){
1509
  return;
1510
  }
1511
-
1512
- function spcal_bp_script_style() {
1513
- $screen = get_current_screen();
1514
  $screen_id = $screen->id;
1515
- if($screen_id!="toplevel_page_SpiderCalendar" && $screen_id!="calendar_page_spider_calendar_event_category" && $screen_id!="calendar_page_spider_calendar_themes" && $screen_id!="calendar_page_spider_widget_calendar_themes" && $screen_id!="calendar_page_calendar_export" && $screen_id!="calendar_page_Uninstall_sp_calendar" && $screen_id!="calendar_page_overview_sp_calendar"&& $screen_id!="calendar_page_Spider_calendar_Licensing") {
1516
  return;
1517
  }
1518
-
1519
  $spcal_bp_plugin_url = plugins_url('', __FILE__);
1520
  wp_enqueue_script('spcal_bck_install', $spcal_bp_plugin_url . '/js/wd_bp_install.js', array('jquery'));
1521
  wp_enqueue_style('spcal_bck_install', $spcal_bp_plugin_url . '/style_for_cal/wd_bp_install.css');
1522
  }
1523
- add_action('admin_enqueue_scripts', 'spcal_bp_script_style');
1524
 
 
1525
  /**
1526
  * Show notice to install backup plugin
1527
  */
1528
- function spcal_bp_install_notice() {
1529
- $screen = get_current_screen();
1530
  $screen_id = $screen->id;
1531
- if($screen_id!="toplevel_page_SpiderCalendar" && $screen_id!="calendar_page_spider_calendar_event_category" && $screen_id!="calendar_page_spider_calendar_themes" && $screen_id!="calendar_page_spider_widget_calendar_themes" && $screen_id!="calendar_page_calendar_export" && $screen_id!="calendar_page_Uninstall_sp_calendar" && $screen_id!="calendar_page_overview_sp_calendar"&& $screen_id!="calendar_page_Spider_calendar_Licensing") {
1532
  return;
1533
  }
1534
-
1535
  $spcal_bp_plugin_url = plugins_url('', __FILE__);
1536
- $prefix = 'sp';
1537
- $meta_value = get_option('wd_seo_notice_status');
1538
  if ($meta_value === '' || $meta_value === false) {
1539
  ob_start();
1540
  ?>
1541
- <div class="notice notice-info" id="wd_bp_notice_cont">
1542
- <p>
1543
- <img id="wd_bp_logo_notice" src="<?php echo $spcal_bp_plugin_url . '/images/seo_logo.png'; ?>">
1544
- <?php _e("Spider Event Calendar advises:Optimize your web pages for search engines with the", $prefix) ?>
1545
- <a href="https://wordpress.org/plugins/seo-by-10web/" title="<?php _e("More details", $prefix) ?>"
1546
- target="_blank"><?php _e("FREE SEO", $prefix) ?></a>
1547
- <?php _e("plugin.", $prefix) ?>
1548
- <a class="button button-primary"
1549
- href="<?php echo esc_url(wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=seo-by-10web'), 'install-plugin_seo-by-10web')); ?>">
1550
- <span onclick="wd_bp_notice_install()"><?php _e("Install", $prefix); ?></span>
1551
- </a>
1552
- </p>
1553
- <button type="button" class="wd_bp_notice_dissmiss notice-dismiss"><span class="screen-reader-text"></span>
1554
- </button>
1555
- </div>
1556
- <script>spcal_bp_url = '<?php echo add_query_arg(array('action' => 'wd_seo_dismiss',), admin_url('admin-ajax.php')); ?>'</script>
1557
  <?php
1558
  echo ob_get_clean();
1559
  }
@@ -1562,16 +1531,16 @@ if (!function_exists('spcal_bp_install_notice')) {
1562
  if (!is_dir(plugin_dir_path(dirname(__FILE__)) . 'seo-by-10web')) {
1563
  add_action('admin_notices', 'spcal_bp_install_notice');
1564
  }
1565
-
1566
  /**
1567
  * Add usermeta to db
1568
  *
1569
  * empty: notice,
1570
  * 1 : never show again
1571
  */
1572
- function spcal_bp_install_notice_status() {
1573
  update_option('wd_seo_notice_status', '1', 'no');
1574
  }
 
1575
  add_action('wp_ajax_wd_seo_dismiss', 'spcal_bp_install_notice_status');
1576
  }
1577
  ?>
3
  Plugin Name: Spider Event Calendar
4
  Plugin URI: https://web-dorado.com/products/wordpress-calendar.html
5
  Description: Spider Event Calendar is a highly configurable product which allows you to have multiple organized events. Spider Event Calendar is an extraordinary user friendly extension.
6
+ Version: 1.5.61
7
  Author: WebDorado
8
  Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
11
+ $wd_spider_calendar_version = "1.5.61";
12
  // LANGUAGE localization.
13
+ function sp_calendar_language_load () {
14
+ load_plugin_textdomain('sp_calendar', false, basename(dirname(__FILE__)) . '/languages');
15
  }
 
16
 
17
+ add_action('init', 'sp_calendar_language_load');
18
  add_action('init', 'sp_cal_registr_some_scripts');
19
+ function sp_cal_registr_some_scripts () {
 
20
  global $wd_spider_calendar_version;
21
  wp_register_script("Canlendar_upcoming", plugins_url("elements/calendar.js", __FILE__), array(), $wd_spider_calendar_version);
22
  wp_register_script("calendnar-setup_upcoming", plugins_url("elements/calendar-setup.js", __FILE__), array(), $wd_spider_calendar_version);
23
  wp_register_script("calenndar_function_upcoming", plugins_url("elements/calendar_function.js", __FILE__), array(), $wd_spider_calendar_version);
24
+ if (isset($_GET['page']) && $_GET['page'] == "Uninstall_sp_calendar") {
25
+ wp_enqueue_script("sp_calendar-deactivate-popup", plugins_url('wd/assets/js/deactivate_popup.js', __FILE__), array(), $wd_spider_calendar_version);
26
+ $admin_data = wp_get_current_user();
27
+ wp_localize_script('sp_calendar-deactivate-popup', 'sp_calendarWDDeactivateVars', array(
28
+ "prefix" => "sp_calendar",
29
+ "deactivate_class" => 'sp_calendar_deactivate_link',
30
+ "email" => $admin_data->data->user_email,
31
+ "plugin_wd_url" => "https://web-dorado.com/products/wordpress-calendar.html",
32
+ ));
33
+ }
34
+
 
 
35
  }
36
 
37
  // Include widget.
38
  require_once("widget_spider_calendar.php");
39
  require_once("spidercalendar_upcoming_events_widget.php");
40
+ function current_page_url_sc () {
41
  if (is_home()) {
42
  $pageURL = site_url();
43
+ } else {
 
44
  $pageURL = get_permalink();
45
  }
46
+
47
  return $pageURL;
48
  }
49
 
50
+ function resolv_js_prob () {
51
  ?>
52
  <script>
53
  var xx_cal_xx = '&';
54
  </script>
55
  <?php
56
  }
 
57
 
58
+ add_action('wp_head', 'resolv_js_prob');
59
+ function spider_calendar_scripts () {
60
  wp_enqueue_script('jquery');
61
  wp_enqueue_script('thickbox', NULL, array('jquery'));
62
  wp_enqueue_style('thickbox.css', '/' . WPINC . '/js/thickbox/thickbox.css', NULL, '1.0');
63
  wp_enqueue_style('thickbox');
64
  }
 
65
 
66
+ add_action('wp_enqueue_scripts', 'spider_calendar_scripts');
67
  $many_sp_calendar = 1;
68
+ function spider_calendar_big ($atts) {
69
  if (!isset($atts['default'])) {
70
+ $atts['theme'] = 30;
71
  $atts['default'] = 'month';
72
  }
73
  extract(shortcode_atts(array(
79
  if (!isset($atts['select'])) {
80
  $atts['select'] = 'month,list,day,week,';
81
  }
82
+
83
  return spider_calendar_big_front_end($id, $theme, $default, $select);
84
  }
 
85
 
86
+ add_shortcode('Spider_Calendar', 'spider_calendar_big');
87
+ function spider_calendar_big_front_end ($id, $theme, $default, $select, $widget = 0) {
88
+ require_once("front_end/frontend_functions.php");
89
  ob_start();
90
  global $many_sp_calendar;
91
  global $wpdb;
 
92
  if ($widget === 1) {
93
+ $themes = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme));
94
+ } else {
95
+ $themes = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme));
96
+ }
 
97
  $cal_width = $themes->width; ?>
98
+ <input type="hidden" id="cal_width<?php echo $many_sp_calendar ?>" value="<?php echo $cal_width ?>"/>
99
  <div id='bigcalendar<?php echo $many_sp_calendar ?>' class="wdc_calendar"></div>
100
+ <script>
101
  var tb_pathToImage = "<?php echo plugins_url('images/loadingAnimation.gif', __FILE__) ?>";
102
  var tb_closeImage = "<?php echo plugins_url('images/tb-close.png', __FILE__) ?>"
103
+ var randi;
104
+ if (typeof showbigcalendar != 'function') {
105
  function showbigcalendar(id, calendarlink, randi, widget) {
106
+ jQuery.ajax({
107
+ type: "GET",
108
+ url: calendarlink,
109
+ data: {},
110
+ success: function (data) {
111
+ jQuery('#' + id).html(data);
112
+ spider_calendar_ajax_success(id, calendarlink, randi, widget)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  }
114
+ });
115
+ }
116
+ function spider_calendar_ajax_success(id, calendarlink, randi, widget) {
117
+ jQuery(document).ready(function () {
118
+ jQuery('#views_select').toggle(function () {
119
+ jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
120
+ jQuery('#views_select .arrow-down').addClass("show_arrow");
121
+ jQuery('#views_select .arrow-right').removeClass("show_arrow");
122
+ }, function () {
123
+ jQuery('#drop_down_views').stop(true, true).slideUp(500);
124
+ jQuery('#views_select .arrow-down').removeClass("show_arrow");
125
+ jQuery('#views_select .arrow-right').addClass("show_arrow");
126
+ });
127
+ });
128
+ if (widget != 1) {
129
+ jQuery('drop_down_views').hide();
130
+ var parent_width = document.getElementById('bigcalendar' + randi).parentNode.clientWidth;
131
+ var calwidth = document.getElementById('cal_width' + randi).value;
132
+ var responsive_width = (calwidth) / parent_width * 100;
133
+ document.getElementById('bigcalendar' + randi).setAttribute('style', 'width:' + responsive_width + '%;');
134
+ jQuery('pop_table').css('height', '100%');
135
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  var thickDims, tbWidth, tbHeight;
137
+ jQuery(document).ready(function ($) {
138
+ if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
139
+ jQuery('body').addClass('ios_device');
140
+ }
141
+ setInterval(function () {
142
+ if (jQuery("body").hasClass("modal-open")) jQuery("html").addClass("thickbox_open");
143
+ else jQuery("html").removeClass("thickbox_open");
144
+ }, 500);
145
+ thickDims = function () {
146
+ var tbWindow = jQuery('#TB_window'), H = jQuery(window).height(), W = jQuery(window).width(), w, h;
147
  if (tbWidth) {
148
+ if (tbWidth < (W - 90)) w = tbWidth; else w = W - 200;
149
  } else w = W - 200;
150
  if (tbHeight) {
151
+ if (tbHeight < (H - 90)) h = tbHeight; else h = H - 200;
152
+ } else h = H - 200;
153
  if (tbWindow.size()) {
154
  tbWindow.width(w).height(h);
155
  jQuery('#TB_iframeContent').width(w).height(h - 27);
156
+ tbWindow.css({'margin-left': '-' + parseInt((w / 2), 10) + 'px'});
157
  if (typeof document.body.style.maxWidth != 'undefined')
158
+ tbWindow.css({'top': (H - h) / 2, 'margin-top': '0'});
159
+ }
160
+ if (jQuery(window).width() < 768) {
161
+ var tb_left = parseInt((w / 2), 10) + 20;
162
+ jQuery('#TB_window').css({"left": tb_left + "px", "width": "90%", "margin-top": "-13%", "height": "100%"})
163
+ jQuery('#TB_window iframe').css({'height': '100%', 'width': '100%'});
164
+ }
165
+ else jQuery('#TB_window').css('left', '50%');
166
+ if (typeof popup_width_from_src != "undefined") {
167
+ popup_width_from_src = jQuery('.thickbox-previewbigcalendar' + randi).attr('href').indexOf('tbWidth=');
168
+ str = jQuery('.thickbox-previewbigcalendar' + randi).attr('href').substr(popup_width_from_src + 8, 150)
169
+ find_amp = str.indexOf('&');
170
+ width_orig = str.substr(0, find_amp);
171
+ find_eq = str.indexOf('=');
172
+ height_orig = str.substr(find_eq + 1, 5);
173
+ jQuery('#TB_window').css({'max-width': width_orig + 'px', 'max-height': height_orig + 'px'});
174
+ jQuery('#TB_window iframe').css('max-width', width_orig + 'px');
175
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  };
177
  thickDims();
178
  jQuery(window).resize(function () {
179
+ thickDims();
180
+ });
181
  jQuery('a.thickbox-preview' + id).click(function () {
182
  tb_click.call(this);
183
+ var alink = jQuery(this).parents('.available-theme').find('.activatelink'), link = '',
184
+ href = jQuery(this).attr('href'), url, text;
185
+ var reg_with = new RegExp(xx_cal_xx + "tbWidth=[0-9]+");
186
  if (tbWidth = href.match(reg_with))
187
  tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
188
  else
189
+ tbWidth = jQuery(window).width() - 90;
190
  var reg_heght = new RegExp(xx_cal_xx + "tbHeight=[0-9]+");
191
  if (tbHeight = href.match(reg_heght))
192
  tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
193
  else
194
  tbHeight = jQuery(window).height() - 60;
195
+ jQuery('#TB_ajaxWindowTitle').css({'float': 'right'}).html(link);
196
+ thickDims();
197
+ return false;
198
  });
199
+
200
  });
201
  }
202
+ }
203
  document.onkeydown = function (evt) {
204
  evt = evt || window.event;
205
  if (evt.keyCode == 27) {
209
  <?php global $wpdb;
210
  $calendarr = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id='%d'", $id));
211
  $year = ($calendarr->def_year ? $calendarr->def_year : date("Y"));
212
+ $month = ($calendarr->def_month ? $calendarr->def_month : date("m"));
213
+
214
  $date = $year . '-' . $month;
215
  if ($default == 'day') {
216
  $date .= '-' . date('d');
217
  }
218
  if ($default == 'week') {
219
+ $date .= '-' . date('d');
220
+ $d = new DateTime($date);
221
  $weekday = $d->format('w');
222
+ $diff = ($weekday == 0 ? 6 : $weekday - 1);
223
  if ($widget === 1) {
224
  $theme_row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_widget_theme WHERE id='%d'", $theme));
225
+ } else {
 
226
  $theme_row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_theme WHERE id='%d'", $theme));
227
  }
228
  $weekstart = $theme_row->week_start_day;
231
  }
232
  $d->modify("-$diff day");
233
  $d->modify("-1 day");
234
+ $prev_date = $d->format('Y-m-d');
235
+ $prev_month = add_0((int)substr($prev_date, 5, 2) - 1);
236
+ $this_month = add_0((int)substr($prev_date, 5, 2));
237
+ $next_month = add_0((int)substr($prev_date, 5, 2) + 1);
238
  if ($next_month == '13') {
239
  $next_month = '01';
240
  }
244
  }
245
  if ($widget === 1) {
246
  $default .= '_widget';
247
+ } else {
 
248
  }
249
  ?> showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
250
  'action' => 'spiderbigcalendar_' . $default,
255
  'months' => (($default == 'week' || $default == 'week_widget') ? $prev_month . ',' . $this_month . ',' . $next_month : ''),
256
  'many_sp_calendar' => $many_sp_calendar,
257
  'widget' => $widget,
258
+ 'rand' => $many_sp_calendar,
259
+ ), admin_url('admin-ajax.php'));?>', '<?php echo $many_sp_calendar; ?>', '<?php echo $widget; ?>');</script>
260
+ <style>
261
+ #TB_window iframe {
262
+ background: <?php echo '#'.str_replace('#','',$themes->show_event_bgcolor); ?>;
263
+ }
264
+ </style>
265
  <?php
266
  $many_sp_calendar++;
267
  $calendar = ob_get_contents();
268
  ob_end_clean();
269
+
270
  return $calendar;
271
  }
272
 
273
+ function convert_time ($calendar_format, $old_time) {
274
+ if ($calendar_format == 0) {
275
+ if (strpos($old_time, 'AM') !== false || strpos($old_time, 'PM') !== false) {
276
+ $row_time_12 = explode('-', $old_time);
277
+ $row_time_24 = "";
278
+ for ($i = 0; $i < count($row_time_12); $i++) {
279
+ $row_time_24 .= date("H:i", strtotime($row_time_12[$i])) . "-";
280
+ }
281
+ if (substr($row_time_24, -1) == "-")
282
+ $row_time = rtrim($row_time_24, '-');
283
+ } else $row_time = $old_time;
284
+ } else {
285
+ if (strpos($old_time, 'AM') !== false || strpos($old_time, 'PM') !== false)
286
+ $row_time = $old_time; else {
287
+ $row_time_12 = "";
288
+ $row_time_24 = explode('-', $old_time);
289
+ for ($i = 0; $i < count($row_time_24); $i++) {
290
+ $row_time_12 .= date("g:iA", strtotime($row_time_24[$i])) . "-";
291
+ }
292
+ if (substr($row_time_12, -1) == "-")
293
+ $row_time = rtrim($row_time_12, '-');
294
+ }
295
+ }
296
+
297
+ return $row_time;
298
  }
299
 
300
  // Quick edit.
301
  add_action('wp_ajax_spidercalendarinlineedit', 'spider_calendar_quick_edit');
302
  add_action('wp_ajax_spidercalendarinlineupdate', 'spider_calendar_quick_update');
303
  add_action('wp_ajax_upcoming', 'upcoming_widget');
304
+ function spider_calendar_quick_update () {
305
  $current_user = wp_get_current_user();
306
  if ($current_user->roles[0] !== 'administrator') {
307
  echo 'You have no permission.';
310
  global $wpdb;
311
  if (isset($_POST['calendar_id']) && isset($_POST['calendar_title']) && isset($_POST['us_12_format_sp_calendar']) && isset($_POST['default_year']) && isset($_POST['default_month'])) {
312
  $wpdb->update($wpdb->prefix . 'spidercalendar_calendar', array(
313
+ 'title' => esc_sql(esc_html(stripslashes($_POST['calendar_title']))),
314
+ 'time_format' => esc_sql(esc_html(stripslashes($_POST['us_12_format_sp_calendar']))),
315
+ 'def_year' => esc_sql(esc_html(stripslashes($_POST['default_year']))),
316
+ 'def_month' => esc_sql(esc_html(stripslashes($_POST['default_month']))),
317
+ ), array('id' => esc_sql(esc_html(stripslashes($_POST['calendar_id'])))), array(
318
+ '%s',
319
+ '%d',
320
+ '%s',
321
+ '%s',
322
+ ), array('%d'));
323
+ $row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id='%d'", (int)$_POST['calendar_id']));
324
+ $calendar_format = esc_sql(esc_html(stripslashes($_POST['us_12_format_sp_calendar'])));
325
+ $events_list = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar='%d'", (int)$_POST['calendar_id']));
326
+ for ($i = 0; $i < count($events_list); $i++) {
327
+ if ($events_list[$i]->time != '') {
328
+ $wpdb->update($wpdb->prefix . 'spidercalendar_event', array(
329
+ 'time' => convert_time($calendar_format, $events_list[$i]->time)
330
+ ), array('id' => $events_list[$i]->id), array(
331
+ '%s'
332
+ ));
333
+ }
334
+ }
335
+ ?>
336
+ <td><?php echo $row->id; ?></td>
337
+ <td class="post-title page-title column-title">
338
+ <a title="Manage Events" class="row-title" href="admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=<?php echo $row->id; ?>"><?php echo $row->title; ?></a>
339
+ <div class="row-actions">
 
 
340
  <span class="inline hide-if-no-js">
341
  <a href="#" class="editinline" onclick="show_calendar_inline(<?php echo $row->id; ?>)" title="Edit This Calendar Inline">Quick&nbsp;Edit</a> | </span>
342
+ <span class="trash">
343
  <a class="submitdelete" title="Delete This Calendar" href="javascript:confirmation('admin.php?page=SpiderCalendar&task=remove_calendar&id=<?php echo $row->id; ?>','<?php echo $row->title; ?>')">Delete</a></span>
344
+ </div>
345
+ </td>
346
+ <td><a href="admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=<?php echo $row->id; ?>">Manage
347
+ events</a></td>
348
+ <td>
349
+ <a href="admin.php?page=SpiderCalendar&task=edit_calendar&id=<?php echo $row->id; ?>" title="Edit This Calendar">Edit</a>
350
+ </td>
351
+ <td><a <?php if (!$row->published)
352
+ echo 'style="color:#C00"'; ?>
353
+ href="admin.php?page=SpiderCalendar&task=published&id=<?php echo $row->id; ?>"><?php if ($row->published)
354
+ echo "Yes"; else echo "No"; ?></a></td>
355
+ <?php
356
  die();
357
+ } else {
 
358
  die();
359
  }
360
  }
361
 
362
+ function spider_calendar_quick_edit () {
363
  $current_user = wp_get_current_user();
364
  if ($current_user->roles[0] !== 'administrator') {
365
  echo 'You have no permission.';
367
  }
368
  global $wpdb;
369
  if (isset($_POST['calendar_id'])) {
370
+ $row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id='%d'", (int)$_POST['calendar_id']));
371
  ?>
372
+ <td colspan="4" class="colspanchange">
373
+ <fieldset class="inline-edit-col-left">
374
+ <div style="float:left; width:100% " class="inline-edit-col">
375
+ <h4>Quick Edit</h4>
376
+ <label for="calendar_title"><span style="width:160px !important" class="title">Title: </span></label>
377
+ <span class="input-text-wrap">
378
  <input type="text" style="width:150px !important" id="calendar_title" name="calendar_title" value="<?php echo $row->title; ?>" class="ptitle" value=""/>
379
  </span>
380
+ <label for="def_year"><span class="title alignleft" style="width:160px !important">Default Year: </span></label>
381
+ <span>
382
  <input type="text" name="def_year" id="def_year" style="width:150px;" value="<?php echo $row->def_year ?>"/>
383
  </span>
384
+ <label for="def_month"><span class="title alignleft" style="width:160px !important">Default Month: </span></label>
385
+ <span>
386
  <select id="def_month" name="def_month" style="width:150px;">
387
  <?php
388
  $month_array = array(
402
  );
403
  foreach ($month_array as $key => $def_month) {
404
  ?>
405
+ <option <?php echo(($row->def_month == $key) ? 'selected="selected"' : ''); ?> value="<?php echo $key; ?>"><?php echo $def_month; ?></option>
406
  <?php
407
  }
408
  ?>
409
  </select>
410
  </span>
411
+ <label for="time_format0"><span class="title alignleft" style="width:160px !important">Use 12 hours time format: </span></label>
412
+ <span>
413
+ <input style="margin-top:5px" type="radio" class="alignleft" name="time_format" id="time_format0" value="0" <?php if ($row->time_format == 0)
414
+ echo 'checked="checked"'; ?> />
415
  <em style="margin:4px 5px 0 0" class="alignleft"> No </em>
416
+ <input style="margin-top:5px" class="alignleft" type="radio" name="time_format" id="time_format1" value="1" <?php if ($row->time_format == 1)
417
+ echo 'checked="checked"'; ?> />
418
  <em style="margin:4px 5px 0 0" class="alignleft"> Yes </em>
419
  </span>
420
+ </div>
421
+ </fieldset>
422
+ <p class="submit inline-edit-save">
423
+ <a accesskey="c" href="#" title="Cancel" onclick="cancel_qiucik_edit(<?php echo $row->id; ?>)" class="button-secondary cancel alignleft">Cancel</a>
424
+ <input type="hidden" id="_inline_edit" name="_inline_edit" value="d8393e8662">
425
+ <a accesskey="s" href="#" title="Update" onclick="updae_inline_sp_calendar(<?php echo "'" . $row->id . "'" ?>)" class="button-primary save alignright">Update</a>
426
+ <input type="hidden" name="post_view" value="list">
427
+ <input type="hidden" name="screen" value="edit-page">
428
+ <span class="error" style="display:none"></span>
429
+ <br class="clear">
430
+ </p>
431
+ </td>
432
+ <?php
433
  die();
434
+ } else {
 
435
  die();
436
  }
437
  }
439
  // Add editor new mce button.
440
  add_filter('mce_external_plugins', "sp_calendar_register");
441
  add_filter('mce_buttons', 'sp_calendar_add_button', 0);
 
442
  // Function for add new button.
443
+ function sp_calendar_add_button ($buttons) {
444
  array_push($buttons, "sp_calendar_mce");
445
+
446
  return $buttons;
447
  }
448
 
449
  // Function for registr new button.
450
+ function sp_calendar_register ($plugin_array) {
451
+ $url = plugins_url('js/editor_plugin.js', __FILE__);
452
  $plugin_array["sp_calendar_mce"] = $url;
453
+
454
  return $plugin_array;
455
  }
456
 
457
+ function spider_calendar_ajax_func () {
458
  ?>
459
  <script>
460
  var spider_calendar_ajax = '<?php echo admin_url("admin-ajax.php"); ?>';
461
  </script>
462
  <?php
463
  }
 
464
 
465
+ add_action('admin_head', 'spider_calendar_ajax_func');
466
  // Function create in menu.
467
+ function sp_calendar_options_panel () {
468
+ if (get_option("sp_calendar_subscribe_done") == 1) {
469
+ add_menu_page('Theme page title', 'Calendar', 'manage_options', 'SpiderCalendar', 'Manage_Spider_Calendar', plugins_url("images/calendar_menu.png", __FILE__));
470
  }
471
+ $page_calendar = add_submenu_page('SpiderCalendar', 'Calendars', 'Calendars', 'manage_options', 'SpiderCalendar', 'Manage_Spider_Calendar');
472
  $page_event_category = add_submenu_page('SpiderCalendar', 'Event Category', 'Event Category', 'manage_options', 'spider_calendar_event_category', 'Manage_Spider_Category_Calendar');
473
+ $page_theme = add_submenu_page('SpiderCalendar', 'Calendar Parameters', 'Calendar Themes', 'manage_options', 'spider_calendar_themes', 'spider_calendar_params');
474
+ $page_widget_theme = add_submenu_page('SpiderCalendar', 'Calendar Parameters', 'Widget Themes', 'manage_options', 'spider_widget_calendar_themes', 'spider_widget_calendar_params');
475
+ add_submenu_page('SpiderCalendar', 'Export', 'Export', 'manage_options', 'calendar_export', 'calendar_export');
476
  add_submenu_page('SpiderCalendar', 'Get Pro', 'Get Pro', 'manage_options', 'Spider_calendar_Licensing', 'Spider_calendar_Licensing');
477
  $page_uninstall = add_submenu_page('SpiderCalendar', 'Uninstall Spider Event Calendar', 'Uninstall Spider Event Calendar', 'manage_options', 'Uninstall_sp_calendar', 'Uninstall_sp_calendar'); // uninstall Calendar
478
  add_action('admin_print_styles-' . $page_theme, 'spider_calendar_themes_admin_styles_scripts');
484
 
485
  }
486
 
487
+ function Spider_calendar_Licensing () {
488
+ global $wpdb;
489
  ?>
490
  <div style="width:95%">
491
+ <p>This plugin is the non-commercial version of the Spider Event Calendar. Use of the calendar is free.<br/>
492
+ The only limitation is the use of the themes. If you want to use one of the 11 standard themes or create a new one
493
+ that
494
+ satisfies the needs of your web site, you are required to purchase a license.<br/>
495
+ Purchasing a license will add 12 standard themes and give possibility to edit the themes of the Spider Event
496
+ Calendar.
497
  </p>
498
+ <br/><br/>
499
+ <a href="https://web-dorado.com/files/fromSpiderCalendarWP.php" class="button-primary" target="_blank">Purchase a
500
+ License</a>
501
+ <br/><br/><br/>
502
  <p>After the purchasing the commercial version follow this steps:</p>
503
  <ol>
504
  <li>Deactivate Spider Event Calendar Plugin</li>
505
  <li>Delete Spider Event Calendar Plugin</li>
506
  <li>Install the downloaded commercial version of the plugin</li>
507
+ </ol>
508
  </div>
509
  <?php
510
  }
511
+
512
+ function spider_widget_styles_scripts () {
513
  wp_enqueue_script('wp-color-picker');
514
+ wp_enqueue_style('wp-color-picker');
515
  }
516
 
517
+ function spider_calendar_themes_admin_styles_scripts () {
518
  global $wd_spider_calendar_version;
519
  wp_enqueue_script("jquery");
520
  wp_enqueue_script("standart_themes", plugins_url('elements/theme_reset.js', __FILE__), array(), $wd_spider_calendar_version);
521
+ wp_enqueue_script('wp-color-picker');
522
+ wp_enqueue_style('wp-color-picker');
523
  if (isset($_GET['task'])) {
524
  if ($_GET['task'] == 'edit_theme' || $_GET['task'] == 'add_theme' || $_GET['task'] == 'Apply') {
525
  wp_enqueue_style("parsetheme_css", plugins_url('style_for_cal/style_for_tables_cal.css', __FILE__), array(), $wd_spider_calendar_version);
528
 
529
  }
530
 
531
+ function spider_widget_calendar_themes_admin_styles_scripts () {
532
  global $wd_spider_calendar_version;
533
  wp_enqueue_script("jquery");
534
  wp_enqueue_script("standart_themes", plugins_url('elements/theme_reset_widget.js', __FILE__), array(), $wd_spider_calendar_version);
535
+ wp_enqueue_script('wp-color-picker');
536
+ wp_enqueue_style('wp-color-picker');
537
  if (isset($_GET['task'])) {
538
  if ($_GET['task'] == 'edit_theme' || $_GET['task'] == 'add_theme' || $_GET['task'] == 'Apply') {
539
  wp_enqueue_style("parsetheme_css", plugins_url('style_for_cal/style_for_tables_cal.css', __FILE__), array(), $wd_spider_calendar_version);
541
  }
542
  }
543
 
544
+ function spider_calendar_admin_styles_scripts () {
545
  global $wd_spider_calendar_version;
546
+ wp_enqueue_script("Calendar", plugins_url("elements/calendar.js", __FILE__), array(), $wd_spider_calendar_version, false);
547
+ wp_enqueue_script("calendar-setup", plugins_url("elements/calendar-setup.js", __FILE__), array(), $wd_spider_calendar_version, false);
548
+ wp_enqueue_script("calendar_function", plugins_url("elements/calendar_function.js", __FILE__), array(), $wd_spider_calendar_version, false);
549
+ wp_enqueue_style("spcalendar-jos", plugins_url("elements/calendar-jos.css", __FILE__), array(), $wd_spider_calendar_version, false);
550
+ if (isset($_GET['page']) && $_GET['page'] == "Uninstall_sp_calendar") {
551
+ wp_enqueue_style("sp_calendar_deactivate-css", plugins_url("wd/assets/css/deactivate_popup.css", __FILE__), array(), $wd_spider_calendar_version, false);
 
552
  }
553
  }
554
 
555
+ function spider_calendar_event_category_admin_styles_scripts () {
556
  global $wd_spider_calendar_version;
557
+ wp_enqueue_script("Calendar", plugins_url("elements/calendar.js", __FILE__), array(), $wd_spider_calendar_version, false);
558
+ wp_enqueue_script("calendar-setup", plugins_url("elements/calendar-setup.js", __FILE__), array(), $wd_spider_calendar_version, false);
559
+ wp_enqueue_script('wp-color-picker');
560
+ wp_enqueue_style('wp-color-picker');
561
+ wp_enqueue_style("spcalendar-jos", plugins_url("elements/calendar-jos.css", __FILE__), array(), $wd_spider_calendar_version, false);
562
+ }
563
 
564
  add_filter('admin_head', 'spide_ShowTinyMCE');
565
+ function spide_ShowTinyMCE () {
566
+ $screen = get_current_screen();
567
  $screen_id = $screen->id;
568
+ if ($screen_id == "toplevel_page_SpiderCalendar" || $screen_id == "calendar_page_spider_calendar_event_category" || $screen_id == "calendar_page_spider_calendar_themes" || $screen_id == "calendar_page_spider_widget_calendar_themes" || $screen_id == "calendar_page_calendar_export" || $screen_id == "calendar_page_Uninstall_sp_calendar" || $screen_id == "calendar_page_overview_sp_calendar") {
569
  // conditions here
570
  wp_enqueue_script('common');
571
  wp_enqueue_script('jquery-color');
587
  }
588
 
589
  // Add menu.
590
+ add_action('admin_menu', 'sp_calendar_options_panel');
591
+ add_action('init', "wd_spcal_init");
592
+ function wd_spcal_init () {
593
+
594
+ if (!class_exists("DoradoWeb")) {
595
+ require_once('wd/start.php');
596
+ }
597
+ global $sp_calendar_options;
598
+ $sp_calendar_options = array(
599
+ "prefix" => "sp_calendar",
600
+ "wd_plugin_id" => 29,
601
+ "plugin_title" => "Spider Calendar",
602
+ "plugin_wordpress_slug" => "spider-event-calendar",
603
+ "plugin_dir" => plugins_url('/', __FILE__),
604
+ "plugin_main_file" => __FILE__,
605
+ "description" => __('This is the best WordPress event Calendar plugin available in WordPress Directory.', 'sp_calendar'),
606
+ // from web-dorado.com
607
+ "plugin_features" => array(
608
+ 0 => array(
609
+ "title" => __("Responsive", "sp_calendar"),
610
+ "description" => __("Spider Calendar plugin is fully responsive and mobile-ready. Thus a beautiful display on all types of devices and screens is guaranteed.", "sp_calendar"),
611
+ ),
612
+ 1 => array(
613
+ "title" => __("Unlimited Calendars & Events", "sp_calendar"),
614
+ "description" => __("The calendar plugin allows you to create as many calendars as you want and add unlimited number of events in each calendar. Customize the design of each calendar, create events for each calendar separately and show multiple calendars on one page.", "sp_calendar"),
615
+ ),
616
+ 2 => array(
617
+ "title" => __("Event Categories", "sp_calendar"),
618
+ "description" => __("You can assign categories to your events by adding titles, descriptions and category colors from the website admin panel. The plugin allows you customize the calendars to show events from all or just a few categories.", "sp_calendar"),
619
+ ),
620
+ 3 => array(
621
+ "title" => __("Themes", "sp_calendar"),
622
+ "description" => __("Choose among 17 different calendar themes to make sure the calendar fits perfectly with your website design. Add your own style to the themes by customizing almost everything or easily create your own theme.", "sp_calendar"),
623
+ ),
624
+ 4 => array(
625
+ "title" => __("Repeat Events", "sp_calendar"),
626
+ "description" => __("If you have events in your calendar that occur regularly you can choose to use the recurring events option. You can set the events to repeat daily, weekly, monthly, yearly on specific days of the week, specific days of the month or year.", "sp_calendar"),
627
+ )
628
+ ),
629
+ // user guide from web-dorado.com
630
+ "user_guide" => array(
631
+ 0 => array(
632
+ "main_title" => __("Creating/Editing Calendars", "sp_calendar"),
633
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/creating-editing-calendar.html",
634
+ "titles" => array()
635
+ ),
636
+ 1 => array(
637
+ "main_title" => __("Creating/Editing Events", "sp_calendar"),
638
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html",
639
+ "titles" => array()
640
+ ),
641
+ 2 => array(
642
+ "main_title" => __("Adding Event Category", "sp_calendar"),
643
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-event-category.html",
644
+ "titles" => array()
645
+ ),
646
+ 3 => array(
647
+ "main_title" => __("Adding Themes", "sp_calendar"),
648
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-themes.html",
649
+ "titles" => array(
650
+ array(
651
+ "title" => __("General Parameters", "sp_calendar"),
652
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-themes/general-parameters.html",
653
+ ),
654
+ array(
655
+ "title" => __("Header Parameters", "sp_calendar"),
656
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-themes/header-parameters.html",
657
+ ),
658
+ array(
659
+ "title" => __("Body Parameters", "sp_calendar"),
660
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-themes/body-parameters.html",
661
+ ),
662
+ array(
663
+ "title" => __("Popup Window Parameters", "sp_calendar"),
664
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-themes/popup-window-parameters.html",
665
+ ),
666
+ array(
667
+ "title" => __("Other Views Parameters of the Wordpress Calendar", "sp_calendar"),
668
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-themes/other-views-parameters.html",
669
+ ),
670
+ )
671
+ ),
672
+ 4 => array(
673
+ "main_title" => __("Adding Themes for a widget view", "sp_calendar"),
674
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-widget-view-themes.html",
675
+ "titles" => array(
676
+ array(
677
+ "title" => __("General Parameters", "sp_calendar"),
678
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-widget-view-themes/general-parameters.html",
679
+ ),
680
+ array(
681
+ "title" => __("Popup Window Parameters", "sp_calendar"),
682
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-widget-view-themes/popup-window-parameters.html",
683
+ ),
684
+ array(
685
+ "title" => __("Body Parameters", "sp_calendar"),
686
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/adding-widget-view-themes/body-parameters.html",
687
+ ),
688
+ )
689
+ ),
690
+ 5 => array(
691
+ "main_title" => __("Publishing the Created Calendar in a Page or a Post", "sp_calendar"),
692
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/publishing-calendar.html",
693
+ "titles" => array()
694
+ ),
695
+ 6 => array(
696
+ "main_title" => __("Publishing the Created Calendar in the Widget", "sp_calendar"),
697
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/publishing-calendar-in-widget.html",
698
+ "titles" => array()
699
+ ),
700
+ 7 => array(
701
+ "main_title" => __("Publishing the Upcoming Events widget", "sp_calendar"),
702
+ "url" => "https://web-dorado.com/wordpress-spider-calendar/publishing-upcoming-events-widget.html",
703
+ "titles" => array()
704
+ ),
705
+ ),
706
+ "video_youtube_id" => "wDrMRAjhgHk",
707
+ // e.g. https://www.youtube.com/watch?v=acaexefeP7o youtube id is the acaexefeP7o
708
+ "overview_welcome_image" => null,
709
+ "plugin_wd_url" => "https://web-dorado.com/products/wordpress-calendar.html",
710
+ "plugin_wd_demo_link" => "http://wpdemo.web-dorado.com/spider-calendar/?_ga=1.67418517.523103993.1473155982",
711
+ "plugin_wd_addons_link" => null,
712
+ "plugin_wizard_link" => null,
713
+ "after_subscribe" => admin_url('admin.php?page=overview_sp_calendar'),
714
+ // this can be plagin overview page or set up page
715
+ "plugin_menu_title" => "Calendar",
716
+ "plugin_menu_icon" => plugins_url('/images/calendar_menu.png', __FILE__),
717
+ "deactivate" => true,
718
+ "subscribe" => true,
719
+ "custom_post" => "SpiderCalendar",
720
+ // if true => edit.php?post_type=contact
721
+ "menu_capability" => "manage_options",
722
+ "menu_position" => null,
723
+ );
724
+ dorado_web_init($sp_calendar_options);
 
 
 
725
  }
726
 
727
  require_once("functions_for_xml_and_ajax.php");
733
  require_once("front_end/bigcalendarweek_widget.php");
734
  require_once("front_end/bigcalendarlist_widget.php");
735
  require_once("front_end/bigcalendarday_widget.php");
 
736
  // Actions for popup and xmls.
737
  add_action('wp_ajax_spiderbigcalendar_day', 'big_calendar_day');
738
  add_action('wp_ajax_spiderbigcalendar_list', 'big_calendar_list');
757
  add_action('wp_ajax_nopriv_spidercalendarbig', 'spiderbigcalendar');
758
  add_action('wp_ajax_nopriv_spiderseemore', 'seemore');
759
  add_action('wp_ajax_nopriv_window', 'php_window');
 
 
760
  // Add style head.
761
+ function add_button_style_calendar () {
762
  echo '<script>var wdplugin_url = "' . plugins_url('', __FILE__) . '";</script>';
763
  }
 
764
 
765
+ add_action('admin_head', 'add_button_style_calendar');
766
+ function Manage_Spider_Calendar () {
767
  global $wpdb;
768
  if (!function_exists('print_html_nav')) {
769
  require_once("nav_function/nav_html_func.php");
772
  require_once("calendar_functions.html.php"); // add functions for vive Spider_Video_Player
773
  if (isset($_GET["task"])) {
774
  $task = esc_html($_GET["task"]);
775
+ } else {
 
776
  $task = "";
777
  }
778
  if (isset($_GET["id"])) {
779
+ $id = (int)$_GET["id"];
780
+ } else {
 
781
  $id = 0;
782
  }
783
  if (isset($_GET["calendar_id"])) {
784
+ $calendar_id = (int)$_GET["calendar_id"];
785
+ } else {
 
786
  $calendar_id = 0;
787
  }
788
  switch ($task) {
793
  add_spider_calendar();
794
  break;
795
  case 'published';
796
+ $nonce_sp_cal = $_REQUEST['_wpnonce'];
797
+ if (!wp_verify_nonce($nonce_sp_cal, 'nonce_sp_cal'))
798
+ die("Are you sure you want to do this?");
799
  spider_calendar_published($id);
800
  show_spider_calendar();
801
  break;
802
  case 'Save':
803
  if (!$id) {
804
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
805
  apply_spider_calendar(-1);
806
+ } else {
807
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
 
808
  apply_spider_calendar($id);
809
  }
810
  show_spider_calendar();
811
  break;
812
  case 'Apply':
813
  if (!$id) {
814
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
815
  apply_spider_calendar(-1);
816
  $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "spidercalendar_calendar");
817
+ } else {
818
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
 
819
  apply_spider_calendar($id);
820
  }
821
  edit_spider_calendar($id);
824
  edit_spider_calendar($id);
825
  break;
826
  case 'remove_calendar':
827
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
828
  remove_spider_calendar($id);
829
  show_spider_calendar();
830
  break;
837
  break;
838
  case 'save_event':
839
  if ($id) {
840
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
841
  apply_spider_event($calendar_id, $id);
842
+ } else {
843
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
 
844
  apply_spider_event($calendar_id, -1);
845
  }
846
  show_spider_event($calendar_id);
847
  break;
848
  case 'apply_event':
849
  if ($id) {
850
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
851
  apply_spider_event($calendar_id, $id);
852
+ } else {
853
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
 
854
  apply_spider_event($calendar_id, -1);
855
  $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "spidercalendar_event");
856
  }
860
  edit_spider_event($calendar_id, $id);
861
  break;
862
  case 'remove_event':
863
+ $nonce_sp_cal = $_REQUEST['_wpnonce'];
864
+ if (!wp_verify_nonce($nonce_sp_cal, 'nonce_sp_cal'))
865
+ die("Are you sure you want to do this?");
866
  remove_spider_event($calendar_id, $id);
867
  show_spider_event($calendar_id);
868
  break;
869
+ case 'copy_event':
870
+ $nonce_sp_cal = $_REQUEST['_wpnonce'];
871
+ if (!wp_verify_nonce($nonce_sp_cal, 'nonce_sp_cal'))
872
+ die("Are you sure you want to do this?");
873
  copy_spider_event($calendar_id, $id);
874
  show_spider_event($calendar_id);
875
  break;
876
  case 'published_event';
877
+ $nonce_sp_cal = $_REQUEST['_wpnonce'];
878
+ if (!wp_verify_nonce($nonce_sp_cal, 'nonce_sp_cal'))
879
+ die("Are you sure you want to do this?");
880
  published_spider_event($calendar_id, $id);
881
  show_spider_event($calendar_id);
882
  break;
886
  }
887
  }
888
 
889
+ function Manage_Spider_Category_Calendar () {
890
+ require_once("calendar_functions.html.php");
891
+ require_once("calendar_functions.php");
892
+ if (!function_exists('print_html_nav')) {
893
  require_once("nav_function/nav_html_func.php");
894
  }
895
+ global $wpdb;
 
896
  if (isset($_GET["task"])) {
897
  $task = esc_html($_GET["task"]);
898
+ } else {
 
899
  $task = "";
900
+ show_event_cat();
901
+
902
+ return;
903
  }
904
  if (isset($_GET["id"])) {
905
+ $id = (int)$_GET["id"];
906
+ } else {
 
907
  $id = 0;
908
  }
909
+ switch ($task) {
910
+ case 'add_category':
911
+ edit_event_category($id);
912
+ break;
913
+ case 'save_category_event':
914
+ if (!$id) {
915
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
916
  save_spider_category_event();
917
  $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "spidercalendar_event_category");
918
+ } else {
919
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
920
+ apply_spider_category_event($id);
921
  }
922
+ show_event_cat();
923
+ break;
924
+ case 'apply_event_category':
925
+ if (!$id) {
926
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
927
+ save_spider_category_event();
928
+ $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "spidercalendar_event_category");
929
+ } else {
930
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
931
  apply_spider_category_event($id);
932
  }
933
  edit_event_category($id);
934
+ break;
935
+ case 'edit_event_category':
936
+ //apply_spider_category_event();
937
+ edit_event_category($id);
938
+ break;
939
+ case 'remove_event_category':
940
+ check_admin_referer('nonce_sp_cal', 'nonce_sp_cal');
941
+ remove_category_event($id);
942
+ show_event_cat();
943
+ break;
944
+ case 'published':
945
+ $nonce_sp_cal = $_REQUEST['_wpnonce'];
946
+ if (!wp_verify_nonce($nonce_sp_cal, 'nonce_sp_cal'))
947
+ die("Are you sure you want to do this?");
948
+ spider_category_published($id);
949
+ show_event_cat();
950
+ break;
951
+ }
 
 
952
 
953
  }
954
 
955
+ function upcoming_widget () {
956
+ require_once("calendar_functions.html.php");
957
+ require_once("spidercalendar_upcoming_events_widget.php");
958
+ require_once("calendar_functions.php");
959
+ if (!function_exists('print_html_nav')) {
960
  require_once("nav_function/nav_html_func.php");
961
  }
962
+ global $wpdb;
 
 
963
  spider_upcoming();
964
  }
965
 
966
+ function spider_widget_calendar_params () {
967
  wp_enqueue_script('media-upload');
968
  wp_admin_css('thickbox');
969
  if (!function_exists('print_html_nav')) {
973
  global $wpdb;
974
  if (isset($_GET["task"])) {
975
  $task = esc_html($_GET["task"]);
976
+ } else {
 
977
  $task = "";
978
  }
979
  switch ($task) {
986
  }
987
 
988
  // Themes.
989
+ function spider_calendar_params () {
990
  wp_enqueue_script('media-upload');
991
  wp_admin_css('thickbox');
992
  if (!function_exists('print_html_nav')) {
996
  global $wpdb;
997
  if (isset($_GET["task"])) {
998
  $task = esc_html($_GET["task"]);
999
+ } else {
 
1000
  $task = "";
1001
  }
1002
  switch ($task) {
1008
  }
1009
  }
1010
 
1011
+ function Uninstall_sp_calendar () {
1012
+ global $wpdb, $sp_calendar_options;
1013
+ if (!class_exists("DoradoWebConfig")) {
1014
+ require_once("wd/config.php");
1015
  }
1016
  $config = new DoradoWebConfig();
1017
+ $config->set_options($sp_calendar_options);
1018
+ $deactivate_reasons = new DoradoWebDeactivate($config);
1019
+ $deactivate_reasons->submit_and_deactivate();
 
1020
  $base_name = plugin_basename('Spider_Calendar');
1021
  $base_page = 'admin.php?page=' . $base_name;
1022
+ $mode = (isset($_GET['mode']) ? trim($_GET['mode']) : '');
 
1023
  ?>
1024
+ <?php upgrade_pro_sp(); ?>
1025
+ <br/>
1026
+ <div class="goodbye-text">
1027
+ Before uninstalling the plugin, please Contact our
1028
+ <a href="https://web-dorado.com/support/contact-us.html?source=spidercalendar" target='_blank'>support team</a>.
1029
+ We'll do our best to help you out with your issue. We value each and every user and value what’s right for our users
1030
+ in everything we do.<br>
1031
+ However, if anyway you have made a decision to uninstall the plugin, please take a minute to
1032
+ <a href="https://web-dorado.com/support/contact-us.html?source=spidercalendar" target='_blank'>Contact us</a> and
1033
+ tell what you didn't like for our plugins further improvement and development. Thank you !!!
1034
+ </div>
1035
  <?php
1036
  if (!empty($_POST['do'])) {
1037
  if ($_POST['do'] == "UNINSTALL Spider Event Calendar") {
1038
  check_admin_referer('Spider_Calendar uninstall');
1039
+ echo '<form id="message" class="updated fade">';
1040
+ echo '<p>';
1041
+ echo "Table '" . $wpdb->prefix . "spidercalendar_event' has been deleted.";
1042
+ $wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_event");
1043
+ echo '<font style="color:#000;">';
1044
+ echo '</font><br />';
1045
+ echo '</p>';
1046
+ echo '<p>';
1047
+ echo "Table '" . $wpdb->prefix . "spidercalendar_event_category' has been deleted.";
1048
+ $wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_event_category");
1049
+ echo '<font style="color:#000;">';
1050
+ echo '</font><br />';
1051
+ echo '</p>';
1052
+ echo '<p>';
1053
+ echo "Table '" . $wpdb->prefix . "spidercalendar_calendar' has been deleted.";
1054
+ $wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_calendar");
1055
+ echo '<font style="color:#000;">';
1056
+ echo '</font><br />';
1057
+ echo '</p>';
1058
+ echo '<p>';
1059
+ echo "Table '" . $wpdb->prefix . "spidercalendar_theme' has been deleted.";
1060
+ $wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_theme");
1061
+ echo '<font style="color:#000;">';
1062
+ echo '</font><br />';
1063
+ echo '</p>';
1064
+ echo '<p>';
1065
+ echo "Table '" . $wpdb->prefix . "spidercalendar_widget_theme' has been deleted.";
1066
+ $wpdb->query("DROP TABLE " . $wpdb->prefix . "spidercalendar_widget_theme");
1067
+ echo '<font style="color:#000;">';
1068
+ echo '</font><br />';
1069
+ echo '</p>';
1070
+ echo '</form>';
1071
+ delete_option('sp_calendar_subscribe_done');
1072
+ $mode = 'end-UNINSTALL';
 
 
1073
  }
1074
  }
 
1075
  switch ($mode) {
1076
  case 'end-UNINSTALL':
1077
  echo '<div class="wrap">';
1082
  // Main Page
1083
  default:
1084
  ?>
1085
+ <form method="post" id="uninstall_form" action="<?php echo admin_url('admin.php?page=Uninstall_sp_calendar'); ?>">
1086
  <?php wp_nonce_field('Spider_Calendar uninstall'); ?>
1087
  <div class="wrap">
1088
  <div id="icon-Spider_Calendar" class="icon32"><br/></div>
1092
  </p>
1093
 
1094
  <p style="color: red">
1095
+ <strong><?php echo 'WARNING:'; ?></strong>
1096
  <?php echo 'Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.'; ?>
1097
  </p>
1098
 
1111
  <ol>
1112
  <?php
1113
  echo '<li>' . $wpdb->prefix . 'spidercalendar_event</li>' . "\n";
1114
+ echo '<li>' . $wpdb->prefix . 'spidercalendar_event_category</li>' . "\n";
1115
  echo '<li>' . $wpdb->prefix . 'spidercalendar_calendar</li>' . "\n";
1116
+ echo '<li>' . $wpdb->prefix . 'spidercalendar_theme</li>' . "\n";
1117
  echo '<li>' . $wpdb->prefix . 'spidercalendar_widget_theme</li>' . "\n";
1118
  ?>
1119
  </ol>
1120
  </td>
1121
  </tr>
1122
  </table>
1123
+ <script>
1124
+ function uninstall() {
1125
+ jQuery(document).ready(function () {
1126
+ if (jQuery('#uninstall_yes').is(':checked')) {
1127
+ var answer = confirm('<?php echo 'You Are About To Uninstall Spider Event Calendar From WordPress.\nThis Action Is Not Reversible.\n\n Choose [Cancel] To Stop, [OK] To Uninstall.'; ?>');
1128
+
1129
+ if (answer)
1130
+ jQuery("#uninstall_form").submit();
1131
+ }
1132
+ else
1133
+ alert('To uninstall please check the box above.');
1134
+
1135
+ });
1136
+ }
1137
+ </script>
1138
  <p style="text-align: center;">
1139
+ <?php echo 'Do you really want to uninstall Spider Event Calendar?'; ?><br/><br/>
1140
+ <input type="checkbox" value="yes" id="uninstall_yes"/>&nbsp;<?php echo 'Yes'; ?><br/><br/>
1141
+ <input type="hidden" name="do" value="UNINSTALL Spider Event Calendar"/>
1142
  <input type="button" name="DODO" value="<?php echo 'UNINSTALL Spider Event Calendar'; ?>"
1143
  class="button-primary"
1144
  onclick="uninstall()"/>
1146
  </div>
1147
  </form>
1148
  <?php
1149
+
1150
  }
1151
  }
1152
 
1153
  add_action('init', 'spider_calendar_export');
1154
+ function spider_calendar_export () {
1155
+ if (isset($_POST['export_spider_calendar']) && $_POST['export_spider_calendar'] == 'Export') {
1156
+ global $wpdb;
1157
+ $tmp_folder = get_temp_dir();
1158
+ $select_spider_categories = "SELECT * from " . $wpdb->prefix . "spidercalendar_event_category";
1159
+ $spider_cats = $wpdb->get_results($select_spider_categories);
1160
+ $cat_columns = array(
1161
+ array(
1162
+ 'id',
1163
+ 'title',
1164
+ 'published',
1165
+ 'color',
1166
+ 'description'
1167
+ )
1168
+ );
1169
+ if ($spider_cats) {
1170
+ foreach ($spider_cats as $cat) {
1171
+ $cat_columns[] = array(
1172
+ $cat->id,
1173
+ $cat->title,
1174
+ $cat->published,
1175
+ $cat->color,
1176
+ $cat->description
1177
  );
1178
+ }
1179
+ }
1180
+ $cat_handle = fopen($tmp_folder . '/sc_categories.csv', 'w+');
1181
+ foreach ($cat_columns as $ar) {
1182
+ if (fputcsv($cat_handle, $ar, ',') === false) {
1183
+ break;
1184
+ }
1185
+ }
1186
+ @fclose($cat_handle);
1187
+ $select_spider_calendars = "SELECT * from " . $wpdb->prefix . "spidercalendar_calendar";
1188
+ $spider_calendars = $wpdb->get_results($select_spider_calendars);
1189
+ $cal_columns = array(
1190
+ array(
1191
+ 'id',
1192
+ 'title',
1193
+ 'published'
1194
+ )
1195
+ );
1196
+ if ($spider_calendars) {
1197
+ foreach ($spider_calendars as $cal) {
1198
+ $cal_columns[] = array(
1199
+ $cal->id,
1200
+ $cal->title,
1201
+ $cal->published
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1202
  );
1203
+ }
1204
+ }
1205
+ $cal_handle = fopen($tmp_folder . '/sc_calendars.csv', 'w+');
1206
+ foreach ($cal_columns as $ar) {
1207
+ if (fputcsv($cal_handle, $ar, ',') === false) {
1208
+ break;
1209
+ }
1210
+ }
1211
+ @fclose($cal_handle);
1212
+ $select_spider_events = "SELECT * from " . $wpdb->prefix . "spidercalendar_event";
1213
+ $spider_events = $wpdb->get_results($select_spider_events);
1214
+ $events_columns = array(
1215
+ array(
1216
+ 'id',
1217
+ 'cal_id',
1218
+ 'start_date',
1219
+ 'end_date',
1220
+ 'title',
1221
+ 'cat_id',
1222
+ 'time',
1223
+ 'text_for_date',
1224
+ 'userID',
1225
+ 'repeat_method',
1226
+ 'repeat',
1227
+ 'week',
1228
+ 'month',
1229
+ 'month_type',
1230
+ 'monthly_list',
1231
+ 'month_week',
1232
+ 'year_month',
1233
+ 'published'
1234
+ )
1235
+ );
1236
+ if ($spider_events) {
1237
+ foreach ($spider_events as $ev) {
1238
+ $events_columns[] = array(
1239
+ $ev->id,
1240
+ $ev->calendar,
1241
+ $ev->date,
1242
+ $ev->date_end,
1243
+ $ev->title,
1244
+ $ev->category,
1245
+ $ev->time,
1246
+ $ev->text_for_date,
1247
+ $ev->userID,
1248
+ $ev->repeat_method,
1249
+ $ev->repeat,
1250
+ $ev->week,
1251
+ $ev->month,
1252
+ $ev->month_type,
1253
+ $ev->monthly_list,
1254
+ $ev->month_week,
1255
+ $ev->year_month,
1256
+ $ev->published
1257
  );
1258
+ }
1259
+ }
1260
+ $ev_handle = fopen($tmp_folder . '/sc_events.csv', 'w+');
1261
+ foreach ($events_columns as $ar) {
1262
+ if (fputcsv($ev_handle, $ar, ',') === false) {
1263
+ break;
1264
+ }
1265
+ }
1266
+ @fclose($ev_handle);
1267
+ $files = array(
1268
+ 'sc_categories.csv',
1269
+ 'sc_calendars.csv',
1270
+ 'sc_events.csv'
1271
+ );
1272
+ $zip = new ZipArchive();
1273
+ $tmp_file = tempnam('.', '');
1274
+ if ($zip->open($tmp_file, ZIPARCHIVE::CREATE) === true) {
1275
+ foreach ($files as $file) {
1276
+ if (file_exists($tmp_folder . $file)) {
1277
+ $zip->addFile($tmp_folder . $file, $file);
1278
  }
1279
+ }
1280
+ $zip->close();
1281
+ header("Content-type: application/zip; charset=utf-8");
1282
+ header("Content-Disposition: attachment; filename=spider-event-calendar-export.zip");
1283
+ header("Content-length: " . filesize($tmp_file));
1284
+ header("Pragma: no-cache");
1285
+ header("Expires: 0");
1286
+ readfile($tmp_file);
1287
+ }
1288
+ foreach ($files as $file) {
1289
+ @unlink($tmp_folder . $file);
1290
  }
1291
+ }
1292
  }
1293
 
1294
+ function upgrade_pro_sp ($text = false) {
1295
+ $page = isset($_GET["page"]) ? $_GET["page"] : "";
1296
+ ?>
1297
+ <div class="sp_calendar_upgrade wd-clear">
1298
+ <div class="sp-wd-left">
1299
+ <?php
1300
+ switch ($page) {
1301
+ case "SpiderCalendar":
1302
+ ?>
1303
+ <div style="font-size: 14px;">
1304
+ <?php _e("This section allows you to create calendars.", "sp_calendar"); ?>
1305
+ <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-calendar.html"><?php _e("Read More in User Manual.", "sp_calendar"); ?></a>
1306
+ </div>
1307
+ <?php
1308
+ break;
1309
+ case "spider_calendar_event_category":
1310
+ ?>
1311
+ <div style="font-size: 14px;">
1312
+ <?php _e("This section allows you to create event categories.", "sp_calendar"); ?>
1313
+ <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/adding-event-category.html"><?php _e("Read More in User Manual.", "sp_calendar"); ?></a>
1314
+ </div>
1315
+ <?php
1316
+ break;
1317
+ case "calendar_export":
1318
+ ?>
1319
+ <div style="font-size: 14px;">
1320
+ <?php _e("This section will allow exporting Spider Calendar data for further import to Event Calendar WD.", "sp_calendar"); ?>
1321
+ <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/products/wordpress-event-calendar-wd.html"><?php _e("Read More in User Manual.", "sp_calendar"); ?></a>
1322
+ </div>
1323
+ <?php
1324
+ break;
1325
+ case "Uninstall_sp_calendar":
1326
+ ?>
1327
+ <div style="font-size: 14px;">
1328
+ <div class="page-banner uninstall-banner">
1329
+ <div class="uninstall_icon">
1330
+ </div>
1331
+ <div class="logo-title">Uninstall Spider Calendar</div>
1332
+ </div>
1333
+ </div>
1334
+ <?php
1335
+ break;
1336
+ }
1337
+ ?>
1338
+ </div>
1339
+ <div class="sp-wd-right">
1340
+ <div class="wd-table">
1341
+ <div class="wd-cell wd-cell-valign-middle">
1342
+ <a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
1343
+ <img src="<?php echo plugins_url('images/i_support.png', __FILE__); ?>">
1344
+ <?php _e("Support Forum", "sp_calendar"); ?>
1345
+ </a>
1346
  </div>
1347
+ <div class="wd-cell wd-cell-valign-middle">
1348
+ <a href="https://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank">
1349
+ <?php _e("UPGRADE TO PAID VERSION", "sp_calendar"); ?>
1350
+ </a>
 
 
 
 
 
 
 
 
 
 
 
1351
  </div>
1352
+ </div>
1353
+
1354
  </div>
1355
+ </div>
1356
+ <?php if ($text) {
1357
  ?>
1358
+ <div class="wd-text-right wd-row" style="color: #15699F; font-size: 20px; margin-top:10px; padding:0px 15px;">
1359
+ <?php echo sprintf(__("This is FREE version, Customizing %s is available only in the PAID version.", "sp_calendar"), $text); ?>
1360
+ </div>
1361
  <?php
1362
+ }
1363
 
1364
  }
1365
 
1366
+ function calendar_export () {
1367
+ ?>
1368
+ <?php upgrade_pro_sp(); ?>
1369
+ <form method="post" style="font-size: 14px; font-weight: bold;">
1370
+ <input type='submit' value='Export' id="export_WD" name='export_spider_calendar'/>
1371
+ </form>
1372
+ <style>
1373
+ #export_div {
1374
+ background: #fff;
1375
+ border: 1px solid #e5e5e5;
1376
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
1377
+ box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
1378
+ border-spacing: 0;
1379
+ width: 65%;
1380
+ clear: both;
1381
+ margin: 0;
1382
+ padding: 7px 7px 8px 10px;
1383
+ margin: 20px 0 10px 0;
1384
+ }
 
 
 
 
 
 
 
 
1385
 
1386
+ #export_WD {
1387
+ font-size: 13px;
1388
+ padding: 7px 25px;
1389
+ }
1390
+ </style>
1391
+ <?php
1392
+ }
1393
 
1394
  add_filter("plugin_row_meta", 'spidercal_add_plugin_meta_links', 10, 2);
1395
+ function spidercal_add_plugin_meta_links ($meta_fields, $file) {
1396
 
1397
+ if (plugin_basename(__FILE__) == $file) {
 
 
1398
 
1399
  $meta_fields[] = "<a href='https://wordpress.org/support/plugin/spider-event-calendar/' target='_blank'>Support Forum</a>";
1400
  $meta_fields[] = "<a href='https://wordpress.org/support/plugin/spider-event-calendar/reviews#new-post' target='_blank' title='Rate'>
1401
+ <i class='spidercal-rate-stars'>" . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>" . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>" . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>" . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>" . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>" . "</i></a>";
 
 
 
 
 
 
 
1402
  $stars_color = "#ffb900";
1403
+ echo "<style>" . ".spidercal-rate-stars{display:inline-block;color:" . $stars_color . ";position:relative;top:3px;}" . ".spidercal-rate-stars svg{fill:" . $stars_color . ";}" . ".spidercal-rate-stars svg:hover{fill:" . $stars_color . "}" . ".spidercal-rate-stars svg:hover ~ svg{fill:none;}" . "</style>";
 
 
 
 
 
 
1404
  }
1405
 
1406
  return $meta_fields;
1407
  }
1408
 
1409
+ function spidercal_activate ($networkwide) {
1410
+ if (function_exists('is_multisite') && is_multisite()) {
1411
+ // Check if it is a network activation - if so, run the activation function for each blog id.
1412
+ if ($networkwide) {
1413
+ global $wpdb;
1414
+ // Get all blog ids.
1415
+ $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
1416
+ foreach ($blogids as $blog_id) {
1417
+ switch_to_blog($blog_id);
1418
+ SpiderCalendar_activate();
1419
+ restore_current_blog();
1420
+ }
1421
+
1422
+ return;
1423
+ }
1424
+ }
1425
+ SpiderCalendar_activate();
1426
  }
1427
 
1428
  // Activate plugin.
1429
+ function SpiderCalendar_activate () {
1430
  global $wpdb;
1431
+ $spider_event_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "spidercalendar_event` (
1432
  `id` int(11) NOT NULL AUTO_INCREMENT,
1433
  `calendar` int(11) NOT NULL,
1434
  `date` date NOT NULL,
1448
  `published` int(11) NOT NULL,
1449
  PRIMARY KEY (`id`)
1450
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
1451
+ $spider_calendar_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "spidercalendar_calendar` (
1452
  `id` int(11) NOT NULL AUTO_INCREMENT,
1453
  `title` varchar(255) NOT NULL,
1454
  `gid` varchar(255) NOT NULL,
1459
  `published` tinyint(1) NOT NULL,
1460
  PRIMARY KEY (`id`)
1461
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
1462
+ $spider_category_event_table = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "spidercalendar_event_category` (
1463
  `id` int(11) NOT NULL AUTO_INCREMENT,
1464
  `title` varchar(255) NOT NULL,
1465
  `published` tinyint(1) NOT NULL,
1473
  require_once "spider_calendar_update.php";
1474
  spider_calendar_chech_update();
1475
  }
 
1476
 
1477
+ register_activation_hook(__FILE__, 'spidercal_activate');
1478
  if (!function_exists('spcal_bp_install_notice')) {
1479
 
1480
+ if (get_option('wds_seo_notice_status') === '' || get_option('wds_seo_notice_status') === '1') {
1481
  return;
1482
  }
1483
+ function spcal_bp_script_style () {
1484
+ $screen = get_current_screen();
 
1485
  $screen_id = $screen->id;
1486
+ if ($screen_id != "toplevel_page_SpiderCalendar" && $screen_id != "calendar_page_spider_calendar_event_category" && $screen_id != "calendar_page_spider_calendar_themes" && $screen_id != "calendar_page_spider_widget_calendar_themes" && $screen_id != "calendar_page_calendar_export" && $screen_id != "calendar_page_Uninstall_sp_calendar" && $screen_id != "calendar_page_overview_sp_calendar" && $screen_id != "calendar_page_Spider_calendar_Licensing") {
1487
  return;
1488
  }
 
1489
  $spcal_bp_plugin_url = plugins_url('', __FILE__);
1490
  wp_enqueue_script('spcal_bck_install', $spcal_bp_plugin_url . '/js/wd_bp_install.js', array('jquery'));
1491
  wp_enqueue_style('spcal_bck_install', $spcal_bp_plugin_url . '/style_for_cal/wd_bp_install.css');
1492
  }
 
1493
 
1494
+ add_action('admin_enqueue_scripts', 'spcal_bp_script_style');
1495
  /**
1496
  * Show notice to install backup plugin
1497
  */
1498
+ function spcal_bp_install_notice () {
1499
+ $screen = get_current_screen();
1500
  $screen_id = $screen->id;
1501
+ if ($screen_id != "toplevel_page_SpiderCalendar" && $screen_id != "calendar_page_spider_calendar_event_category" && $screen_id != "calendar_page_spider_calendar_themes" && $screen_id != "calendar_page_spider_widget_calendar_themes" && $screen_id != "calendar_page_calendar_export" && $screen_id != "calendar_page_Uninstall_sp_calendar" && $screen_id != "calendar_page_overview_sp_calendar" && $screen_id != "calendar_page_Spider_calendar_Licensing") {
1502
  return;
1503
  }
 
1504
  $spcal_bp_plugin_url = plugins_url('', __FILE__);
1505
+ $prefix = 'sp';
1506
+ $meta_value = get_option('wd_seo_notice_status');
1507
  if ($meta_value === '' || $meta_value === false) {
1508
  ob_start();
1509
  ?>
1510
+ <div class="notice notice-info" id="wd_bp_notice_cont">
1511
+ <p>
1512
+ <img id="wd_bp_logo_notice" src="<?php echo $spcal_bp_plugin_url . '/images/seo_logo.png'; ?>">
1513
+ <?php _e("Spider Event Calendar advises:Optimize your web pages for search engines with the", $prefix) ?>
1514
+ <a href="https://wordpress.org/plugins/seo-by-10web/" title="<?php _e("More details", $prefix) ?>"
1515
+ target="_blank"><?php _e("FREE SEO", $prefix) ?></a>
1516
+ <?php _e("plugin.", $prefix) ?>
1517
+ <a class="button button-primary"
1518
+ href="<?php echo esc_url(wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=seo-by-10web'), 'install-plugin_seo-by-10web')); ?>">
1519
+ <span onclick="wd_bp_notice_install()"><?php _e("Install", $prefix); ?></span>
1520
+ </a>
1521
+ </p>
1522
+ <button type="button" class="wd_bp_notice_dissmiss notice-dismiss"><span class="screen-reader-text"></span>
1523
+ </button>
1524
+ </div>
1525
+ <script>spcal_bp_url = '<?php echo add_query_arg(array('action' => 'wd_seo_dismiss',), admin_url('admin-ajax.php')); ?>'</script>
1526
  <?php
1527
  echo ob_get_clean();
1528
  }
1531
  if (!is_dir(plugin_dir_path(dirname(__FILE__)) . 'seo-by-10web')) {
1532
  add_action('admin_notices', 'spcal_bp_install_notice');
1533
  }
 
1534
  /**
1535
  * Add usermeta to db
1536
  *
1537
  * empty: notice,
1538
  * 1 : never show again
1539
  */
1540
+ function spcal_bp_install_notice_status () {
1541
  update_option('wd_seo_notice_status', '1', 'no');
1542
  }
1543
+
1544
  add_action('wp_ajax_wd_seo_dismiss', 'spcal_bp_install_notice_status');
1545
  }
1546
  ?>
calendar_functions.html.php CHANGED
@@ -697,7 +697,7 @@ function show_event_category($rows, $pageNav, $sort){
697
  <td><h2>Event Category</h2></td>
698
  <td style="text-align:right;">
699
  <p class="submit" style="padding:0px; text-align:left">
700
- <input type="button" value="Add a Category" name="custom_parametrs" onClick="window.location.href='admin.php?page=spider_calendar_event_category&task=add_category'" class="wd-right"/>
701
  </p>
702
  </td>
703
  </tr>
@@ -1155,13 +1155,13 @@ function html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name)
1155
  }
1156
  </script>
1157
  <div class="sp_calendar_upgrade wd-clear" >
1158
- <div class="wd-left">
1159
  <div style="font-size: 14px;">
1160
  <?php _e("This section allows you to create/edit the events of a particular calendar.","sp_calendar");?>
1161
  <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
1162
  </div>
1163
  </div>
1164
- <div class="wd-right">
1165
  <div class="wd-table">
1166
  <div class="wd-cell wd-cell-valign-middle">
1167
  <a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
@@ -1573,13 +1573,13 @@ function html_add_spider_event($calendar_id, $cal_name) {
1573
  }
1574
  </style>
1575
  <div class="sp_calendar_upgrade wd-clear" >
1576
- <div class="wd-left">
1577
  <div style="font-size: 14px;">
1578
  <?php _e("This section allows you to create/edit the events of a particular calendar.","sp_calendar");?>
1579
  <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
1580
  </div>
1581
  </div>
1582
- <div class="wd-right">
1583
  <div class="wd-table">
1584
  <div class="wd-cell wd-cell-valign-middle">
1585
  <a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
@@ -2070,13 +2070,13 @@ function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
2070
  $query2 = $wpdb->get_results("SELECT title,id FROM " . $wpdb->prefix . "spidercalendar_event_category");
2071
  ?>
2072
  <div class="sp_calendar_upgrade wd-clear" >
2073
- <div class="wd-left">
2074
  <div style="font-size: 14px;">
2075
  <?php _e("This section allows you to create/edit the events of a particular calendar.","sp_calendar");?>
2076
  <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
2077
  </div>
2078
  </div>
2079
- <div class="wd-right">
2080
  <div class="wd-table">
2081
  <div class="wd-cell wd-cell-valign-middle">
2082
  <a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
697
  <td><h2>Event Category</h2></td>
698
  <td style="text-align:right;">
699
  <p class="submit" style="padding:0px; text-align:left">
700
+ <input type="button" value="Add a Category" name="custom_parametrs" onClick="window.location.href='admin.php?page=spider_calendar_event_category&task=add_category'" class="sp-wd-right"/>
701
  </p>
702
  </td>
703
  </tr>
1155
  }
1156
  </script>
1157
  <div class="sp_calendar_upgrade wd-clear" >
1158
+ <div class="sp-wd-left">
1159
  <div style="font-size: 14px;">
1160
  <?php _e("This section allows you to create/edit the events of a particular calendar.","sp_calendar");?>
1161
  <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
1162
  </div>
1163
  </div>
1164
+ <div class="sp-wd-right">
1165
  <div class="wd-table">
1166
  <div class="wd-cell wd-cell-valign-middle">
1167
  <a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
1573
  }
1574
  </style>
1575
  <div class="sp_calendar_upgrade wd-clear" >
1576
+ <div class="sp-wd-left">
1577
  <div style="font-size: 14px;">
1578
  <?php _e("This section allows you to create/edit the events of a particular calendar.","sp_calendar");?>
1579
  <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
1580
  </div>
1581
  </div>
1582
+ <div class="sp-wd-right">
1583
  <div class="wd-table">
1584
  <div class="wd-cell wd-cell-valign-middle">
1585
  <a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
2070
  $query2 = $wpdb->get_results("SELECT title,id FROM " . $wpdb->prefix . "spidercalendar_event_category");
2071
  ?>
2072
  <div class="sp_calendar_upgrade wd-clear" >
2073
+ <div class="sp-wd-left">
2074
  <div style="font-size: 14px;">
2075
  <?php _e("This section allows you to create/edit the events of a particular calendar.","sp_calendar");?>
2076
  <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
2077
  </div>
2078
  </div>
2079
+ <div class="sp-wd-right">
2080
  <div class="wd-table">
2081
  <div class="wd-cell wd-cell-valign-middle">
2082
  <a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
elements/calendar-jos.css CHANGED
@@ -310,10 +310,10 @@ div.calendar {
310
  .wd-text-center{
311
  text-align:center;
312
  }
313
- .wd-left{
314
  float:left;
315
  }
316
- .wd-right{
317
  float:right;
318
  }
319
  .wd-clear:after{
310
  .wd-text-center{
311
  text-align:center;
312
  }
313
+ .sp-wd-left{
314
  float:left;
315
  }
316
+ .sp-wd-right{
317
  float:right;
318
  }
319
  .wd-clear:after{
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: webdorado, wdsupport, 10web
3
  Tags: calendar, event, event calendar, events, events calendar, calendars, event manager, calendar widget, event management, free calendar, Calender, upcoming events
4
  Requires at least: 3.9
5
  Tested up to: 4.9
6
- Stable tag: 1.5.60
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -74,6 +74,10 @@ If you think you found a bug in the plugin or have any problem/question concerni
74
 
75
  == Changelog ==
76
 
 
 
 
 
77
  = 1.5.60 =
78
  Fixed: Events of the same day of the previous year were visible in popup
79
  Updated: Italian translation thanks to Marco Moniga
3
  Tags: calendar, event, event calendar, events, events calendar, calendars, event manager, calendar widget, event management, free calendar, Calender, upcoming events
4
  Requires at least: 3.9
5
  Tested up to: 4.9
6
+ Stable tag: 1.5.61
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
74
 
75
  == Changelog ==
76
 
77
+ = 1.5.61 =
78
+ Fixed: Faster loading of pages. Synchronous requests in calendar frontend are removed
79
+ Changed: PHP 7.2 compatibility, create_function is not used anymore
80
+
81
  = 1.5.60 =
82
  Fixed: Events of the same day of the previous year were visible in popup
83
  Updated: Italian translation thanks to Marco Moniga
spidercalendar_upcoming_events_widget.php CHANGED
@@ -2891,4 +2891,8 @@ jSelectEvents('<?php echo $this->get_field_id('event_select'); ?>','<?php echo $
2891
 
2892
 
2893
  }
2894
- add_action('widgets_init', create_function('', 'return register_widget("upcoming_events");'));?>
 
 
 
 
2891
 
2892
 
2893
  }
2894
+ function spider_calendar_upcoming_events(){
2895
+ return register_widget("upcoming_events");
2896
+ }
2897
+
2898
+ add_action('widgets_init', 'spider_calendar_upcoming_events'); ?>
widget_spider_calendar.php CHANGED
@@ -149,6 +149,9 @@ class spider_calendar extends WP_Widget {
149
  <?php
150
  }
151
  }
 
 
 
152
 
153
- add_action('widgets_init', create_function('', 'return register_widget("spider_calendar");'));
154
  ?>
149
  <?php
150
  }
151
  }
152
+ function spider_calendar_widget(){
153
+ return register_widget("spider_calendar");
154
+ }
155
 
156
+ add_action('widgets_init', 'spider_calendar_widget');
157
  ?>