Slideshow Gallery - Version 1.4.1

Version Description

  • ADD: Set opacity for information bar per slide
  • ADD: Setting per slide to show title/description or not
  • IMPROVE: Updated TimThumb script
  • IMPROVE: Updated WordPress plugin file header
  • IMPROVE: Function call_user_method() is deprecated
  • IMPROVE: New spinner/loading image
  • FIX: More PHP warnings/notices
  • FIX: 404 Not Found on spinner/loading image
Download this release

Release Info

Developer contrid
Plugin Icon 128x128 Slideshow Gallery
Version 1.4.1
Comparing to
See all releases

Code changes from version 1.4 to 1.4.1

css/admin.css CHANGED
@@ -63,27 +63,6 @@ a.colorbox img.slideshow {
63
  -moz-box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
64
  }
65
 
66
- /*.galleryhelp {
67
- display: inline-block;
68
- margin: 2px 0 0 5px;
69
- vertical-align: top;
70
- -moz-border-radius: 10px;
71
- -webkit-border-radius: 10px;
72
- border-radius: 10px;
73
- z-index: 26;
74
- background-color: #444444;
75
- }
76
-
77
- .galleryhelp a {
78
- display: block;
79
- padding: 0 5px;
80
- color: white;
81
- text-decoration: none;
82
- font-weight: bold;
83
- font-size: 10px;
84
- line-height: 15px;
85
- }*/
86
-
87
  .galleryhelp a,
88
  .galleryhelp a:hover,
89
  .galleryhelp a:active {
63
  -moz-box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
64
  }
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  .galleryhelp a,
67
  .galleryhelp a:hover,
68
  .galleryhelp a:active {
helpers/db.php CHANGED
@@ -259,7 +259,7 @@ class GalleryDbHelper extends GalleryPlugin {
259
  if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
260
  $value = serialize($this -> data -> {$field});
261
  } else {
262
- $value = mysql_escape_string($this -> data -> {$field});
263
  }
264
 
265
  $query1 .= "`" . $field . "`";
@@ -305,7 +305,7 @@ class GalleryDbHelper extends GalleryPlugin {
305
  if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
306
  $value = serialize($this -> data -> {$field});
307
  } else {
308
- $value = mysql_escape_string($this -> data -> {$field});
309
  }
310
 
311
  $query .= "`" . $field . "` = '" . $value . "'";
259
  if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
260
  $value = serialize($this -> data -> {$field});
261
  } else {
262
+ $value = mysql_real_escape_string($this -> data -> {$field});
263
  }
264
 
265
  $query1 .= "`" . $field . "`";
305
  if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
306
  $value = serialize($this -> data -> {$field});
307
  } else {
308
+ $value = mysql_real_escape_string($this -> data -> {$field});
309
  }
310
 
311
  $query .= "`" . $field . "` = '" . $value . "'";
helpers/html.php CHANGED
@@ -19,7 +19,7 @@ class GalleryHtmlHelper extends GalleryPlugin {
19
  }
20
  }
21
 
22
- function uploads_path() {
23
  if ($upload_dir = wp_upload_dir()) {
24
  return str_replace("\\", "/", $upload_dir['basedir']);
25
  }
@@ -258,7 +258,7 @@ class GalleryHtmlHelper extends GalleryPlugin {
258
  return false;
259
  }
260
 
261
- function gen_date($format = "Y-m-d H:i:s", $time = false) {
262
  $time = (empty($time)) ? time() : $time;
263
  $date = date($format, $time);
264
 
19
  }
20
  }
21
 
22
+ public static function uploads_path() {
23
  if ($upload_dir = wp_upload_dir()) {
24
  return str_replace("\\", "/", $upload_dir['basedir']);
25
  }
258
  return false;
259
  }
260
 
