Slider by WD – Responsive Slider - Version 1.1.60

Version Description

  • Added: Two way slideshow. Slideshow can go backwards if someone switch to a previous slide.
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Slider by WD – Responsive Slider
Version 1.1.60
Comparing to
See all releases

Code changes from version 1.1.59 to 1.1.60

admin/controllers/WDSControllerSliders_wds.php CHANGED
@@ -219,6 +219,7 @@ class WDSControllerSliders_wds {
219
  $possib_add_ffamily_google = ((isset($params_array['possib_add_ffamily_google'])) ? esc_html(stripslashes($params_array['possib_add_ffamily_google'])) : '');
220
  $slider_loop = ((isset($params_array['slider_loop'])) ? (int) esc_html(stripslashes($params_array['slider_loop'])) : 1);
221
  $hide_on_mobile = ((isset($params_array['hide_on_mobile'])) ? (int) esc_html(stripslashes($params_array['hide_on_mobile'])) : 0);
 
222
  $data = array(
223
  'name' => $name,
224
  'published' => $published,
@@ -332,6 +333,7 @@ class WDSControllerSliders_wds {
332
  'possib_add_ffamily_google' => $possib_add_ffamily_google,
333
  'slider_loop' => $slider_loop,
334
  'hide_on_mobile' => $hide_on_mobile,
 
335
  );
336
 
337
  if (!$slider_id) {
@@ -477,6 +479,7 @@ class WDSControllerSliders_wds {
477
  $layer_callback_list = ((isset($params_array_layer['layer_callback_list'])) ? esc_html(stripslashes($params_array_layer['layer_callback_list'])) : '');
478
  $hover_color_text = ((isset($params_array_layer['hover_color_text'])) ? esc_html(stripslashes($params_array_layer['hover_color_text'])) : '');
479
  $text_alignment = ((isset($params_array_layer['text_alignment'])) ? esc_html(stripslashes($params_array_layer['text_alignment'])) : 'center');
 
480
  if ($title) {
481
  if (strpos($layer_id, 'pr_') !== FALSE) {
482
  $save = $wpdb->insert($wpdb->prefix . 'wdslayer', array(
@@ -532,6 +535,7 @@ class WDSControllerSliders_wds {
532
  'hotspot_text_display' => 0,
533
  'hover_color_text' => $hover_color_text,
534
  'text_alignment' => $text_alignment,
 
535
  ));
536
  }
537
  else {
@@ -583,6 +587,7 @@ class WDSControllerSliders_wds {
583
  'layer_callback_list' => $layer_callback_list,
584
  'hover_color_text' => $hover_color_text,
585
  'text_alignment' => $text_alignment,
 
586
  ), array('id' => $layer_id));
587
  }
588
  }
@@ -840,6 +845,7 @@ class WDSControllerSliders_wds {
840
  'show_thumbnail' => $slider_row->show_thumbnail,
841
  'thumb_size' => $slider_row->thumb_size,
842
  'hide_on_mobile' => $slider_row->hide_on_mobile,
 
843
  ));
844
  $new_slider_id = $wpdb->get_var('SELECT MAX(id) FROM ' . $wpdb->prefix . 'wdsslider');
845
 
@@ -917,6 +923,7 @@ class WDSControllerSliders_wds {
917
  'hotspot_text_display' => $layer_id->hotspot_text_display,
918
  'hover_color_text' => $layer_id->hover_color_text,
919
  'text_alignment' => $layer_id->text_alignment,
 
920
  ));
921
  }
922
  }
219
  $possib_add_ffamily_google = ((isset($params_array['possib_add_ffamily_google'])) ? esc_html(stripslashes($params_array['possib_add_ffamily_google'])) : '');
220
  $slider_loop = ((isset($params_array['slider_loop'])) ? (int) esc_html(stripslashes($params_array['slider_loop'])) : 1);
