Slideshow Gallery - Version 1.5.3.2

Version Description

  • IMPROVE: Prevent plugin files from being accessed directly for security
  • IMPROVE: Check file mime and type of image URL on slide for security
  • IMPROVE: Validate, sanitize and escape data for security purposes
  • IMPROVE: Implement WordPress nonces throughout for security
  • FIX: CSS and JS files don't work with child theme folder
  • FIX: Setting to only hide title
  • FIX: Multiple slideshows, overlay shows all images
  • FIX: Broken permissions page when paging gallery
Download this release

Release Info

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

Code changes from version 1.5.3 to 1.5.3.2

Files changed (60) hide show
  1. css/index.php +1 -0
  2. fonts/index.php +1 -0
  3. helpers/db.php +13 -11
  4. helpers/form.php +2 -0
  5. helpers/html.php +2 -0
  6. helpers/index.php +1 -0
  7. helpers/metabox.php +2 -0
  8. images/about/index.php +1 -0
  9. images/colorbox/ie6/index.php +1 -0
  10. images/colorbox/index.php +1 -0
  11. images/index.php +1 -0
  12. images/jquery-ui/index.php +1 -0
  13. images/plugins/index.php +1 -0
  14. images/plugins/newsletters.png +0 -0
  15. includes/checkinit.php +2 -0
  16. includes/index.php +1 -0
  17. js/index.php +1 -0
  18. js/tinymce/index.php +1 -0
  19. js/tinymce/langs/index.php +1 -0
  20. languages/index.php +1 -0
  21. models/gallery.php +2 -0
  22. models/galleryslides.php +2 -0
  23. models/index.php +0 -0
  24. models/slide.php +18 -4
  25. readme.txt +12 -2
  26. slideshow-gallery-plugin.php +61 -31
  27. slideshow-gallery.php +30 -5
  28. vendors/class.paginate.php +4 -2
  29. vendors/index.php +1 -0
  30. views/admin/about.php +3 -0
  31. views/admin/err-top.php +6 -0
  32. views/admin/galleries/hardcode.php +6 -0
  33. views/admin/galleries/index.php +9 -0
  34. views/admin/galleries/save.php +4 -0
  35. views/admin/galleries/view.php +6 -0
  36. views/admin/head.php +6 -0
  37. views/admin/index.php +1 -0
  38. views/admin/metaboxes/index.php +1 -0
  39. views/admin/metaboxes/settings-about.php +6 -0
  40. views/admin/metaboxes/settings-general.php +2 -0
  41. views/admin/metaboxes/settings-linksimages.php +6 -0
  42. views/admin/metaboxes/settings-plugins.php +7 -1
  43. views/admin/metaboxes/settings-styles.php +2 -0
  44. views/admin/metaboxes/settings-submit.php +2 -0
  45. views/admin/metaboxes/settings-tech.php +2 -0
  46. views/admin/metaboxes/settings-wprelated.php +2 -0
  47. views/admin/msg-top.php +6 -0
  48. views/admin/paginate.php +6 -0
  49. views/admin/settings.php +5 -0
  50. views/admin/slides/index.php +6 -0
  51. views/admin/slides/loop.php +9 -0
  52. views/admin/slides/order.php +6 -0
  53. views/admin/slides/save-multiple.php +9 -0
  54. views/admin/slides/save.php +5 -0
  55. views/default/css/colorbox.css +70 -0
  56. views/default/gallery.php +13 -7
  57. views/default/index.php +1 -0
  58. views/default/js/colorbox.js +1086 -0
  59. {js → views/default/js}/gallery.js +1 -1
  60. views/index.php +1 -0
css/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
fonts/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
helpers/db.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
 