261
+ public static function gen_date($format = "Y-m-d H:i:s", $time = false) {
262
  $time = (empty($time)) ? time() : $time;
263
  $date = date($format, $time);
264
 
images/spinner.gif ADDED
Binary file
js/gallery.js CHANGED
@@ -34,8 +34,9 @@ TINY.slideshow.prototype={
34
 
35
  for(i;i<this.l;i++){
36
  this.a[i]={};
37
- var h=m[i], a=this.a[i];
38
  a.t= tag('h3',h)[0].innerHTML;
 
39
  a.d= tag('p',h)[0].innerHTML;
40
  a.l= tag('a',h)[0]? tag('a',h)[0].href:'';
41
  a.tg = tag('a',h)[0] != '' ? tag('a',h)[0].target:'_self';
@@ -81,8 +82,8 @@ TINY.slideshow.prototype={
81
  this.c=t;
82
  this.is(t,c)
83
  },
84
- is:function(s,c){
85
- if(this.info){
86
  TINY.height.set(this.r,1,this.infoSpeed/2,-1)
87
  }
88
  var i=new Image();
@@ -137,13 +138,19 @@ TINY.slideshow.prototype={
137
  },
138
  nf:function(s){
139
  if(this.info){
140
- s=this.a[s];
 
 
141
  tag('h3',this.r)[0].innerHTML=s.t;
142
  tag('p',this.r)[0].innerHTML=s.d;
143
  this.r.style.height='auto';
144
  var h=parseInt(this.r.offsetHeight);
145
  this.r.style.height=0;
146
- TINY.height.set(this.r,h,this.infoSpeed,0)
 
 
 
 
147
  }
148
  }
149
  };
34
 
35
  for(i;i<this.l;i++){
36
  this.a[i]={};
37
+ var h=m[i], a=this.a[i];
38
  a.t= tag('h3',h)[0].innerHTML;
39
+ a.io = tag('h3',h)[0].style.opacity;
40
  a.d= tag('p',h)[0].innerHTML;
41
  a.l= tag('a',h)[0]? tag('a',h)[0].href:'';
42
  a.tg = tag('a',h)[0] != '' ? tag('a',h)[0].target:'_self';
82
  this.c=t;
83
  this.is(t,c)
84
  },
85
+ is:function(s,c){
86
+ if(this.info && this.a[s].t.length > 0){
87
  TINY.height.set(this.r,1,this.infoSpeed/2,-1)
88
  }
89
  var i=new Image();
138
  },
139
  nf:function(s){
140
  if(this.info){
141
+ console.log(this.a[s]);
142
+
143
+ s=this.a[s];
144
  tag('h3',this.r)[0].innerHTML=s.t;
145
  tag('p',this.r)[0].innerHTML=s.d;
146
  this.r.style.height='auto';
147
  var h=parseInt(this.r.offsetHeight);
148
  this.r.style.height=0;
149
+
150
+ if (s.t.length > 0) {
151
+ TINY.height.set(this.r,h,this.infoSpeed,0);
152
+ TINY.alpha.set(this.r,s.io,5);
153
+ }
154
  }
155
  }
156
  };
models/slide.php CHANGED
@@ -14,6 +14,8 @@ class GallerySlide extends GalleryDbHelper {
14
  'id' => "INT(11) NOT NULL AUTO_INCREMENT",
15
  'title' => "VARCHAR(150) NOT NULL DEFAULT ''",
16
  'description' => "TEXT NOT NULL",
 
 
17
  'image' => "VARCHAR(50) NOT NULL DEFAULT ''",
18
  'type' => "ENUM('file','url') NOT NULL DEFAULT 'file'",
19
  'image_url' => "VARCHAR(200) NOT NULL DEFAULT ''",
@@ -83,6 +85,8 @@ class GallerySlide extends GalleryDbHelper {
83
  extract($data, EXTR_SKIP);
84
 
85
  if (empty($title)) { $this -> errors['title'] = __('Please fill in a title', $this -> plugin_name); }
 
 
86
  if (empty($type)) { $this -> errors['type'] = __('Please select an image type', $this -> plugin_name); }
87
  elseif ($type == "file") {
88
  if (!empty($image_oldfile) && empty($_FILES['image_file']['name'])) {
14
  'id' => "INT(11) NOT NULL AUTO_INCREMENT",
15
  'title' => "VARCHAR(150) NOT NULL DEFAULT ''",
16
  'description' => "TEXT NOT NULL",
17
+ 'showtd' => "INT(11) NOT NULL DEFAULT '1'",
18
+ 'iopacity' => "INT(11) NOT NULL DEFAULT '70'",
19
  'image' => "VARCHAR(50) NOT NULL DEFAULT ''",
20
  'type' => "ENUM('file','url') NOT NULL DEFAULT 'file'",
21
  'image_url' => "VARCHAR(200) NOT NULL DEFAULT ''",
85
  extract($data, EXTR_SKIP);
86
 
87
  if (empty($title)) { $this -> errors['title'] = __('Please fill in a title', $this -> plugin_name); }
88
+ if (empty($showtd)) { $this -> data -> showtd = 0; }
89
+
90
  if (empty($type)) { $this -> errors['type'] = __('Please select an image type', $this -> plugin_name); }
91
  elseif ($type == "file") {
92
  if (!empty($image_oldfile) && empty($_FILES['image_file']['name'])) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://tribulant.com/
4
  Tags: wordpress plugins, wordpress slideshow gallery, slides, slideshow, image gallery, images, gallery, featured content, content gallery, javascript, javascript slideshow, slideshow gallery
5
  Requires at least: 3.1
6
  Tested up to: 3.9
7
- Stable tag: 1.4
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
@@ -93,7 +93,7 @@ Installing the WordPress slideshow gallery plugin is very easy. Simply follow th
93
 
94
  = Can I display/embed multiple instances of the slideshow gallery? =
95
 
96
- Yes, you can, but only one slideshow per page.
97
 
98
  = How can I display specific slides in a slideshow gallery instance? =
99
 
@@ -122,6 +122,16 @@ There is an "Images Tester" utility under Slideshow > Configuration on the right
122
 
123
  == Changelog ==
124
 
 
 
 
 
 
 
 
 
 
 
125
  = 1.4 =
126
  * ADD: WordPress 3.9 compatibility
127
  * ADD: New shortcode `[tribulant_slideshow]` to prevent conflicts
4
  Tags: wordpress plugins, wordpress slideshow gallery, slides, slideshow, image gallery, images, gallery, featured content, content gallery, javascript, javascript slideshow, slideshow gallery
5
  Requires at least: 3.1
6
  Tested up to: 3.9
7
+ Stable tag: 1.4.1
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
93
 
94
  = Can I display/embed multiple instances of the slideshow gallery? =
95
 
96
+ Yes, you can and you can put multiple slideshows on the same page as well.
97
 
98
  = How can I display specific slides in a slideshow gallery instance? =
99
 
122
 
123
  == Changelog ==
124
 
125
+ = 1.4.1 =
126
+ * ADD: Set opacity for information bar per slide
127
+ * ADD: Setting per slide to show title/description or not
128
+ * IMPROVE: Updated TimThumb script
129
+ * IMPROVE: Updated WordPress plugin file header
130
+ * IMPROVE: Function call_user_method() is deprecated
131
+ * IMPROVE: New spinner/loading image
132
+ * FIX: More PHP warnings/notices
133
+ * FIX: 404 Not Found on spinner/loading image
134
+
135
  = 1.4 =
136
  * ADD: WordPress 3.9 compatibility
137
  * ADD: New shortcode `[tribulant_slideshow]` to prevent conflicts
slideshow-gallery-plugin.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  class GalleryPlugin {
4
 
5
- var $version = '1.4';
6
  var $plugin_name;
7
  var $plugin_base;
8
  var $pre = 'Gallery';
2
 
3
  class GalleryPlugin {
4
 
5
+ var $version = '1.4.1';
6
  var $plugin_name;
7
  var $plugin_base;
8
  var $pre = 'Gallery';
slideshow-gallery.php CHANGED
@@ -6,7 +6,12 @@ Plugin URI: http://wpgallery.tribulant.net
6
  Author: Tribulant Software
7
  Author URI: http://tribulant.com
8
  Description: Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website. The slideshow is flexible and all aspects can easily be configured. Embedding or hardcoding the slideshow gallery is a breeze. To embed into a post/page, simply insert <code>[tribulant_slideshow]</code> into its content with an optional <code>post_id</code> parameter. To hardcode into any PHP file of your WordPress theme, simply use <code>&lt;?php if (function_exists('slideshow')) { slideshow($output = true, $post_id = false, $gallery_id = false, $params = array()); } ?&gt;</code>.
9
- Version: 1.4
 
 
 
 
 
10
  */
11
 
12
  if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); }
@@ -82,10 +87,10 @@ if (!class_exists('Gallery')) {
82
  function admin_head_gallery_settings() {
83
  add_meta_box('submitdiv', __('Save Settings', $this -> plugin_name), array($this -> Metabox, "settings_submit"), $this -> menus['slideshow-settings'], 'side', 'core');
84
  add_meta_box('aboutdiv', __('About This Plugin', $this -> plugin_name) . $this -> Html -> help(__('More about this plugin and the creators of it', $this -> plugin_name)), array($this -> Metabox, "settings_about"), $this -> menus['slideshow-settings'], 'side', 'core');
85
- add_meta_box('wprelateddiv', __('WordPress Related', $this -> plugin_name) . $this -> Html -> help(__('Settings specifically related to WordPress', $this -> plugin_name)), array($this -> Metabox, "settings_wprelated"), $this -> menus['slideshow-settings'], 'normal', 'core');
86
  add_meta_box('generaldiv', __('General Settings', $this -> plugin_name) . $this -> Html -> help(__('General configuration settings for the inner workings and some default behaviours', $this -> plugin_name)), array($this -> Metabox, "settings_general"), $this -> menus['slideshow-settings'], 'normal', 'core');
87
  add_meta_box('linksimagesdiv', __('Links &amp; Images Overlay', $this -> plugin_name) . $this -> Html -> help(__('Configure the way that slides with links are opened', $this -> plugin_name)), array($this -> Metabox, "settings_linksimages"), $this -> menus['slideshow-settings'], 'normal', 'core');
88
  add_meta_box('stylesdiv', __('Appearance &amp; Styles', $this -> plugin_name) . $this -> Html -> help(__('Change the way the slideshows look so that it suits your needs', $this -> plugin_name)), array($this -> Metabox, "settings_styles"), $this -> menus['slideshow-settings'], 'normal', 'core');
 
89
 
90
  do_action('do_meta_boxes', $this -> menus['slideshow-settings'], 'normal');
91
  do_action('do_meta_boxes', $this -> menus['slideshow-settings'], 'side');
@@ -96,7 +101,7 @@ if (!class_exists('Gallery')) {
96
 
97
  if (!empty($_GET[$this -> pre . 'message'])) {
98
  $msg_type = (!empty($_GET[$this -> pre . 'updated'])) ? 'msg' : 'err';
99
- call_user_method('render_' . $msg_type, $this, $_GET[$this -> pre . 'message']);
100
  }
101
 
102
  if (!empty($_GET['page']) && (empty($_GET['method']) || $_GET['method'] != "imagestester") && in_array($_GET['page'], (array) $this -> sections)) {
6
  Author: Tribulant Software
7
  Author URI: http://tribulant.com
8
  Description: Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website. The slideshow is flexible and all aspects can easily be configured. Embedding or hardcoding the slideshow gallery is a breeze. To embed into a post/page, simply insert <code>[tribulant_slideshow]</code> into its content with an optional <code>post_id</code> parameter. To hardcode into any PHP file of your WordPress theme, simply use <code>&lt;?php if (function_exists('slideshow')) { slideshow($output = true, $post_id = false, $gallery_id = false, $params = array()); } ?&gt;</code>.
9
+ Version: 1.4.1
10
+ License: GNU General Public License v2 or later
11
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
+ Tags: slideshow gallery, slideshow, gallery, slider, jquery, timthumb, galleries, photos, images
13
+ Text Domain: slideshow-gallery
14
+ Domain Path: /languages
15
  */
16
 
17
  if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); }
87
  function admin_head_gallery_settings() {
88
  add_meta_box('submitdiv', __('Save Settings', $this -> plugin_name), array($this -> Metabox, "settings_submit"), $this -> menus['slideshow-settings'], 'side', 'core');
89
  add_meta_box('aboutdiv', __('About This Plugin', $this -> plugin_name) . $this -> Html -> help(__('More about this plugin and the creators of it', $this -> plugin_name)), array($this -> Metabox, "settings_about"), $this -> menus['slideshow-settings'], 'side', 'core');
 
90
  add_meta_box('generaldiv', __('General Settings', $this -> plugin_name) . $this -> Html -> help(__('General configuration settings for the inner workings and some default behaviours', $this -> plugin_name)), array($this -> Metabox, "settings_general"), $this -> menus['slideshow-settings'], 'normal', 'core');
91
  add_meta_box('linksimagesdiv', __('Links &amp; Images Overlay', $this -> plugin_name) . $this -> Html -> help(__('Configure the way that slides with links are opened', $this -> plugin_name)), array($this -> Metabox, "settings_linksimages"), $this -> menus['slideshow-settings'], 'normal', 'core');
92
  add_meta_box('stylesdiv', __('Appearance &amp; Styles', $this -> plugin_name) . $this -> Html -> help(__('Change the way the slideshows look so that it suits your needs', $this -> plugin_name)), array($this -> Metabox, "settings_styles"), $this -> menus['slideshow-settings'], 'normal', 'core');
93
+ add_meta_box('wprelateddiv', __('WordPress Related', $this -> plugin_name) . $this -> Html -> help(__('Settings specifically related to WordPress', $this -> plugin_name)), array($this -> Metabox, "settings_wprelated"), $this -> menus['slideshow-settings'], 'normal', 'core');
94
 
95
  do_action('do_meta_boxes', $this -> menus['slideshow-settings'], 'normal');
96
  do_action('do_meta_boxes', $this -> menus['slideshow-settings'], 'side');
101
 
102
  if (!empty($_GET[$this -> pre . 'message'])) {
103
  $msg_type = (!empty($_GET[$this -> pre . 'updated'])) ? 'msg' : 'err';
104
+ call_user_func(array($this, 'render_' . $msg_type), $_GET[$this -> pre . 'message']);
105
  }
106
 
107
  if (!empty($_GET['page']) && (empty($_GET['method']) || $_GET['method'] != "imagestester") && in_array($_GET['page'], (array) $this -> sections)) {
vendors/timthumb.php CHANGED
@@ -20,17 +20,17 @@
20
  * loaded by timthumb. This will save you having to re-edit these variables
21
  * everytime you download a new version
22
  */
23
- define ('VERSION', '2.8.10'); // Version of this script
24
  //Load a config file if it exists. Otherwise, use the values below
25
  if( file_exists(dirname(__FILE__) . '/timthumb-config.php')) require_once('timthumb-config.php');
26
  if(! defined('DEBUG_ON') ) define ('DEBUG_ON', false); // Enable debug logging to web server error log (STDERR)
27
  if(! defined('DEBUG_LEVEL') ) define ('DEBUG_LEVEL', 1); // Debug level 1 is less noisy and 3 is the most noisy
28
  if(! defined('MEMORY_LIMIT') ) define ('MEMORY_LIMIT', '30M'); // Set PHP memory limit
29
  if(! defined('BLOCK_EXTERNAL_LEECHERS') ) define ('BLOCK_EXTERNAL_LEECHERS', false); // If the image or webshot is being loaded on an external site, display a red "No Hotlinking" gif.
30
-
31
  //Image fetching and caching
32
  if(! defined('ALLOW_EXTERNAL') ) define ('ALLOW_EXTERNAL', TRUE); // Allow image fetching from external websites. Will check against ALLOWED_SITES if ALLOW_ALL_EXTERNAL_SITES is false
33
- if(! defined('ALLOW_ALL_EXTERNAL_SITES') ) define ('ALLOW_ALL_EXTERNAL_SITES', TRUE); // Less secure.
34
  if(! defined('FILE_CACHE_ENABLED') ) define ('FILE_CACHE_ENABLED', TRUE); // Should we store resized/modified images on disk to speed things up?
35
  if(! defined('FILE_CACHE_TIME_BETWEEN_CLEANS')) define ('FILE_CACHE_TIME_BETWEEN_CLEANS', 86400); // How often the cache is cleaned
36
 
@@ -40,24 +40,30 @@ if(! defined('FILE_CACHE_PREFIX') ) define ('FILE_CACHE_PREFIX', 'timthumb');
40
  if(! defined('FILE_CACHE_DIRECTORY') ) define ('FILE_CACHE_DIRECTORY', '../../../uploads/slideshow-gallery/cache'); // Directory where images are cached. Left blank it will use the system temporary directory (which is better for security)
41
  if(! defined('MAX_FILE_SIZE') ) define ('MAX_FILE_SIZE', 10485760); // 10 Megs is 10485760. This is the max internal or external file size that we'll process.
42
  if(! defined('CURL_TIMEOUT') ) define ('CURL_TIMEOUT', 20); // Timeout duration for Curl. This only applies if you have Curl installed and aren't using PHP's default URL fetching mechanism.
43
- if(! defined('WAIT_BETWEEN_FETCH_ERRORS') ) define ('WAIT_BETWEEN_FETCH_ERRORS', 3600); //Time to wait between errors fetching remote file
44
 
45
  //Browser caching
46
  if(! defined('BROWSER_CACHE_MAX_AGE') ) define ('BROWSER_CACHE_MAX_AGE', 864000); // Time to cache in the browser
47
  if(! defined('BROWSER_CACHE_DISABLE') ) define ('BROWSER_CACHE_DISABLE', false); // Use for testing if you want to disable all browser caching
48
 
49
  //Image size and defaults
50
- if(! defined('MAX_WIDTH') ) define ('MAX_WIDTH', 1500); // Maximum image width
51
- if(! defined('MAX_HEIGHT') ) define ('MAX_HEIGHT', 1500); // Maximum image height
52
- if(! defined('NOT_FOUND_IMAGE') ) define ('NOT_FOUND_IMAGE', ''); // Image to serve if any 404 occurs
53
- if(! defined('ERROR_IMAGE') ) define ('ERROR_IMAGE', ''); // Image to serve if an error occurs instead of showing error message
54
- if(! defined('PNG_IS_TRANSPARENT') ) define ('PNG_IS_TRANSPARENT', FALSE); //42 Define if a png image should have a transparent background color. Use False value if you want to display a custom coloured canvas_colour
55
- if(! defined('DEFAULT_Q') ) define ('DEFAULT_Q', 90); // Default image quality. Allows overrid in timthumb-config.php
56
- if(! defined('DEFAULT_ZC') ) define ('DEFAULT_ZC', 1); // Default zoom/crop setting. Allows overrid in timthumb-config.php
57
- if(! defined('DEFAULT_F') ) define ('DEFAULT_F', ''); // Default image filters. Allows overrid in timthumb-config.php
58
- if(! defined('DEFAULT_S') ) define ('DEFAULT_S', 0); // Default sharpen value. Allows overrid in timthumb-config.php
59
- if(! defined('DEFAULT_CC') ) define ('DEFAULT_CC', 'ffffff'); // Default canvas colour. Allows overrid in timthumb-config.php
 
 
60
 
 
 
 
 
61
 
62
  //Image compression is enabled if either of these point to valid paths
63
 
@@ -220,7 +226,7 @@ class timthumb {
220
  // nothing to worry about! :)
221
  $imgData = base64_decode("R0lGODlhUAAMAIAAAP8AAP///yH5BAAHAP8ALAAAAABQAAwAAAJpjI+py+0Po5y0OgAMjjv01YUZ\nOGplhWXfNa6JCLnWkXplrcBmW+spbwvaVr/cDyg7IoFC2KbYVC2NQ5MQ4ZNao9Ynzjl9ScNYpneb\nDULB3RP6JuPuaGfuuV4fumf8PuvqFyhYtjdoeFgAADs=");
222
  header('Content-Type: image/gif');
223
- header('Content-Length: ' . sizeof($imgData));
224
  header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
225
  header("Pragma: no-cache");
226
  header('Expires: ' . gmdate ('D, d M Y H:i:s', time()));
@@ -416,13 +422,16 @@ class timthumb {
416
  }
417
  protected function serveErrors(){
418
  header ($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
 
 
 
419
  $html = '<ul>';
420
  foreach($this->errors as $err){
421
  $html .= '<li>' . htmlentities($err) . '</li>';
422
  }
423
  $html .= '</ul>';
424
  echo '<h1>A TimThumb error has occured</h1>The following error(s) occured:<br />' . $html . '<br />';
425
- echo '<br />Query String : ' . htmlentities ($_SERVER['QUERY_STRING']);
426
  echo '<br />TimThumb version : ' . VERSION . '</pre>';
427
  }
428
  protected function serveInternalImage(){
@@ -528,8 +537,8 @@ class timthumb {
528
 
529
  // set default width and height if neither are set already
530
  if ($new_width == 0 && $new_height == 0) {
531
- $new_width = 100;
532
- $new_height = 100;
533
  }
534
 
535
  // ensure size limits can not be abused
@@ -855,7 +864,11 @@ class timthumb {
855
  return $this->realpath($file);
856
  }
857
  return $this->error("Could not find your website document root and the file specified doesn't exist in timthumbs directory. We don't support serving files outside timthumb's directory without a document root for security reasons.");
858
- } //Do not go past this point without docRoot set
 
 
 
 
859
 
860
  //Try src under docRoot
861
  if(file_exists ($this->docRoot . '/' . $src)) {
@@ -992,7 +1005,7 @@ class timthumb {
992
  $this->debug(3, "Remote file has invalid mime type: $mimeType");
993
  @unlink($this->cachefile);
994
  touch($this->cachefile);
995
- $this->error("The remote file is not a valid image.");
996
  return false;
997
  }
998
  if($this->processImageAndWriteToCache($tempfile)){
@@ -1087,6 +1100,8 @@ class timthumb {
1087
 
1088
  case 'image/png':
1089
  $image = imagecreatefrompng ($src);
 
 
1090
  break;
1091
 
1092
  case 'image/gif':
@@ -1155,6 +1170,7 @@ class timthumb {
1155
  default: return $size_str;
1156
  }
1157
  }
 
1158
  protected function getURL($url, $tempfile){
1159
  $this->lastURLError = false;
1160
  $url = preg_replace('/ /', '%20', $url);
@@ -1183,6 +1199,10 @@ class timthumb {
1183
  if($httpStatus == 404){
1184
  $this->set404();
1185
  }
 
 
 
 
1186
  if($curlResult){
1187
  curl_close($curl);
1188
  return true;
20
  * loaded by timthumb. This will save you having to re-edit these variables
21
  * everytime you download a new version
22
  */
23
+ define ('VERSION', '2.8.13'); // Version of this script
24
  //Load a config file if it exists. Otherwise, use the values below
25
  if( file_exists(dirname(__FILE__) . '/timthumb-config.php')) require_once('timthumb-config.php');
26
  if(! defined('DEBUG_ON') ) define ('DEBUG_ON', false); // Enable debug logging to web server error log (STDERR)
27
  if(! defined('DEBUG_LEVEL') ) define ('DEBUG_LEVEL', 1); // Debug level 1 is less noisy and 3 is the most noisy
28
  if(! defined('MEMORY_LIMIT') ) define ('MEMORY_LIMIT', '30M'); // Set PHP memory limit
29
  if(! defined('BLOCK_EXTERNAL_LEECHERS') ) define ('BLOCK_EXTERNAL_LEECHERS', false); // If the image or webshot is being loaded on an external site, display a red "No Hotlinking" gif.
30
+ if(! defined('DISPLAY_ERROR_MESSAGES') ) define ('DISPLAY_ERROR_MESSAGES', true); // Display error messages. Set to false to turn off errors (good for production websites)
31
  //Image fetching and caching
32
  if(! defined('ALLOW_EXTERNAL') ) define ('ALLOW_EXTERNAL', TRUE); // Allow image fetching from external websites. Will check against ALLOWED_SITES if ALLOW_ALL_EXTERNAL_SITES is false
33
+ if(! defined('ALLOW_ALL_EXTERNAL_SITES') ) define ('ALLOW_ALL_EXTERNAL_SITES', false); // Less secure.
34
  if(! defined('FILE_CACHE_ENABLED') ) define ('FILE_CACHE_ENABLED', TRUE); // Should we store resized/modified images on disk to speed things up?
35
  if(! defined('FILE_CACHE_TIME_BETWEEN_CLEANS')) define ('FILE_CACHE_TIME_BETWEEN_CLEANS', 86400); // How often the cache is cleaned
36
 
40
  if(! defined('FILE_CACHE_DIRECTORY') ) define ('FILE_CACHE_DIRECTORY', '../../../uploads/slideshow-gallery/cache'); // Directory where images are cached. Left blank it will use the system temporary directory (which is better for security)
41
  if(! defined('MAX_FILE_SIZE') ) define ('MAX_FILE_SIZE', 10485760); // 10 Megs is 10485760. This is the max internal or external file size that we'll process.
42
  if(! defined('CURL_TIMEOUT') ) define ('CURL_TIMEOUT', 20); // Timeout duration for Curl. This only applies if you have Curl installed and aren't using PHP's default URL fetching mechanism.
43
+ if(! defined('WAIT_BETWEEN_FETCH_ERRORS') ) define ('WAIT_BETWEEN_FETCH_ERRORS', 3600); // Time to wait between errors fetching remote file
44
 
45
  //Browser caching
46
  if(! defined('BROWSER_CACHE_MAX_AGE') ) define ('BROWSER_CACHE_MAX_AGE', 864000); // Time to cache in the browser
47
  if(! defined('BROWSER_CACHE_DISABLE') ) define ('BROWSER_CACHE_DISABLE', false); // Use for testing if you want to disable all browser caching
48
 
49
  //Image size and defaults
50
+ if(! defined('MAX_WIDTH') ) define ('MAX_WIDTH', 1500); // Maximum image width
51
+ if(! defined('MAX_HEIGHT') ) define ('MAX_HEIGHT', 1500); // Maximum image height
52
+ if(! defined('NOT_FOUND_IMAGE') ) define ('NOT_FOUND_IMAGE', ''); // Image to serve if any 404 occurs
53
+ if(! defined('ERROR_IMAGE') ) define ('ERROR_IMAGE', ''); // Image to serve if an error occurs instead of showing error message
54
+ if(! defined('PNG_IS_TRANSPARENT') ) define ('PNG_IS_TRANSPARENT', FALSE); // Define if a png image should have a transparent background color. Use False value if you want to display a custom coloured canvas_colour
55
+ if(! defined('DEFAULT_Q') ) define ('DEFAULT_Q', 90); // Default image quality. Allows overrid in timthumb-config.php
56
+ if(! defined('DEFAULT_ZC') ) define ('DEFAULT_ZC', 1); // Default zoom/crop setting. Allows overrid in timthumb-config.php
57
+ if(! defined('DEFAULT_F') ) define ('DEFAULT_F', ''); // Default image filters. Allows overrid in timthumb-config.php
58
+ if(! defined('DEFAULT_S') ) define ('DEFAULT_S', 0); // Default sharpen value. Allows overrid in timthumb-config.php
59
+ if(! defined('DEFAULT_CC') ) define ('DEFAULT_CC', 'ffffff'); // Default canvas colour. Allows overrid in timthumb-config.php
60
+ if(! defined('DEFAULT_WIDTH') ) define ('DEFAULT_WIDTH', 100); // Default thumbnail width. Allows overrid in timthumb-config.php
61
+ if(! defined('DEFAULT_HEIGHT') ) define ('DEFAULT_HEIGHT', 100); // Default thumbnail height. Allows overrid in timthumb-config.php
62
 
63
+ /**
64
+ * Additional Parameters:
65
+ * LOCAL_FILE_BASE_DIRECTORY = Override the DOCUMENT_ROOT. This is best used in timthumb-config.php
66
+ */
67
 
68
  //Image compression is enabled if either of these point to valid paths
69
 
226
  // nothing to worry about! :)
227
  $imgData = base64_decode("R0lGODlhUAAMAIAAAP8AAP///yH5BAAHAP8ALAAAAABQAAwAAAJpjI+py+0Po5y0OgAMjjv01YUZ\nOGplhWXfNa6JCLnWkXplrcBmW+spbwvaVr/cDyg7IoFC2KbYVC2NQ5MQ4ZNao9Ynzjl9ScNYpneb\nDULB3RP6JuPuaGfuuV4fumf8PuvqFyhYtjdoeFgAADs=");
228
  header('Content-Type: image/gif');
229
+ header('Content-Length: ' . strlen($imgData));
230
  header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
231
  header("Pragma: no-cache");
232
  header('Expires: ' . gmdate ('D, d M Y H:i:s', time()));
422
  }
423
  protected function serveErrors(){
424
  header ($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
425
+ if ( ! DISPLAY_ERROR_MESSAGES ) {
426
+ return;
427
+ }
428
  $html = '<ul>';
429
  foreach($this->errors as $err){
430
  $html .= '<li>' . htmlentities($err) . '</li>';
431
  }
432
  $html .= '</ul>';
433
  echo '<h1>A TimThumb error has occured</h1>The following error(s) occured:<br />' . $html . '<br />';
434
+ echo '<br />Query String : ' . htmlentities( $_SERVER['QUERY_STRING'], ENT_QUOTES );
435
  echo '<br />TimThumb version : ' . VERSION . '</pre>';
436
  }
437
  protected function serveInternalImage(){
537
 
538
  // set default width and height if neither are set already
539
  if ($new_width == 0 && $new_height == 0) {
540
+ $new_width = (int) DEFAULT_WIDTH;
541
+ $new_height = (int) DEFAULT_HEIGHT;
542
  }
543
 
544
  // ensure size limits can not be abused
864
  return $this->realpath($file);
865
  }
866
  return $this->error("Could not find your website document root and the file specified doesn't exist in timthumbs directory. We don't support serving files outside timthumb's directory without a document root for security reasons.");
867
+ } else if ( ! is_dir( $this->docRoot ) ) {
868
+ $this->error("Server path does not exist. Ensure variable \$_SERVER['DOCUMENT_ROOT'] is set correctly");
869
+ }
870
+
871
+ //Do not go past this point without docRoot set
872
 
873
  //Try src under docRoot
874
  if(file_exists ($this->docRoot . '/' . $src)) {
1005
  $this->debug(3, "Remote file has invalid mime type: $mimeType");
1006
  @unlink($this->cachefile);
1007
  touch($this->cachefile);
1008
+ $this->error("The remote file is not a valid image. Mimetype = '" . $mimeType . "'" . $tempfile);
1009
  return false;
1010
  }
1011
  if($this->processImageAndWriteToCache($tempfile)){
1100
 
1101
  case 'image/png':
1102
  $image = imagecreatefrompng ($src);
1103
+ imagealphablending( $image, true );
1104
+ imagesavealpha( $image, true );
1105
  break;
1106
 
1107
  case 'image/gif':
1170
  default: return $size_str;
1171
  }
1172
  }
1173
+
1174
  protected function getURL($url, $tempfile){
1175
  $this->lastURLError = false;
1176
  $url = preg_replace('/ /', '%20', $url);
1199
  if($httpStatus == 404){
1200
  $this->set404();
1201
  }
1202
+ if($httpStatus == 302){
1203
+ $this->error("External Image is Redirecting. Try alternate image url");
1204
+ return false;
1205
+ }
1206
  if($curlResult){
1207
  curl_close($curl);
1208
  return true;
views/admin/slides/save.php CHANGED
@@ -1,4 +1,12 @@
1
- <div class="wrap <?php echo $this -> pre; ?>">
 
 
 
 
 
 
 
 
2
  <h2><?php _e('Save a Slide', $this -> plugin_name); ?></h2>
3
 
4
  <form action="<?php echo $this -> url; ?>&amp;method=save" method="post" enctype="multipart/form-data">
@@ -25,6 +33,32 @@
25
  <?php echo (!empty($this -> Slide -> errors['description'])) ? '<div style="color:red;">' . $this -> Slide -> errors['description'] . '</div>' : ''; ?>
26
  </td>
27
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  <tr>
29
  <th><label for="checkboxall"><?php _e('Galleries', $this -> plugin_name); ?></label>
30
  <?php echo $this -> Html -> help(__('You can organize/assign a slide to multiple galleries as needed. It is easy to display a slideshow with the slides of a specific gallery then.', $this -> plugin_name)); ?></th>
1
+ <!-- Save a Slide -->
2
+
3
+ <?php
4
+
5
+ $showtd = $this -> Slide -> data -> showtd;
6
+
7
+ ?>
8
+
9
+ <div class="wrap <?php echo $this -> pre; ?> slideshow-gallery">
10
  <h2><?php _e('Save a Slide', $this -> plugin_name); ?></h2>
11
 
12
  <form action="<?php echo $this -> url; ?>&amp;method=save" method="post" enctype="multipart/form-data">
33
  <?php echo (!empty($this -> Slide -> errors['description'])) ? '<div style="color:red;">' . $this -> Slide -> errors['description'] . '</div>' : ''; ?>
34
  </td>
35
  </tr>
36
+ <tr>
37
+ <th><label for="showtd"><?php _e('Show Information?', $this -> plugin_name); ?></label></th>
38
+ <td>
39
+ <label><input onclick="if (jQuery(this).is(':checked')) { jQuery('#showtd_div').show(); } else { jQuery('#showtd_div').hide(); }" <?php echo (!empty($showtd) && $showtd == 1) ? 'checked="checked"' : ''; ?> type="checkbox" name="Slide[showtd]" value="1" id="showtd" /> <?php _e('Yes, show the title and description on the slide', $this -> plugin_name); ?></label>
40
+ <span class="howto"><?php _e('Tick/check to show the information bar with title and description on the slide.', $this -> plugin_name); ?></span>
41
+ </td>
42
+ </tr>
43
+ </tbody>
44
+ </table>
45
+
46
+ <div id="showtd_div" style="display:<?php echo (!empty($showtd) && $showtd == 1) ? 'block' : 'none'; ?>;">
47
+ <table class="form-table">
48
+ <tbody>
49
+ <tr>
50
+ <th><label for="iopacity"><?php _e('Opacity', $this -> plugin_name); ?></label></th>
51
+ <td>
52
+ <input type="text" id="iopacity" class="widefat" style="width:45px;" name="Slide[iopacity]" value="<?php echo esc_attr(stripslashes($this -> Slide -> data -> iopacity)); ?>" />
53
+ <span class="howto"><?php _e('A value between 0 and 100. Leave empty for default.', $this -> plugin_name); ?></span>
54
+ </td>
55
+ </tr>
56
+ </tbody>
57
+ </table>
58
+ </div>
59
+
60
+ <table class="form-table">
61
+ <tbody>
62
  <tr>
63
  <th><label for="checkboxall"><?php _e('Galleries', $this -> plugin_name); ?></label>
64
  <?php echo $this -> Html -> help(__('You can organize/assign a slide to multiple galleries as needed. It is easy to display a slideshow with the slides of a specific gallery then.', $this -> plugin_name)); ?></th>
views/default/gallery.php CHANGED
@@ -60,13 +60,13 @@ $thumbopacity = $this -> get_option('thumbopacity');
60
  <?php else : ?>
61
  <?php foreach ($slides as $slide) : ?>
62
  <li>
63
- <h3><?php echo $slide -> title; ?></h3>
64
  <?php if ($options['layout'] != "responsive" && $options['resizeimages'] == "true" && $options['width'] != "auto") : ?>
65
  <span><?php echo $this -> Html -> timthumb_image_src($slide -> image_path, $options['width'], $options['height'], 100); ?></span>
66
  <?php else : ?>
67
  <span><?php echo $this -> Html -> image_url($slide -> image); ?></span>
68
  <?php endif; ?>
69
- <p><?php echo $slide -> description; ?></p>
70
  <?php if ($options['showthumbs'] == "true") : ?>
71
  <?php if ($slide -> uselink == "Y" && !empty($slide -> link)) : ?>
72
  <a href="<?php echo $slide -> link; ?>" title="<?php echo esc_attr($slide -> title); ?>" target="_<?php echo $slide -> linktarget; ?>"><img src="<?php echo $this -> Html -> timthumb_image_src($slide -> image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" /></a>
60
  <?php else : ?>
61
  <?php foreach ($slides as $slide) : ?>
62
  <li>
63
+ <h3 style="opacity:<?php echo (!empty($slide -> iopacity)) ? ($slide -> iopacity) : 70; ?>;"><?php echo (!empty($slide -> showtd) && $slide -> showtd == 1) ? $slide -> title : ''; ?></h3>
64
  <?php if ($options['layout'] != "responsive" && $options['resizeimages'] == "true" && $options['width'] != "auto") : ?>
65
  <span><?php echo $this -> Html -> timthumb_image_src($slide -> image_path, $options['width'], $options['height'], 100); ?></span>
66
  <?php else : ?>
67
  <span><?php echo $this -> Html -> image_url($slide -> image); ?></span>
68
  <?php endif; ?>
69
+ <p><?php echo (!empty($slide -> showtd) && $slide -> showtd == 1) ? $slide -> description : ''; ?></p>
70
  <?php if ($options['showthumbs'] == "true") : ?>
71
  <?php if ($slide -> uselink == "Y" && !empty($slide -> link)) : ?>
72
  <a href="<?php echo $slide -> link; ?>" title="<?php echo esc_attr($slide -> title); ?>" target="_<?php echo $slide -> linktarget; ?>"><img src="<?php echo $this -> Html -> timthumb_image_src($slide -> image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" /></a>