221
  $hide_on_mobile = ((isset($params_array['hide_on_mobile'])) ? (int) esc_html(stripslashes($params_array['hide_on_mobile'])) : 0);
222
+ $twoway_slideshow = ((isset($params_array['twoway_slideshow'])) ? (int) esc_html(stripslashes($params_array['twoway_slideshow'])) : 0);
223
  $data = array(
224
  'name' => $name,
225
  'published' => $published,
333
  'possib_add_ffamily_google' => $possib_add_ffamily_google,
334
  'slider_loop' => $slider_loop,
335
  'hide_on_mobile' => $hide_on_mobile,
336
+ 'twoway_slideshow' => $twoway_slideshow,
337
  );
338
 
339
  if (!$slider_id) {
479
  $layer_callback_list = ((isset($params_array_layer['layer_callback_list'])) ? esc_html(stripslashes($params_array_layer['layer_callback_list'])) : '');
480
  $hover_color_text = ((isset($params_array_layer['hover_color_text'])) ? esc_html(stripslashes($params_array_layer['hover_color_text'])) : '');
481
  $text_alignment = ((isset($params_array_layer['text_alignment'])) ? esc_html(stripslashes($params_array_layer['text_alignment'])) : 'center');
482
+ $link_to_slide = ((isset($params_array_layer['link_to_slide'])) ? (int) esc_html(stripslashes($params_array_layer['link_to_slide'])) : 0);
483
  if ($title) {
484
  if (strpos($layer_id, 'pr_') !== FALSE) {
485
  $save = $wpdb->insert($wpdb->prefix . 'wdslayer', array(
535
  'hotspot_text_display' => 0,
536
  'hover_color_text' => $hover_color_text,
537
  'text_alignment' => $text_alignment,
538
+ 'link_to_slide' => $link_to_slide,
539
  ));
540
  }
541
  else {
587
  'layer_callback_list' => $layer_callback_list,
588
  'hover_color_text' => $hover_color_text,
589
  'text_alignment' => $text_alignment,
590
+ 'link_to_slide' => $link_to_slide,
591
  ), array('id' => $layer_id));
592
  }
593
  }
845
  'show_thumbnail' => $slider_row->show_thumbnail,
846
  'thumb_size' => $slider_row->thumb_size,
847
  'hide_on_mobile' => $slider_row->hide_on_mobile,
848
+ 'twoway_slideshow' => $slider_row->twoway_slideshow,
849
  ));
850
  $new_slider_id = $wpdb->get_var('SELECT MAX(id) FROM ' . $wpdb->prefix . 'wdsslider');
851
 
923
  'hotspot_text_display' => $layer_id->hotspot_text_display,
924
  'hover_color_text' => $layer_id->hover_color_text,
925
  'text_alignment' => $layer_id->text_alignment,
926
+ 'link_to_slide' => $layer_id->link_to_slide,
927
  ));
928
  }
929
  }
admin/models/WDSModelSliders_wds.php CHANGED
@@ -234,6 +234,7 @@ class WDSModelSliders_wds {
234
  $row->possib_add_ffamily_google = '';
235
  $row->slider_loop = 1;
236
  $row->hide_on_mobile = 0;
 
237
  }
238
  return $row;
239
  }
234
  $row->possib_add_ffamily_google = '';
235
  $row->slider_loop = 1;
236
  $row->hide_on_mobile = 0;
237
+ $row->twoway_slideshow = 0;
238
  }
239
  return $row;
240
  }
