Smooth Slider - Version 2.8

Version Description

If you have Smooth Slider 2.6 or plus, kindly update to 2.6.3 for proper height calcualtion for responsiveness.

= Before Upgrading =

  • Note the Title and Content fonts on your old Smooth Slider.
  • Go to 'Settings' panel and 'Save Changes'.
  • Recheck the Slider Title, Post Title and the Slider Content fonts on the Settings Panel.

Get older versions

Download this release

Release Info

Developer internet techies
Plugin Icon 128x128 Smooth Slider
Version 2.8
Comparing to
See all releases

Code changes from version 2.7.1 to 2.8

includes/smooth-slider-functions.php CHANGED
@@ -6,6 +6,66 @@ function ss_get_sliders(){
6
  $sliders = $wpdb->get_results($sql, ARRAY_A);
7
  return $sliders;
8
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  function get_slider_posts_in_order($slider_id) {
10
  global $wpdb, $table_prefix;
11
  $table_name = $table_prefix.SLIDER_TABLE;
@@ -153,5 +213,18 @@ function add_cf5_column_if_not_exist($table_name, $column_name, $create_ddl) {
153
  }
154
  return false;
155
  }
156
-
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  ?>
6
  $sliders = $wpdb->get_results($sql, ARRAY_A);
7
  return $sliders;
8
  }
9
+ function smooth_dateformat_PHP_to_jQueryUI($php_format)
10
+ {
11
+ $SYMBOLS_MATCHING = array(
12
+ // Day
13
+ 'd' => 'dd',
14
+ 'D' => 'D',
15
+ 'j' => 'd',
16
+ 'l' => 'DD',
17
+ 'N' => '',
18
+ 'S' => '',
19
+ 'w' => '',
20
+ 'z' => 'o',
21
+ // Week
22
+ 'W' => '',
23
+ // Month
24
+ 'F' => 'MM',
25
+ 'm' => 'mm',
26
+ 'M' => 'M',
27
+ 'n' => 'm',
28
+ 't' => '',
29
+ // Year
30
+ 'L' => '',
31
+ 'o' => '',
32
+ 'Y' => 'yy',
33
+ 'y' => 'y',
34
+ // Time
35
+ 'a' => '',
36
+ 'A' => '',
37
+ 'B' => '',
38
+ 'g' => '',
39
+ 'G' => '',
40
+ 'h' => '',
41
+ 'H' => '',
42
+ 'i' => '',
43
+ 's' => '',
44
+ 'u' => ''
45
+ );
46
+ $jqueryui_format = "";
47
+ $escaping = false;
48
+ for($i = 0; $i < strlen($php_format); $i++)
49
+ {
50
+ $char = $php_format[$i];
51
+ if($char === '\\') // PHP date format escaping character
52
+ {
53
+ $i++;
54
+ if($escaping) $jqueryui_format .= $php_format[$i];
55
+ else $jqueryui_format .= '\'' . $php_format[$i];
56
+ $escaping = true;
57
+ }
58
+ else
59
+ {
60
+ if($escaping) { $jqueryui_format .= "'"; $escaping = false; }
61
+ if(isset($SYMBOLS_MATCHING[$char]))
62
+ $jqueryui_format .= $SYMBOLS_MATCHING[$char];
63
+ else
64
+ $jqueryui_format .= $char;
65
+ }
66
+ }
67
+ return $jqueryui_format;
68
+ }
69
  function get_slider_posts_in_order($slider_id) {
70
  global $wpdb, $table_prefix;
71
  $table_name = $table_prefix.SLIDER_TABLE;
213
  }
214
  return false;
215
  }
216
+ add_action( 'wp_ajax_update_review_me', 'update_review_me' );
217
+ function update_review_me() {
218
+ $smooth_slider=array();
219
+ $smooth_slider = get_option('smooth_slider_options');
220
+ $reviewme=(isset($_POST['reviewme']))?($_POST['reviewme']):(strtotime("now"));
221
+ if($reviewme>0){
222
+ $updated_reviewme=$smooth_slider['reviewme']=strtotime("+1 week", $reviewme);
223
+ }
224
+ else{
225
+ $updated_reviewme=$smooth_slider['reviewme']=$reviewme;
226
+ }
227
+ update_option('smooth_slider_options',$smooth_slider);
228
+ die();
229
+ }
230
  ?>