3
  class GalleryDbHelper extends GalleryPlugin {
4
 
@@ -35,7 +37,7 @@ class GalleryDbHelper extends GalleryPlugin {
35
  $c = 1;
36
 
37
  foreach ($conditions as $ckey => $cval) {
38
- $query .= " `" . $ckey . "` = '" . $cval . "'";
39
 
40
  if ($c < count($conditions)) {
41
  $query .= " AND";
@@ -50,7 +52,7 @@ class GalleryDbHelper extends GalleryPlugin {
50
  } else {
51
  $order = (empty($order)) ? array('id', "DESC") : $order;
52
  list($ofield, $odir) = $order;
53
- $query .= " ORDER BY `" . $ofield . "` " . $odir . "";
54
  }
55
 
56
  $query .= " LIMIT 1";
@@ -90,7 +92,7 @@ class GalleryDbHelper extends GalleryPlugin {
90
  $c = 1;
91
 
92
  foreach ($conditions as $ckey => $cval) {
93
- $query .= " `" . $ckey . "` = '" . $cval . "'";
94
 
95
  if ($c < count($conditions)) {
96
  $query .= " AND";
@@ -107,7 +109,7 @@ class GalleryDbHelper extends GalleryPlugin {
107
  } else {
108
  if (!is_array($order)) { $order = array('id', "DESC"); }
109
  list($ofield, $odir) = $order;
110
- $query .= " ORDER BY `" . $ofield . "` " . $odir . "";
111
  }
112
 
113
  $query .= (empty($limit)) ? '' : " LIMIT " . $limit . "";
@@ -216,14 +218,14 @@ class GalleryDbHelper extends GalleryPlugin {
216
  global $wpdb;
217
 
218
  if (!empty($field)) {
219
- $query = "UPDATE `" . $this -> table . "` SET `" . $field . "` = '" . $value . "'";
220
 
221
  if (!empty($conditions) && is_array($conditions)) {
222
  $query .= " WHERE";
223
  $c = 1;
224
 
225
  foreach ($conditions as $ckey => $cval) {
226
- $query .= " `" . $ckey . "` = '" . $cval . "'";
227
 
228
  if ($c < count($conditions)) {
229
  $query .= " AND";
@@ -246,7 +248,7 @@ class GalleryDbHelper extends GalleryPlugin {
246
  global $wpdb;
247
 
248
  if (!empty($record_id) && $record = $this -> find(array('id' => $record_id))) {
249
- $query = "DELETE FROM `" . $this -> table . "` WHERE `id` = '" . $record_id . "' LIMIT 1";
250
 
251
  if ($wpdb -> query($query)) {
252
  switch ($this -> model) {
@@ -285,11 +287,11 @@ class GalleryDbHelper extends GalleryPlugin {
285
  if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
286
  $value = serialize($this -> data -> {$field});
287
  } else {
288
- $value = esc_sql($this -> data -> {$field});
289
  }
290
 
291
  $query1 .= "`" . $field . "`";
292
- $query2 .= "'" . $value . "'";
293
 
294
  if ($c < count($this -> fields)) {
295
  $query1 .= ", ";
@@ -331,10 +333,10 @@ class GalleryDbHelper extends GalleryPlugin {
331
  if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
332
  $value = serialize($this -> data -> {$field});
333
  } else {
334
- $value = esc_sql($this -> data -> {$field});
335
  }
336
 
337
- $query .= "`" . $field . "` = '" . $value . "'";
338
 
339
  if ($c < count($this -> fields)) {
340
  $query .= ", ";
1
  <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  class GalleryDbHelper extends GalleryPlugin {
6
 
37
  $c = 1;
38
 
39
  foreach ($conditions as $ckey => $cval) {
40
+ $query .= " `" . $ckey . "` = '" . ($cval) . "'";
41
 
42
  if ($c < count($conditions)) {
43
  $query .= " AND";
52
  } else {
53
  $order = (empty($order)) ? array('id', "DESC") : $order;
54
  list($ofield, $odir) = $order;
55
+ $query .= " ORDER BY `" . $ofield . "` " . ($odir) . "";
56
  }
57
 
58
  $query .= " LIMIT 1";
92
  $c = 1;
93
 
94
  foreach ($conditions as $ckey => $cval) {
95
+ $query .= " `" . $ckey . "` = '" . ($cval) . "'";
96
 
97
  if ($c < count($conditions)) {
98
  $query .= " AND";
109
  } else {
110
  if (!is_array($order)) { $order = array('id', "DESC"); }
111
  list($ofield, $odir) = $order;
112
+ $query .= " ORDER BY `" . $ofield . "` " . ($odir) . "";
113
  }
114
 
115
  $query .= (empty($limit)) ? '' : " LIMIT " . $limit . "";
218
  global $wpdb;
219
 
220
  if (!empty($field)) {
221
+ $query = "UPDATE `" . $this -> table . "` SET `" . $field . "` = '" . ($value) . "'";
222
 
223
  if (!empty($conditions) && is_array($conditions)) {
224
  $query .= " WHERE";
225
  $c = 1;
226
 
227
  foreach ($conditions as $ckey => $cval) {
228
+ $query .= " `" . $ckey . "` = '" . ($cval) . "'";
229
 
230
  if ($c < count($conditions)) {
231
  $query .= " AND";
248
  global $wpdb;
249
 
250
  if (!empty($record_id) && $record = $this -> find(array('id' => $record_id))) {
251
+ $query = "DELETE FROM `" . $this -> table . "` WHERE `id` = '" . ($record_id) . "' LIMIT 1";
252
 
253
  if ($wpdb -> query($query)) {
254
  switch ($this -> model) {
287
  if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
288
  $value = serialize($this -> data -> {$field});
289
  } else {
290
+ $value = ($this -> data -> {$field});
291
  }
292
 
293
  $query1 .= "`" . $field . "`";
294
+ $query2 .= "'" . ($value) . "'";
295
 
296
  if ($c < count($this -> fields)) {
297
  $query1 .= ", ";
333
  if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
334
  $value = serialize($this -> data -> {$field});
335
  } else {
336
+ $value = ($this -> data -> {$field});
337
  }
338
 
339
+ $query .= "`" . $field . "` = '" . ($value) . "'";
340
 
341
  if ($c < count($this -> fields)) {
342
  $query .= ", ";
helpers/form.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
 
3
  class GalleryFormHelper extends GalleryPlugin {
4
 
1
  <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  class GalleryFormHelper extends GalleryPlugin {
6
 
helpers/html.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
 
3
  class GalleryHtmlHelper extends GalleryPlugin {
4
 
1
  <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  class GalleryHtmlHelper extends GalleryPlugin {
6
 
helpers/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
helpers/metabox.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
 
3
  class GalleryMetaboxHelper extends GalleryPlugin {
4
 
1
  <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  class GalleryMetaboxHelper extends GalleryPlugin {
6
 
images/about/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
images/colorbox/ie6/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
images/colorbox/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
images/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
images/jquery-ui/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
images/plugins/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
images/plugins/newsletters.png CHANGED
Binary file
includes/checkinit.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
 
3
  if (!class_exists('GalleryCheckinit')) {
4
  class GalleryCheckinit {
1
  <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  if (!class_exists('GalleryCheckinit')) {
6
  class GalleryCheckinit {
includes/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
js/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
js/tinymce/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
js/tinymce/langs/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
languages/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
models/gallery.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
 
3
  class GalleryGallery extends GalleryDbHelper {
4
 
1
  <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  class GalleryGallery extends GalleryDbHelper {
6
 
models/galleryslides.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
 
3
  class GalleryGallerySlides extends GalleryDbHelper {
4
 
1
  <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  class GalleryGallerySlides extends GalleryDbHelper {
6
 
models/index.php ADDED
File without changes
models/slide.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
 
3
  class GallerySlide extends GalleryDbHelper {
4
 
@@ -173,10 +175,22 @@ class GallerySlide extends GalleryDbHelper {
173
  $filepath = GalleryHtmlHelper::uploads_path() . DS . $this -> plugin_name . DS;
174
  $filefull = $filepath . $filename;
175
 
176
- if (!file_exists($filefull)) {
177
- $fh = @fopen($filefull, "w");
178
- @fwrite($fh, $image);
179
- @fclose($fh);
 
 
 
 
 
 
 
 
 
 
 
 
180
  }
181
  }
182
  }
1
  <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  class GallerySlide extends GalleryDbHelper {
6
 
175
  $filepath = GalleryHtmlHelper::uploads_path() . DS . $this -> plugin_name . DS;
176
  $filefull = $filepath . $filename;
177
 
178
+ $issafe = false;
179
+ $mimes = get_allowed_mime_types();
180
+ foreach ($mimes as $type => $mime) {
181
+ if (strpos($type, $image_ext) !== false) {
182
+ $issafe = true;
183
+ }
184
+ }
185
+
186
+ if (empty($issafe) || $issafe == false) {
187
+ $this -> errors['image_url'] = __('This file type is not allowed for security reasons', $this -> plugin_name);
188
+ } else {
189
+ if (!file_exists($filefull)) {
190
+ $fh = @fopen($filefull, "w");
191
+ fwrite($fh, $image);
192
+ fclose($fh);
193
+ }
194
  }
195
  }
196
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: contrid
3
  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: 4.1
7
- Stable tag: 1.5.3
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
@@ -175,6 +175,16 @@ There is an "Images Tester" utility under Slideshow > Configuration on the right
175
 
176
  == Changelog ==
177
 
 
 
 
 
 
 
 
 
 
 
178
  = 1.5.3 =
179
  * FIX: Link not showing with auto height on
180
  * FIX: Dots (.) in image filenames break images/slides
3
  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: 4.3
7
+ Stable tag: 1.5.3.2
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
175
 
176
  == Changelog ==
177
 
178
+ = 1.5.3.2 =
179
+ * IMPROVE: Prevent plugin files from being accessed directly for security
180
+ * IMPROVE: Check file mime and type of image URL on slide for security
181
+ * IMPROVE: Validate, sanitize and escape data for security purposes
182
+ * IMPROVE: Implement WordPress nonces throughout for security
183
+ * FIX: CSS and JS files don't work with child theme folder
184
+ * FIX: Setting to only hide title
185
+ * FIX: Multiple slideshows, overlay shows all images
186
+ * FIX: Broken permissions page when paging gallery
187
+
188
  = 1.5.3 =
189
  * FIX: Link not showing with auto height on
190
  * FIX: Dots (.) in image filenames break images/slides
slideshow-gallery-plugin.php CHANGED
@@ -1,8 +1,10 @@
1
  <?php
 
 
2
 
3
  class GalleryPlugin extends GalleryCheckinit {
4
 
5
- var $version = '1.5.3';
6
  var $plugin_name;
7
  var $plugin_base;
8
  var $pre = 'Gallery';
@@ -158,8 +160,16 @@ class GalleryPlugin extends GalleryCheckinit {
158
  $query = "ALTER TABLE `" . $this -> Slide -> table . "` CHANGE `type` `type` ENUM('media','file','url') NOT NULL DEFAULT 'media'";
159
  $wpdb -> query($query);
160
 
 
161
  $version = "1.5.3";
162
  }
 
 
 
 
 
 
 
163
 
164
  //the current version is older.
165
  //lets update the database
@@ -295,14 +305,16 @@ class GalleryPlugin extends GalleryCheckinit {
295
  }
296
 
297
  function render_msg($message = null) {
 
298
  $this -> render('msg-top', array('message' => $message), true, 'admin');
299
  }
300
 
301
  function render_err($message = null) {
 
302
  $this -> render('err-top', array('message' => $message), true, 'admin');
303
  }
304
 
305
- function redirect($location = null, $msgtype = null, $message = null) {
306
  $url = $location;
307
 
308
  if ($msgtype == "message") {
@@ -315,6 +327,10 @@ class GalleryPlugin extends GalleryCheckinit {
315
  $url .= '&' . $this -> pre . 'message=' . urlencode($message);
316
  }
317
 
 
 
 
 
318
  ?>
319
 
320
  <script type="text/javascript">
@@ -428,21 +444,8 @@ class GalleryPlugin extends GalleryCheckinit {
428
 
429
  if (is_admin()) {
430
  if (!empty($_GET['page']) && in_array($_GET['page'], (array) $this -> sections)) {
431
- wp_enqueue_script(
432
- 'iris',
433
- admin_url('js/iris.min.js'),
434
- array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ),
435
- false,
436
- 1
437
- );
438
-
439
- wp_enqueue_script(
440
- 'wp-color-picker',
441
- admin_url('js/color-picker.min.js'),
442
- array( 'iris' ),
443
- false,
444
- 1
445
- );
446
 
447
  wp_enqueue_script('jquery-ui-tabs');
448
  wp_enqueue_script('jquery-ui-tooltip');
@@ -453,7 +456,7 @@ class GalleryPlugin extends GalleryCheckinit {
453
  wp_enqueue_script('wp-lists');
454
  wp_enqueue_script('postbox');
455
  wp_enqueue_script('plugin-install');
456
- wp_enqueue_script('settings-editor', plugins_url() . '/' . $this -> plugin_name . '/js/settings-editor.js', array('jquery'), '1.0');
457
  }
458
 
459
  if ($_GET['page'] == "slideshow-slides" && $_GET['method'] == "order") {
@@ -467,11 +470,11 @@ class GalleryPlugin extends GalleryCheckinit {
467
  add_thickbox();
468
  }
469
 
470
- wp_enqueue_script('colorbox', plugins_url() . '/' . $this -> plugin_name . '/js/colorbox.js', array('jquery'), '1.3.19');
471
- wp_enqueue_script($this -> plugin_name . 'admin', plugins_url() . '/' . $this -> plugin_name . '/js/admin.js', null, '1.0');
472
  } else {
473
- wp_enqueue_script($this -> plugin_name, plugins_url() . '/' . $this -> plugin_name . '/js/gallery.js', null, '1.0');
474
- wp_enqueue_script('colorbox', plugins_url() . '/' . $this -> plugin_name . '/js/colorbox.js', array('jquery'), '1.3.19');
475
  wp_enqueue_script('jquery-effects-core');
476
  }
477
 
@@ -480,7 +483,8 @@ class GalleryPlugin extends GalleryCheckinit {
480
 
481
  function get_css_url($attr = null, $layout = null) {
482
  $file = (empty($layout) || $layout == "specific") ? 'css' : 'css-responsive';
483
- $css_url = plugins_url() . '/' . $this -> plugin_name . '/views/default/' . $file . '.php?';
 
484
 
485
  $default_attr = $this -> get_option('styles');
486
  $styles = wp_parse_args($attr, $default_attr);
@@ -504,17 +508,15 @@ class GalleryPlugin extends GalleryCheckinit {
504
 
505
  function enqueue_styles() {
506
  if (is_admin()) {
507
- $src = plugins_url() . '/' . $this -> plugin_name . '/css/admin.css';
508
- wp_enqueue_style($this -> plugin_name, $src, null, "1.0", "all");
509
  wp_enqueue_style('wp-color-picker');
510
- $jquery_ui_src = plugins_url() . '/' . $this -> plugin_name . '/css/jquery-ui.css';
511
- wp_enqueue_style('jquery-ui', $jquery_ui_src, null, "1.0", "all");
 
 
512
  }
513
 
514
- $colorbox_src = plugins_url() . '/' . $this -> plugin_name . '/css/colorbox.css';
515
- wp_enqueue_style('colorbox', $colorbox_src, null, "1.3.19", "all");
516
- $font_src = plugins_url() . '/' . $this -> plugin_name . '/views/default/css/font.css';
517
- wp_enqueue_style('slideshow-font', $font_src, null, null, "all");
518
 
519
  return true;
520
  }
@@ -821,7 +823,35 @@ class GalleryPlugin extends GalleryCheckinit {
821
  return false;
822
  }
823
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
824
  function render($file = null, $params = array(), $output = true, $folder = 'admin') {
 
825
  if (!empty($file)) {
826
  $this -> plugin_name = basename(dirname(__FILE__));
827
  $this -> plugin_base = rtrim(dirname(__FILE__), DS);
1
  <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  class GalleryPlugin extends GalleryCheckinit {
6
 
7
+ var $version = '1.5.3.2';
8
  var $plugin_name;
9
  var $plugin_base;
10
  var $pre = 'Gallery';
160
  $query = "ALTER TABLE `" . $this -> Slide -> table . "` CHANGE `type` `type` ENUM('media','file','url') NOT NULL DEFAULT 'media'";
161
  $wpdb -> query($query);
162
 
163
+
164
  $version = "1.5.3";
165
  }
166
+
167
+ if (version_compare($cur_version, "1.5.3.2") < 0) {
168
+
169
+ $this -> initialize_options();
170
+
171
+ $version = "1.5.3.2";
172
+ }
173
 
174
  //the current version is older.
175
  //lets update the database
305
  }
306
 
307
  function render_msg($message = null) {
308
+ $message = esc_html($message);
309
  $this -> render('msg-top', array('message' => $message), true, 'admin');
310
  }
311
 
312
  function render_err($message = null) {
313
+ $message = esc_html($message);
314
  $this -> render('err-top', array('message' => $message), true, 'admin');
315
  }
316
 
317
+ function redirect($location = null, $msgtype = null, $message = null, $action = null) {
318
  $url = $location;
319
 
320
  if ($msgtype == "message") {
327
  $url .= '&' . $this -> pre . 'message=' . urlencode($message);
328
  }
329
 
330
+ if (!empty($action)) {
331
+ $url = wp_nonce_url($url, $action);
332
+ }
333
+
334
  ?>
335
 
336
  <script type="text/javascript">
444
 
445
  if (is_admin()) {
446
  if (!empty($_GET['page']) && in_array($_GET['page'], (array) $this -> sections)) {
447
+ wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
448
+ wp_enqueue_script('wp-color-picker', admin_url('js/color-picker.min.js'), array( 'iris' ), false, 1);
 
 
 
 
 
 
 
 
 
 
 
 
 
449
 
450
  wp_enqueue_script('jquery-ui-tabs');
451
  wp_enqueue_script('jquery-ui-tooltip');
456
  wp_enqueue_script('wp-lists');
457
  wp_enqueue_script('postbox');
458
  wp_enqueue_script('plugin-install');
459
+ wp_enqueue_script('settings-editor', $this -> render_url('js/settings-editor.js', "admin"), array('jquery'), '1.0');
460
  }
461
 
462
  if ($_GET['page'] == "slideshow-slides" && $_GET['method'] == "order") {
470
  add_thickbox();
471
  }
472
 
473
+ wp_enqueue_script('colorbox', $this -> render_url('js/colorbox.js', "admin"), array('jquery'), '1.3.19');
474
+ wp_enqueue_script($this -> plugin_name . 'admin', $this -> render_url('js/admin.js', "admin"), null, '1.0');
475
  } else {
476
+ wp_enqueue_script($this -> plugin_name, $this -> render_url('js/gallery.js', "default"), null, '1.0');
477
+ wp_enqueue_script('colorbox', $this -> render_url('js/colorbox.js', "default"), array('jquery'), '1.3.19');
478
  wp_enqueue_script('jquery-effects-core');
479
  }
480
 
483
 
484
  function get_css_url($attr = null, $layout = null) {
485
  $file = (empty($layout) || $layout == "specific") ? 'css' : 'css-responsive';
486
+ //$css_url = plugins_url() . '/' . $this -> plugin_name . '/views/default/' . $file . '.php?';
487
+ $css_url = $this -> render_url($file . '.php', 'default') . '?';
488
 
489
  $default_attr = $this -> get_option('styles');
490
  $styles = wp_parse_args($attr, $default_attr);
508
 
509
  function enqueue_styles() {
510
  if (is_admin()) {
511
+ wp_enqueue_style($this -> plugin_name, $this -> render_url('css/admin.css', "admin"), null, "1.0", "all");
 
512
  wp_enqueue_style('wp-color-picker');
513
+ wp_enqueue_style('jquery-ui', $this -> render_url('css/jquery-ui.css', "admin"), null, "1.0", "all");
514
+ wp_enqueue_style('colorbox', $this -> render_url('css/colorbox.css', "admin"), null, "1.3.19", "all");
515
+ } else {
516
+ wp_enqueue_style('colorbox', $this -> render_url('css/colorbox.css', "default"), null, "1.3.19", "all");
517
  }
518
 
519
+ wp_enqueue_style('slideshow-font', $this -> render_url('css/font.css', "default"), null, null, "all");
 
 
 
520
 
521
  return true;
522
  }
823
  return false;
824
  }
825
 
826
+ function render_url($file = null, $folder = 'admin', $extension = null) {
827
+ $this -> plugin_name = basename(dirname(__FILE__));
828
+
829
+ if (!empty($file)) {
830
+ if (!empty($folder) && $folder != "admin") {
831
+ $theme_folder = $this -> get_option('theme_folder');
832
+ $folder = (!empty($theme_folder)) ? $theme_folder : $folder;
833
+ $folderurl = plugins_url() . '/' . $this -> plugin_name . '/views/' . $folder . '/';
834
+
835
+ $template_url = get_stylesheet_directory_uri();
836
+ $theme_path = get_stylesheet_directory();
837
+ $full_path = $theme_path . DS . 'slideshow' . DS . $file;
838
+
839
+ if (!empty($theme_path) && file_exists($full_path)) {
840
+ $folderurl = $template_url . '/slideshow/';
841
+ }
842
+ } else {
843
+ $folderurl = plugins_url() . '/' . $this -> plugin_name . '/';
844
+ }
845
+
846
+ $url = $folderurl . $file;
847
+ return $url;
848
+ }
849
+
850
+ return false;
851
+ }
852
+
853
  function render($file = null, $params = array(), $output = true, $folder = 'admin') {
854
+
855
  if (!empty($file)) {
856
  $this -> plugin_name = basename(dirname(__FILE__));
857
  $this -> plugin_base = rtrim(dirname(__FILE__), DS);
slideshow-gallery.php CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://tribulant.com/plugins/view/13/wordpress-slideshow-gallery
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.5.3
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, bfithumb, galleries, photos, images
@@ -14,6 +14,8 @@ Text Domain: slideshow-gallery
14
  Domain Path: /languages
15
  */
16
 
 
 
17
  if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); }
18
 
19
  $path = dirname(__FILE__) . DS . 'slideshow-gallery-plugin.php';
@@ -175,7 +177,7 @@ if (!class_exists('Gallery')) {
175
  function admin_notices() {
176
  $this -> check_uploaddir();
177
 
178
- if (!empty($_GET[$this -> pre . 'message'])) {
179
  $msg_type = (!empty($_GET[$this -> pre . 'updated'])) ? 'msg' : 'err';
180
  call_user_func(array($this, 'render_' . $msg_type), $_GET[$this -> pre . 'message']);
181
  }
@@ -303,6 +305,7 @@ if (!class_exists('Gallery')) {
303
  // if this is an RSS/Atom feed, it should not continue...
304
  if (is_feed()) { return false; }
305
 
 
306
  if (!empty($products)) {
307
  include_once(ABSPATH . 'wp-admin/includes/plugin.php');
308
  if (is_plugin_active('wp-checkout' . DS . 'wp-checkout.php')) {
@@ -336,6 +339,7 @@ if (!class_exists('Gallery')) {
336
  $content .= stripslashes($error);
337
  $content .= '</p>';
338
  }
 
339
  } elseif (!empty($featured)) {
340
  global $post;
341
 
@@ -358,6 +362,7 @@ if (!class_exists('Gallery')) {
358
  $content .= stripslashes($error);
359
  $content .= '</p>';
360
  }
 
361
  } elseif (!empty($gallery_id)) {
362
  if (!is_array($orderby) || $orderby == "random") {
363
  $orderbystring = "ORDER BY RAND()";
@@ -391,8 +396,9 @@ if (!class_exists('Gallery')) {
391
  }
392
 
393
  if ($orderby == "random") { shuffle($slides); }
394
- $content = $this -> render('gallery', array('slides' => $slides, 'unique' => 'gallery' . $gallery_id, 'options' => $s, 'frompost' => false), false, 'default');
395
  }
 
396
  } elseif (!empty($custom) || empty($post_id)) {
397
  $slides = $this -> Slide -> find_all(null, null, $orderby);
398
 
@@ -408,6 +414,7 @@ if (!class_exists('Gallery')) {
408
 
409
  if ($orderby == "random") { shuffle($slides); }
410
  $content = $this -> render('gallery', array('slides' => $slides, 'unique' => "custom", 'options' => $s, 'frompost' => false), false, 'default');
 
411
  } else {
412
  global $post;
413
  $pid = (empty($post_id)) ? $post -> ID : $post_id;
@@ -467,8 +474,11 @@ if (!class_exists('Gallery')) {
467
 
468
  $this -> redirect($this -> referer, $msg_type, $message);
469
  break;
470
- case 'save' :
471
  if (!empty($_POST)) {
 
 
 
472
  if ($this -> Slide -> save($_POST, true)) {
473
  $message = __('Slide has been saved', $this -> plugin_name);
474
 
@@ -489,6 +499,9 @@ if (!class_exists('Gallery')) {
489
  break;
490
  case 'save-multiple' :
491
  if (!empty($_POST)) {
 
 
 
492
  $errors = array();
493
 
494
  if (!empty($_POST['Slide']['slides'])) {
@@ -524,6 +537,9 @@ if (!class_exists('Gallery')) {
524
  $this -> render('slides' . DS . 'save-multiple', array('errors' => $errors), true, 'admin');
525
  break;
526
  case 'mass' :
 
 
 
527
  if (!empty($_POST['action'])) {
528
  if (!empty($_POST['Slide']['checklist'])) {
529
  switch ($_POST['action']) {
@@ -587,6 +603,9 @@ if (!class_exists('Gallery')) {
587
  switch ($_GET['method']) {
588
  case 'save' :
589
  if (!empty($_POST)) {
 
 
 
590
  if ($this -> Gallery -> save($_POST, true)) {
591
  $message = __('Gallery has been saved', $this -> plugin_name);
592
 
@@ -607,7 +626,7 @@ if (!class_exists('Gallery')) {
607
  case 'view' :
608
  $this -> Db -> model = $this -> Gallery -> model;
609
  $gallery = $this -> Gallery -> find(array('id' => $_GET['id']));
610
- $data = $this -> paginate('GallerySlides', "*", false, array('gallery_id' => $gallery -> id));
611
 
612
  $data['Slide'] = array();
613
  if (!empty($data[$this -> GallerySlides -> model])) {
@@ -641,6 +660,9 @@ if (!class_exists('Gallery')) {
641
  $this -> redirect($this -> referer, $msg_type, $message);
642
  break;
643
  case 'mass' :
 
 
 
644
  if (!empty($_POST['action'])) {
645
  if (!empty($_POST['Gallery']['checklist'])) {
646
  switch ($_POST['action']) {
@@ -716,6 +738,9 @@ if (!class_exists('Gallery')) {
716
  break;
717
  default :
718
  if (!empty($_POST)) {
 
 
 
719
  delete_option('tridebugging');
720
  $this -> delete_option('infohideonmobile');
721
  $this -> delete_option('autoheight');
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.5.3.2
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, bfithumb, galleries, photos, images
14
  Domain Path: /languages
15
  */
16
 
17
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
18
+
19
  if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); }
20
 
21
  $path = dirname(__FILE__) . DS . 'slideshow-gallery-plugin.php';
177
  function admin_notices() {
178
  $this -> check_uploaddir();
179
 
180
+ if (!empty($_GET[$this -> pre . 'message'])) {
181
  $msg_type = (!empty($_GET[$this -> pre . 'updated'])) ? 'msg' : 'err';
182
  call_user_func(array($this, 'render_' . $msg_type), $_GET[$this -> pre . 'message']);
183
  }
305
  // if this is an RSS/Atom feed, it should not continue...
306
  if (is_feed()) { return false; }
307
 
308
+ // Shopping Cart plugin products
309
  if (!empty($products)) {
310
  include_once(ABSPATH . 'wp-admin/includes/plugin.php');
311
  if (is_plugin_active('wp-checkout' . DS . 'wp-checkout.php')) {
339
  $content .= stripslashes($error);
340
  $content .= '</p>';
341
  }
342
+ // Featured images
343
  } elseif (!empty($featured)) {
344
  global $post;
345
 
362
  $content .= stripslashes($error);
363
  $content .= '</p>';
364
  }
365
+ // Slides of a gallery
366
  } elseif (!empty($gallery_id)) {
367
  if (!is_array($orderby) || $orderby == "random") {
368
  $orderbystring = "ORDER BY RAND()";
396
  }
397
 
398
  if ($orderby == "random") { shuffle($slides); }
399
+ $content = $this -> render('gallery', array('slides' => $slides, 'unique' => 'gallery' . $gallery_id . rand(1, 999), 'options' => $s, 'frompost' => false), false, 'default');
400
  }
401
+ // All slides
402
  } elseif (!empty($custom) || empty($post_id)) {
403
  $slides = $this -> Slide -> find_all(null, null, $orderby);
404
 
414
 
415
  if ($orderby == "random") { shuffle($slides); }
416
  $content = $this -> render('gallery', array('slides' => $slides, 'unique' => "custom", 'options' => $s, 'frompost' => false), false, 'default');
417
+ // Images of a post/page
418
  } else {
419
  global $post;
420
  $pid = (empty($post_id)) ? $post -> ID : $post_id;
474
 
475
  $this -> redirect($this -> referer, $msg_type, $message);
476
  break;
477
+ case 'save' :
478
  if (!empty($_POST)) {
479
+
480
+ check_admin_referer('slideshow-slides-save_' . $_POST['Slide']['id']);
481
+
482
  if ($this -> Slide -> save($_POST, true)) {
483
  $message = __('Slide has been saved', $this -> plugin_name);
484
 
499
  break;
500
  case 'save-multiple' :
501
  if (!empty($_POST)) {
502
+
503
+ check_admin_referer($this -> sections -> slides . '-save-multiple');
504
+
505
  $errors = array();
506
 
507
  if (!empty($_POST['Slide']['slides'])) {
537
  $this -> render('slides' . DS . 'save-multiple', array('errors' => $errors), true, 'admin');
538
  break;
539
  case 'mass' :
540
+
541
+ check_admin_referer($this -> sections -> slides . '-bulkaction');
542
+
543
  if (!empty($_POST['action'])) {
544
  if (!empty($_POST['Slide']['checklist'])) {
545
  switch ($_POST['action']) {
603
  switch ($_GET['method']) {
604
  case 'save' :
605
  if (!empty($_POST)) {
606
+
607
+ check_admin_referer('slideshow-galleries-save_' . $_POST['Gallery']['id']);
608
+
609
  if ($this -> Gallery -> save($_POST, true)) {
610
  $message = __('Gallery has been saved', $this -> plugin_name);
611
 
626
  case 'view' :
627
  $this -> Db -> model = $this -> Gallery -> model;
628
  $gallery = $this -> Gallery -> find(array('id' => $_GET['id']));
629
+ $data = $this -> paginate('GallerySlides', "*", $this -> sections -> galleries . '&method=view&id=' . $gallery -> id, array('gallery_id' => $gallery -> id));
630
 
631
  $data['Slide'] = array();
632
  if (!empty($data[$this -> GallerySlides -> model])) {
660
  $this -> redirect($this -> referer, $msg_type, $message);
661
  break;
662
  case 'mass' :
663
+
664
+ check_admin_referer($this -> sections -> galleries . '-bulkaction');
665
+
666
  if (!empty($_POST['action'])) {
667
  if (!empty($_POST['Gallery']['checklist'])) {
668
  switch ($_POST['action']) {
738
  break;
739
  default :
740
  if (!empty($_POST)) {
741
+
742
+ check_admin_referer($this -> sections -> settings);
743
+
744
  delete_option('tridebugging');
745
  $this -> delete_option('infohideonmobile');
746
  $this -> delete_option('autoheight');
vendors/class.paginate.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
 
3
  class GalleryPaginate extends GalleryPlugin {
4
 
@@ -50,7 +52,7 @@ class GalleryPaginate extends GalleryPlugin {
50
 
51
  var $pagination = '';
52
 
53
- function GalleryPaginate($table = '', $fields = '', $sub = '', $parent = '') {
54
  $this -> sub = $sub;
55
  $this -> parentd = $parent;
56
 
@@ -63,7 +65,7 @@ class GalleryPaginate extends GalleryPlugin {
63
  }
64
  }
65
 
66
- function start_paging($page = '') {
67
  global $wpdb;
68
 
69
  $page = (empty($page)) ? 1 : $page;
1
  <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  class GalleryPaginate extends GalleryPlugin {
6
 
52
 
53
  var $pagination = '';
54
 
55
+ function GalleryPaginate($table = null, $fields = null, $sub = null, $parent = null) {
56
  $this -> sub = $sub;
57
  $this -> parentd = $parent;
58
 
65
  }
66
  }
67
 
68
+ function start_paging($page = null) {
69
  global $wpdb;
70
 
71
  $page = (empty($page)) ? 1 : $page;
vendors/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
views/admin/about.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  /**
3
  * Slideshow Gallery About Dashboard v1.4.4.3
4
  */
1
  <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
  /**
6
  * Slideshow Gallery About Dashboard v1.4.4.3
7
  */
views/admin/err-top.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <?php if (!empty($message)) : ?>
2
  <div class="error fade">
3
  <p><?php echo $message; ?></p>
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <?php if (!empty($message)) : ?>
8
  <div class="error fade">
9
  <p><?php echo $message; ?></p>
views/admin/galleries/hardcode.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <div class="wrap <?php echo $this -> pre; ?>">
2
  <h2><?php echo sprintf(__('Hardcode Gallery: %s', $this -> plugin_name), __($gallery -> title)); ?></h2>
3
  <div style="float:none;" class="subsubsub"><?php echo $this -> Html -> link(__('&larr; All Galleries', $this -> plugin_name), $this -> url, array('title' => __('All Galleries', $this -> plugin_name))); ?></div>
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <div class="wrap <?php echo $this -> pre; ?>">
8
  <h2><?php echo sprintf(__('Hardcode Gallery: %s', $this -> plugin_name), __($gallery -> title)); ?></h2>
9
  <div style="float:none;" class="subsubsub"><?php echo $this -> Html -> link(__('&larr; All Galleries', $this -> plugin_name), $this -> url, array('title' => __('All Galleries', $this -> plugin_name))); ?></div>
views/admin/galleries/index.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <div class="wrap <?php echo $this -> pre; ?> slideshow">
2
  <h2><?php _e('Manage Galleries', $this -> plugin_name); ?> <?php echo $this -> Html -> link(__('Add New', $this -> plugin_name), $this -> url . '&amp;method=save', array('class' => "add-new-h2")); ?></h2>
3
 
@@ -9,6 +15,9 @@
9
  </form>
10
 
11
  <form onsubmit="if (!confirm('<?php _e('Are you sure you wish to execute this action on the selected galleries?', $this -> plugin_name); ?>')) { return false; }" action="<?php echo $this -> url; ?>&amp;method=mass" method="post">
 
 
 
12
  <div class="tablenav">
13
  <div class="alignleft actions">
14
  <select name="action" class="action">
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <div class="wrap <?php echo $this -> pre; ?> slideshow">
8
  <h2><?php _e('Manage Galleries', $this -> plugin_name); ?> <?php echo $this -> Html -> link(__('Add New', $this -> plugin_name), $this -> url . '&amp;method=save', array('class' => "add-new-h2")); ?></h2>
9
 
15
  </form>
16
 
17
  <form onsubmit="if (!confirm('<?php _e('Are you sure you wish to execute this action on the selected galleries?', $this -> plugin_name); ?>')) { return false; }" action="<?php echo $this -> url; ?>&amp;method=mass" method="post">
18
+
19
+ <?php wp_nonce_field($this -> sections -> galleries . '-bulkaction'); ?>
20
+
21
  <div class="tablenav">
22
  <div class="alignleft actions">
23
  <select name="action" class="action">
views/admin/galleries/save.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
 
 
3
  $languages = $this -> language_getlanguages();
4
 
5
  ?>
@@ -8,6 +9,9 @@ $languages = $this -> language_getlanguages();
8
  <h2><?php _e('Save a Gallery', $this -> plugin_name); ?></h2>
9
 
10
  <form action="<?php echo $this -> url; ?>&amp;method=save" method="post">
 
 
 
11
  <input type="hidden" name="Gallery[id]" value="<?php echo $this -> Gallery -> data -> id; ?>" />
12
 
13
  <table class="form-table">
1
  <?php
2
 
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
  $languages = $this -> language_getlanguages();
5
 
6
  ?>
9
  <h2><?php _e('Save a Gallery', $this -> plugin_name); ?></h2>
10
 
11
  <form action="<?php echo $this -> url; ?>&amp;method=save" method="post">
12
+
13
+ <?php wp_nonce_field('slideshow-galleries-save_' . $this -> Gallery -> data -> id); ?>
14
+
15
  <input type="hidden" name="Gallery[id]" value="<?php echo $this -> Gallery -> data -> id; ?>" />
16
 
17
  <table class="form-table">
views/admin/galleries/view.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <div class="wrap <?php echo $this -> pre; ?> slideshow">
2
  <h2><?php echo sprintf(__('View Gallery: %s', $this -> plugin_name), __($gallery -> title)); ?></h2>
3
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <div class="wrap <?php echo $this -> pre; ?> slideshow">
8
  <h2><?php echo sprintf(__('View Gallery: %s', $this -> plugin_name), __($gallery -> title)); ?></h2>
9
 
views/admin/head.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <script type="text/javascript">
2
  var GalleryAjax = "<?php echo $this -> url(); ?>/<?php echo $this -> plugin_name; ?>-ajax.php";
3
  var slideshowajax = "<?php echo admin_url('admin-ajax.php'); ?>";
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <script type="text/javascript">
8
  var GalleryAjax = "<?php echo $this -> url(); ?>/<?php echo $this -> plugin_name; ?>-ajax.php";
9
  var slideshowajax = "<?php echo admin_url('admin-ajax.php'); ?>";
views/admin/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
views/admin/metaboxes/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
views/admin/metaboxes/settings-about.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <div class="submitbox">
2
  <div id="minor-publishing">
3
  <div id="misc-publishing-actions">
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <div class="submitbox">
8
  <div id="minor-publishing">
9
  <div id="misc-publishing-actions">
views/admin/metaboxes/settings-general.php CHANGED
@@ -1,6 +1,8 @@
1
  <!-- General Settings -->
2
 
3
  <?php
 
 
4
 
5
  $effect = $this -> get_option('effect');
6
  $slide_direction = $this -> get_option('slide_direction');
1
  <!-- General Settings -->
2
 
3
  <?php
4
+
5
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
6
 
7
  $effect = $this -> get_option('effect');
8
  $slide_direction = $this -> get_option('slide_direction');
views/admin/metaboxes/settings-linksimages.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <table class="form-table">
2
  <tbody>
3
  <tr>
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <table class="form-table">
8
  <tbody>
9
  <tr>
views/admin/metaboxes/settings-plugins.php CHANGED
@@ -1,7 +1,13 @@
 
 
 
 
 
 
1
  <div style="text-align:center;">
2
  <h4><a href="https://wordpress.org/plugins/newsletters-lite/" target="_blank">WordPress Newsletter plugin LITE</a></h4>
3
  <p>
4
- <a href="https://wordpress.org/plugins/newsletters-lite/" target="_blank"><img src="<?php echo $this -> url(); ?>/images/plugins/newsletters.png" alt="newsletters" /></a>
5
  </p>
6
  <p>
7
  Get the WordPress Newsletter plugin LITE today. It is a FREE plugin which can be installed by clicking the button below.
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <div style="text-align:center;">
8
  <h4><a href="https://wordpress.org/plugins/newsletters-lite/" target="_blank">WordPress Newsletter plugin LITE</a></h4>
9
  <p>
10
+ <a href="https://wordpress.org/plugins/newsletters-lite/" target="_blank"><img style="width:200px; height:auto;" width="200" src="<?php echo $this -> url(); ?>/images/plugins/newsletters.png" alt="newsletters" /></a>
11
  </p>
12
  <p>
13
  Get the WordPress Newsletter plugin LITE today. It is a FREE plugin which can be installed by clicking the button below.
views/admin/metaboxes/settings-styles.php CHANGED
@@ -1,6 +1,8 @@
1
  <!-- Styles Settings -->
2
 
3
  <?php
 
 
4
 
5
  $styles = $this -> get_option('styles');
6
  $autoheight = $this -> get_option('autoheight');
1
  <!-- Styles Settings -->
2
 
3
  <?php
4
+
5
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
6
 
7
  $styles = $this -> get_option('styles');
8
  $autoheight = $this -> get_option('autoheight');
views/admin/metaboxes/settings-submit.php CHANGED
@@ -1,6 +1,8 @@
1
  <!-- Settings Submit -->
2
 
3
  <?php
 
 
4
 
5
  $debugging = get_option('tridebugging');
6
 
1
  <!-- Settings Submit -->
2
 
3
  <?php
4
+
5
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
6
 
7
  $debugging = get_option('tridebugging');
8
 
views/admin/metaboxes/settings-tech.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  <?php
4
 
 
 
5
  $jsoutput = $this -> get_option('jsoutput');
6
 
7
  ?>
2
 
3
  <?php
4
 
5
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
6
+
7
  $jsoutput = $this -> get_option('jsoutput');
8
 
9
  ?>
views/admin/metaboxes/settings-wprelated.php CHANGED
@@ -1,6 +1,8 @@
1
  <!-- WordPress Related Settings -->
2
 
3
  <?php
 
 
4
 
5
  $language_external = $this -> get_option('language_external');
6
  $locale = get_locale();
1
  <!-- WordPress Related Settings -->
2
 
3
  <?php
4
+
5
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
6
 
7
  $language_external = $this -> get_option('language_external');
8
  $locale = get_locale();
views/admin/msg-top.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <?php if (!empty($message)) : ?>
2
  <div class="updated fade">
3
  <p><?php echo $message; ?></p>
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <?php if (!empty($message)) : ?>
8
  <div class="updated fade">
9
  <p><?php echo $message; ?></p>
views/admin/paginate.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <?php if (!empty($paginate -> pagination)) : ?>
2
  <div class="tablenav-pages">
3
  <?php echo $paginate -> pagination; ?>
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <?php if (!empty($paginate -> pagination)) : ?>
8
  <div class="tablenav-pages">
9
  <?php echo $paginate -> pagination; ?>
views/admin/settings.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
 
3
  global $post, $post_ID;
4
  $post_ID = 1;
@@ -12,6 +14,9 @@ wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
12
  <h2><?php _e('Configuration Settings', $this -> plugin_name); ?></h2>
13
 
14
  <form action="<?php echo $this -> url; ?>" name="post" id="post" method="post">
 
 
 
15
  <div id="poststuff" class="metabox-holder has-right-sidebar">
16
  <div id="side-info-column" class="inner-sidebar">
17
  <?php do_action('submitpage_box'); ?>
1
  <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  global $post, $post_ID;
6
  $post_ID = 1;
14
  <h2><?php _e('Configuration Settings', $this -> plugin_name); ?></h2>
15
 
16
  <form action="<?php echo $this -> url; ?>" name="post" id="post" method="post">
17
+
18
+ <?php wp_nonce_field($this -> sections -> settings); ?>
19
+
20
  <div id="poststuff" class="metabox-holder has-right-sidebar">
21
  <div id="side-info-column" class="inner-sidebar">
22
  <?php do_action('submitpage_box'); ?>
views/admin/slides/index.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <div class="wrap <?php echo $this -> pre; ?> slideshow">
2
  <h2><?php _e('Manage Slides', $this -> plugin_name); ?>
3
  <?php echo $this -> Html -> link(__('Add New', $this -> plugin_name), $this -> url . '&amp;method=save', array('class' => "add-new-h2")); ?>
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <div class="wrap <?php echo $this -> pre; ?> slideshow">
8
  <h2><?php _e('Manage Slides', $this -> plugin_name); ?>
9
  <?php echo $this -> Html -> link(__('Add New', $this -> plugin_name), $this -> url . '&amp;method=save', array('class' => "add-new-h2")); ?>
views/admin/slides/loop.php CHANGED
@@ -1,5 +1,14 @@
 
 
 
 
 
 
1
  <?php if (!empty($slides)) : ?>
2
  <form onsubmit="if (!confirm('<?php _e('Are you sure you wish to execute this action on the selected slides?', $this -> plugin_name); ?>')) { return false; }" action="<?php echo $this -> url; ?>&amp;method=mass" method="post">
 
 
 
3
  <div class="tablenav">
4
  <div class="alignleft actions">
5
  <?php if (!empty($_GET['page']) && $_GET['page'] == $this -> sections -> galleries) : ?>
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <?php if (!empty($slides)) : ?>
8
  <form onsubmit="if (!confirm('<?php _e('Are you sure you wish to execute this action on the selected slides?', $this -> plugin_name); ?>')) { return false; }" action="<?php echo $this -> url; ?>&amp;method=mass" method="post">
9
+
10
+ <?php wp_nonce_field($this -> sections -> slides . '-bulkaction'); ?>
11
+
12
  <div class="tablenav">
13
  <div class="alignleft actions">
14
  <?php if (!empty($_GET['page']) && $_GET['page'] == $this -> sections -> galleries) : ?>
views/admin/slides/order.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <div class="wrap">
2
  <h2><?php _e('Order Slides', $this -> plugin_name); ?><?php echo (!empty($gallery)) ? ': ' . __($gallery -> title) : ''; ?></h2>
3
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <div class="wrap">
8
  <h2><?php _e('Order Slides', $this -> plugin_name); ?><?php echo (!empty($gallery)) ? ': ' . __($gallery -> title) : ''; ?></h2>
9
 
views/admin/slides/save-multiple.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <div class="wrap <?php echo $this -> pre; ?> slideshow">
2
  <h2><?php _e('Save Multiple Slides', $this -> plugin_name); ?></h2>
3
 
@@ -12,6 +18,9 @@
12
  <?php endif; ?>
13
 
14
  <form action="" method="post">
 
 
 
15
  <table class="form-table">
16
  <tbody>
17
  <tr>
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ ?>
6
+
7
  <div class="wrap <?php echo $this -> pre; ?> slideshow">
8
  <h2><?php _e('Save Multiple Slides', $this -> plugin_name); ?></h2>
9
 
18
  <?php endif; ?>
19
 
20
  <form action="" method="post">
21
+
22
+ <?php wp_nonce_field($this -> sections -> slides . '-save-multiple'); ?>
23
+
24
  <table class="form-table">
25
  <tbody>
26
  <tr>
views/admin/slides/save.php CHANGED
@@ -1,6 +1,8 @@
1
  <!-- Save a Slide -->
2
 
3
  <?php
 
 
4
 
5
  $showinfo = $this -> Slide -> data -> showinfo;
6
  $languages = $this -> language_getlanguages();
@@ -11,6 +13,9 @@ $languages = $this -> language_getlanguages();
11
  <h2><?php _e('Save a Slide', $this -> plugin_name); ?></h2>
12
 
13
  <form action="<?php echo $this -> url; ?>&amp;method=save" method="post" enctype="multipart/form-data">
 
 
 
14
  <input type="hidden" name="Slide[id]" value="<?php echo $this -> Slide -> data -> id; ?>" />
15
  <input type="hidden" name="Slide[order]" value="<?php echo $this -> Slide -> data -> order; ?>" />
16
 
1
  <!-- Save a Slide -->
2
 
3
  <?php
4
+
5
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
6
 
7
  $showinfo = $this -> Slide -> data -> showinfo;
8
  $languages = $this -> language_getlanguages();
13
  <h2><?php _e('Save a Slide', $this -> plugin_name); ?></h2>
14
 
15
  <form action="<?php echo $this -> url; ?>&amp;method=save" method="post" enctype="multipart/form-data">
16
+
17
+ <?php wp_nonce_field('slideshow-slides-save_' . $this -> Slide -> data -> id); ?>
18
+
19
  <input type="hidden" name="Slide[id]" value="<?php echo $this -> Slide -> data -> id; ?>" />
20
  <input type="hidden" name="Slide[order]" value="<?php echo $this -> Slide -> data -> order; ?>" />
21
 
views/default/css/colorbox.css ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Colorbox Core Style:
3
+ The following CSS is consistent between example themes and should not be altered.
4
+ */
5
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
6
+ #cboxWrapper {max-width:none;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative;}
10
+ #cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
11
+ #cboxTitle{margin:0;}
12
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
13
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
14
+ .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
15
+ .cboxIframe{width:100%; height:100%; display:block; border:0;}
16
+ #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
17
+
18
+ /*
19
+ User Style:
20
+ Change the following styles to modify the appearance of Colorbox. They are
21
+ ordered & tabbed in a way that represents the nesting of the generated HTML.
22
+ */
23
+ #cboxOverlay{background:url(../images/colorbox/overlay.png) repeat 0 0;}
24
+ #colorbox{outline:0;}
25
+ #cboxTopLeft{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -101px 0;}
26
+ #cboxTopRight{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -130px 0;}
27
+ #cboxBottomLeft{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -101px -29px;}
28
+ #cboxBottomRight{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -130px -29px;}
29
+ #cboxMiddleLeft{width:21px; background:url(../images/colorbox/controls.png) left top repeat-y;}
30
+ #cboxMiddleRight{width:21px; background:url(../images/colorbox/controls.png) right top repeat-y;}
31
+ #cboxTopCenter{height:21px; background:url(../images/colorbox/border.png) 0 0 repeat-x;}
32
+ #cboxBottomCenter{height:21px; background:url(../images/colorbox/border.png) 0 -29px repeat-x;}
33
+ #cboxContent{background:#fff; overflow:hidden;}
34
+ .cboxIframe{background:#fff;}
35
+ #cboxError{padding:50px; border:1px solid #ccc;}
36
+ #cboxLoadedContent{margin-bottom:28px;}
37
+ #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
38
+ #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
39
+ #cboxLoadingOverlay{background:url(../images/colorbox/loading_background.png) no-repeat center center;}
40
+ #cboxLoadingGraphic{background:url(../images/colorbox/loading.gif) no-repeat center center;}
41
+
42
+ /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
43
+ #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
44
+
45
+ /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
46
+ #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
47
+
48
+ #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
49
+ #cboxPrevious{position:absolute; bottom:0; left:0; background:url(../images/colorbox/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
50
+ #cboxPrevious:hover{background-position:-75px -25px;}
51
+ #cboxNext{position:absolute; bottom:0; left:27px; background:url(../images/colorbox/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
52
+ #cboxNext:hover{background-position:-50px -25px;}
53
+ #cboxClose{position:absolute; bottom:0; right:0; background:url(../images/colorbox/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
54
+ #cboxClose:hover{background-position:-25px -25px;}
55
+
56
+ /*
57
+ The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
58
+ when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
59
+ See: http://jacklmoore.com/notes/ie-transparency-problems/
60
+ */
61
+ .cboxIE #cboxTopLeft,
62
+ .cboxIE #cboxTopCenter,
63
+ .cboxIE #cboxTopRight,
64
+ .cboxIE #cboxBottomLeft,
65
+ .cboxIE #cboxBottomCenter,
66
+ .cboxIE #cboxBottomRight,
67
+ .cboxIE #cboxMiddleLeft,
68
+ .cboxIE #cboxMiddleRight {
69
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
70
+ }
views/default/gallery.php CHANGED
@@ -22,16 +22,22 @@ $thumbopacity = $this -> get_option('thumbopacity');
22
  <?php else : ?>
23
  <span><?php echo $full_image_href[0]; ?></span>
24
  <?php endif; ?>
25
- <p><?php echo stripslashes(__(get_the_excerpt())); ?></p>
 
 
 
 
 
 
26
  <?php $thumbnail_link = wp_get_attachment_image_src($slide -> ID, 'thumbnail', false); ?>
27
  <?php if ($options['showthumbs'] == "true") : ?>
28
  <?php if (!empty($slide -> guid)) : ?>
29
- <a href="<?php echo $slide -> guid; ?>" id="<?php echo $unique; ?>imglink<?php echo $slide -> ID; ?>" <?php if ($this -> Html -> is_image($slide -> guid)) : ?>class="colorbox" rel="slideshow<?php echo $unique; ?>overlay"<?php endif; ?> target="_self" title="<?php echo esc_attr(__($slide -> post_title)); ?>"><img src="<?php echo $this -> Html -> bfithumb_image_src($full_image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> post_title)); ?>" /></a>
30
  <?php else : ?>
31
- <a id="<?php echo $unique; ?>imglink<?php echo $slide -> ID; ?>" <?php if ($this -> Html -> is_image($full_image_url)) : ?>class="colorbox" rel="slideshow<?php echo $unique; ?>overlay"<?php endif; ?>><img src="<?php echo $this -> Html -> bfithumb_image_src($full_image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> post_title)); ?>" /></a>
32
  <?php endif; ?>
33
  <?php else : ?>
34
- <a id="<?php echo $unique; ?>imglink<?php echo $slide -> ID; ?>" <?php if ($this -> Html -> is_image($slide -> guid)) : ?>class="colorbox" rel="slideshow<?php echo $unique; ?>overlay"<?php endif; ?> href="<?php echo $slide -> guid; ?>" title="<?php echo __($slide -> post_title); ?>"></a>
35
  <?php endif; ?>
36
  </li>
37
  <?php wp_reset_postdata(); ?>
@@ -56,7 +62,7 @@ $thumbopacity = $this -> get_option('thumbopacity');
56
  <?php if (!empty($slide -> guid)) : ?>
57
  <a href="<?php echo $slide -> guid; ?>" target="_self" title="<?php echo esc_attr(__($slide -> post_title)); ?>"><img src="<?php echo $this -> Html -> bfithumb_image_src($full_image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> post_title)); ?>" /></a>
58
  <?php else : ?>
59
- <a id="<?php echo $unique; ?>imglink<?php echo $slide -> ID; ?>" <?php if ($this -> Html -> is_image($full_image_url)) : ?>class="colorbox" rel="slideshow<?php echo $unique; ?>overlay"<?php endif; ?>><img src="<?php echo $this -> Html -> bfithumb_image_src($full_image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> post_title)); ?>" /></a>
60
  <?php endif; ?>
61
  <?php else : ?>
62
  <a href="<?php echo $slide -> guid; ?>" target="_self" title="<?php echo __($slide -> post_title); ?>"></a>
@@ -101,7 +107,7 @@ $thumbopacity = $this -> get_option('thumbopacity');
101
  <?php if ($slide -> uselink == "Y" && !empty($slide -> link)) : ?>
102
  <a href="<?php echo $slide -> link; ?>" title="<?php echo esc_attr(__($slide -> title)); ?>" target="_<?php echo $slide -> linktarget; ?>"><img src="<?php echo $this -> Html -> bfithumb_image_src($slide -> image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> title)); ?>" /></a>
103
  <?php elseif ($options['imagesoverlay'] == "true") : ?>
104
- <a href="<?php echo $slide -> image_path; ?>" id="<?php echo $unique; ?>imglink<?php echo $slide -> id; ?>" <?php if ($this -> Html -> is_image($slide -> image_path)) : ?>class="colorbox" rel="slideshow<?php echo $unique; ?>overlay"<?php endif; ?> target="_<?php echo $slide -> linktarget; ?>" title="<?php echo __($slide -> title); ?>"><img src="<?php echo $this -> Html -> bfithumb_image_src($slide -> image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> title)); ?>" /></a>
105
  <?php else : ?>
106
  <a><img src="<?php echo $this -> Html -> bfithumb_image_src($slide -> image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> title)); ?>" /></a>
107
  <?php endif; ?>
@@ -109,7 +115,7 @@ $thumbopacity = $this -> get_option('thumbopacity');
109
  <?php if ($slide -> uselink == "Y" && !empty($slide -> link)) : ?>
110
  <a href="<?php echo $slide -> link; ?>" target="_<?php echo $slide -> linktarget; ?>" title="<?php echo __($slide -> title); ?>"></a>
111
  <?php elseif ($options['imagesoverlay'] == "true") : ?>
112
- <a href="<?php echo $slide -> image_path; ?>" id="<?php echo $unique; ?>imglink<?php echo $slide -> id; ?>" <?php if ($this -> Html -> is_image($slide -> image_path)) : ?>class="colorbox" rel="slideshow<?php echo $unique; ?>overlay"<?php endif; ?> class="colorbox" rel="slideshow<?php echo $unique; ?>overlay" target="_<?php echo $slide -> linktarget; ?>" title="<?php echo __($slide -> title); ?>"></a>
113
  <?php else : ?>
114
  <a></a>
115
  <?php endif; ?>
22
  <?php else : ?>
23
  <span><?php echo $full_image_href[0]; ?></span>
24
  <?php endif; ?>
25
+ <?php /*<p><?php echo stripslashes(__(get_the_excerpt())); ?></p>*/ ?>
26
+ <?php
27
+
28
+ $attachment = wp_get_attachment_metadata($slide -> ID);
29
+
30
+ ?>
31
+ <p><?php echo $attachment['image_meta']['caption']; ?></p>
32
  <?php $thumbnail_link = wp_get_attachment_image_src($slide -> ID, 'thumbnail', false); ?>
33
  <?php if ($options['showthumbs'] == "true") : ?>
34
  <?php if (!empty($slide -> guid)) : ?>
35
+ <a href="<?php echo $slide -> guid; ?>" id="<?php echo $unique; ?>imglink<?php echo $slide -> ID; ?>" <?php if ($this -> Html -> is_image($slide -> guid)) : ?>class="colorboxslideshow<?php echo $unique; ?>" rel="slideshow<?php echo $unique; ?>overlay"<?php endif; ?> target="_self" title="<?php echo esc_attr(__($slide -> post_title)); ?>"><img src="<?php echo $this -> Html -> bfithumb_image_src($full_image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> post_title)); ?>" /></a>
36
  <?php else : ?>
37
+ <a id="<?php echo $unique; ?>imglink<?php echo $slide -> ID; ?>" <?php if ($this -> Html -> is_image($full_image_url)) : ?>class="colorboxslideshow<?php echo $unique; ?>" rel="slideshow<?php echo $unique; ?>overlay"<?php endif; ?>><img src="<?php echo $this -> Html -> bfithumb_image_src($full_image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> post_title)); ?>" /></a>
38
  <?php endif; ?>
39
  <?php else : ?>
40
+ <a id="<?php echo $unique; ?>imglink<?php echo $slide -> ID; ?>" <?php if ($this -> Html -> is_image($slide -> guid)) : ?>class="colorboxslideshow<?php echo $unique; ?>" rel="slideshow<?php echo $unique; ?>overlay"<?php endif; ?> href="<?php echo $slide -> guid; ?>" title="<?php echo __($slide -> post_title); ?>"></a>
41
  <?php endif; ?>
42
  </li>
43
  <?php wp_reset_postdata(); ?>
62
  <?php if (!empty($slide -> guid)) : ?>
63
  <a href="<?php echo $slide -> guid; ?>" target="_self" title="<?php echo esc_attr(__($slide -> post_title)); ?>"><img src="<?php echo $this -> Html -> bfithumb_image_src($full_image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> post_title)); ?>" /></a>
64
  <?php else : ?>
65
+ <a id="<?php echo $unique; ?>imglink<?php echo $slide -> ID; ?>" <?php if ($this -> Html -> is_image($full_image_url)) : ?>class="colorboxslideshow<?php echo $unique; ?>" rel="slideshow<?php echo $unique; ?>overlay"<?php endif; ?>><img src="<?php echo $this -> Html -> bfithumb_image_src($full_image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> post_title)); ?>" /></a>
66
  <?php endif; ?>
67
  <?php else : ?>
68
  <a href="<?php echo $slide -> guid; ?>" target="_self" title="<?php echo __($slide -> post_title); ?>"></a>
107
  <?php if ($slide -> uselink == "Y" && !empty($slide -> link)) : ?>
108
  <a href="<?php echo $slide -> link; ?>" title="<?php echo esc_attr(__($slide -> title)); ?>" target="_<?php echo $slide -> linktarget; ?>"><img src="<?php echo $this -> Html -> bfithumb_image_src($slide -> image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> title)); ?>" /></a>
109
  <?php elseif ($options['imagesoverlay'] == "true") : ?>
110
+ <a href="<?php echo $slide -> image_path; ?>" id="<?php echo $unique; ?>imglink<?php echo $slide -> id; ?>" <?php if ($this -> Html -> is_image($slide -> image_path)) : ?>class="colorboxslideshow<?php echo $unique; ?>" rel="slideshow<?php echo $unique; ?>overlay"<?php endif; ?> target="_<?php echo $slide -> linktarget; ?>" title="<?php echo __($slide -> title); ?>"><img src="<?php echo $this -> Html -> bfithumb_image_src($slide -> image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> title)); ?>" /></a>
111
  <?php else : ?>
112
  <a><img src="<?php echo $this -> Html -> bfithumb_image_src($slide -> image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> title)); ?>" /></a>
113
  <?php endif; ?>
115
  <?php if ($slide -> uselink == "Y" && !empty($slide -> link)) : ?>
116
  <a href="<?php echo $slide -> link; ?>" target="_<?php echo $slide -> linktarget; ?>" title="<?php echo __($slide -> title); ?>"></a>
117
  <?php elseif ($options['imagesoverlay'] == "true") : ?>
118
+ <a href="<?php echo $slide -> image_path; ?>" id="<?php echo $unique; ?>imglink<?php echo $slide -> id; ?>" <?php if ($this -> Html -> is_image($slide -> image_path)) : ?>class="colorboxslideshow<?php echo $unique; ?>" rel="slideshow<?php echo $unique; ?>overlay"<?php endif; ?> rel="slideshow<?php echo $unique; ?>overlay" target="_<?php echo $slide -> linktarget; ?>" title="<?php echo __($slide -> title); ?>"></a>
119
  <?php else : ?>
120
  <a></a>
121
  <?php endif; ?>
views/default/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>
views/default/js/colorbox.js ADDED
@@ -0,0 +1,1086 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ Colorbox v1.4.37 - 2014-02-11
3
+ jQuery lightbox and modal window plugin
4
+ (c) 2014 Jack Moore - http://www.jacklmoore.com/colorbox
5
+ license: http://www.opensource.org/licenses/mit-license.php
6
+ */
7
+ (function ($, document, window) {
8
+ var
9
+ // Default settings object.
10
+ // See http://jacklmoore.com/colorbox for details.
11
+ defaults = {
12
+ // data sources
13
+ html: false,
14
+ photo: false,
15
+ iframe: false,
16
+ inline: false,
17
+
18
+ // behavior and appearance
19
+ transition: "elastic",
20
+ speed: 300,
21
+ fadeOut: 300,
22
+ width: false,
23
+ initialWidth: "600",
24
+ innerWidth: false,
25
+ maxWidth: false,
26
+ height: false,
27
+ initialHeight: "450",
28
+ innerHeight: false,
29
+ maxHeight: false,
30
+ scalePhotos: true,
31
+ scrolling: true,
32
+ href: false,
33
+ title: false,
34
+ rel: false,
35
+ opacity: 0.9,
36
+ preloading: true,
37
+ className: false,
38
+ overlayClose: true,
39
+ escKey: true,
40
+ arrowKey: true,
41
+ top: false,
42
+ bottom: false,
43
+ left: false,
44
+ right: false,
45
+ fixed: false,
46
+ data: undefined,
47
+ closeButton: true,
48
+ fastIframe: true,
49
+ open: false,
50
+ reposition: true,
51
+ loop: true,
52
+ slideshow: false,
53
+ slideshowAuto: true,
54
+ slideshowSpeed: 2500,
55
+ slideshowStart: "start slideshow",
56
+ slideshowStop: "stop slideshow",
57
+ photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr)((#|\?).*)?$/i,
58
+
59
+ // alternate image paths for high-res displays
60
+ retinaImage: false,
61
+ retinaUrl: false,
62
+ retinaSuffix: '@2x.$1',
63
+
64
+ // internationalization
65
+ current: "image {current} of {total}",
66
+ previous: "previous",
67
+ next: "next",
68
+ close: "close",
69
+ xhrError: "This content failed to load.",
70
+ imgError: "This image failed to load.",
71
+
72
+ // accessbility
73
+ returnFocus: true,
74
+ trapFocus: true,
75
+
76
+ // callbacks
77
+ onOpen: false,
78
+ onLoad: false,
79
+ onComplete: false,
80
+ onCleanup: false,
81
+ onClosed: false
82
+ },
83
+
84
+ // Abstracting the HTML and event identifiers for easy rebranding
85
+ colorbox = 'colorbox',
86
+ prefix = 'cbox',
87
+ boxElement = prefix + 'Element',
88
+
89
+ // Events
90
+ event_open = prefix + '_open',
91
+ event_load = prefix + '_load',
92
+ event_complete = prefix + '_complete',
93
+ event_cleanup = prefix + '_cleanup',
94
+ event_closed = prefix + '_closed',
95
+ event_purge = prefix + '_purge',
96
+
97
+ // Cached jQuery Object Variables
98
+ $overlay,
99
+ $box,
100
+ $wrap,
101
+ $content,
102
+ $topBorder,
103
+ $leftBorder,
104
+ $rightBorder,
105
+ $bottomBorder,
106
+ $related,
107
+ $window,
108
+ $loaded,
109
+ $loadingBay,
110
+ $loadingOverlay,
111
+ $title,
112
+ $current,
113
+ $slideshow,
114
+ $next,
115
+ $prev,
116
+ $close,
117
+ $groupControls,
118
+ $events = $('<a/>'), // $([]) would be prefered, but there is an issue with jQuery 1.4.2
119
+
120
+ // Variables for cached values or use across multiple functions
121
+ settings,
122
+ interfaceHeight,
123
+ interfaceWidth,
124
+ loadedHeight,
125
+ loadedWidth,
126
+ element,
127
+ index,
128
+ photo,
129
+ open,
130
+ active,
131
+ closing,
132
+ loadingTimer,
133
+ publicMethod,
134
+ div = "div",
135
+ className,
136
+ requests = 0,
137
+ previousCSS = {},
138
+ init;
139
+
140
+ // ****************
141
+ // HELPER FUNCTIONS
142
+ // ****************
143
+
144
+ // Convenience function for creating new jQuery objects
145
+ function $tag(tag, id, css) {
146
+ var element = document.createElement(tag);
147
+
148
+ if (id) {
149
+ element.id = prefix + id;
150
+ }
151
+
152
+ if (css) {
153
+ element.style.cssText = css;
154
+ }
155
+
156
+ return $(element);
157
+ }
158
+
159
+ // Get the window height using innerHeight when available to avoid an issue with iOS
160
+ // http://bugs.jquery.com/ticket/6724
161
+ function winheight() {
162
+ return window.innerHeight ? window.innerHeight : $(window).height();
163
+ }
164
+
165
+ // Determine the next and previous members in a group.
166
+ function getIndex(increment) {
167
+ var
168
+ max = $related.length,
169
+ newIndex = (index + increment) % max;
170
+
171
+ return (newIndex < 0) ? max + newIndex : newIndex;
172
+ }
173
+
174
+ // Convert '%' and 'px' values to integers
175
+ function setSize(size, dimension) {
176
+ return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
177
+ }
178
+
179
+ // Checks an href to see if it is a photo.
180
+ // There is a force photo option (photo: true) for hrefs that cannot be matched by the regex.
181
+ function isImage(settings, url) {
182
+ return settings.photo || settings.photoRegex.test(url);
183
+ }
184
+
185
+ function retinaUrl(settings, url) {
186
+ return settings.retinaUrl && window.devicePixelRatio > 1 ? url.replace(settings.photoRegex, settings.retinaSuffix) : url;
187
+ }
188
+
189
+ function trapFocus(e) {
190
+ if ('contains' in $box[0] && !$box[0].contains(e.target)) {
191
+ e.stopPropagation();
192
+ $box.focus();
193
+ }
194
+ }
195
+
196
+ // Assigns function results to their respective properties
197
+ function makeSettings() {
198
+ var i,
199
+ data = $.data(element, colorbox);
200
+
201
+ if (data == null) {
202
+ settings = $.extend({}, defaults);
203
+ if (console && console.log) {
204
+ console.log('Error: cboxElement missing settings object');
205
+ }
206
+ } else {
207
+ settings = $.extend({}, data);
208
+ }
209
+
210
+ for (i in settings) {
211
+ if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
212
+ settings[i] = settings[i].call(element);
213
+ }
214
+ }
215
+
216
+ settings.rel = settings.rel || element.rel || $(element).data('rel') || 'nofollow';
217
+ settings.href = settings.href || $(element).attr('href');
218
+ settings.title = settings.title || element.title;
219
+
220
+ if (typeof settings.href === "string") {
221
+ settings.href = $.trim(settings.href);
222
+ }
223
+ }
224
+
225
+ function trigger(event, callback) {
226
+ // for external use
227
+ $(document).trigger(event);
228
+
229
+ // for internal use
230
+ $events.triggerHandler(event);
231
+
232
+ if ($.isFunction(callback)) {
233
+ callback.call(element);
234
+ }
235
+ }
236
+
237
+
238
+ var slideshow = (function(){
239
+ var active,
240
+ className = prefix + "Slideshow_",
241
+ click = "click." + prefix,
242
+ timeOut;
243
+
244
+ function clear () {
245
+ clearTimeout(timeOut);
246
+ }
247
+
248
+ function set() {
249
+ if (settings.loop || $related[index + 1]) {
250
+ clear();
251
+ timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
252
+ }
253
+ }
254
+
255
+ function start() {
256
+ $slideshow
257
+ .html(settings.slideshowStop)
258
+ .unbind(click)
259
+ .one(click, stop);
260
+
261
+ $events
262
+ .bind(event_complete, set)
263
+ .bind(event_load, clear);
264
+
265
+ $box.removeClass(className + "off").addClass(className + "on");
266
+ }
267
+
268
+ function stop() {
269
+ clear();
270
+
271
+ $events
272
+ .unbind(event_complete, set)
273
+ .unbind(event_load, clear);
274
+
275
+ $slideshow
276
+ .html(settings.slideshowStart)
277
+ .unbind(click)
278
+ .one(click, function () {
279
+ publicMethod.next();
280
+ start();
281
+ });
282
+
283
+ $box.removeClass(className + "on").addClass(className + "off");
284
+ }
285
+
286
+ function reset() {
287
+ active = false;
288
+ $slideshow.hide();
289
+ clear();
290
+ $events
291
+ .unbind(event_complete, set)
292
+ .unbind(event_load, clear);
293
+ $box.removeClass(className + "off " + className + "on");
294
+ }
295
+
296
+ return function(){
297
+ if (active) {
298
+ if (!settings.slideshow) {
299
+ $events.unbind(event_cleanup, reset);
300
+ reset();
301
+ }
302
+ } else {
303
+ if (settings.slideshow && $related[1]) {
304
+ active = true;
305
+ $events.one(event_cleanup, reset);
306
+ if (settings.slideshowAuto) {
307
+ start();
308
+ } else {
309
+ stop();
310
+ }
311
+ $slideshow.show();
312
+ }
313
+ }
314
+ };
315
+
316
+ }());
317
+
318
+
319
+ function launch(target) {
320
+ if (!closing) {
321
+
322
+ element = target;
323
+
324
+ makeSettings();
325
+
326
+ $related = $(element);
327
+
328
+ index = 0;
329
+
330
+ if (settings.rel !== 'nofollow') {
331
+ $related = $('.' + boxElement).filter(function () {
332
+ var data = $.data(this, colorbox),
333
+ relRelated;
334
+
335
+ if (data) {
336
+ relRelated = $(this).data('rel') || data.rel || this.rel;
337
+ }
338
+
339
+ return (relRelated === settings.rel);
340
+ });
341
+ index = $related.index(element);
342
+
343
+ // Check direct calls to Colorbox.
344
+ if (index === -1) {
345
+ $related = $related.add(element);
346
+ index = $related.length - 1;
347
+ }
348
+ }
349
+
350
+ $overlay.css({
351
+ opacity: parseFloat(settings.opacity),
352
+ cursor: settings.overlayClose ? "pointer" : "auto",
353
+ visibility: 'visible'
354
+ }).show();
355
+
356
+
357
+ if (className) {
358
+ $box.add($overlay).removeClass(className);
359
+ }
360
+ if (settings.className) {
361
+ $box.add($overlay).addClass(settings.className);
362
+ }
363
+ className = settings.className;
364
+
365
+ if (settings.closeButton) {
366
+ $close.html(settings.close).appendTo($content);
367
+ } else {
368
+ $close.appendTo('<div/>');
369
+ }
370
+
371
+ if (!open) {
372
+ open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
373
+
374
+ // Show colorbox so the sizes can be calculated in older versions of jQuery
375
+ $box.css({visibility:'hidden', display:'block'});
376
+
377
+ $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden');
378
+ $content.css({width:'', height:''}).append($loaded);
379
+
380
+ // Cache values needed for size calculations
381
+ interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();
382
+ interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
383
+ loadedHeight = $loaded.outerHeight(true);
384
+ loadedWidth = $loaded.outerWidth(true);
385
+
386
+ // Opens inital empty Colorbox prior to content being loaded.
387
+ settings.w = setSize(settings.initialWidth, 'x');
388
+ settings.h = setSize(settings.initialHeight, 'y');
389
+ $loaded.css({width:'', height:settings.h});
390
+ publicMethod.position();
391
+
392
+ trigger(event_open, settings.onOpen);
393
+
394
+ $groupControls.add($title).hide();
395
+
396
+ $box.focus();
397
+
398
+ if (settings.trapFocus) {
399
+ // Confine focus to the modal
400
+ // Uses event capturing that is not supported in IE8-
401
+ if (document.addEventListener) {
402
+
403
+ document.addEventListener('focus', trapFocus, true);
404
+
405
+ $events.one(event_closed, function () {
406
+ document.removeEventListener('focus', trapFocus, true);
407
+ });
408
+ }
409
+ }
410
+
411
+ // Return focus on closing
412
+ if (settings.returnFocus) {
413
+ $events.one(event_closed, function () {
414
+ $(element).focus();
415
+ });
416
+ }
417
+ }
418
+ load();
419
+ }
420
+ }
421
+
422
+ // Colorbox's markup needs to be added to the DOM prior to being called
423
+ // so that the browser will go ahead and load the CSS background images.
424
+ function appendHTML() {
425
+ if (!$box && document.body) {
426
+ init = false;
427
+ $window = $(window);
428
+ $box = $tag(div).attr({
429
+ id: colorbox,
430
+ 'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.
431
+ role: 'dialog',
432
+ tabindex: '-1'
433
+ }).hide();
434
+ $overlay = $tag(div, "Overlay").hide();
435
+ $loadingOverlay = $([$tag(div, "LoadingOverlay")[0],$tag(div, "LoadingGraphic")[0]]);
436
+ $wrap = $tag(div, "Wrapper");
437
+ $content = $tag(div, "Content").append(
438
+ $title = $tag(div, "Title"),
439
+ $current = $tag(div, "Current"),
440
+ $prev = $('<button type="button"/>').attr({id:prefix+'Previous'}),
441
+ $next = $('<button type="button"/>').attr({id:prefix+'Next'}),
442
+ $slideshow = $tag('button', "Slideshow"),
443
+ $loadingOverlay
444
+ );
445
+
446
+ $close = $('<button type="button"/>').attr({id:prefix+'Close'});
447
+
448
+ $wrap.append( // The 3x3 Grid that makes up Colorbox
449
+ $tag(div).append(
450
+ $tag(div, "TopLeft"),
451
+ $topBorder = $tag(div, "TopCenter"),
452
+ $tag(div, "TopRight")
453
+ ),
454
+ $tag(div, false, 'clear:left').append(
455
+ $leftBorder = $tag(div, "MiddleLeft"),
456
+ $content,
457
+ $rightBorder = $tag(div, "MiddleRight")
458
+ ),
459
+ $tag(div, false, 'clear:left').append(
460
+ $tag(div, "BottomLeft"),
461
+ $bottomBorder = $tag(div, "BottomCenter"),
462
+ $tag(div, "BottomRight")
463
+ )
464
+ ).find('div div').css({'float': 'left'});
465
+
466
+ $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');
467
+
468
+ $groupControls = $next.add($prev).add($current).add($slideshow);
469
+
470
+ $(document.body).append($overlay, $box.append($wrap, $loadingBay));
471
+ }
472
+ }
473
+
474
+ // Add Colorbox's event bindings
475
+ function addBindings() {
476
+ function clickHandler(e) {
477
+ // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
478
+ // See: http://jacklmoore.com/notes/click-events/
479
+ if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
480
+ e.preventDefault();
481
+ launch(this);
482
+ }
483
+ }
484
+
485
+ if ($box) {
486
+ if (!init) {
487
+ init = true;
488
+
489
+ // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
490
+ $next.click(function () {
491
+ publicMethod.next();
492
+ });
493
+ $prev.click(function () {
494
+ publicMethod.prev();
495
+ });
496
+ $close.click(function () {
497
+ publicMethod.close();
498
+ });
499
+ $overlay.click(function () {
500
+ if (settings.overlayClose) {
501
+ publicMethod.close();
502
+ }
503
+ });
504
+
505
+ // Key Bindings
506
+ $(document).bind('keydown.' + prefix, function (e) {
507
+ var key = e.keyCode;
508
+ if (open && settings.escKey && key === 27) {
509
+ e.preventDefault();
510
+ publicMethod.close();
511
+ }
512
+ if (open && settings.arrowKey && $related[1] && !e.altKey) {
513
+ if (key === 37) {
514
+ e.preventDefault();
515
+ $prev.click();
516
+ } else if (key === 39) {
517
+ e.preventDefault();
518
+ $next.click();
519
+ }
520
+ }
521
+ });
522
+
523
+ if ($.isFunction($.fn.on)) {
524
+ // For jQuery 1.7+
525
+ $(document).on('click.'+prefix, '.'+boxElement, clickHandler);
526
+ } else {
527
+ // For jQuery 1.3.x -> 1.6.x
528
+ // This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.
529
+ // This is not here for jQuery 1.9, it's here for legacy users.
530
+ $('.'+boxElement).live('click.'+prefix, clickHandler);
531
+ }
532
+ }
533
+ return true;
534
+ }
535
+ return false;
536
+ }
537
+
538
+ // Don't do anything if Colorbox already exists.
539
+ if ($.colorbox) {
540
+ return;
541
+ }
542
+
543
+ // Append the HTML when the DOM loads
544
+ $(appendHTML);
545
+
546
+
547
+ // ****************
548
+ // PUBLIC FUNCTIONS
549
+ // Usage format: $.colorbox.close();
550
+ // Usage from within an iframe: parent.jQuery.colorbox.close();
551
+ // ****************
552
+
553
+ publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
554
+ var $this = this;
555
+
556
+ options = options || {};
557
+
558
+ appendHTML();
559
+
560
+ if (addBindings()) {
561
+ if ($.isFunction($this)) { // assume a call to $.colorbox
562
+ $this = $('<a/>');
563
+ options.open = true;
564
+ } else if (!$this[0]) { // colorbox being applied to empty collection
565
+ return $this;
566
+ }
567
+
568
+ if (callback) {
569
+ options.onComplete = callback;
570
+ }
571
+
572
+ $this.each(function () {
573
+ $.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options));
574
+ }).addClass(boxElement);
575
+
576
+ if (($.isFunction(options.open) && options.open.call($this)) || options.open) {
577
+ launch($this[0]);
578
+ }
579
+ }
580
+
581
+ return $this;
582
+ };
583
+
584
+ publicMethod.position = function (speed, loadedCallback) {
585
+ var
586
+ css,
587
+ top = 0,
588
+ left = 0,
589
+ offset = $box.offset(),
590
+ scrollTop,
591
+ scrollLeft;
592
+
593
+ $window.unbind('resize.' + prefix);
594
+
595
+ // remove the modal so that it doesn't influence the document width/height
596
+ $box.css({top: -9e4, left: -9e4});
597
+
598
+ scrollTop = $window.scrollTop();
599
+ scrollLeft = $window.scrollLeft();
600
+
601
+ if (settings.fixed) {
602
+ offset.top -= scrollTop;
603
+ offset.left -= scrollLeft;
604
+ $box.css({position: 'fixed'});
605
+ } else {
606
+ top = scrollTop;
607
+ left = scrollLeft;
608
+ $box.css({position: 'absolute'});
609
+ }
610
+
611
+ // keeps the top and left positions within the browser's viewport.
612
+ if (settings.right !== false) {
613
+ left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0);
614
+ } else if (settings.left !== false) {
615
+ left += setSize(settings.left, 'x');
616
+ } else {
617
+ left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
618
+ }
619
+
620
+ if (settings.bottom !== false) {
621
+ top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0);
622
+ } else if (settings.top !== false) {
623
+ top += setSize(settings.top, 'y');
624
+ } else {
625
+ top += Math.round(Math.max(winheight() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
626
+ }
627
+
628
+ $box.css({top: offset.top, left: offset.left, visibility:'visible'});
629
+
630
+ // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
631
+ // but it has to be shrank down around the size of div#colorbox when it's done. If not,
632
+ // it can invoke an obscure IE bug when using iframes.
633
+ $wrap[0].style.width = $wrap[0].style.height = "9999px";
634
+
635
+ function modalDimensions() {
636
+ $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt($box[0].style.width,10) - interfaceWidth)+'px';
637
+ $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt($box[0].style.height,10) - interfaceHeight)+'px';
638
+ }
639
+
640
+ css = {width: settings.w + loadedWidth + interfaceWidth, height: settings.h + loadedHeight + interfaceHeight, top: top, left: left};
641
+
642
+ // setting the speed to 0 if the content hasn't changed size or position
643
+ if (speed) {
644
+ var tempSpeed = 0;
645
+ $.each(css, function(i){
646
+ if (css[i] !== previousCSS[i]) {
647
+ tempSpeed = speed;
648
+ return;
649
+ }
650
+ });
651
+ speed = tempSpeed;
652
+ }
653
+
654
+ previousCSS = css;
655
+
656
+ if (!speed) {
657
+ $box.css(css);
658
+ }
659
+
660
+ $box.dequeue().animate(css, {
661
+ duration: speed || 0,
662
+ complete: function () {
663
+ modalDimensions();
664
+
665
+ active = false;
666
+
667
+ // shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
668
+ $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
669
+ $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
670
+
671
+ if (settings.reposition) {
672
+ setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
673
+ $window.bind('resize.' + prefix, function(){
674
+ publicMethod.position();
675
+ });
676
+ }, 1);
677
+ }
678
+
679
+ if ($.isFunction(loadedCallback)) {
680
+ loadedCallback();
681
+ }
682
+ },
683
+ step: modalDimensions
684
+ });
685
+ };
686
+
687
+ publicMethod.resize = function (options) {
688
+ var scrolltop;
689
+
690
+ if (open) {
691
+ options = options || {};
692
+
693
+ if (options.width) {
694
+ settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
695
+ }
696
+
697
+ if (options.innerWidth) {
698
+ settings.w = setSize(options.innerWidth, 'x');
699
+ }
700
+
701
+ $loaded.css({width: settings.w});
702
+
703
+ if (options.height) {
704
+ settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
705
+ }
706
+
707
+ if (options.innerHeight) {
708
+ settings.h = setSize(options.innerHeight, 'y');
709
+ }
710
+
711
+ if (!options.innerHeight && !options.height) {
712
+ scrolltop = $loaded.scrollTop();
713
+ $loaded.css({height: "auto"});
714
+ settings.h = $loaded.height();
715
+ }
716
+
717
+ $loaded.css({height: settings.h});
718
+
719
+ if(scrolltop) {
720
+ $loaded.scrollTop(scrolltop);
721
+ }
722
+
723
+ publicMethod.position(settings.transition === "none" ? 0 : settings.speed);
724
+ }
725
+ };
726
+
727
+ publicMethod.prep = function (object) {
728
+ if (!open) {
729
+ return;
730
+ }
731
+
732
+ var callback, speed = settings.transition === "none" ? 0 : settings.speed;
733
+
734
+ $loaded.empty().remove(); // Using empty first may prevent some IE7 issues.
735
+
736
+ $loaded = $tag(div, 'LoadedContent').append(object);
737
+
738
+ function getWidth() {
739
+ settings.w = settings.w || $loaded.width();
740
+ settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
741
+ return settings.w;
742
+ }
743
+ function getHeight() {
744
+ settings.h = settings.h || $loaded.height();
745
+ settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
746
+ return settings.h;
747
+ }
748
+
749
+ $loaded.hide()
750
+ .appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
751
+ .css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'})
752
+ .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
753
+ .prependTo($content);
754
+
755
+ $loadingBay.hide();
756
+
757
+ // floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
758
+
759
+ $(photo).css({'float': 'none'});
760
+
761
+ callback = function () {
762
+ var total = $related.length,
763
+ iframe,
764
+ frameBorder = 'frameBorder',
765
+ allowTransparency = 'allowTransparency',
766
+ complete;
767
+
768
+ if (!open) {
769
+ return;
770
+ }
771
+
772
+ function removeFilter() { // Needed for IE7 & IE8 in versions of jQuery prior to 1.7.2
773
+ if ($.support.opacity === false) {
774
+ $box[0].style.removeAttribute('filter');
775
+ }
776
+ }
777
+
778
+ complete = function () {
779
+ clearTimeout(loadingTimer);
780
+ $loadingOverlay.hide();
781
+ trigger(event_complete, settings.onComplete);
782
+ };
783
+
784
+
785
+ $title.html(settings.title).add($loaded).show();
786
+
787
+ if (total > 1) { // handle grouping
788
+ if (typeof settings.current === "string") {
789
+ $current.html(settings.current.replace('{current}', index + 1).replace('{total}', total)).show();
790
+ }
791
+
792
+ $next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(settings.next);
793
+ $prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous);
794
+
795
+ slideshow();
796
+
797
+ // Preloads images within a rel group
798
+ if (settings.preloading) {
799
+ $.each([getIndex(-1), getIndex(1)], function(){
800
+ var src,
801
+ img,
802
+ i = $related[this],
803
+ data = $.data(i, colorbox);
804
+
805
+ if (data && data.href) {
806
+ src = data.href;
807
+ if ($.isFunction(src)) {
808
+ src = src.call(i);
809
+ }
810
+ } else {
811
+ src = $(i).attr('href');
812
+ }
813
+
814
+ if (src && isImage(data, src)) {
815
+ src = retinaUrl(data, src);
816
+ img = document.createElement('img');
817
+ img.src = src;
818
+ }
819
+ });
820
+ }
821
+ } else {
822
+ $groupControls.hide();
823
+ }
824
+
825
+ if (settings.iframe) {
826
+ iframe = $tag('iframe')[0];
827
+
828
+ if (frameBorder in iframe) {
829
+ iframe[frameBorder] = 0;
830
+ }
831
+
832
+ if (allowTransparency in iframe) {
833
+ iframe[allowTransparency] = "true";
834
+ }
835
+
836
+ if (!settings.scrolling) {
837
+ iframe.scrolling = "no";
838
+ }
839
+
840
+ $(iframe)
841
+ .attr({
842
+ src: settings.href,
843
+ name: (new Date()).getTime(), // give the iframe a unique name to prevent caching
844
+ 'class': prefix + 'Iframe',
845
+ allowFullScreen : true, // allow HTML5 video to go fullscreen
846
+ webkitAllowFullScreen : true,
847
+ mozallowfullscreen : true
848
+ })
849
+ .one('load', complete)
850
+ .appendTo($loaded);
851
+
852
+ $events.one(event_purge, function () {
853
+ iframe.src = "//about:blank";
854
+ });
855
+
856
+ if (settings.fastIframe) {
857
+ $(iframe).trigger('load');
858
+ }
859
+ } else {
860
+ complete();
861
+ }
862
+
863
+ if (settings.transition === 'fade') {
864
+ $box.fadeTo(speed, 1, removeFilter);
865
+ } else {
866
+ removeFilter();
867
+ }
868
+ };
869
+
870
+ if (settings.transition === 'fade') {
871
+ $box.fadeTo(speed, 0, function () {
872
+ publicMethod.position(0, callback);
873
+ });
874
+ } else {
875
+ publicMethod.position(speed, callback);
876
+ }
877
+ };
878
+
879
+ function load () {
880
+ var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
881
+
882
+ active = true;
883
+
884
+ photo = false;
885
+
886
+ element = $related[index];
887
+
888
+ makeSettings();
889
+
890
+ trigger(event_purge);
891
+
892
+ trigger(event_load, settings.onLoad);
893
+
894
+ settings.h = settings.height ?
895
+ setSize(settings.height, 'y') - loadedHeight - interfaceHeight :
896
+ settings.innerHeight && setSize(settings.innerHeight, 'y');
897
+
898
+ settings.w = settings.width ?
899
+ setSize(settings.width, 'x') - loadedWidth - interfaceWidth :
900
+ settings.innerWidth && setSize(settings.innerWidth, 'x');
901
+
902
+ // Sets the minimum dimensions for use in image scaling
903
+ settings.mw = settings.w;
904
+ settings.mh = settings.h;
905
+
906
+ // Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
907
+ // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
908
+ if (settings.maxWidth) {
909
+ settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth;
910
+ settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
911
+ }
912
+ if (settings.maxHeight) {
913
+ settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight;
914
+ settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
915
+ }
916
+
917
+ href = settings.href;
918
+
919
+ loadingTimer = setTimeout(function () {
920
+ $loadingOverlay.show();
921
+ }, 100);
922
+
923
+ if (settings.inline) {
924
+ // Inserts an empty placeholder where inline content is being pulled from.
925
+ // An event is bound to put inline content back when Colorbox closes or loads new content.
926
+ $inline = $tag(div).hide().insertBefore($(href)[0]);
927
+
928
+ $events.one(event_purge, function () {
929
+ $inline.replaceWith($loaded.children());
930
+ });
931
+
932
+ prep($(href));
933
+ } else if (settings.iframe) {
934
+ // IFrame element won't be added to the DOM until it is ready to be displayed,
935
+ // to avoid problems with DOM-ready JS that might be trying to run in that iframe.
936
+ prep(" ");
937
+ } else if (settings.html) {
938
+ prep(settings.html);
939
+ } else if (isImage(settings, href)) {
940
+
941
+ href = retinaUrl(settings, href);
942
+
943
+ photo = document.createElement('img');
944
+
945
+ $(photo)
946
+ .addClass(prefix + 'Photo')
947
+ .bind('error',function () {
948
+ settings.title = false;
949
+ prep($tag(div, 'Error').html(settings.imgError));
950
+ })
951
+ .one('load', function () {
952
+ var percent;
953
+
954
+ if (request !== requests) {
955
+ return;
956
+ }
957
+
958
+ $.each(['alt', 'longdesc', 'aria-describedby'], function(i,val){
959
+ var attr = $(element).attr(val) || $(element).attr('data-'+val);
960
+ if (attr) {
961
+ photo.setAttribute(val, attr);
962
+ }
963
+ });
964
+
965
+ if (settings.retinaImage && window.devicePixelRatio > 1) {
966
+ photo.height = photo.height / window.devicePixelRatio;
967
+ photo.width = photo.width / window.devicePixelRatio;
968
+ }
969
+
970
+ if (settings.scalePhotos) {
971
+ setResize = function () {
972
+ photo.height -= photo.height * percent;
973
+ photo.width -= photo.width * percent;
974
+ };
975
+ if (settings.mw && photo.width > settings.mw) {
976
+ percent = (photo.width - settings.mw) / photo.width;
977
+ setResize();
978
+ }
979
+ if (settings.mh && photo.height > settings.mh) {
980
+ percent = (photo.height - settings.mh) / photo.height;
981
+ setResize();
982
+ }
983
+ }
984
+
985
+ if (settings.h) {
986
+ photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px';
987
+ }
988
+
989
+ if ($related[1] && (settings.loop || $related[index + 1])) {
990
+ photo.style.cursor = 'pointer';
991
+ photo.onclick = function () {
992
+ publicMethod.next();
993
+ };
994
+ }
995
+
996
+ photo.style.width = photo.width + 'px';
997
+ photo.style.height = photo.height + 'px';
998
+
999
+ setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise.
1000
+ prep(photo);
1001
+ }, 1);
1002
+ });
1003
+
1004
+ setTimeout(function () { // A pause because Opera 10.6+ will sometimes not run the onload function otherwise.
1005
+ photo.src = href;
1006
+ }, 1);
1007
+ } else if (href) {
1008
+ $loadingBay.load(href, settings.data, function (data, status) {
1009
+ if (request === requests) {
1010
+ prep(status === 'error' ? $tag(div, 'Error').html(settings.xhrError) : $(this).contents());
1011
+ }
1012
+ });
1013
+ }
1014
+ }
1015
+
1016
+ // Navigates to the next page/image in a set.
1017
+ publicMethod.next = function () {
1018
+ if (!active && $related[1] && (settings.loop || $related[index + 1])) {
1019
+ index = getIndex(1);
1020
+ launch($related[index]);
1021
+ }
1022
+ };
1023
+
1024
+ publicMethod.prev = function () {
1025
+ if (!active && $related[1] && (settings.loop || index)) {
1026
+ index = getIndex(-1);
1027
+ launch($related[index]);
1028
+ }
1029
+ };
1030
+
1031
+ // Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close();
1032
+ publicMethod.close = function () {
1033
+ if (open && !closing) {
1034
+
1035
+ closing = true;
1036
+
1037
+ open = false;
1038
+
1039
+ trigger(event_cleanup, settings.onCleanup);
1040
+
1041
+ $window.unbind('.' + prefix);
1042
+
1043
+ $overlay.fadeTo(settings.fadeOut || 0, 0);
1044
+
1045
+ $box.stop().fadeTo(settings.fadeOut || 0, 0, function () {
1046
+
1047
+ $box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();
1048
+
1049
+ trigger(event_purge);
1050
+
1051
+ $loaded.empty().remove(); // Using empty first may prevent some IE7 issues.
1052
+
1053
+ setTimeout(function () {
1054
+ closing = false;
1055
+ trigger(event_closed, settings.onClosed);
1056
+ }, 1);
1057
+ });
1058
+ }
1059
+ };
1060
+
1061
+ // Removes changes Colorbox made to the document, but does not remove the plugin.
1062
+ publicMethod.remove = function () {
1063
+ if (!$box) { return; }
1064
+
1065
+ $box.stop();
1066
+ $.colorbox.close();
1067
+ $box.stop().remove();
1068
+ $overlay.remove();
1069
+ closing = false;
1070
+ $box = null;
1071
+ $('.' + boxElement)
1072
+ .removeData(colorbox)
1073
+ .removeClass(boxElement);
1074
+
1075
+ $(document).unbind('click.'+prefix);
1076
+ };
1077
+
1078
+ // A method for fetching the current element Colorbox is referencing.
1079
+ // returns a jQuery object.
1080
+ publicMethod.element = function () {
1081
+ return $(element);
1082
+ };
1083
+
1084
+ publicMethod.settings = defaults;
1085
+
1086
+ }(jQuery, document, window));
{js → views/default/js}/gallery.js RENAMED
@@ -221,7 +221,7 @@ TINY.slideshow.prototype={
221
  //this.q.onclick = new Function('jQuery.colorbox({href:"' + this.a[s].l + '",maxWidth:"90%",maxHeight:"90%",title:"' + this.a[s].t + '"})');
222
  this.q.onmouseover = new Function('this.className="' + this.linkclass + '"; this.href = "' + this.a[s].l + '";');
223
  var uniqueimglinkid = jQuery('a[href="' + this.a[s].l + '"]').attr('id');
224
- this.q.onclick = new Function('jQuery(".colorbox").colorbox({rel:"' + unique + 'overlay", maxWidth:"90%", maxHeight:"90%"}); jQuery("#' + uniqueimglinkid + '").click(); return false;');
225
  } else {
226
  this.q.onmouseover = new Function('this.className="' + this.linkclass + '";');
227
  this.q.onclick = new Function('window.open("' + this.a[s].l + '","' + this.a[s].tg + '"); return false;');
221
  //this.q.onclick = new Function('jQuery.colorbox({href:"' + this.a[s].l + '",maxWidth:"90%",maxHeight:"90%",title:"' + this.a[s].t + '"})');
222
  this.q.onmouseover = new Function('this.className="' + this.linkclass + '"; this.href = "' + this.a[s].l + '";');
223
  var uniqueimglinkid = jQuery('a[href="' + this.a[s].l + '"]').attr('id');
224
+ this.q.onclick = new Function('jQuery(".colorbox' + unique + '").colorbox({rel:"' + unique + 'overlay", maxWidth:"90%", maxHeight:"90%"}); jQuery("#' + uniqueimglinkid + '").click(); return false;');
225
  } else {
226
  this.q.onmouseover = new Function('this.className="' + this.linkclass + '";');
227
  this.q.onclick = new Function('window.open("' + this.a[s].l + '","' + this.a[s].tg + '"); return false;');
views/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php /* Silence, so that search engines don't index/crawl this folder and it's contents */ ?>