admin/views/WDSViewSliders_wds.php CHANGED
@@ -800,6 +800,14 @@ class WDSViewSliders_wds {
800
  <div class="spider_description">Choose whether to autoplay the sliders or not.</div>
801
  </td>
802
  </tr>
 
 
 
 
 
 
 
 
803
  <tr>
804
  <td class="spider_label"><label>Enable loop: </label></td>
805
  <td>
@@ -1064,8 +1072,7 @@ class WDSViewSliders_wds {
1064
  <div class="spider_description"></div>
1065
  </td>
1066
  </tr>
1067
- <tr>
1068
- <tr>
1069
  <td class="spider_label_options">
1070
  <label>Mouse wheel navigation: </label>
1071
  </td>
@@ -1075,7 +1082,7 @@ class WDSViewSliders_wds {
1075
  <div class="spider_description"></div>
1076
  </td>
1077
  </tr>
1078
- <tr>
1079
  <td class="spider_label_options">
1080
  <label>Keyboard navigation: </label>
1081
  </td>
800
  <div class="spider_description">Choose whether to autoplay the sliders or not.</div>
801
  </td>
802
  </tr>
803
+ <tr>
804
+ <td class="spider_label"><label>Two way slideshow: </label></td>
805
+ <td>
806
+ <input type="radio" id="twoway_slideshow1" name="twoway_slideshow" <?php echo (($row->twoway_slideshow) ? 'checked="checked"' : ''); ?> value="1" /><label <?php echo (($row->twoway_slideshow) ? 'class="selected_color"' : ''); ?> for="twoway_slideshow1">Yes</label>
807
+ <input type="radio" id="twoway_slideshow0" name="twoway_slideshow" <?php echo (($row->twoway_slideshow) ? '' : 'checked="checked"'); ?> value="0" /><label <?php echo (($row->twoway_slideshow) ? '' : 'class="selected_color"'); ?> for="twoway_slideshow0">No</label>
808
+ <div class="spider_description">Slideshow can go backwards if someone switch to a previous slide.</div>
809
+ </td>
810
+ </tr>
811
  <tr>
812
  <td class="spider_label"><label>Enable loop: </label></td>
813
  <td>
1072
  <div class="spider_description"></div>
1073
  </td>
1074
  </tr>
1075
+ <tr>
 
1076
  <td class="spider_label_options">
1077
  <label>Mouse wheel navigation: </label>
1078
  </td>
1082
  <div class="spider_description"></div>
1083
  </td>
1084
  </tr>
1085
+ <tr>
1086
  <td class="spider_label_options">
1087
  <label>Keyboard navigation: </label>
1088
  </td>
frontend/views/WDSViewSlider.php CHANGED
@@ -154,7 +154,7 @@ class WDSViewSlider {
154
  $smart_crop = isset($slider_row->smart_crop) ? $slider_row->smart_crop : 0;
155
  $crop_image_position = isset($slider_row->crop_image_position) ? $slider_row->crop_image_position : 'center center';
156
  $slider_loop = isset($slider_row->slider_loop) ? $slider_row->slider_loop : 1;
157
-
158
  $current_image_url = '';
159
  $hide_on_mobile = (isset($slider_row->hide_on_mobile) ? $slider_row->hide_on_mobile : 0);
160
  ?>
@@ -777,6 +777,7 @@ class WDSViewSlider {
777
  ?>
778
  </style>
779
  <script>
 
780
  var wds_data_<?php echo $wds; ?> = [];
781
  var wds_event_stack_<?php echo $wds; ?> = [];
782
  var wds_clear_layers_effects_in_<?php echo $wds; ?> = [];
@@ -1077,8 +1078,8 @@ class WDSViewSlider {
1077
  </div>
1078
  </div>
1079
  </div>
1080
-
1081
  <script>
 
1082
  var wds_trans_in_progress_<?php echo $wds; ?> = false;
1083
  var wds_transition_duration_<?php echo $wds; ?> = <?php echo $slider_row->effect_duration; ?>;
1084
  if (<?php echo $slideshow_interval; ?> < 4) {
@@ -1418,6 +1419,11 @@ class WDSViewSlider {
1418
  if (<?php echo $enable_slideshow_shuffle; ?>) {
1419
  iterator = Math.floor((wds_data_<?php echo $wds; ?>.length - 1) * Math.random() + 1);
1420
  }
 
 
 
 
 
1421
  return iterator;
1422
  }
1423
  function wds_change_image_<?php echo $wds; ?>(current_key, key, wds_data_<?php echo $wds; ?>, from_effect, btn) {
@@ -1508,6 +1514,16 @@ class WDSViewSlider {
1508
  else {
1509
  direction = btn;
1510
  }
 
 
 
 
 
 
 
 
 
 
1511
  /* Set active thumbnail position.*/
1512
  wds_current_filmstrip_pos_<?php echo $wds; ?> = key * (jQuery(".wds_slideshow_filmstrip_thumbnail_<?php echo $wds; ?>").<?php echo $width_or_height; ?>() + 2 + 2 * 0);
1513
  wds_current_key_<?php echo $wds; ?> = key;
@@ -2251,10 +2267,17 @@ class WDSViewSlider {
2251
  }
2252
  }
2253
  var iterator = 1;
2254
- if (<?php echo $enable_slideshow_shuffle; ?>) {
2255
- iterator = Math.floor((wds_data_<?php echo $wds; ?>.length - 1) * Math.random() + 1);
2256
- }
2257
- wds_change_image_<?php echo $wds; ?>(parseInt(jQuery('#wds_current_image_key_<?php echo $wds; ?>').val()), (parseInt(jQuery('#wds_current_image_key_<?php echo $wds; ?>').val()) + iterator) % wds_data_<?php echo $wds; ?>.length, wds_data_<?php echo $wds; ?>);
 
 
 
 
 
 
 
2258
  }, parseInt('<?php echo ($slideshow_interval * 1000); ?>') + wds_duration_for_change_<?php echo $wds; ?>);
2259
  }
2260
  jQuery(window).focus(function() {
154
  $smart_crop = isset($slider_row->smart_crop) ? $slider_row->smart_crop : 0;
155
  $crop_image_position = isset($slider_row->crop_image_position) ? $slider_row->crop_image_position : 'center center';
156
  $slider_loop = isset($slider_row->slider_loop) ? $slider_row->slider_loop : 1;
157
+ $twoway_slideshow = isset($slider_row->twoway_slideshow) ? (int) $slider_row->twoway_slideshow : 0;
158
  $current_image_url = '';
159
  $hide_on_mobile = (isset($slider_row->hide_on_mobile) ? $slider_row->hide_on_mobile : 0);
160
  ?>
777
  ?>
778
  </style>
779
  <script>
780
+ var wds_global_btn_<?php echo $wds; ?> = "right";
781
  var wds_data_<?php echo $wds; ?> = [];
782
  var wds_event_stack_<?php echo $wds; ?> = [];
783
  var wds_clear_layers_effects_in_<?php echo $wds; ?> = [];
1078
  </div>
1079
  </div>
1080
  </div>
 
1081
  <script>
1082
+ var wds_global_btn_<?php echo $wds; ?> = "right";
1083
  var wds_trans_in_progress_<?php echo $wds; ?> = false;
1084
  var wds_transition_duration_<?php echo $wds; ?> = <?php echo $slider_row->effect_duration; ?>;
1085
  if (<?php echo $slideshow_interval; ?> < 4) {
1419
  if (<?php echo $enable_slideshow_shuffle; ?>) {
1420
  iterator = Math.floor((wds_data_<?php echo $wds; ?>.length - 1) * Math.random() + 1);
1421
  }
1422
+ else if (<?php echo $twoway_slideshow; ?>) {
1423
+ if (wds_global_btn_<?php echo $wds; ?> == "left") {
1424
+ iterator = -1;
1425
+ }
1426
+ }
1427
  return iterator;
1428
  }
1429
  function wds_change_image_<?php echo $wds; ?>(current_key, key, wds_data_<?php echo $wds; ?>, from_effect, btn) {
1514
  else {
1515
  direction = btn;
1516
  }
1517
+ if (<?php echo $enable_slideshow_autoplay; ?>) {
1518
+ if (<?php echo $twoway_slideshow; ?>) {
1519
+ if (direction == "left") {
1520
+ wds_global_btn_<?php echo $wds; ?> = "left";
1521
+ }
1522
+ else if (direction == "right") {
1523
+ wds_global_btn_<?php echo $wds; ?> = "right";
1524
+ }
1525
+ }
1526
+ }
1527
  /* Set active thumbnail position.*/
1528
  wds_current_filmstrip_pos_<?php echo $wds; ?> = key * (jQuery(".wds_slideshow_filmstrip_thumbnail_<?php echo $wds; ?>").<?php echo $width_or_height; ?>() + 2 + 2 * 0);
1529
  wds_current_key_<?php echo $wds; ?> = key;
2267
  }
2268
  }
2269
  var iterator = 1;
2270
+ var img_index = (parseInt(jQuery('#wds_current_image_key_<?php echo $wds; ?>').val()) + iterator) % wds_data_<?php echo $wds; ?>.length;
2271
+ if (<?php echo $enable_slideshow_shuffle; ?>) {
2272
+ iterator = Math.floor((wds_data_<?php echo $wds; ?>.length - 1) * Math.random() + 1);
2273
+ }
2274
+ else if (<?php echo $twoway_slideshow; ?>) {
2275
+ if (wds_global_btn_<?php echo $wds; ?> == "left") {
2276
+ iterator = -1;
2277
+ img_index = (parseInt(jQuery('#wds_current_image_key_<?php echo $wds; ?>').val()) + iterator) >= 0 ? (parseInt(jQuery('#wds_current_image_key_<?php echo $wds; ?>').val()) + iterator) % wds_data_<?php echo $wds; ?>.length : wds_data_<?php echo $wds; ?>.length - 1;
2278
+ }
2279
+ }
2280
+ wds_change_image_<?php echo $wds; ?>(parseInt(jQuery('#wds_current_image_key_<?php echo $wds; ?>').val()), img_index, wds_data_<?php echo $wds; ?>);
2281
  }, parseInt('<?php echo ($slideshow_interval * 1000); ?>') + wds_duration_for_change_<?php echo $wds; ?>);
2282
  }
2283
  jQuery(window).focus(function() {
js/wds.js CHANGED
@@ -56,6 +56,7 @@ function spider_ajax_save(form_id, event) {
56
  slider_data["carousel_transparency"] = jQuery("#carousel_transparency").val();
57
  slider_data["slider_loop"] = jQuery("input[name=slider_loop]:checked").val();
58
  slider_data["hide_on_mobile"] = jQuery("#hide_on_mobile").val();
 
59
 
60
  /* Navigation.*/
61
  slider_data["prev_next_butt"] = jQuery("input[name=prev_next_butt]:checked").val();
56
  slider_data["carousel_transparency"] = jQuery("#carousel_transparency").val();
57
  slider_data["slider_loop"] = jQuery("input[name=slider_loop]:checked").val();
58
  slider_data["hide_on_mobile"] = jQuery("#hide_on_mobile").val();
59
+ slider_data["twoway_slideshow"] = jQuery("input[name=twoway_slideshow]:checked").val();
60
 
61
  /* Navigation.*/
62
  slider_data["prev_next_butt"] = jQuery("input[name=prev_next_butt]:checked").val();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-slider-plugin.html
4
  Tags: image slider, slider, slideshow, image, images, responsive, shortcode, widget, jquery, gallery, swipe, layer
5
  Requires at least: 3.4
6
  Tested up to: 4.6
7
- Stable tag: 1.1.59
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -125,6 +125,9 @@ After downloading the ZIP file of the slider plugin,
125
 
126
  == Changelog ==
127
 
 
 
 
128
  = 1.1.59 =
129
  * Changed: UploadHandler class name to prevent conflict with some themes.
130
  * Fixed: Layer styles conflict with some themes.
4
  Tags: image slider, slider, slideshow, image, images, responsive, shortcode, widget, jquery, gallery, swipe, layer
5
  Requires at least: 3.4
6
  Tested up to: 4.6
7
+ Stable tag: 1.1.60
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
125
 
126
  == Changelog ==
127
 
128
+ = 1.1.60 =
129
+ * Added: Two way slideshow. Slideshow can go backwards if someone switch to a previous slide.
130
+
131
  = 1.1.59 =
132
  * Changed: UploadHandler class name to prevent conflict with some themes.
133
  * Fixed: Layer styles conflict with some themes.
slider-wd.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Slider WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-slider-plugin.html
6
  * Description: This is a responsive plugin, which allows adding sliders to your posts/pages and to custom location. It uses large number of transition effects and supports various types of layers.
7
- * Version: 1.1.59
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -14,7 +14,7 @@ define('WD_S_NAME', plugin_basename(dirname(__FILE__)));
14
  define('WD_S_DIR', WP_PLUGIN_DIR . "/" . WD_S_NAME);
15
  define('WD_S_URL', plugins_url(WD_S_NAME));
16
 
17
- define('WD_S_VERSION', '1.1.59');
18
 
19
  function wds_use_home_url() {
20
  $home_url = str_replace("http://", "", home_url());
4
  * Plugin Name: Slider WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-slider-plugin.html
6
  * Description: This is a responsive plugin, which allows adding sliders to your posts/pages and to custom location. It uses large number of transition effects and supports various types of layers.
7
+ * Version: 1.1.60
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
14
  define('WD_S_DIR', WP_PLUGIN_DIR . "/" . WD_S_NAME);
15
  define('WD_S_URL', plugins_url(WD_S_NAME));
16
 
17
+ define('WD_S_VERSION', '1.1.60');
18
 
19
  function wds_use_home_url() {
20
  $home_url = str_replace("http://", "", home_url());
sliders-insert.php CHANGED
@@ -116,6 +116,7 @@ function wds_insert() {
116
  `possib_add_ffamily_google` varchar(255) NOT NULL,
117
  `slider_loop` tinyint(1) NOT NULL,
118
  `hide_on_mobile` int(4) NOT NULL,
 
119
  PRIMARY KEY (`id`)
120
  ) DEFAULT CHARSET=utf8;";
121
  $wpdb->query($wdsslider);
116
  `possib_add_ffamily_google` varchar(255) NOT NULL,
117
  `slider_loop` tinyint(1) NOT NULL,
118
  `hide_on_mobile` int(4) NOT NULL,
119
+ `twoway_slideshow` tinyint(1) NOT NULL,
120
  PRIMARY KEY (`id`)
121
  ) DEFAULT CHARSET=utf8;";
122
  $wpdb->query($wdsslider);
sliders-update.php CHANGED
@@ -151,7 +151,10 @@ function wds_update($version) {
151
  $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "wdslayer` CHANGE `layer_effect_out` `layer_effect_out` varchar(32)");
152
  }
153
  if (version_compare($version, '1.1.58') == -1) {
154
- $wpdb->query("ALTER TABLE " . $wpdb->prefix . "wdslayer ADD `link_to_slide` int(4) NOT NULL DEFAULT 0");
 
 
 
155
  }
156
  return;
157
  }
151
  $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "wdslayer` CHANGE `layer_effect_out` `layer_effect_out` varchar(32)");
152
  }
153
  if (version_compare($version, '1.1.58') == -1) {
154
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "wdslayer ADD `link_to_slide` int(4) NOT NULL DEFAULT 0");
155
+ }
156
+ if (version_compare($version, '1.1.60') == -1) {
157
+ $wpdb->query("ALTER TABLE " . $wpdb->prefix . "wdsslider ADD `twoway_slideshow` tinyint(1) NOT NULL DEFAULT 0");
158
  }
159
  return;
160
  }