js/admin.js CHANGED
@@ -1,5 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  jQuery(function () {
2
- jQuery('.moreInfo').each(function () {
3
  // options
4
  var distance = 10;
5
  var time = 250;
1
+ jQuery(document).ready(function(){
2
+ jQuery('#later').on("click", function(){
3
+ var r = jQuery('#smooth_reviewme').val();
4
+ var data = {};
5
+ data['reviewme'] = parseInt(r);
6
+ data['action'] = 'update_review_me';
7
+ jQuery.post(ajaxurl, data, function(response) {
8
+ if(response) {
9
+ alert(jQuery('#smooth_reviewme').val(response));
10
+ jQuery('#smooth_reviewme').val(response);
11
+ }
12
+ jQuery('#reviewme').remove();
13
+ });
14
+ });
15
+ jQuery('#already').on("click", function(){
16
+ var data = {};
17
+ data['reviewme'] = 0;
18
+ data['action'] = 'update_review_me';
19
+ jQuery.post(ajaxurl, data, function(response) {
20
+ if(response) {
21
+ jQuery('#smooth_reviewme').val(response);
22
+ }
23
+ jQuery('#reviewme').remove();
24
+ });
25
+ });
26
+ });
27
  jQuery(function () {
28
+ jQuery('.moreInfo').each(function () {
29
  // options
30
  var distance = 10;
31
  var time = 250;
readme.txt CHANGED
@@ -1,21 +1,21 @@
1
  === Smooth Slider ===
2
  Contributors: internet techies, slidervilla
3
- Tags: slider, slideshow, wordpress slider, content slider, posts slider,image slider, responsive slideshow, image Rotator, jquery slider, Photo Slider, nivo slider, slider plugin, javascript slider, coin slider, responsive slider, featured-content-slider, Horizontal slider, carousel slider, wp slider, vertical slider, best slider plugin, content slideshow, javascript slideshow, slideshow manager, slideshow plugin, image slideshow, jquery slideshow, wordpress slideshow, vertical slides, responsive, nivoslider, flex slider, coinslider, carousel, post, posts, plugin, slider widget, widget slider, widget slideshow, widget, widgets, seo, wordpress seo, media, page, slide, slides
4
  Donate link: http://www.clickonf5.org/go/smooth-slider/
 
5
  Requires at least: 3.0
6
- Tested up to: 4.3
7
- Stable tag: 2.7.1
8
  License: GPLv2 or later
9
 
10
- Most Popular Responsive WordPress Slider for Featured Content, Videos and Media Images
11
 
12
  == Description ==
13
 
14
- In less than 50 seconds, embed a recent posts, category specific or featured posts slider using Smooth Slider. It creates a dynamic slideshow/s for featured Posts, Pages, Media Images and Custom Post Types on a WordPress site. With live preview on admin panel, one can customize the slider before implementation. At SliderVilla - <a href="http://slidervilla.com/" rel="friend" title="Best WordPress Slider Store">Best WordPress Slider Store</a> , we develop only sliders and we know the requirements very well. Smooth Slider is a basic slider WordPress plugin but is capable of adding a nice carousel in no time. With shortcode, widgets and template tag, one can embed Smooth SLider anywhere in the site.
15
 
16
  = Features =
17
 
18
- * Responsive Design
19
  * Six transition effects ( Fade transition supported )
20
  * Custom Slider, Category Slider and Recent Posts Slider supported ( Template tags, Shortcode and Widget available )
21
  * Slider Preview in admin panel
@@ -152,6 +152,11 @@ Check the other FAQs on Smooth [Slider Documetation on SliderVilla](http://guide
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
155
  Version 2.7.1 (08/21/2015)
156
 
157
  1. Fix: Notice for WP_Widget constructor call
1
  === Smooth Slider ===
2
  Contributors: internet techies, slidervilla
 
3
  Donate link: http://www.clickonf5.org/go/smooth-slider/
4
+ Tags: best slider plugin, carousel, carousel slider, coin slider, content slider, content slideshow, custom video slider, flex slider, free video slider, free video slideshow, Horizontal slider, Image Rotator, image slider, image slideshow, javascript slider, javascript slideshow, jquery slider, jquery slideshow, Photo Slider, posts slider, responsive slider, responsive slideshow, sidebar, slide, slide show, slider, slider plugin, slider widget, slides, slideshow,slideshow manager, slideshow plugin, vertical slider, video slider, video slideshow,vimeo slideshow, vimeo slider, widget slider, widget slideshow, wordpress slider, wordpress slideshow, wp slider, youtube slider, youtube slideshow, post slider, fullscreen Slider, css3 slider, responsive image slider, banner slider, social slider, cycle slider, text slider, revolution slider, thumbnail slider, touch slider, sliders, parallax slider, coinslider, featured-content-slider, image, images, picture, pictures, picture slider, responsive, shortcode, widget, vertical slides, autoplay, auto, jquery, rotate, flexslider, gallery, photo gallery, javascript, rotator, wordpress picture slider, wordpress responsive slider, animation, best slider, fullwidth slider, mobile slider, swipe, layer, layer slider, product slider, mp3, video
5
  Requires at least: 3.0
6
+ Tested up to: 4.3.1
7
+ Stable tag: 2.8
8
  License: GPLv2 or later
9
 
10
+ Responsive WordPress Slider for Featured Content, Videos and Media Images
11
 
12
  == Description ==
13
 
14
+ In less than 50 seconds, embed a recent posts, category specific or featured posts slider using Smooth Slider WordPress plugin. It creates a dynamic slideshow/s of featured Posts, Pages, Media Images and Custom Post Types on a WordPress site. With live preview on admin panel, one can customize the slider before implementation. At SliderVilla - <a href="http://slidervilla.com/" rel="friend" title="Best WordPress Slider Store">Best WordPress Slider Store</a> , we develop only sliders of different needs and we know the requirements very well. Smooth Slider is a basic slider WordPress plugin but is capable of adding a nice carousel in no time. With shortcode, widgets and template tag, one can embed Smooth SLider anywhere in the site.
15
 
16
  = Features =
17
 
18
+ * Responsive Design and the slider works perfectly fine on mobile devices, tablets etc.
19
  * Six transition effects ( Fade transition supported )
20
  * Custom Slider, Category Slider and Recent Posts Slider supported ( Template tags, Shortcode and Widget available )
21
  * Slider Preview in admin panel
152
 
153
  == Changelog ==
154
 
155
+ Version 2.8 (10/13/2015)
156
+
157
+ 1. New � Slide Expiry Date can be added for each slide in Custom Slider thru Smooth Slider Metabox on Edit Post/Page/Slide
158
+ 2. Fix: UTF-8 characters appeared as question marks for Slider title and Category
159
+
160
  Version 2.7.1 (08/21/2015)
161
 
162
  1. Fix: Notice for WP_Widget constructor call
settings/settings.php CHANGED
@@ -755,8 +755,8 @@ $categories = get_categories();
755
  $scat_html='<option value="" selected >Select the Category</option>';
756
 
757
  foreach ($categories as $category) {
758
- if($category->slug==$smooth_slider['catg_slug']){$selected = 'selected';} else{$selected='';}
759
- $scat_html =$scat_html.'<option value="'.$category->slug.'" '.$selected.'>'. $category->name .'</option>';
760
  }
761
  //fetching slider names 2.6
762
  global $smooth_slider;
@@ -849,6 +849,7 @@ else
849
  <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
850
  </p>
851
  <input type="hidden" name="smooth_slider_options[active_tab]" id="smooth_activetab" value="<?php echo $smooth_slider['active_tab']; ?>" />
 
852
  <input type="hidden" name="smooth_slider_options[popup]" id="smoothpopup" value="<?php echo $smooth_slider['popup']; ?>" />
853
  <input type="hidden" name="hidden_preview" id="hidden_preview" value="<?php echo $smooth_slider['preview']; ?>" />
854
  <input type="hidden" name="hidden_category" id="hidden_category" value="<?php echo $smooth_slider['catg_slug']; ?>" />
@@ -899,6 +900,22 @@ if ($handle = opendir($directory)) {
899
  <input type="submit" value="Import" name="import" onclick="return confirmSettingsImport()" title="<?php _e('Import Settings from a file','smooth-slider'); ?>" class="button-primary" />
900
  </form>
901
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
902
  </div> <!--end of float left -->
903
  <!-- Added for validations - start -->
904
  <script type="text/javascript">
755
  $scat_html='<option value="" selected >Select the Category</option>';
756
 
757
  foreach ($categories as $category) {
758
+ if(urldecode($category->slug)==$smooth_slider['catg_slug']){$selected = 'selected';} else{$selected='';}
759
+ $scat_html =$scat_html.'<option value="'.urldecode($category->slug).'" '.$selected.'>'. $category->name .'</option>';
760
  }
761
  //fetching slider names 2.6
762
  global $smooth_slider;
849
  <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
850
  </p>
851
  <input type="hidden" name="smooth_slider_options[active_tab]" id="smooth_activetab" value="<?php echo $smooth_slider['active_tab']; ?>" />
852
+ <input type="hidden" name="smooth_slider_options[reviewme]" id="smooth_reviewme" value="<?php echo $smooth_slider['reviewme']; ?>" />
853
  <input type="hidden" name="smooth_slider_options[popup]" id="smoothpopup" value="<?php echo $smooth_slider['popup']; ?>" />
854
  <input type="hidden" name="hidden_preview" id="hidden_preview" value="<?php echo $smooth_slider['preview']; ?>" />
855
  <input type="hidden" name="hidden_category" id="hidden_category" value="<?php echo $smooth_slider['catg_slug']; ?>" />
900
  <input type="submit" value="Import" name="import" onclick="return confirmSettingsImport()" title="<?php _e('Import Settings from a file','smooth-slider'); ?>" class="button-primary" />
901
  </form>
902
  </div>
903
+
904
+ <?php
905
+ $now=strtotime("now");
906
+ $reviewme=$smooth_slider['reviewme'];
907
+ if($reviewme!=0 and $reviewme<$now) {
908
+ echo "<div id='reviewme' style='border:1px solid #ccc;padding:10px;background:#fff;margin-top:2%;float: left;width: 95%;'>
909
+ <p>".__('Hey, I noticed you have created an awesome slider using Smooth Slider and using it for more than a week. Could you please do me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation.', 'smooth-slider')."</p>
910
+ <p>".__("~ Tejaswini from SliderVilla","smooth-slider")."</p>
911
+ <ul><li><a href='https://wordpress.org/support/view/plugin-reviews/smooth-slider?filter=5' target='_blank' title='".__('Please review and rate Smooth Slider on WordPress.org', 'smooth-slider')."'>".__('Ok, you deserve it', 'smooth-slider')."</a></li>
912
+ <li><a id='later' href='#' title='".__('Rate Smooth Slider at some other time!', 'smooth-slider')."'>".__('Nope, maybe later', 'smooth-slider')."</a></li>
913
+ <li><a id='already' href='#' title='".__('Click this if you have already rated us 5-star!', 'smooth-slider')."'>".__('I already did', 'smooth-slider'). "</a></li></ul></div>";
914
+ }
915
+ ?>
916
+
917
+
918
+
919
  </div> <!--end of float left -->
920
  <!-- Added for validations - start -->
921
  <script type="text/javascript">
settings/sliders.php CHANGED
@@ -293,13 +293,31 @@ wp_enqueue_script( 'media-uploader', smooth_slider_plugin_url( 'js/media-uploade
293
  <input type="submit" value="<?php _e('Rename','smooth-slider'); ?>" name="<?php _e('rename_slider','smooth-slider'); ?>" />
294
 
295
  <input type="hidden" name="active_tab" class="smooth_activetab" value="0" />
 
296
 
297
  </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  <!-- Added for rename slider -end -->
299
  </div>
300
 
301
  <?php } ?>
302
 
 
 
303
  <?php if(isset($smooth_slider['multiple_sliders']) && $smooth_slider['multiple_sliders'] == '1') {?>
304
  <div id="new_slider" style="width:56%;">
305
  <form action="" method="post" onsubmit="return slider_checkform(this);" >
293
  <input type="submit" value="<?php _e('Rename','smooth-slider'); ?>" name="<?php _e('rename_slider','smooth-slider'); ?>" />
294
 
295
  <input type="hidden" name="active_tab" class="smooth_activetab" value="0" />
296
+ <input type="hidden" name="smooth_slider_options[reviewme]" id="smooth_reviewme" value="<?php echo $smooth_slider['reviewme']; ?>" />
297
 
298
  </form>
299
+
300
+
301
+ <?php
302
+ $now=strtotime("now");
303
+ $reviewme=$smooth_slider['reviewme'];
304
+ if($reviewme!=0 and $reviewme<$now) {
305
+ echo "<div id='reviewme' style='border:1px solid #ccc;padding:10px;background:#fff;margin-top:2%;float: left;width: 95%;'>
306
+ <p>".__('Hey, I noticed you have created an awesome slider using Smooth Slider and using it for more than a week. Could you please do me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation.', 'smooth-slider')."</p>
307
+ <p>".__("~ Tejaswini from SliderVilla","smooth-slider")."</p>
308
+ <ul><li><a href='https://wordpress.org/support/view/plugin-reviews/smooth-slider?filter=5' target='_blank' title='".__('Please review and rate Smooth Slider on WordPress.org', 'smooth-slider')."'>".__('Ok, you deserve it', 'smooth-slider')."</a></li>
309
+ <li><a id='later' href='#' title='".__('Rate Smooth Slider at some other time!', 'smooth-slider')."'>".__('Nope, maybe later', 'smooth-slider')."</a></li>
310
+ <li><a id='already' href='#' title='".__('Click this if you have already rated us 5-star!', 'smooth-slider')."'>".__('I already did', 'smooth-slider'). "</a></li></ul></div>";
311
+ }
312
+ ?>
313
+
314
  <!-- Added for rename slider -end -->
315
  </div>
316
 
317
  <?php } ?>
318
 
319
+
320
+
321
  <?php if(isset($smooth_slider['multiple_sliders']) && $smooth_slider['multiple_sliders'] == '1') {?>
322
  <div id="new_slider" style="width:56%;">
323
  <form action="" method="post" onsubmit="return slider_checkform(this);" >
slider_versions/smooth_1.php CHANGED
@@ -69,7 +69,7 @@ function get_global_smooth_slider($slider_handle,$r_array,$smooth_slider, $set='
69
  }
70
  //Basic Smooth Slider
71
  function carousel_posts_on_slider($max_posts, $offset=0, $slider_id = '1',$out_echo = '1', $set='', $data=array() ) {
72
- global $smooth_slider,$default_slider;
73
  foreach($default_slider as $key=>$value){
74
  if(!isset($smooth_slider[$key])) $smooth_slider[$key]='';
75
  }
@@ -86,7 +86,7 @@ function carousel_posts_on_slider($max_posts, $offset=0, $slider_id = '1',$out_e
86
  $posts = $wpdb->get_results("SELECT b.* FROM
87
  $table_name a LEFT OUTER JOIN $post_table b
88
  ON a.post_id = b.ID
89
- WHERE (b.post_status = 'publish' OR (b.post_type='attachment' AND b.post_status = 'inherit')) AND a.slider_id = '$slider_id' ORDER BY ".$orderby." LIMIT $offset, $max_posts", OBJECT);
90
 
91
  $r_array=smooth_global_posts_processor( $posts, $smooth_slider, $out_echo, $set, $data );
92
  return $r_array;
69
  }
70
  //Basic Smooth Slider
71
  function carousel_posts_on_slider($max_posts, $offset=0, $slider_id = '1',$out_echo = '1', $set='', $data=array() ) {
72
+ global $smooth_slider,$default_slider,$wpdb;
73
  foreach($default_slider as $key=>$value){
74
  if(!isset($smooth_slider[$key])) $smooth_slider[$key]='';
75
  }
86
  $posts = $wpdb->get_results("SELECT b.* FROM
87
  $table_name a LEFT OUTER JOIN $post_table b
88
  ON a.post_id = b.ID
89
+ WHERE (b.post_status = 'publish' OR (b.post_type='attachment' AND b.post_status = 'inherit')) AND a.slider_id = '$slider_id' AND (a.expiry IS NULL OR DATE(a.expiry) >= DATE(NOW()) ) ORDER BY ".$orderby." LIMIT $offset, $max_posts", OBJECT);
90
 
91
  $r_array=smooth_global_posts_processor( $posts, $smooth_slider, $out_echo, $set, $data );
92
  return $r_array;
smooth-slider.php CHANGED
@@ -3,8 +3,9 @@
3
  Plugin Name: Smooth Slider
4
  Plugin URI: http://slidervilla.com/smooth-slider/
5
  Description: Smooth slider adds a responsive featured content on image slider using shortcode, widget and template tags. Create and embed featured content slider, recent post slider, category slider in less than 60 seconds.
6
- Version: 2.7.1
7
  Author: SliderVilla
 
8
  Author URI: http://slidervilla.com/
9
  Wordpress version supported: 2.9 and above
10
  */
@@ -30,12 +31,12 @@ Wordpress version supported: 2.9 and above
30
  //defined global variables and constants here
31
  global $smooth_slider,$default_slider,$smooth_db_version,$default_smooth_slider_settings;
32
  $smooth_slider = get_option('smooth_slider_options');
33
- $smooth_db_version='2.7.1'; //current version of smooth slider database
34
  define('SLIDER_TABLE','smooth_slider'); //Slider TABLE NAME
35
  define('PREV_SLIDER_TABLE','slider'); //Slider TABLE NAME
36
  define('SLIDER_META','smooth_slider_meta'); //Meta TABLE NAME
37
  define('SLIDER_POST_META','smooth_slider_postmeta'); //Meta TABLE NAME
38
- define("SMOOTH_SLIDER_VER","2.7.1",false);//Current Version of Smooth Slider
39
  if ( ! defined( 'SMOOTH_SLIDER_PLUGIN_BASENAME' ) )
40
  define( 'SMOOTH_SLIDER_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
41
  if ( ! defined( 'SMOOTH_SLIDER_CSS_DIR' ) ){
@@ -104,7 +105,8 @@ $default_smooth_slider_settings=$default_slider = array('speed'=>'7',
104
  'catg_slug'=>'',
105
  'popup'=>'1',
106
  'readmorecolor'=>'#0092E4',
107
- 'noscript'=>''
 
108
  );
109
  // Create Text Domain For Translations
110
  load_plugin_textdomain('smooth-slider', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
@@ -147,12 +149,19 @@ function install_smooth_slider() {
147
  }
148
  }
149
  add_cf5_column_if_not_exist($table_name, 'slide_order', "ALTER TABLE ".$table_name." ADD slide_order int(5) NOT NULL DEFAULT '0';");
 
 
 
 
 
 
 
150
 
151
  $meta_table_name = $table_prefix.SLIDER_META;
152
  if($wpdb->get_var("show tables like '$meta_table_name'") != $meta_table_name) {
153
  $sql = "CREATE TABLE $meta_table_name (
154
  slider_id int(5) NOT NULL AUTO_INCREMENT,
155
- slider_name varchar(100) NOT NULL default '',
156
  UNIQUE KEY slider_id(slider_id)
157
  );";
158
  $rs2 = $wpdb->query($sql);
@@ -167,7 +176,12 @@ function install_smooth_slider() {
167
  )
168
  );
169
  }
170
-
 
 
 
 
 
171
  $slider_postmeta = $table_prefix.SLIDER_POST_META;
172
  if($wpdb->get_var("show tables like '$slider_postmeta'") != $slider_postmeta) {
173
  $sql = "CREATE TABLE $slider_postmeta (
@@ -265,14 +279,14 @@ global $smooth_slider;
265
  if(is_post_on_any_slider($post_id)){
266
  $wpdb->delete( $table_name, array( 'post_id' => $post_id ), array( '%d' ) );
267
  }
268
-
269
  if(isset($_POST['slider']) and $_POST['slider'] == "slider" and !slider($post_id,$slider_id)) {
270
- $dt = date('Y-m-d H:i:s');
271
  $wpdb->query(
272
  $wpdb->prepare(
273
  "INSERT INTO $table_name
274
  (post_id, date, slider_id)
275
- VALUES ( %d, %s, %d )",
276
  $post_id,
277
  $dt,
278
  $slider_id
@@ -280,6 +294,21 @@ global $smooth_slider;
280
  );
281
  }
282
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  if(isset($_POST['slider']) and $_POST['slider'] == "slider" and isset($_POST['slider_name'])){
284
  $slider_id_arr = $_POST['slider_name'];
285
  $post_sliders_data = ss_get_post_sliders($post_id);
@@ -344,6 +373,12 @@ global $smooth_slider;
344
  update_post_meta($post_id, 'slide_redirect_url', $link);
345
  }
346
 
 
 
 
 
 
 
347
  $sslider_nolink = get_post_meta($post_id,'sslider_nolink',true);
348
  $post_sslider_nolink = isset($_POST['sslider_nolink'])?$_POST['sslider_nolink']:'';
349
  if($sslider_nolink != $post_sslider_nolink) {
@@ -471,16 +506,25 @@ function add_to_slider_checkbox() {
471
  }
472
 
473
  $sliders = ss_get_sliders();
 
474
  $sslider_link= get_post_meta($post_id, 'slide_redirect_url', true);
475
  $sslider_nolink=get_post_meta($post_id, 'sslider_nolink', true);
476
  $thumbnail_key = $smooth_slider['img_pick'][1];
477
  $sslider_thumbnail= get_post_meta($post_id, $thumbnail_key, true);
478
  $sslider_disable_image=get_post_meta($post_id, '_disable_image', true);
479
  $smooth_embed_shortcode=get_post_meta($post_id, '_smooth_embed_shortcode', true);
 
 
 
 
 
480
  ?>
481
  <?php /* start tab 2.6 */ ?>
482
  <script type="text/javascript">
483
  jQuery(document).ready(function($) {
 
 
 
484
  jQuery("#smooth_basic").css({"background":"#222222","color":"#ffffff"});
485
  jQuery("#smooth_basic").on("click", function(){
486
  jQuery("#smooth_basic_tab").fadeIn("fast");
@@ -561,6 +605,12 @@ function add_to_slider_checkbox() {
561
  <th scope="row"><label for="sslider_thumbnail"><?php _e('Custom Thumbnail Image(url)','smooth-slider'); ?></label></th>
562
  <td><input type="text" name="sslider_thumbnail" class="sslider_thumbnail" value="<?php echo $sslider_thumbnail;?>" size="50" />
563
  </td></tr>
 
 
 
 
 
 
564
  <tr valign="top">
565
  <th scope="row"><label for="disable_image"><?php _e('Disable Thumbnail Image','smooth-slider'); ?> </label></th>
566
  <td><input type="checkbox" name="disable_image" value="1" <?php if($sslider_disable_image=='1'){echo "checked";}?> /> </td>
@@ -647,7 +697,6 @@ function sslider_plugin_action_links( $links, $file ) {
647
 
648
  return $links;
649
  }
650
-
651
  require_once (dirname (__FILE__) . '/slider_versions/smooth_1.php');
652
  require_once (dirname (__FILE__) . '/settings/settings.php');
653
  require_once (dirname (__FILE__) . '/includes/media-images.php');
3
  Plugin Name: Smooth Slider
4
  Plugin URI: http://slidervilla.com/smooth-slider/
5
  Description: Smooth slider adds a responsive featured content on image slider using shortcode, widget and template tags. Create and embed featured content slider, recent post slider, category slider in less than 60 seconds.
6
+ Version: 2.8
7
  Author: SliderVilla
8
+ Text Domain: smooth-slider
9
  Author URI: http://slidervilla.com/
10
  Wordpress version supported: 2.9 and above
11
  */
31
  //defined global variables and constants here
32
  global $smooth_slider,$default_slider,$smooth_db_version,$default_smooth_slider_settings;
33
  $smooth_slider = get_option('smooth_slider_options');
34
+ $smooth_db_version='2.8'; //current version of smooth slider database
35
  define('SLIDER_TABLE','smooth_slider'); //Slider TABLE NAME
36
  define('PREV_SLIDER_TABLE','slider'); //Slider TABLE NAME
37
  define('SLIDER_META','smooth_slider_meta'); //Meta TABLE NAME
38
  define('SLIDER_POST_META','smooth_slider_postmeta'); //Meta TABLE NAME
39
+ define("SMOOTH_SLIDER_VER","2.8",false);//Current Version of Smooth Slider
40
  if ( ! defined( 'SMOOTH_SLIDER_PLUGIN_BASENAME' ) )
41
  define( 'SMOOTH_SLIDER_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
42
  if ( ! defined( 'SMOOTH_SLIDER_CSS_DIR' ) ){
105
  'catg_slug'=>'',
106
  'popup'=>'1',
107
  'readmorecolor'=>'#0092E4',
108
+ 'noscript'=>'',
109
+ 'reviewme'=>strtotime("+1 week")
110
  );
111
  // Create Text Domain For Translations
112
  load_plugin_textdomain('smooth-slider', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
149
  }
150
  }
151
  add_cf5_column_if_not_exist($table_name, 'slide_order', "ALTER TABLE ".$table_name." ADD slide_order int(5) NOT NULL DEFAULT '0';");
152
+ if($wpdb->get_var("SHOW COLUMNS FROM $table_name LIKE 'expiry'") != 'expiry') {
153
+ $sql = "ALTER TABLE $table_name
154
+ ADD COLUMN expiry DATE DEFAULT NULL";
155
+ $rs1 = $wpdb->query($sql);
156
+ }
157
+ //add_cf5_column_if_not_exist($table_name, 'expiry', "ALTER TABLE ".$table_name." ADD expiry datetime NOT NULL DEFAULT 'NULL';");
158
+
159
 
160
  $meta_table_name = $table_prefix.SLIDER_META;
161
  if($wpdb->get_var("show tables like '$meta_table_name'") != $meta_table_name) {
162
  $sql = "CREATE TABLE $meta_table_name (
163
  slider_id int(5) NOT NULL AUTO_INCREMENT,
164
+ slider_name varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '',
165
  UNIQUE KEY slider_id(slider_id)
166
  );";
167
  $rs2 = $wpdb->query($sql);
176
  )
177
  );
178
  }
179
+ else{
180
+ if($installed_ver<'2.8'){
181
+ $sql = "ALTER TABLE $meta_table_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci";
182
+ $rs3 = $wpdb->query($sql);
183
+ }
184
+ }
185
  $slider_postmeta = $table_prefix.SLIDER_POST_META;
186
  if($wpdb->get_var("show tables like '$slider_postmeta'") != $slider_postmeta) {
187
  $sql = "CREATE TABLE $slider_postmeta (
279
  if(is_post_on_any_slider($post_id)){
280
  $wpdb->delete( $table_name, array( 'post_id' => $post_id ), array( '%d' ) );
281
  }
282
+ $expiry=get_post_meta($post_id,'_sslider_expiry',true);
283
  if(isset($_POST['slider']) and $_POST['slider'] == "slider" and !slider($post_id,$slider_id)) {
284
+ $dt = date('Y-m-d H:i:s');
285
  $wpdb->query(
286
  $wpdb->prepare(
287
  "INSERT INTO $table_name
288
  (post_id, date, slider_id)
289
+ VALUES ( %d, %s, %d, )",
290
  $post_id,
291
  $dt,
292
  $slider_id
294
  );
295
  }
296
  }
297
+ if(isset($_POST['sslider_expiry']) ) {
298
+ if(!empty($_POST['sslider_expiry'])){
299
+ $date=$_POST['sslider_expiry'];
300
+ $dt = date("Y-m-d",strtotime($date));
301
+ $wpdb->update($table_name, array('expiry' => $dt), array('post_id' => $post_id), array('%s'), array('%s'));
302
+ update_post_meta($post_id, '_sslider_expiry', $dt);
303
+ }
304
+ else {
305
+ //$wpdb->update($table_name, array('expiry' => NULL), array('post_id' => $post_id), array('%s'), array('%s'));
306
+ $sql = "UPDATE $table_name SET expiry = NULL WHERE post_id ='$post_id'";
307
+ $wpdb->query($sql);
308
+ update_post_meta($post_id, '_sslider_expiry', '');
309
+ }
310
+
311
+ }
312
  if(isset($_POST['slider']) and $_POST['slider'] == "slider" and isset($_POST['slider_name'])){
313
  $slider_id_arr = $_POST['slider_name'];
314
  $post_sliders_data = ss_get_post_sliders($post_id);
373
  update_post_meta($post_id, 'slide_redirect_url', $link);
374
  }
375
 
376
+ $sslider_expiry = get_post_meta($post_id,'sslider_expiry',true);
377
+ $post_sslider_expiry = isset($_POST['sslider_expiry'])?$_POST['sslider_expiry']:'';
378
+ if($sslider_expiry != $post_sslider_expiry) {
379
+ update_post_meta($post_id, '_sslider_expiry', $post_sslider_expiry);
380
+ }
381
+
382
  $sslider_nolink = get_post_meta($post_id,'sslider_nolink',true);
383
  $post_sslider_nolink = isset($_POST['sslider_nolink'])?$_POST['sslider_nolink']:'';
384
  if($sslider_nolink != $post_sslider_nolink) {
506
  }
507
 
508
  $sliders = ss_get_sliders();
509
+ $wpDateFormat = get_option('date_format');
510
  $sslider_link= get_post_meta($post_id, 'slide_redirect_url', true);
511
  $sslider_nolink=get_post_meta($post_id, 'sslider_nolink', true);
512
  $thumbnail_key = $smooth_slider['img_pick'][1];
513
  $sslider_thumbnail= get_post_meta($post_id, $thumbnail_key, true);
514
  $sslider_disable_image=get_post_meta($post_id, '_disable_image', true);
515
  $smooth_embed_shortcode=get_post_meta($post_id, '_smooth_embed_shortcode', true);
516
+ $sslider_expiry=get_post_meta($post_id, '_sslider_expiry', true);
517
+ //wp_enqueue_style( 'smooth-meta-box', smooth_slider_plugin_url( 'css/css/smooth-metabox.css' ), false, SMOOTH_SLIDER_VER, 'all');
518
+ wp_enqueue_script( 'jquery-ui-datepicker', false,array('jquery','jQuery-ui-core'),SMOOTH_SLIDER_VER, true);
519
+ wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
520
+ $dtpicker = smooth_dateformat_PHP_to_jQueryUI($wpDateFormat);
521
  ?>
522
  <?php /* start tab 2.6 */ ?>
523
  <script type="text/javascript">
524
  jQuery(document).ready(function($) {
525
+ jQuery('#smooth_ExpiryDate').datepicker({
526
+ dateFormat : '<?php echo $dtpicker ?>'
527
+ });
528
  jQuery("#smooth_basic").css({"background":"#222222","color":"#ffffff"});
529
  jQuery("#smooth_basic").on("click", function(){
530
  jQuery("#smooth_basic_tab").fadeIn("fast");
605
  <th scope="row"><label for="sslider_thumbnail"><?php _e('Custom Thumbnail Image(url)','smooth-slider'); ?></label></th>
606
  <td><input type="text" name="sslider_thumbnail" class="sslider_thumbnail" value="<?php echo $sslider_thumbnail;?>" size="50" />
607
  </td></tr>
608
+
609
+ <tr valign="top">
610
+ <th scope="row"><label for="sslider_expiry"><?php _e('Expiry Date','smooth-slider'); ?></label></th>
611
+ <td><input type="text" name="sslider_expiry" id="smooth_ExpiryDate" class="sslider_expiry" value="<?php echo $sslider_expiry;?>" size="20" />
612
+ </td></tr>
613
+
614
  <tr valign="top">
615
  <th scope="row"><label for="disable_image"><?php _e('Disable Thumbnail Image','smooth-slider'); ?> </label></th>
616
  <td><input type="checkbox" name="disable_image" value="1" <?php if($sslider_disable_image=='1'){echo "checked";}?> /> </td>
697
 
698
  return $links;
699
  }
 
700
  require_once (dirname (__FILE__) . '/slider_versions/smooth_1.php');
701
  require_once (dirname (__FILE__) . '/settings/settings.php');
702
  require_once (dirname (__FILE__) . '/includes/media-images.php');