Slideshow Gallery - Version 1.7.5

Version Description

  • FIX: Null safe checker is added to some places.
Download this release

Release Info

Developer mohsenr1
Plugin Icon 128x128 Slideshow Gallery
Version 1.7.5
Comparing to
See all releases

Code changes from version 1.7.4.4 to 1.7.5

Files changed (53) hide show
  1. css/colorbox.css +0 -0
  2. css/jquery-ui.css +0 -0
  3. images/colorbox/border.png +0 -0
  4. images/colorbox/controls.png +0 -0
  5. images/colorbox/ie6/borderBottomCenter.png +0 -0
  6. images/colorbox/ie6/borderBottomLeft.png +0 -0
  7. images/colorbox/ie6/borderBottomRight.png +0 -0
  8. images/colorbox/ie6/borderMiddleLeft.png +0 -0
  9. images/colorbox/ie6/borderMiddleRight.png +0 -0
  10. images/colorbox/ie6/borderTopCenter.png +0 -0
  11. images/colorbox/ie6/borderTopLeft.png +0 -0
  12. images/colorbox/ie6/borderTopRight.png +0 -0
  13. images/colorbox/loading.gif +0 -0
  14. images/colorbox/loading_background.png +0 -0
  15. images/colorbox/overlay.png +0 -0
  16. images/jquery-ui/animated-overlay.gif +0 -0
  17. images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  18. images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  19. images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  20. images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  21. images/jquery-ui/ui-bg_glass_75_dadada_1x400.png +0 -0
  22. images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  23. images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  24. images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  25. images/jquery-ui/ui-icons_222222_256x240.png +0 -0
  26. images/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
  27. images/jquery-ui/ui-icons_454545_256x240.png +0 -0
  28. images/jquery-ui/ui-icons_888888_256x240.png +0 -0
  29. images/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
  30. images/logo.png +0 -0
  31. images/plugins/newsletters.png +0 -0
  32. includes/errorhandler.php +1 -1
  33. readme.txt +660 -657
  34. select2.css +0 -0
  35. slideshow-gallery-plugin.php +1707 -1707
  36. slideshow-gallery.php +1211 -1211
  37. vendors/BFI_Thumb.php +0 -0
  38. vendors/otf_regen_thumbs.php +0 -0
  39. views/default/css-generator-fn.php +126 -126
  40. views/default/css/colorbox.css +0 -0
  41. views/default/images/colorbox/border.png +0 -0
  42. views/default/images/colorbox/controls.png +0 -0
  43. views/default/images/colorbox/ie6/borderBottomCenter.png +0 -0
  44. views/default/images/colorbox/ie6/borderBottomLeft.png +0 -0
  45. views/default/images/colorbox/ie6/borderBottomRight.png +0 -0
  46. views/default/images/colorbox/ie6/borderMiddleLeft.png +0 -0
  47. views/default/images/colorbox/ie6/borderMiddleRight.png +0 -0
  48. views/default/images/colorbox/ie6/borderTopCenter.png +0 -0
  49. views/default/images/colorbox/ie6/borderTopLeft.png +0 -0
  50. views/default/images/colorbox/ie6/borderTopRight.png +0 -0
  51. views/default/images/colorbox/loading.gif +0 -0
  52. views/default/images/colorbox/loading_background.png +0 -0
  53. views/default/images/colorbox/overlay.png +0 -0
css/colorbox.css CHANGED
File without changes
css/jquery-ui.css CHANGED
File without changes
images/colorbox/border.png CHANGED
File without changes
images/colorbox/controls.png CHANGED
File without changes
images/colorbox/ie6/borderBottomCenter.png CHANGED
File without changes
images/colorbox/ie6/borderBottomLeft.png CHANGED
File without changes
images/colorbox/ie6/borderBottomRight.png CHANGED
File without changes
images/colorbox/ie6/borderMiddleLeft.png CHANGED
File without changes
images/colorbox/ie6/borderMiddleRight.png CHANGED
File without changes
images/colorbox/ie6/borderTopCenter.png CHANGED
File without changes
images/colorbox/ie6/borderTopLeft.png CHANGED
File without changes
images/colorbox/ie6/borderTopRight.png CHANGED
File without changes
images/colorbox/loading.gif CHANGED
File without changes
images/colorbox/loading_background.png CHANGED
File without changes
images/colorbox/overlay.png CHANGED
File without changes
images/jquery-ui/animated-overlay.gif CHANGED
File without changes
images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png CHANGED
File without changes
images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png CHANGED
File without changes
images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png CHANGED
File without changes
images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png CHANGED
File without changes
images/jquery-ui/ui-bg_glass_75_dadada_1x400.png CHANGED
File without changes
images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png CHANGED
File without changes
images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png CHANGED
File without changes
images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png CHANGED
File without changes
images/jquery-ui/ui-icons_222222_256x240.png CHANGED
File without changes
images/jquery-ui/ui-icons_2e83ff_256x240.png CHANGED
File without changes
images/jquery-ui/ui-icons_454545_256x240.png CHANGED
File without changes
images/jquery-ui/ui-icons_888888_256x240.png CHANGED
File without changes
images/jquery-ui/ui-icons_cd0a0a_256x240.png CHANGED
File without changes
images/logo.png CHANGED
File without changes
images/plugins/newsletters.png CHANGED
File without changes
includes/errorhandler.php CHANGED
@@ -65,7 +65,7 @@ class SlideshowErrorHandler extends GalleryPlugin {
65
  function check_for_fatal()
66
  {
67
  $error = error_get_last();
68
- if ( $error["type"] == E_ERROR )
69
  $this -> log_error1( $error["type"], $error["message"], $error["file"], $error["line"] );
70
  }
71
  }
65
  function check_for_fatal()
66
  {
67
  $error = error_get_last();
68
+ if ( !empty($error) && $error["type"] == E_ERROR )
69
  $this -> log_error1( $error["type"], $error["message"], $error["file"], $error["line"] );
70
  }
71
  }
readme.txt CHANGED
@@ -1,657 +1,660 @@
1
- === Slideshow Gallery LITE ===
2
- Contributors: contrid
3
- Donate link: https://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: 5.8.2
7
- Stable tag: 1.7.4.4
8
-
9
- Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
-
11
- == Description ==
12
-
13
- Feature content in beautiful and fast JavaScript powered slideshow gallery showcases on your WordPress website.
14
-
15
- You can easily display multiple galleries throughout your WordPress website displaying your custom added slides, slide galleries or showing slides from WordPress posts/pages.
16
-
17
- The slideshow is flexible, all aspects can easily be configured and embedding/hardcoding the slideshow gallery is a breeze.
18
-
19
- See the <a href="https://tribulant.net/slideshowgallery/">online demonstration</a>.
20
-
21
- Here are several ways to display a slideshow:
22
-
23
- = Shortcode for all slides =
24
-
25
- To embed a slideshow with all slides under **Slideshow > Manage Slides** in the plugin, simply insert the shortcode below into the content of a post/page.
26
-
27
- `[tribulant_slideshow]`
28
-
29
- = Shortcode for featured posts =
30
-
31
- You can create a slideshow from featured posts, each post being a slide and it's featured image used as the slide image. The link of the slide will be the link of the post so clicking on the slide will take users to that post.
32
-
33
- Here is a sample shortcode that you can use for this:
34
-
35
- `[tribulant_slideshow featured="true" featurednumber="10" featuredtype="post"]`
36
-
37
- = Shortcode for a gallery's slides =
38
-
39
- To embed a slideshow with slides from a specific gallery under **Slideshow > Manage Galleries** in the plugin, simply insert the shortcode below (where X is the ID value of the gallery) into the content of a post/page.
40
-
41
- `[tribulant_slideshow gallery_id="X"]`
42
-
43
- = Shortcode for the images of a WordPress post/page =
44
-
45
- To embed a slideshow with the images uploaded to a WordPress post/page through it's media gallery, simply insert the shortcode below (where X is the ID value of the post). Whether you want to display the images from a post or a page, the parameter remains `post_id`.
46
-
47
- `[tribulant_slideshow post_id="X"]`
48
-
49
- = Shortcode for latest/featured products =
50
-
51
- In order to display latest or featured products in a slideshow, you need the <a href="https://tribulant.com/plugins/view/10/wordpress-shopping-cart-plugin" title="WordPress Shopping Cart">Shopping Cart plugin</a> from Tribulant. Once you have this installed and activated, you can easily display recent or featured products. To display recent products use the shortcode below.
52
-
53
- `[tribulant_slideshow products="latest"]`
54
-
55
- And to display featured products, use the one below.
56
-
57
- `[tribulant_slideshow products="featured"]`
58
-
59
- For both, you can use the `productsnumber` parameter to limit the number of products eg.
60
-
61
- `[tribulant_slideshow products="latest" productsnumber="5"]`
62
-
63
- = Hardcode into any plugin/theme with PHP =
64
-
65
- To hardcode into any PHP file of your WordPress theme, simply use
66
-
67
- `<?php if (function_exists('slideshow')) { slideshow($output = true, $gallery_id = false, $post_id = false, $params = array()); } ?>`.
68
-
69
- = Parameters for shortcode/hardcode to customize each slideshow =
70
-
71
- You can use any of the following parameters with both the hardcoding and shortcode to customize each slideshow gallery:
72
-
73
- Shortcode example 1:
74
-
75
- `[tribulant_slideshow layout="responsive" gallery_id="3" auto="true" navopacity="0" showthumbs="true"]`
76
-
77
- Shortcode example 2:
78
-
79
- `[tribulant_slideshow layout="specific" post_id="379" width="600" height="300" auto="false" showinfo="false"]`
80
-
81
- Hardcode example 1:
82
-
83
- `<?php slideshow(true, 3, false, array('layout' => "responsive", 'auto' => "true", 'navopacity' => "0", 'showthumbs' => "true")); ?>`
84
-
85
- Hardcode example 2:
86
-
87
- `<?php slideshow(true, false, 379, array('layout' => "specific", 'width' => "600", 'height' => "300", 'auto' => "false", 'showinfo' => "false")); ?>`
88
-
89
- This way you can customize each slideshow you embed or hardcode, despite the settings you saved under **Slideshow > Settings**.
90
-
91
- * `effect` [ fade | slide ] = Choose the transition effect of the slideshow. Either fade or slide
92
- * `slide_direction` [ lr | tb ] = If you're using `slide` for the `effect`, you can choose left/right or top/bottom sliding
93
- * `easing` [ swing ] = Choose the easing effect you'd like. The default is `swing`
94
- * `products` [ latest | featured ] = String "latest" or "featured" to display products from the <a href="https://tribulant.com/plugins/view/10/wordpress-shopping-cart-plugin">Checkout plugin</a>.
95
- * `productsnumber` [ productsnumber ] = Numeric/integer to limit the number of products to display.
96
- * `featured` [ true | false ] = Show posts with their featured images
97
- * `featurednumber` [ number ] = A numeric/integer value. The default is 10
98
- * `featuredtype` [ post_type ] = A post type slug like 'post', 'page', etc. The default is 'post'
99
- * `gallery_id` [ gallery_id ] = Numeric/integer ID of a gallery to display images from.
100
- * `post_id` [ post_id ] = Numeric/integer ID of a post to take images from it, uploaded through it's "Add Media" button.
101
- * `numberposts` [ numberposts ] = Numeric value of the number of images to take from the post/page. "-1" for unlimited/all
102
- * `layout` [ responsive | specific ] = Set to 'responsive' for mobile/tablet compatible theme and 'specific' for fixed width/height.
103
- * `resizeimages` [ true | false ] = Set to 'true' to resize images to fit the slideshow dimensions.
104
- * `imagesoverlay` [ true | false ] (default: setting) = Set to 'true' to display links of slides that are images in a Colorbox overlay on the page.
105
- * `orderby` [ random ] = Set to 'random' to randomly order the slides. Leave this shortcode parameter to order by the order set on the slides.
106
- * `width` [ width | auto ] = (only with layout="specific") Width of the slideshow in pixels. Don't specify 'px' part, just the numeric value for the height.
107
- * `resheight` [ resheight ] = (only with layout="responsive") Numeric/integer value such as "30" to be used with 'resheighttype' below
108
- * `resheighttype [ resheighttype ] = (only with layout="responsive") "px" (pixels) or "%" (percent) as the value e.g., resheighttype="%"
109
- * `height` [ height ] (only with layout="specific"; default: setting) = Height of the slideshow in pixels. Don't specify the 'px' part, just the numeric value for the height.
110
- * `autoheight` [ true | false ] = Should the gallery adjust it's height for each slide?
111
- * `auto` [ true | false ] (default: setting) = Set this to 'true' to automatically slide the slides in the slideshow.
112
- * `autospeed` [ speed ] (default: setting) = Speed of the auto sliding. 10 is normal. Lower number is faster. Between 5 and 15 is recommended.
113
- * `fadespeed` [ speed ] (default: setting) = Speed of the fading of images. 10 is normal. Lower number is faster. Between 1 and 20 is recommended.
114
- * `shownav` [ true | false ] (default: setting) = Set to 'true' to show the next/previous image navigation buttons.
115
- * `navopacity` [ opacity ] (default: setting) = The opacity of the next/previous buttons. Between 0 and 100 with 0 being transparent and 100 being fully opaque.
116
- * `navhoveropacity` [ opacity ] (default: setting) = The opacity of the next/previous buttons on hovering. Between 0 and 100 with 0 being transparent and 100 being fully opaque.
117
- * `showinfo` [ true | false ] (default: setting) = Set to 'true' to show the information bar for each slide.
118
- * `infospeed` [ speed ] (default: setting) = Speed at which the information bar will slide up. Between 5 and 15 is recommended.
119
- * `showthumbs` [ true | false ] (default: setting) = Set to 'true' to show the thumbnails for the slides.
120
- * `thumbsposition` [ top | bottom ] (default: setting) = Set to "top" to show above the slideshow.
121
- * `thumbsborder` [ hexidecimal color ] (default: setting) = Hex color of the active thumb border. For example #333333.
122
- * `thumbsspeed` [ speed> ] (default: setting) = Speed of the thumbnail bar scrolling. Lower is slower. Between 1 and 20 is recommended.
123
- * `thumbsspacing` [ spacing ] (default: setting) = An integer value in pixels to space the thumbnails apart. Don’t include the 'px' part, just the number. Between 0 and 10 is recommended.
124
-
125
- = Languages =
126
-
127
- Thank you to these wonderful people who contributed to translating the Slideshow Gallery plugin:
128
-
129
- * Afrikaans (af_ZA) by <a href="https://tribulant.com">Antonie Potgieter | Tribulant</a>
130
- * Slovak (sk_SK) by Branco Radenovich
131
-
132
- <a href="https://tribulant.com/support/">Contact us</a> to submit your language file and be mentioned here!
133
-
134
- == Installation ==
135
-
136
- Installing the WordPress slideshow gallery plugin is very easy. Simply follow the steps below.
137
-
138
- 1. Extract the package to obtain the `slideshow-gallery` folder
139
- 1. Upload the `slideshow-gallery` folder to the `/wp-content/plugins/` directory
140
- 1. Activate the plugin through the 'Plugins' menu in WordPress
141
- 1. Configure the settings according to your needs through the **Slideshow > Settings** menu
142
- 1. Add and manage your slides in the 'Slideshow' section
143
- 1. Put `[tribulant_slideshow post_id="X"]` to embed a slideshow with the images of a post into your posts/pages or use `[tribulant_slideshow gallery_id="X"]` to display the slides of a specific gallery by ID or use `[tribulant_slideshow]` to embed a slideshow with your custom added slides under **Slideshow > Manage Slides** or `<?php if (function_exists('slideshow')) { slideshow($output = true, $gallery_id = false, $post_id = false, $params = array()); } ?>` into your WordPress theme using PHP code.
144
-
145
- == Frequently Asked Questions ==
146
-
147
- = Can I display/embed multiple instances of the slideshow gallery? =
148
-
149
- Yes, you can and you can add multiple slideshows on the same page as well.
150
-
151
- = How can I display specific slides in a slideshow gallery instance? =
152
-
153
- You can organize slides either into multiple galleries according to your needs or you can upload images to WordPress posts and display the images uploaded to a post.
154
-
155
- = How do I display the images uploaded to a post? =
156
-
157
- You can embed a slideshow and show the images uploaded to a post with the `post_id` parameter. Like this `[tribulant_slideshow post_id="123"]`.
158
-
159
- = Can I exclude certain images from a post in the slideshow? =
160
-
161
- Yes, you can use the `exclude` parameter to exclude post images by their order in the gallery (comma separated) like this `[tribulant_slideshow post_id="123" exclude="2,4,8"]`.
162
-
163
- = How can I fix slide images or thumbnails not displaying? =
164
-
165
- There is an "Images Tester" utility under Slideshow > Settings on the right-hand side. Use that to determine the problem.
166
-
167
- == Screenshots ==
168
-
169
- 1. Slideshow gallery with thumbnails at the bottom.
170
- 2. Slideshow gallery with thumbnails turned OFF.
171
- 3. Slideshow gallery with thumbnails at the top.
172
- 4. Different styles/colors.
173
- 5. TinyMCE editor button to insert shortcodes.
174
- 6. Turn on Thickbox to show enlarged images in an overlay.
175
-
176
- == Changelog ==
177
-
178
- = 1.7.4.4 =
179
- * FIX: Multiple slideshows error on a page/post.
180
-
181
- = 1.7.4.3 =
182
- * IMPROVE: Various security fixes.
183
- * IMPROVE: Removed unneeded libraries.
184
-
185
- = 1.7.4.2 =
186
- * IMPROVE: Various security fixes.
187
-
188
- = 1.7.4.1 =
189
- * IMPROVE: Various security updates.
190
- * IMPORTANT: Due to required changes by WordPress.org and us hosting this free plugin here with them, we were unfortunately required to remove the ability to use translation plugins with this free lite version. This still works in our premium version and you can purchase that on our Tribulant website. The premium version will also get more features in the future. We apologise for the inconvenience.
191
-
192
- = 1.7.4 =
193
- * FIX: XSS vulnerability issue.
194
-
195
- = 1.7.3 =
196
- * IMPROVE: Removed update checker.
197
-
198
- = 1.7.2 =
199
- * IMPROVE: Removed serial key management for this free version. To manage the serial key and get access to all the features, you can purchase and use the paid version of this plugin.
200
-
201
- = 1.7.1 =
202
- * FIX: Colorbox updates and fixes.
203
-
204
- = 1.7 =
205
- * FIX: Error handler.
206
- * FIX: Undefined $_SERVER variable indexes, while executing WP Cron.
207
- * FIX: PHP Errors and Notices fixes for current and future versions of PHP.
208
-
209
- = 1.6.15 =
210
- * FIX: Additional errors related to errorhandler.php.
211
-
212
- = 1.6.14 =
213
- * FIX: Errors related to errorhandler.php.
214
- * FIX: Errors in recent PHP versions.
215
- * FIX: Incompatibility with the Avada theme and potentially other WordPress themes.
216
-
217
- = 1.6.13 =
218
- * FIX: Undefined variable and other errors.
219
-
220
- = 1.6.12 =
221
- * ADD: infoheadingcontent attribute on shortcode
222
- * IMPROVE: Preload slideshow images on page load
223
- * IMPROVE: Security fixes and improvements
224
- * IMPROVE: About page update with new layout
225
- * FIX: Debugging setting affects debugging on WordPress globally
226
-
227
- = 1.6.11 =
228
- * ADD: Variable buttons when saving multiple slides for Alt, Caption, etc.
229
- * ADD: Polylang multilingual integration
230
- * ADD: WPGlobus multilingual integration
231
- * IMPROVE: Make Select2 select drop downs accessible by screen readers
232
- * IMPROVE: Make Colorbox translatable
233
- * FIX: Expired slides are showing up in the ordering screen
234
- * FIX: Apostrophe in gallery title/name won't save
235
-
236
- = 1.6.10 =
237
- * ADD: WordPress 5+ compatibility
238
-
239
- = 1.6.9 =
240
- * ADD: Search box in admin sections to find slides and galleries
241
- * IMPROVE: ALT attributes on slide images
242
- * IMPROVE: Change "Configuration" to "Settings" throughout
243
- * IMPROVE: http:// to https://
244
- * FIX: Possible XSS and SQLi vulnerability
245
- * FIX: Media library loading very slowly
246
- * FIX: Buttons/icons not showing in some browsers like FireFox
247
- * FIX: Serial key overlay not showing correctly
248
-
249
- = 1.6.8 =
250
- * ADD: Set an expiry date on a slide
251
- * ADD: Use WP_List_Table for proper, responsive tables in admin
252
- * IMPROVE: Static textdomain for easier translation
253
- * IMPROVE: Update WP Color Picker
254
- * IMPROVE: http:// to https://
255
- * IMPROVE: hange INPUT to BUTTON element in several places
256
- * IMPROVE: Prevent conflict with outdated Select2 versions from other plugins
257
- * FIX: Jetpack Lazy Load causes problems with slides
258
- * FIX: url() function sometimes breaks plugin path
259
- * FIX: Use link on slide confusion and not opening
260
- * FIX: Apostrophe in gallery title/name won't save
261
- * FIX: "No slides are available" due to getimagesize() not supported
262
-
263
- = 1.6.7 =
264
- * ADD: Compatibility with WordPress 4.8+
265
- * ADD: Display slideshow images inside RSS feeds
266
- * FIX: Blank/empty slide breaks slideshow
267
- * FIX: Woocommerce loads outdated version of Select2, conflicts
268
- * FIX: Conflict with Select2 of Yoast SEO
269
-
270
- = 1.6.6 =
271
- * IMPROVE: Check for missing media/attachment records
272
- * IMPROVE: ALT attributes on slide images
273
- * FIX: Arrows on thumbnails slider misaligned on some themes
274
- * FIX: Thumbnail dimensions incorrect on media image slides
275
- * FIX: Possible XSS vulnerability (credit: www.defensecode.com)
276
- * FIX: PHP deprecated class constructors cause warning message
277
- * FIX: Slideshow doesn't show in posts/pages loaded with Ajax
278
-
279
- = 1.6.5 =
280
- * IMPROVE: Use attachment full URL if 'thumbnail' size is not available when adding slides
281
- * IMPROVE: Change deprecated jQuery live() to on()
282
- * IMPROVE: Colorbox upgrade to 1.6.4
283
- * IMPROVE: Review SSL/https
284
- * IMPROVE: Updated welcome/about page
285
- * IMPROVE: New, improved object cache system
286
- * FIX: Security, possible XSS on CSS parameters
287
- * FIX: Missing FontAwesome font files in admin area
288
- * FIX: Fatal error: Call to a member function image_path() on a non-object
289
- * FIX: Colorbox when you have Multiple Galleries
290
-
291
- = 1.6.4 =
292
- * ADD: Full retina/high definition compatibility
293
- * ADD: Setting to hide thumbnails bar on mobile
294
- * ADD: Show thumbnails in order list for slides
295
- * ADD: Information Bar position
296
- * ADD: Show info bar only on hover
297
- * ADD: Fade the information bar after a few seconds
298
- * IMPROVE: Remove auto slide on slideshow with single image
299
- * IMPROVE: CSS Selectors Resize images setting for responsive slideshows as well
300
- * IMPROVE: Ensure that autoheight always works even with responsive height set
301
- * IMPROVE: Generate images/thumbnails on remote URLs as well
302
- * IMPROVE: Compatibility with new PHP OOP such as PHP7
303
- * FIX: Paging broken in admin sections, database error
304
-
305
- = 1.6.3 =
306
- * IMPROVE: Allow html in description of slides
307
- * IMPROVE: Set line-height on icons
308
- * IMPROVE: Auto hide thumbnails bar if only one image/slide
309
- * IMPROVE: Featured posts in TinyMCE button/icon dialog
310
- * IMPROVE: No items tables in admin sections
311
- * FIX: Changing paths causes media uploaded slides thumbnails to break
312
- * FIX: Prev an Next buttons not showing in some browsers (Firefox)
313
- * FIX: Update issue
314
- * FIX: Image overlay (Colorbox) close icon not working in some browsers (FireFox)
315
- * FIX: Overflow of thumbnails slider with very narrow slideshow
316
- * FIX: Next & Prev arrows not showing in Colorbox overlay
317
- * FIX: Slideshow is sliding with only one slide/image available
318
- * FIX: Possible security vulnerability with malicious strings in slides/galleries
319
-
320
- = 1.6.2 =
321
- * ADD: (PRO) jQuery UI effects - Blind, Clip, Explode, Puff, Pulsate, Shake, etc.
322
- * ADD: (PRO) jQuery easing effects
323
- * ADD: (PRO) Excerpt length and more settings for featured posts in slideshow
324
- * ADD: (PRO) Touch/mobile swipe gestures support
325
- * ADD: (PRO) Set a delay on the information bar
326
- * ADD: (PRO) WPML multilingual support
327
- * ADD: (PRO) qTranslate X multilingual support
328
- * FIX: Do not load any resources from remote sources
329
- * FIX: Removed all limitations/restrictions on galleries and slides
330
-
331
- = 1.6.1 =
332
- * IMPROVE: Featured posts in TinyMCE button/icon dialog
333
- * IMPROVE: No items tables in admin sections
334
- * FIX: Possible security vulnerability with malicious strings in slides/galleries
335
-
336
- = 1.6 =
337
- * ADD: Assign/set/remove galleries bulk action for slides in admin
338
- * ADD: "Per Page" setting in admin sections
339
- * ADD: Max height setting for auto height
340
- * IMPROVE: Upgrade Colorbox and load from CDN
341
- * IMPROVE: WordPress 4.4 headings changes compatibility
342
- * IMPROVE: Headings in admin settings for easier settings
343
- * IMPROVE: Use post_id="X" to pull current post/page ID automatically
344
- * IMPROVE: Make sure links in information bar is the same colour as information text
345
- * IMPROVE: WordPress configured date format in admin sections for dates
346
- * IMPROVE: Select2 drop downs in admin sections
347
- * IMPROVE: Performance improvements with PHP class autoload
348
- * IMPROVE: Remove wp_head/wp_footer checks
349
- * IMPROVE: Check that slide 'type' database field is present
350
- * FIX: Featured posts featuredtype parameter ineffective
351
- * FIX: "Submit Serial Key" permission/access error
352
- * FIX: Sorting of slides within gallery in admin not working
353
- * FIX: Possible XSS security issues
354
- * FIX: HTML validation errors
355
- * FIX: Specify URL slides not always pulling image correctly
356
- * FIX: Specify URL "File type is not allowed..."
357
- * FIX: Colorbox images wrong path (404 Not Found)
358
- * FIX: Information bar not showing excerpt of post correctly
359
- * FIX: Post/page media images description not showing in info bar
360
- * FIX: Thumbnails don't show on some browsers (Android, Opera, Safari, etc)
361
-
362
- = 1.5.3.4 =
363
- * ADD: FontAwesome icons throughout
364
- * IMPROVE: Improved error handling on multiple slides adding
365
- * IMPROVE: Minimalistic Colorbox design
366
- * IMPROVE: Remove dashicons and fonts completely
367
- * IMPROVE: New WordPress 4.3 check-column styling
368
- * FIX: Some notices/errors showing raw HTML code
369
- * FIX: Vulnerability/security issues
370
-
371
- = 1.5.3.2 =
372
- * IMPROVE: Prevent plugin files from being accessed directly for security
373
- * IMPROVE: Check file mime and type of image URL on slide for security
374
- * IMPROVE: Validate, sanitize and escape data for security purposes
375
- * IMPROVE: Implement WordPress nonces throughout for security
376
- * FIX: CSS and JS files don't work with child theme folder
377
- * FIX: Setting to only hide title
378
- * FIX: Multiple slideshows, overlay shows all images
379
- * FIX: Broken permissions page when paging gallery
380
-
381
- = 1.5.3 =
382
- * FIX: Link not showing with auto height on
383
- * FIX: Dots (.) in image filenames break images/slides
384
- * FIX: Multiple loading/spinning images
385
-
386
- = 1.5.2 =
387
- * ADD: Navigate between images in overlay
388
- * IMPROVE: Ability to hide wp_head/wp_footer notifications in admin
389
- * IMPROVE: HTML validation
390
- * IMPROVE: WordPress 4.1 compatibility
391
- * FIX: Remove unnecessary flush()
392
-
393
- = 1.5.1 =
394
- * ADD: Setting to output Javascript per slideshow or globally in footer
395
- * ADD: Detection of wp_head/wp_footer functions in theme which are required
396
- * ADD: Left/right and top/bottom sliding effect
397
- * ADD: Effect/transition setting to choose between fade/slide
398
- * IMPROVE: Open featured posts slides in the same window
399
- * IMPROVE: Make prev/next buttons/elements unselectable
400
- * IMPROVE: Animation for auto height of images
401
- * IMPROVE: Cross-fading of images for a better effect
402
- * IMPROVE: Image fade speed setting up to 50
403
- * IMPROVE: New, improved paging in admin sections
404
- * FIX: Slide 'type' database column/field not created or updated to support media
405
- * FIX: Fix drag/drop sorting open- and closed hand cursors
406
- * FIX: Erratic timing between slides
407
- * FIX: Auto height setting doesn't work on fixed layout slideshow
408
-
409
- = 1.5 =
410
- * ADD: Add multiple slides at once from the media gallery/uploader
411
- * ADD: "Check/optimize database tables" feature under settings
412
- * ADD: Load external language files from wp-content/languages/slideshow-gallery/
413
- * ADD: "Continue editing" checkboxes in admin sections
414
- * ADD: Indexes on MySQL database tables for performance
415
- * ADD: Use media library for slides
416
- * IMPROVE: Improvements to load_plugin_textdomain()
417
- * IMPROVE: Blank index.php file to prevent indexing/crawling of plugin files/folders
418
- * IMPROVE: Replace all 'slideshow-gallery' string instances dynamically
419
- * IMPROVE: New help tooltip design
420
- * IMPROVE: Move Javascript out of shortcode into head
421
- * IMPROVE: Add text to arrow buttons
422
-
423
- = 1.4.9 =
424
- * ADD: 'numberposts' shortcode attribute for post/page images as slides
425
- * ADD: Notice to rate/review the plugin
426
- * IMPROVE: Moved some files from plugin core to /assets/ folder
427
- * FIX: Post/page images gallery only shows 10 slides, no more
428
- * FIX: Extra space after thumbnails in thumbnail strip
429
-
430
- = 1.4.8 =
431
- * ADD: WordPress 4.0 compatibility
432
- * FIX: Post/page images slideshow order broken
433
- * FIX: Hide information bar on mobile checkbox resets to on
434
-
435
- = 1.4.7 =
436
- * ADD: Recommended plugin under settings
437
- * IMPROVE: TimThumb absolute URLs to prevent permission problems
438
- * IMPROVE: Allow long filenames for custom slides
439
- * IMPROVE: Replace direct Ajax calls with wp_ajax_
440
- * IMPROVE: Prefill the post ID in the TinyMCE dialog with ID of current post
441
- * FIX: Spaces in filenames uploaded to post/page breaks images
442
- * FIX: Remove all wp-config.php and wp-load.php references
443
- * FIX: Possible shell exploit by uploading PHP file as slide
444
- * FIX: Colorbox script should only load with this featured turned on
445
- * FIX: Thumbnails On/Off setting doesn't work
446
-
447
- = 1.4.6 =
448
- * ADD: Featured content. Display a slide for each post with it's featured image
449
- * ADD: Auto height setting to adjust height for each slide
450
- * IMPROVE: (m)qTranslate compatibility for post images and featured posts
451
- * IMPROVE: Change direct Ajax calls to wp_ajax_ hooks
452
- * FIX: Slideshow inside float:left; element breaks height
453
- * FIX: Information bar not showing on post/pages images slides
454
-
455
- = 1.4.5 =
456
- * ADD: Welcome/about screen on update
457
- * ADD: Child theme folder support
458
- * ADD: Multilingual with (m)qTranslate
459
- * IMPROVE: New style for sliders in settings
460
- * IMPROVE: Deprecated: Function split() is deprecated
461
- * IMPROVE: Deprecated: Function eregi() is deprecated
462
- * FIX: Uppercase file extensions
463
- * FIX: Image overlay/enlargement only works with no thumbnails
464
- * FIX: Image overlay/enlargement URL wrong
465
- * FIX: Space in file name
466
- * FIX: Information bar is overlapped by prev/next
467
-
468
- = 1.4.4.3 =
469
- * FIX: TypeError: 'null' is not an object (evaluating 'e.offsetHeight')
470
-
471
- = 1.4.4.2 =
472
- * IMPROVE: Replaced eregi() with preg_match()
473
- * IMPROVE: Replaced ereg_replace() with preg_replace()
474
- * FIX: Multiple rows of thumbnails issue
475
- * FIX: Info bar delay on hide
476
- * FIX: console.log() call left behind
477
- * FIX: Current image not showing when saving slide and it doesn't save
478
-
479
- = 1.4.4.1 =
480
- * IMPROVE: Change admin-functions.php to includes/admin.php
481
- * FIX: Cannot order slides of a gallery "No slides available"
482
-
483
- = 1.4.4 =
484
- * FIX: Galleries not showing when saving a slide
485
-
486
- = 1.4.3 =
487
- * ADD: WordPress Object Cache API for performance
488
- * FIX: Post/page images slideshow not showing images with resize turned on
489
- * FIX: Featured/latest product images not showing with resizing
490
-
491
- = 1.4.2 =
492
- * ADD: More flexible settings for information bar per slide
493
- * ADD: Switch from TimThumb to BFI Thumb
494
- * FIX: Change mysql_real_escape_string() to esc_sql()
495
- * REMOVE: Images tester is no longer needed
496
-
497
- = 1.4.1 =
498
- * ADD: Set opacity for information bar per slide
499
- * ADD: Setting per slide to show title/description or not
500
- * IMPROVE: Updated TimThumb script
501
- * IMPROVE: Updated WordPress plugin file header
502
- * IMPROVE: Function call_user_method() is deprecated
503
- * IMPROVE: New spinner/loading image
504
- * FIX: More PHP warnings/notices
505
- * FIX: 404 Not Found on spinner/loading image
506
-
507
- = 1.4 =
508
- * ADD: WordPress 3.9 compatibility
509
- * ADD: New shortcode `[tribulant_slideshow]` to prevent conflicts
510
- * IMPROVE: Reduced/hidden information bar on mobile
511
- * IMPROVE: More CSS selectors on elements
512
- * IMPROVE: New dashicon for help instead of CSS
513
- * IMPROVE: File and folder permissions incorrect on some servers
514
- * FIX: TinyMCE editor button/icon not inserting shortcodes
515
- * FIX: PHP strict standards warnings
516
- * FIX: NextGen Conflict
517
- * FIX: Slideshow not showing with 1 slide
518
- * FIX: TinyMCE editor icon/button since WordPress 3.9 missing
519
-
520
- = 1.3.1.3 =
521
- * FIX: Image could not be moved from TMP error in some cases
522
- * FIX: PHP Strict, Notice and Warning messages
523
-
524
- = 1.3.1.2 =
525
- * FIX: Not all Settings loading
526
-
527
- = 1.3.1 =
528
-
529
- * ADD: Images tester utility under Settings to fix broken images
530
- * FIX: Issue with turning off navigation images
531
- * FIX: Issue with new slider settings if empty or set to zero (0)
532
-
533
- = 1.3 =
534
-
535
- * ADD: Show latest/featured products from Shopping Cart plugin
536
- * ADD: Plugin "Settings" link on the "Plugins" page in WordPress
537
- * ADD: TimThumb crop position setting
538
- * ADD: WordPress multi-site compatibility
539
- * ADD: Sortable columns in all admin sections
540
- * ADD: Help tooltips in admin
541
- * ADD: Sliders for speed settings
542
- * ADD: Color picker for color settings
543
- * ADD: Delete image upon deletion of locally created slide
544
- * ADD: WordPress 3.8+ design and compatibility
545
- * ADD: Multiple slideshows on a single page
546
- * ADD: Responsive design for mobiles and tablets
547
- * ADD: Debugging setting in settings
548
- * IMPROVE: Colorbox upgrade/fix
549
- * IMPROVE: Use wp_upload_dir() for dynamic paths
550
- * IMPROVE: Better thumbnail slider using CSS calc
551
- * IMPROVE: Move images to default theme folder
552
- * IMPROVE: New TinyMCE icon/button
553
- * IMPROVE: New dashicons menu icon
554
- * IMPROVE: When the nav arrows are turned off, the link click area should be full
555
- * IMPROVE: Automatically center align images in the slideshow
556
- * FIX: Empty/zero thumbs spacing causes JS error
557
- * FIX: Deleting a slide leaves empty reference in gallery
558
- * FIX: Information overlaps arrows when long
559
- * FIX: Permissions settings not working
560
- * FIX: Turning off autoslide setting doesn't stop autoslide
561
- * FIX: Javascript error due to tooltip() call
562
- * FIX: Width/height of slideshow is less than the settings
563
-
564
- = 1.2.3.2 =
565
- * ADD: List/grid switching for ordering of slides
566
- * ADD: Permission/role settings for sections
567
- * ADD: 'imagesoverlay' parameter to turn On/Off the Colorbox overlay per slideshow
568
- * ADD: "Resize Images" setting TimThumb test case for debugging
569
- * ADD: Order slides per gallery
570
- * ADD: Order slides randomly
571
- * IMPROVE: Change WP_PLUGIN_DIR to plugins_url() for styles/scripts
572
- * IMPROVE: Change mysql_list_fields() to a compatible function
573
- * IMPROVE: Remove previous image to prevent overlapping
574
- * IMPROVE: Max width/height for Colorbox overlay for images
575
- * FIX: Null ID value on insert of slide
576
- * FIX: Validation errors
577
- * FIX: Slide current/new window problem
578
-
579
- = 1.2.2.1 =
580
- * IMPROVE: Upgrade of TimThumb from 2.8.9 to 2.8.10 to fix broken images.
581
-
582
- = 1.2.2 =
583
- * FIX: Slides paging numbers didn't show up
584
- * REMOVE: 'Description' not mandatory/required for each slide.
585
- * FIX: Slashes caused by single/double quotes in titles/descriptions
586
- * ADD: Hardcode for each gallery in 'Manage Galleries' section
587
- * ADD: Shortcode in the 'Manage Galleries' section for each gallery
588
- * ADD: Gallery ID to the 'Manage Galleries' section
589
- * FIX: the 100% width issue on the 'img' tag if resizeimages = false
590
- * IMPROVE: Change cache directory to "wp-content/uploads/slideshow-gallery/cache" for TimThumb
591
-
592
- = 1.2.1 =
593
- * FIX: Thumbnails On/Off setting doesn't work
594
- * IMPROVE: TimThumb absolute URLs to prevent permission problems
595
- * FIX: Colorbox script should only load with this featured turned on
596
-
597
- = 1.2 =
598
- * ADD: 'About Us' box in the Settings section
599
- * IMPROVE: Better, more usable hardcoding procedure
600
- * FIX: Slideshow goes left
601
- * IMPROVE: auto width property
602
- * ADD: Banner image for WordPress.org directory
603
- * IMPROVE: Use load_plugin_textdomain instead for language file
604
- * ADD: Order slides by random?
605
- * FIX: Enqueue scripts/styles at the right time
606
- * ADD: Link target (current/new window) setting on each slide for link
607
- * IMPROVE: Hide next/previous navigation when there is only one slide
608
- * ADD: TimThumb integration for cropping images
609
- * CHANGE: Colorbox for popup images
610
- * ADD: 'Open' link to test slide links
611
- * ADD: Icon in each section of the plugin
612
- * CHANGE: Author name on WordPress.org to link appropriately
613
- * ADD: Dimensions for thumbnail images
614
- * CHANGE: New icon image for the admin menu
615
- * IMPROVE: Change 1=1 for the CSS
616
- * FIX: Code showing in the RSS feed.
617
- * ADD: Shortcode parameters
618
- * ADD: Setting to turn off the next/previous navigation
619
- * IMPROVE: "Previous Image" and "Next Image" in language file
620
- * FIX: Not all thumbnails load the first time
621
- * IMPROVE: Remove black borders left and right of the image
622
- * IMPROVE: Removed link overlay which displayed white in IE6
623
-
624
- = 1.1 =
625
- * ADDED: "THIS POST" added to the TinyMCE dialog to insert a shortcode for a slideshow of the current post
626
- * IMPROVED: Some CSS improvements to the slideshow
627
- * ADDED: Thickbox to show images in overlay. Can be turned On/Off
628
- * FIXED: Fixed all thumbnails not preloading on first load
629
- * FIXED: Slide HREF in IE
630
- * ADDED: Spinner loading indicator to show the slideshow is loading up
631
- * ADDED: "Link" column in the "Manage Slides" section
632
- * FIXED: Load Thickbox on the 'Manage Slides' page for the enlargements
633
- * ADDED: Ability to upload an image when saving a slide rather than specifying a URL
634
- * ADDED: Row actions in the 'Manage Slides' section
635
-
636
- = 1.0.4 =
637
- * IMPROVED: WordPress 2.9 sortable meta boxes.
638
- * FIXED: `wp_redirect()` fatal error in dashboard.
639
- * ADDED: TinyMCE editor button to quickly insert slideshows into posts/pages.
640
- * ADDED: `exclude` parameter to use in conjunction with the `post_id` parameter to exclude attachments by order.
641
- * CHANGED: Changed `#wrapper` in the HTML markup to `#slideshow-wrapper` due to some theme conflicts.
642
-
643
- = 1.0.4 =
644
- * COMPATIBILITY: WordPress 2.9
645
- * FIXED: #fullsize z-index to keep below other elements such as drop down menus.
646
-
647
- = 1.0.3 =
648
- * ADDED: Default, English language file in the `languages` folder.
649
- * ADDED: Settings setting to turn On/Off resizing of images via CSS.
650
- * ADDED: Webkit border radius in CSS for thumbnail images.
651
- * ADDED: `post_id` parameter for the `[tribulant_slideshow]` shortcode to display images from a post/page.
652
- * IMPROVED: Plugin doesn't utilize PHP short open tags anymore.
653
- * COMPATIBILITY: Removed `autoLoad` (introduced in PHP 5) parameter from `class_exists` function for PHP 4 compatibility.
654
- * IMPROVED: Directory separator constant DS from DIRECTORY_SEPARATOR.
655
-
656
- = 1.0 =
657
- * Initial release of the WordPress Slideshow Gallery plugin
 
 
 
1
+ === Slideshow Gallery LITE ===
2
+ Contributors: contrid
3
+ Donate link: https://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: 6.0.2
7
+ Stable tag: 1.7.5
8
+
9
+ Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
+
11
+ == Description ==
12
+
13
+ Feature content in beautiful and fast JavaScript powered slideshow gallery showcases on your WordPress website.
14
+
15
+ You can easily display multiple galleries throughout your WordPress website displaying your custom added slides, slide galleries or showing slides from WordPress posts/pages.
16
+
17
+ The slideshow is flexible, all aspects can easily be configured and embedding/hardcoding the slideshow gallery is a breeze.
18
+
19
+ See the <a href="https://tribulant.net/slideshowgallery/">online demonstration</a>.
20
+
21
+ Here are several ways to display a slideshow:
22
+
23
+ = Shortcode for all slides =
24
+
25
+ To embed a slideshow with all slides under **Slideshow > Manage Slides** in the plugin, simply insert the shortcode below into the content of a post/page.
26
+
27
+ `[tribulant_slideshow]`
28
+
29
+ = Shortcode for featured posts =
30
+
31
+ You can create a slideshow from featured posts, each post being a slide and it's featured image used as the slide image. The link of the slide will be the link of the post so clicking on the slide will take users to that post.
32
+
33
+ Here is a sample shortcode that you can use for this:
34
+
35
+ `[tribulant_slideshow featured="true" featurednumber="10" featuredtype="post"]`
36
+
37
+ = Shortcode for a gallery's slides =
38
+
39
+ To embed a slideshow with slides from a specific gallery under **Slideshow > Manage Galleries** in the plugin, simply insert the shortcode below (where X is the ID value of the gallery) into the content of a post/page.
40
+
41
+ `[tribulant_slideshow gallery_id="X"]`
42
+
43
+ = Shortcode for the images of a WordPress post/page =
44
+
45
+ To embed a slideshow with the images uploaded to a WordPress post/page through it's media gallery, simply insert the shortcode below (where X is the ID value of the post). Whether you want to display the images from a post or a page, the parameter remains `post_id`.
46
+
47
+ `[tribulant_slideshow post_id="X"]`
48
+
49
+ = Shortcode for latest/featured products =
50
+
51
+ In order to display latest or featured products in a slideshow, you need the <a href="https://tribulant.com/plugins/view/10/wordpress-shopping-cart-plugin" title="WordPress Shopping Cart">Shopping Cart plugin</a> from Tribulant. Once you have this installed and activated, you can easily display recent or featured products. To display recent products use the shortcode below.
52
+
53
+ `[tribulant_slideshow products="latest"]`
54
+
55
+ And to display featured products, use the one below.
56
+
57
+ `[tribulant_slideshow products="featured"]`
58
+
59
+ For both, you can use the `productsnumber` parameter to limit the number of products eg.
60
+
61
+ `[tribulant_slideshow products="latest" productsnumber="5"]`
62
+
63
+ = Hardcode into any plugin/theme with PHP =
64
+
65
+ To hardcode into any PHP file of your WordPress theme, simply use
66
+
67
+ `<?php if (function_exists('slideshow')) { slideshow($output = true, $gallery_id = false, $post_id = false, $params = array()); } ?>`.
68
+
69
+ = Parameters for shortcode/hardcode to customize each slideshow =
70
+
71
+ You can use any of the following parameters with both the hardcoding and shortcode to customize each slideshow gallery:
72
+
73
+ Shortcode example 1:
74
+
75
+ `[tribulant_slideshow layout="responsive" gallery_id="3" auto="true" navopacity="0" showthumbs="true"]`
76
+
77
+ Shortcode example 2:
78
+
79
+ `[tribulant_slideshow layout="specific" post_id="379" width="600" height="300" auto="false" showinfo="false"]`
80
+
81
+ Hardcode example 1:
82
+
83
+ `<?php slideshow(true, 3, false, array('layout' => "responsive", 'auto' => "true", 'navopacity' => "0", 'showthumbs' => "true")); ?>`
84
+
85
+ Hardcode example 2:
86
+
87
+ `<?php slideshow(true, false, 379, array('layout' => "specific", 'width' => "600", 'height' => "300", 'auto' => "false", 'showinfo' => "false")); ?>`
88
+
89
+ This way you can customize each slideshow you embed or hardcode, despite the settings you saved under **Slideshow > Settings**.
90
+
91
+ * `effect` [ fade | slide ] = Choose the transition effect of the slideshow. Either fade or slide
92
+ * `slide_direction` [ lr | tb ] = If you're using `slide` for the `effect`, you can choose left/right or top/bottom sliding
93
+ * `easing` [ swing ] = Choose the easing effect you'd like. The default is `swing`
94
+ * `products` [ latest | featured ] = String "latest" or "featured" to display products from the <a href="https://tribulant.com/plugins/view/10/wordpress-shopping-cart-plugin">Checkout plugin</a>.
95
+ * `productsnumber` [ productsnumber ] = Numeric/integer to limit the number of products to display.
96
+ * `featured` [ true | false ] = Show posts with their featured images
97
+ * `featurednumber` [ number ] = A numeric/integer value. The default is 10
98
+ * `featuredtype` [ post_type ] = A post type slug like 'post', 'page', etc. The default is 'post'
99
+ * `gallery_id` [ gallery_id ] = Numeric/integer ID of a gallery to display images from.
100
+ * `post_id` [ post_id ] = Numeric/integer ID of a post to take images from it, uploaded through it's "Add Media" button.
101
+ * `numberposts` [ numberposts ] = Numeric value of the number of images to take from the post/page. "-1" for unlimited/all
102
+ * `layout` [ responsive | specific ] = Set to 'responsive' for mobile/tablet compatible theme and 'specific' for fixed width/height.
103
+ * `resizeimages` [ true | false ] = Set to 'true' to resize images to fit the slideshow dimensions.
104
+ * `imagesoverlay` [ true | false ] (default: setting) = Set to 'true' to display links of slides that are images in a Colorbox overlay on the page.
105
+ * `orderby` [ random ] = Set to 'random' to randomly order the slides. Leave this shortcode parameter to order by the order set on the slides.
106
+ * `width` [ width | auto ] = (only with layout="specific") Width of the slideshow in pixels. Don't specify 'px' part, just the numeric value for the height.
107
+ * `resheight` [ resheight ] = (only with layout="responsive") Numeric/integer value such as "30" to be used with 'resheighttype' below
108
+ * `resheighttype [ resheighttype ] = (only with layout="responsive") "px" (pixels) or "%" (percent) as the value e.g., resheighttype="%"
109
+ * `height` [ height ] (only with layout="specific"; default: setting) = Height of the slideshow in pixels. Don't specify the 'px' part, just the numeric value for the height.
110
+ * `autoheight` [ true | false ] = Should the gallery adjust it's height for each slide?
111
+ * `auto` [ true | false ] (default: setting) = Set this to 'true' to automatically slide the slides in the slideshow.
112
+ * `autospeed` [ speed ] (default: setting) = Speed of the auto sliding. 10 is normal. Lower number is faster. Between 5 and 15 is recommended.
113
+ * `fadespeed` [ speed ] (default: setting) = Speed of the fading of images. 10 is normal. Lower number is faster. Between 1 and 20 is recommended.
114
+ * `shownav` [ true | false ] (default: setting) = Set to 'true' to show the next/previous image navigation buttons.
115
+ * `navopacity` [ opacity ] (default: setting) = The opacity of the next/previous buttons. Between 0 and 100 with 0 being transparent and 100 being fully opaque.
116
+ * `navhoveropacity` [ opacity ] (default: setting) = The opacity of the next/previous buttons on hovering. Between 0 and 100 with 0 being transparent and 100 being fully opaque.
117
+ * `showinfo` [ true | false ] (default: setting) = Set to 'true' to show the information bar for each slide.
118
+ * `infospeed` [ speed ] (default: setting) = Speed at which the information bar will slide up. Between 5 and 15 is recommended.
119
+ * `showthumbs` [ true | false ] (default: setting) = Set to 'true' to show the thumbnails for the slides.
120
+ * `thumbsposition` [ top | bottom ] (default: setting) = Set to "top" to show above the slideshow.
121
+ * `thumbsborder` [ hexidecimal color ] (default: setting) = Hex color of the active thumb border. For example #333333.
122
+ * `thumbsspeed` [ speed> ] (default: setting) = Speed of the thumbnail bar scrolling. Lower is slower. Between 1 and 20 is recommended.
123
+ * `thumbsspacing` [ spacing ] (default: setting) = An integer value in pixels to space the thumbnails apart. Don’t include the 'px' part, just the number. Between 0 and 10 is recommended.
124
+
125
+ = Languages =
126
+
127
+ Thank you to these wonderful people who contributed to translating the Slideshow Gallery plugin:
128
+
129
+ * Afrikaans (af_ZA) by <a href="https://tribulant.com">Antonie Potgieter | Tribulant</a>
130
+ * Slovak (sk_SK) by Branco Radenovich
131
+
132
+ <a href="https://tribulant.com/support/">Contact us</a> to submit your language file and be mentioned here!
133
+
134
+ == Installation ==
135
+
136
+ Installing the WordPress slideshow gallery plugin is very easy. Simply follow the steps below.
137
+
138
+ 1. Extract the package to obtain the `slideshow-gallery` folder
139
+ 1. Upload the `slideshow-gallery` folder to the `/wp-content/plugins/` directory
140
+ 1. Activate the plugin through the 'Plugins' menu in WordPress
141
+ 1. Configure the settings according to your needs through the **Slideshow > Settings** menu
142
+ 1. Add and manage your slides in the 'Slideshow' section
143
+ 1. Put `[tribulant_slideshow post_id="X"]` to embed a slideshow with the images of a post into your posts/pages or use `[tribulant_slideshow gallery_id="X"]` to display the slides of a specific gallery by ID or use `[tribulant_slideshow]` to embed a slideshow with your custom added slides under **Slideshow > Manage Slides** or `<?php if (function_exists('slideshow')) { slideshow($output = true, $gallery_id = false, $post_id = false, $params = array()); } ?>` into your WordPress theme using PHP code.
144
+
145
+ == Frequently Asked Questions ==
146
+
147
+ = Can I display/embed multiple instances of the slideshow gallery? =
148
+
149
+ Yes, you can and you can add multiple slideshows on the same page as well.
150
+
151
+ = How can I display specific slides in a slideshow gallery instance? =
152
+
153
+ You can organize slides either into multiple galleries according to your needs or you can upload images to WordPress posts and display the images uploaded to a post.
154
+
155
+ = How do I display the images uploaded to a post? =
156
+
157
+ You can embed a slideshow and show the images uploaded to a post with the `post_id` parameter. Like this `[tribulant_slideshow post_id="123"]`.
158
+
159
+ = Can I exclude certain images from a post in the slideshow? =
160
+
161
+ Yes, you can use the `exclude` parameter to exclude post images by their order in the gallery (comma separated) like this `[tribulant_slideshow post_id="123" exclude="2,4,8"]`.
162
+
163
+ = How can I fix slide images or thumbnails not displaying? =
164
+
165
+ There is an "Images Tester" utility under Slideshow > Settings on the right-hand side. Use that to determine the problem.
166
+
167
+ == Screenshots ==
168
+
169
+ 1. Slideshow gallery with thumbnails at the bottom.
170
+ 2. Slideshow gallery with thumbnails turned OFF.
171
+ 3. Slideshow gallery with thumbnails at the top.
172
+ 4. Different styles/colors.
173
+ 5. TinyMCE editor button to insert shortcodes.
174
+ 6. Turn on Thickbox to show enlarged images in an overlay.
175
+
176
+ == Changelog ==
177
+
178
+ = 1.7.5 =
179
+ * FIX: Null safe checker is added to some places.
180
+
181
+ = 1.7.4.4 =
182
+ * FIX: Multiple slideshows error on a page/post.
183
+
184
+ = 1.7.4.3 =
185
+ * IMPROVE: Various security fixes.
186
+ * IMPROVE: Removed unneeded libraries.
187
+
188
+ = 1.7.4.2 =
189
+ * IMPROVE: Various security fixes.
190
+
191
+ = 1.7.4.1 =
192
+ * IMPROVE: Various security updates.
193
+ * IMPORTANT: Due to required changes by WordPress.org and us hosting this free plugin here with them, we were unfortunately required to remove the ability to use translation plugins with this free lite version. This still works in our premium version and you can purchase that on our Tribulant website. The premium version will also get more features in the future. We apologise for the inconvenience.
194
+
195
+ = 1.7.4 =
196
+ * FIX: XSS vulnerability issue.
197
+
198
+ = 1.7.3 =
199
+ * IMPROVE: Removed update checker.
200
+
201
+ = 1.7.2 =
202
+ * IMPROVE: Removed serial key management for this free version. To manage the serial key and get access to all the features, you can purchase and use the paid version of this plugin.
203
+
204
+ = 1.7.1 =
205
+ * FIX: Colorbox updates and fixes.
206
+
207
+ = 1.7 =
208
+ * FIX: Error handler.
209
+ * FIX: Undefined $_SERVER variable indexes, while executing WP Cron.
210
+ * FIX: PHP Errors and Notices fixes for current and future versions of PHP.
211
+
212
+ = 1.6.15 =
213
+ * FIX: Additional errors related to errorhandler.php.
214
+
215
+ = 1.6.14 =
216
+ * FIX: Errors related to errorhandler.php.
217
+ * FIX: Errors in recent PHP versions.
218
+ * FIX: Incompatibility with the Avada theme and potentially other WordPress themes.
219
+
220
+ = 1.6.13 =
221
+ * FIX: Undefined variable and other errors.
222
+
223
+ = 1.6.12 =
224
+ * ADD: infoheadingcontent attribute on shortcode
225
+ * IMPROVE: Preload slideshow images on page load
226
+ * IMPROVE: Security fixes and improvements
227
+ * IMPROVE: About page update with new layout
228
+ * FIX: Debugging setting affects debugging on WordPress globally
229
+
230
+ = 1.6.11 =
231
+ * ADD: Variable buttons when saving multiple slides for Alt, Caption, etc.
232
+ * ADD: Polylang multilingual integration
233
+ * ADD: WPGlobus multilingual integration
234
+ * IMPROVE: Make Select2 select drop downs accessible by screen readers
235
+ * IMPROVE: Make Colorbox translatable
236
+ * FIX: Expired slides are showing up in the ordering screen
237
+ * FIX: Apostrophe in gallery title/name won't save
238
+
239
+ = 1.6.10 =
240
+ * ADD: WordPress 5+ compatibility
241
+
242
+ = 1.6.9 =
243
+ * ADD: Search box in admin sections to find slides and galleries
244
+ * IMPROVE: ALT attributes on slide images
245
+ * IMPROVE: Change "Configuration" to "Settings" throughout
246
+ * IMPROVE: http:// to https://
247
+ * FIX: Possible XSS and SQLi vulnerability
248
+ * FIX: Media library loading very slowly
249
+ * FIX: Buttons/icons not showing in some browsers like FireFox
250
+ * FIX: Serial key overlay not showing correctly
251
+
252
+ = 1.6.8 =
253
+ * ADD: Set an expiry date on a slide
254
+ * ADD: Use WP_List_Table for proper, responsive tables in admin
255
+ * IMPROVE: Static textdomain for easier translation
256
+ * IMPROVE: Update WP Color Picker
257
+ * IMPROVE: http:// to https://
258
+ * IMPROVE: hange INPUT to BUTTON element in several places
259
+ * IMPROVE: Prevent conflict with outdated Select2 versions from other plugins
260
+ * FIX: Jetpack Lazy Load causes problems with slides
261
+ * FIX: url() function sometimes breaks plugin path
262
+ * FIX: Use link on slide confusion and not opening
263
+ * FIX: Apostrophe in gallery title/name won't save
264
+ * FIX: "No slides are available" due to getimagesize() not supported
265
+
266
+ = 1.6.7 =
267
+ * ADD: Compatibility with WordPress 4.8+
268
+ * ADD: Display slideshow images inside RSS feeds
269
+ * FIX: Blank/empty slide breaks slideshow
270
+ * FIX: Woocommerce loads outdated version of Select2, conflicts
271
+ * FIX: Conflict with Select2 of Yoast SEO
272
+
273
+ = 1.6.6 =
274
+ * IMPROVE: Check for missing media/attachment records
275
+ * IMPROVE: ALT attributes on slide images
276
+ * FIX: Arrows on thumbnails slider misaligned on some themes
277
+ * FIX: Thumbnail dimensions incorrect on media image slides
278
+ * FIX: Possible XSS vulnerability (credit: www.defensecode.com)
279
+ * FIX: PHP deprecated class constructors cause warning message
280
+ * FIX: Slideshow doesn't show in posts/pages loaded with Ajax
281
+
282
+ = 1.6.5 =
283
+ * IMPROVE: Use attachment full URL if 'thumbnail' size is not available when adding slides
284
+ * IMPROVE: Change deprecated jQuery live() to on()
285
+ * IMPROVE: Colorbox upgrade to 1.6.4
286
+ * IMPROVE: Review SSL/https
287
+ * IMPROVE: Updated welcome/about page
288
+ * IMPROVE: New, improved object cache system
289
+ * FIX: Security, possible XSS on CSS parameters
290
+ * FIX: Missing FontAwesome font files in admin area
291
+ * FIX: Fatal error: Call to a member function image_path() on a non-object
292
+ * FIX: Colorbox when you have Multiple Galleries
293
+
294
+ = 1.6.4 =
295
+ * ADD: Full retina/high definition compatibility
296
+ * ADD: Setting to hide thumbnails bar on mobile
297
+ * ADD: Show thumbnails in order list for slides
298
+ * ADD: Information Bar position
299
+ * ADD: Show info bar only on hover
300
+ * ADD: Fade the information bar after a few seconds
301
+ * IMPROVE: Remove auto slide on slideshow with single image
302
+ * IMPROVE: CSS Selectors Resize images setting for responsive slideshows as well
303
+ * IMPROVE: Ensure that autoheight always works even with responsive height set
304
+ * IMPROVE: Generate images/thumbnails on remote URLs as well
305
+ * IMPROVE: Compatibility with new PHP OOP such as PHP7
306
+ * FIX: Paging broken in admin sections, database error
307
+
308
+ = 1.6.3 =
309
+ * IMPROVE: Allow html in description of slides
310
+ * IMPROVE: Set line-height on icons
311
+ * IMPROVE: Auto hide thumbnails bar if only one image/slide
312
+ * IMPROVE: Featured posts in TinyMCE button/icon dialog
313
+ * IMPROVE: No items tables in admin sections
314
+ * FIX: Changing paths causes media uploaded slides thumbnails to break
315
+ * FIX: Prev an Next buttons not showing in some browsers (Firefox)
316
+ * FIX: Update issue
317
+ * FIX: Image overlay (Colorbox) close icon not working in some browsers (FireFox)
318
+ * FIX: Overflow of thumbnails slider with very narrow slideshow
319
+ * FIX: Next & Prev arrows not showing in Colorbox overlay
320
+ * FIX: Slideshow is sliding with only one slide/image available
321
+ * FIX: Possible security vulnerability with malicious strings in slides/galleries
322
+
323
+ = 1.6.2 =
324
+ * ADD: (PRO) jQuery UI effects - Blind, Clip, Explode, Puff, Pulsate, Shake, etc.
325
+ * ADD: (PRO) jQuery easing effects
326
+ * ADD: (PRO) Excerpt length and more settings for featured posts in slideshow
327
+ * ADD: (PRO) Touch/mobile swipe gestures support
328
+ * ADD: (PRO) Set a delay on the information bar
329
+ * ADD: (PRO) WPML multilingual support
330
+ * ADD: (PRO) qTranslate X multilingual support
331
+ * FIX: Do not load any resources from remote sources
332
+ * FIX: Removed all limitations/restrictions on galleries and slides
333
+
334
+ = 1.6.1 =
335
+ * IMPROVE: Featured posts in TinyMCE button/icon dialog
336
+ * IMPROVE: No items tables in admin sections
337
+ * FIX: Possible security vulnerability with malicious strings in slides/galleries
338
+
339
+ = 1.6 =
340
+ * ADD: Assign/set/remove galleries bulk action for slides in admin
341
+ * ADD: "Per Page" setting in admin sections
342
+ * ADD: Max height setting for auto height
343
+ * IMPROVE: Upgrade Colorbox and load from CDN
344
+ * IMPROVE: WordPress 4.4 headings changes compatibility
345
+ * IMPROVE: Headings in admin settings for easier settings
346
+ * IMPROVE: Use post_id="X" to pull current post/page ID automatically
347
+ * IMPROVE: Make sure links in information bar is the same colour as information text
348
+ * IMPROVE: WordPress configured date format in admin sections for dates
349
+ * IMPROVE: Select2 drop downs in admin sections
350
+ * IMPROVE: Performance improvements with PHP class autoload
351
+ * IMPROVE: Remove wp_head/wp_footer checks
352
+ * IMPROVE: Check that slide 'type' database field is present
353
+ * FIX: Featured posts featuredtype parameter ineffective
354
+ * FIX: "Submit Serial Key" permission/access error
355
+ * FIX: Sorting of slides within gallery in admin not working
356
+ * FIX: Possible XSS security issues
357
+ * FIX: HTML validation errors
358
+ * FIX: Specify URL slides not always pulling image correctly
359
+ * FIX: Specify URL "File type is not allowed..."
360
+ * FIX: Colorbox images wrong path (404 Not Found)
361
+ * FIX: Information bar not showing excerpt of post correctly
362
+ * FIX: Post/page media images description not showing in info bar
363
+ * FIX: Thumbnails don't show on some browsers (Android, Opera, Safari, etc)
364
+
365
+ = 1.5.3.4 =
366
+ * ADD: FontAwesome icons throughout
367
+ * IMPROVE: Improved error handling on multiple slides adding
368
+ * IMPROVE: Minimalistic Colorbox design
369
+ * IMPROVE: Remove dashicons and fonts completely
370
+ * IMPROVE: New WordPress 4.3 check-column styling
371
+ * FIX: Some notices/errors showing raw HTML code
372
+ * FIX: Vulnerability/security issues
373
+
374
+ = 1.5.3.2 =
375
+ * IMPROVE: Prevent plugin files from being accessed directly for security
376
+ * IMPROVE: Check file mime and type of image URL on slide for security
377
+ * IMPROVE: Validate, sanitize and escape data for security purposes
378
+ * IMPROVE: Implement WordPress nonces throughout for security
379
+ * FIX: CSS and JS files don't work with child theme folder
380
+ * FIX: Setting to only hide title
381
+ * FIX: Multiple slideshows, overlay shows all images
382
+ * FIX: Broken permissions page when paging gallery
383
+
384
+ = 1.5.3 =
385
+ * FIX: Link not showing with auto height on
386
+ * FIX: Dots (.) in image filenames break images/slides
387
+ * FIX: Multiple loading/spinning images
388
+
389
+ = 1.5.2 =
390
+ * ADD: Navigate between images in overlay
391
+ * IMPROVE: Ability to hide wp_head/wp_footer notifications in admin
392
+ * IMPROVE: HTML validation
393
+ * IMPROVE: WordPress 4.1 compatibility
394
+ * FIX: Remove unnecessary flush()
395
+
396
+ = 1.5.1 =
397
+ * ADD: Setting to output Javascript per slideshow or globally in footer
398
+ * ADD: Detection of wp_head/wp_footer functions in theme which are required
399
+ * ADD: Left/right and top/bottom sliding effect
400
+ * ADD: Effect/transition setting to choose between fade/slide
401
+ * IMPROVE: Open featured posts slides in the same window
402
+ * IMPROVE: Make prev/next buttons/elements unselectable
403
+ * IMPROVE: Animation for auto height of images
404
+ * IMPROVE: Cross-fading of images for a better effect
405
+ * IMPROVE: Image fade speed setting up to 50
406
+ * IMPROVE: New, improved paging in admin sections
407
+ * FIX: Slide 'type' database column/field not created or updated to support media
408
+ * FIX: Fix drag/drop sorting open- and closed hand cursors
409
+ * FIX: Erratic timing between slides
410
+ * FIX: Auto height setting doesn't work on fixed layout slideshow
411
+
412
+ = 1.5 =
413
+ * ADD: Add multiple slides at once from the media gallery/uploader
414
+ * ADD: "Check/optimize database tables" feature under settings
415
+ * ADD: Load external language files from wp-content/languages/slideshow-gallery/
416
+ * ADD: "Continue editing" checkboxes in admin sections
417
+ * ADD: Indexes on MySQL database tables for performance
418
+ * ADD: Use media library for slides
419
+ * IMPROVE: Improvements to load_plugin_textdomain()
420
+ * IMPROVE: Blank index.php file to prevent indexing/crawling of plugin files/folders
421
+ * IMPROVE: Replace all 'slideshow-gallery' string instances dynamically
422
+ * IMPROVE: New help tooltip design
423
+ * IMPROVE: Move Javascript out of shortcode into head
424
+ * IMPROVE: Add text to arrow buttons
425
+
426
+ = 1.4.9 =
427
+ * ADD: 'numberposts' shortcode attribute for post/page images as slides
428
+ * ADD: Notice to rate/review the plugin
429
+ * IMPROVE: Moved some files from plugin core to /assets/ folder
430
+ * FIX: Post/page images gallery only shows 10 slides, no more
431
+ * FIX: Extra space after thumbnails in thumbnail strip
432
+
433
+ = 1.4.8 =
434
+ * ADD: WordPress 4.0 compatibility
435
+ * FIX: Post/page images slideshow order broken
436
+ * FIX: Hide information bar on mobile checkbox resets to on
437
+
438
+ = 1.4.7 =
439
+ * ADD: Recommended plugin under settings
440
+ * IMPROVE: TimThumb absolute URLs to prevent permission problems
441
+ * IMPROVE: Allow long filenames for custom slides
442
+ * IMPROVE: Replace direct Ajax calls with wp_ajax_
443
+ * IMPROVE: Prefill the post ID in the TinyMCE dialog with ID of current post
444
+ * FIX: Spaces in filenames uploaded to post/page breaks images
445
+ * FIX: Remove all wp-config.php and wp-load.php references
446
+ * FIX: Possible shell exploit by uploading PHP file as slide
447
+ * FIX: Colorbox script should only load with this featured turned on
448
+ * FIX: Thumbnails On/Off setting doesn't work
449
+
450
+ = 1.4.6 =
451
+ * ADD: Featured content. Display a slide for each post with it's featured image
452
+ * ADD: Auto height setting to adjust height for each slide
453
+ * IMPROVE: (m)qTranslate compatibility for post images and featured posts
454
+ * IMPROVE: Change direct Ajax calls to wp_ajax_ hooks
455
+ * FIX: Slideshow inside float:left; element breaks height
456
+ * FIX: Information bar not showing on post/pages images slides
457
+
458
+ = 1.4.5 =
459
+ * ADD: Welcome/about screen on update
460
+ * ADD: Child theme folder support
461
+ * ADD: Multilingual with (m)qTranslate
462
+ * IMPROVE: New style for sliders in settings
463
+ * IMPROVE: Deprecated: Function split() is deprecated
464
+ * IMPROVE: Deprecated: Function eregi() is deprecated
465
+ * FIX: Uppercase file extensions
466
+ * FIX: Image overlay/enlargement only works with no thumbnails
467
+ * FIX: Image overlay/enlargement URL wrong
468
+ * FIX: Space in file name
469
+ * FIX: Information bar is overlapped by prev/next
470
+
471
+ = 1.4.4.3 =
472
+ * FIX: TypeError: 'null' is not an object (evaluating 'e.offsetHeight')
473
+
474
+ = 1.4.4.2 =
475
+ * IMPROVE: Replaced eregi() with preg_match()
476
+ * IMPROVE: Replaced ereg_replace() with preg_replace()
477
+ * FIX: Multiple rows of thumbnails issue
478
+ * FIX: Info bar delay on hide
479
+ * FIX: console.log() call left behind
480
+ * FIX: Current image not showing when saving slide and it doesn't save
481
+
482
+ = 1.4.4.1 =
483
+ * IMPROVE: Change admin-functions.php to includes/admin.php
484
+ * FIX: Cannot order slides of a gallery "No slides available"
485
+
486
+ = 1.4.4 =
487
+ * FIX: Galleries not showing when saving a slide
488
+
489
+ = 1.4.3 =
490
+ * ADD: WordPress Object Cache API for performance
491
+ * FIX: Post/page images slideshow not showing images with resize turned on
492
+ * FIX: Featured/latest product images not showing with resizing
493
+
494
+ = 1.4.2 =
495
+ * ADD: More flexible settings for information bar per slide
496
+ * ADD: Switch from TimThumb to BFI Thumb
497
+ * FIX: Change mysql_real_escape_string() to esc_sql()
498
+ * REMOVE: Images tester is no longer needed
499
+
500
+ = 1.4.1 =
501
+ * ADD: Set opacity for information bar per slide
502
+ * ADD: Setting per slide to show title/description or not
503
+ * IMPROVE: Updated TimThumb script
504
+ * IMPROVE: Updated WordPress plugin file header
505
+ * IMPROVE: Function call_user_method() is deprecated
506
+ * IMPROVE: New spinner/loading image
507
+ * FIX: More PHP warnings/notices
508
+ * FIX: 404 Not Found on spinner/loading image
509
+
510
+ = 1.4 =
511
+ * ADD: WordPress 3.9 compatibility
512
+ * ADD: New shortcode `[tribulant_slideshow]` to prevent conflicts
513
+ * IMPROVE: Reduced/hidden information bar on mobile
514
+ * IMPROVE: More CSS selectors on elements
515
+ * IMPROVE: New dashicon for help instead of CSS
516
+ * IMPROVE: File and folder permissions incorrect on some servers
517
+ * FIX: TinyMCE editor button/icon not inserting shortcodes
518
+ * FIX: PHP strict standards warnings
519
+ * FIX: NextGen Conflict
520
+ * FIX: Slideshow not showing with 1 slide
521
+ * FIX: TinyMCE editor icon/button since WordPress 3.9 missing
522
+
523
+ = 1.3.1.3 =
524
+ * FIX: Image could not be moved from TMP error in some cases
525
+ * FIX: PHP Strict, Notice and Warning messages
526
+
527
+ = 1.3.1.2 =
528
+ * FIX: Not all Settings loading
529
+
530
+ = 1.3.1 =
531
+
532
+ * ADD: Images tester utility under Settings to fix broken images
533
+ * FIX: Issue with turning off navigation images
534
+ * FIX: Issue with new slider settings if empty or set to zero (0)
535
+
536
+ = 1.3 =
537
+
538
+ * ADD: Show latest/featured products from Shopping Cart plugin
539
+ * ADD: Plugin "Settings" link on the "Plugins" page in WordPress
540
+ * ADD: TimThumb crop position setting
541
+ * ADD: WordPress multi-site compatibility
542
+ * ADD: Sortable columns in all admin sections
543
+ * ADD: Help tooltips in admin
544
+ * ADD: Sliders for speed settings
545
+ * ADD: Color picker for color settings
546
+ * ADD: Delete image upon deletion of locally created slide
547
+ * ADD: WordPress 3.8+ design and compatibility
548
+ * ADD: Multiple slideshows on a single page
549
+ * ADD: Responsive design for mobiles and tablets
550
+ * ADD: Debugging setting in settings
551
+ * IMPROVE: Colorbox upgrade/fix
552
+ * IMPROVE: Use wp_upload_dir() for dynamic paths
553
+ * IMPROVE: Better thumbnail slider using CSS calc
554
+ * IMPROVE: Move images to default theme folder
555
+ * IMPROVE: New TinyMCE icon/button
556
+ * IMPROVE: New dashicons menu icon
557
+ * IMPROVE: When the nav arrows are turned off, the link click area should be full
558
+ * IMPROVE: Automatically center align images in the slideshow
559
+ * FIX: Empty/zero thumbs spacing causes JS error
560
+ * FIX: Deleting a slide leaves empty reference in gallery
561
+ * FIX: Information overlaps arrows when long
562
+ * FIX: Permissions settings not working
563
+ * FIX: Turning off autoslide setting doesn't stop autoslide
564
+ * FIX: Javascript error due to tooltip() call
565
+ * FIX: Width/height of slideshow is less than the settings
566
+
567
+ = 1.2.3.2 =
568
+ * ADD: List/grid switching for ordering of slides
569
+ * ADD: Permission/role settings for sections
570
+ * ADD: 'imagesoverlay' parameter to turn On/Off the Colorbox overlay per slideshow
571
+ * ADD: "Resize Images" setting TimThumb test case for debugging
572
+ * ADD: Order slides per gallery
573
+ * ADD: Order slides randomly
574
+ * IMPROVE: Change WP_PLUGIN_DIR to plugins_url() for styles/scripts
575
+ * IMPROVE: Change mysql_list_fields() to a compatible function
576
+ * IMPROVE: Remove previous image to prevent overlapping
577
+ * IMPROVE: Max width/height for Colorbox overlay for images
578
+ * FIX: Null ID value on insert of slide
579
+ * FIX: Validation errors
580
+ * FIX: Slide current/new window problem
581
+
582
+ = 1.2.2.1 =
583
+ * IMPROVE: Upgrade of TimThumb from 2.8.9 to 2.8.10 to fix broken images.
584
+
585
+ = 1.2.2 =
586
+ * FIX: Slides paging numbers didn't show up
587
+ * REMOVE: 'Description' not mandatory/required for each slide.
588
+ * FIX: Slashes caused by single/double quotes in titles/descriptions
589
+ * ADD: Hardcode for each gallery in 'Manage Galleries' section
590
+ * ADD: Shortcode in the 'Manage Galleries' section for each gallery
591
+ * ADD: Gallery ID to the 'Manage Galleries' section
592
+ * FIX: the 100% width issue on the 'img' tag if resizeimages = false
593
+ * IMPROVE: Change cache directory to "wp-content/uploads/slideshow-gallery/cache" for TimThumb
594
+
595
+ = 1.2.1 =
596
+ * FIX: Thumbnails On/Off setting doesn't work
597
+ * IMPROVE: TimThumb absolute URLs to prevent permission problems
598
+ * FIX: Colorbox script should only load with this featured turned on
599
+
600
+ = 1.2 =
601
+ * ADD: 'About Us' box in the Settings section
602
+ * IMPROVE: Better, more usable hardcoding procedure
603
+ * FIX: Slideshow goes left
604
+ * IMPROVE: auto width property
605
+ * ADD: Banner image for WordPress.org directory
606
+ * IMPROVE: Use load_plugin_textdomain instead for language file
607
+ * ADD: Order slides by random?
608
+ * FIX: Enqueue scripts/styles at the right time
609
+ * ADD: Link target (current/new window) setting on each slide for link
610
+ * IMPROVE: Hide next/previous navigation when there is only one slide
611
+ * ADD: TimThumb integration for cropping images
612
+ * CHANGE: Colorbox for popup images
613
+ * ADD: 'Open' link to test slide links
614
+ * ADD: Icon in each section of the plugin
615
+ * CHANGE: Author name on WordPress.org to link appropriately
616
+ * ADD: Dimensions for thumbnail images
617
+ * CHANGE: New icon image for the admin menu
618
+ * IMPROVE: Change 1=1 for the CSS
619
+ * FIX: Code showing in the RSS feed.
620
+ * ADD: Shortcode parameters
621
+ * ADD: Setting to turn off the next/previous navigation
622
+ * IMPROVE: "Previous Image" and "Next Image" in language file
623
+ * FIX: Not all thumbnails load the first time
624
+ * IMPROVE: Remove black borders left and right of the image
625
+ * IMPROVE: Removed link overlay which displayed white in IE6
626
+
627
+ = 1.1 =
628
+ * ADDED: "THIS POST" added to the TinyMCE dialog to insert a shortcode for a slideshow of the current post
629
+ * IMPROVED: Some CSS improvements to the slideshow
630
+ * ADDED: Thickbox to show images in overlay. Can be turned On/Off
631
+ * FIXED: Fixed all thumbnails not preloading on first load
632
+ * FIXED: Slide HREF in IE
633
+ * ADDED: Spinner loading indicator to show the slideshow is loading up
634
+ * ADDED: "Link" column in the "Manage Slides" section
635
+ * FIXED: Load Thickbox on the 'Manage Slides' page for the enlargements
636
+ * ADDED: Ability to upload an image when saving a slide rather than specifying a URL
637
+ * ADDED: Row actions in the 'Manage Slides' section
638
+
639
+ = 1.0.4 =
640
+ * IMPROVED: WordPress 2.9 sortable meta boxes.
641
+ * FIXED: `wp_redirect()` fatal error in dashboard.
642
+ * ADDED: TinyMCE editor button to quickly insert slideshows into posts/pages.
643
+ * ADDED: `exclude` parameter to use in conjunction with the `post_id` parameter to exclude attachments by order.
644
+ * CHANGED: Changed `#wrapper` in the HTML markup to `#slideshow-wrapper` due to some theme conflicts.
645
+
646
+ = 1.0.4 =
647
+ * COMPATIBILITY: WordPress 2.9
648
+ * FIXED: #fullsize z-index to keep below other elements such as drop down menus.
649
+
650
+ = 1.0.3 =
651
+ * ADDED: Default, English language file in the `languages` folder.
652
+ * ADDED: Settings setting to turn On/Off resizing of images via CSS.
653
+ * ADDED: Webkit border radius in CSS for thumbnail images.
654
+ * ADDED: `post_id` parameter for the `[tribulant_slideshow]` shortcode to display images from a post/page.
655
+ * IMPROVED: Plugin doesn't utilize PHP short open tags anymore.
656
+ * COMPATIBILITY: Removed `autoLoad` (introduced in PHP 5) parameter from `class_exists` function for PHP 4 compatibility.
657
+ * IMPROVED: Directory separator constant DS from DIRECTORY_SEPARATOR.
658
+
659
+ = 1.0 =
660
+ * Initial release of the WordPress Slideshow Gallery plugin
select2.css CHANGED
File without changes
slideshow-gallery-plugin.php CHANGED
@@ -1,1707 +1,1707 @@
1
- <?php
2
-
3
- if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
-
5
- class GalleryPlugin extends GalleryCheckinit {
6
-
7
- var $version = '1.7.4.4';
8
- var $plugin_name;
9
- var $plugin_base;
10
- var $pre = 'Gallery';
11
-
12
- var $menus = array();
13
- var $sections = array(
14
- 'welcome' => 'slideshow-slides',
15
- 'submitserial' => 'slideshow-submitserial',
16
- 'about' => 'slideshow-gallery-about',
17
- 'slides' => 'slideshow-slides',
18
- 'galleries' => 'slideshow-galleries',
19
- 'settings' => 'slideshow-settings',
20
- 'settings_updates' => 'slideshow-settings-updates',
21
- );
22
-
23
- var $helpers = array('Db', 'Html', 'Form', 'Metabox');
24
- var $models = array('Slide', 'Gallery', 'GallerySlides');
25
- var $debugging = false; //set to "true" to turn on debugging
26
- var $debug_level = 2; //set to 2 for PHP and DB errors or 1 for just DB errors
27
-
28
- function __call($method = null, $args = null) {
29
- if (!empty($method)) {
30
- // Model
31
- if (in_array($method, $this -> models)) {
32
- $class = $this -> pre . $method;
33
-
34
- if (!class_exists($class)) {
35
- $file = $this -> plugin_base() . DS . 'models' . DS . strtolower($method) . '.php';
36
- if (file_exists($file)) {
37
- include($file);
38
- }
39
- }
40
- // Helper
41
- } elseif (in_array($method, $this -> helpers)) {
42
- $class = $this -> pre . $method . 'Helper';
43
- if (!class_exists($class)) {
44
- $file = $this -> plugin_base() . DS . 'helpers' . DS . strtolower($method) . '.php';
45
- if (file_exists($file)) {
46
- include($file);
47
- }
48
- }
49
- }
50
-
51
- if (empty($this -> {$method}) || !is_object($this -> {$method})) {
52
- if (class_exists($class)) {
53
- $this -> {$method} = new $class($args);
54
- return $this -> {$method};
55
- }
56
- } else {
57
- return $this -> {$method};
58
- }
59
- }
60
-
61
- return false;
62
- }
63
-
64
- function __construct() {
65
-
66
- }
67
-
68
- function register_plugin($name, $base) {
69
- $this -> plugin_name = $name;
70
- $this -> plugin_base = rtrim(dirname($base), DS);
71
- $this -> plugin_file = plugin_basename($base);
72
- $this -> sections = apply_filters('slideshow_sections', (object) $this -> sections);
73
- $this -> initialize_classes();
74
-
75
- if (!defined('SLIDESHOW_LOG_FILE')) { define("SLIDESHOW_LOG_FILE", $this -> plugin_base() . DS . "slideshow.log"); }
76
-
77
- global $wpdb;
78
- $debugging = get_option('tridebugging');
79
- $this -> debugging = (empty($debugging)) ? $this -> debugging : true;
80
-
81
- if ($this -> debugging == true) {
82
- $wpdb -> show_errors();
83
-
84
- /*if ($this -> debug_level == 2) {
85
- error_reporting(E_ALL & ~(E_STRICT|E_NOTICE));
86
- @ini_set('display_errors', 1);
87
- }*/
88
- } else {
89
- //$wpdb -> hide_errors();
90
- //error_reporting(0);
91
- //@ini_set('display_errors', 0);
92
- }
93
-
94
- return true;
95
- }
96
-
97
- function log_error($error = null) {
98
- $debugging = get_option('tridebugging');
99
- $this -> debugging = (empty($debugging)) ? $this -> debugging : true;
100
-
101
- if (!empty($error)) {
102
- if (is_array($error) || is_object($error)) {
103
- $error = '<pre>' . print_r($error, true) . '</pre>';
104
- }
105
-
106
- error_log(date_i18n('[Y-m-d H:i:s] ') . $error . PHP_EOL, 3, SLIDESHOW_LOG_FILE);
107
-
108
- return true;
109
- }
110
-
111
- return false;
112
- }
113
-
114
- function after_plugin_row($plugin_name = null) {
115
- $key = $this -> get_option('serialkey');
116
- $update = $this -> vendor('update');
117
- //$version_info = $update -> get_version_info();
118
- $hidemessage_upgradetopro = $this -> get_option('hidemessage_upgradetopro');
119
-
120
- if (empty($hidemessage_upgradetopro)) {
121
- //if (!$this -> ci_serial_valid() && !empty($version_info) && $version_info['is_valid_key'] == "0") {
122
- if (!$this -> ci_serial_valid()) {
123
- echo '<tr id="slideshow-plugin-update-tr" class="plugin-update-tr">';
124
- echo '<td colspan="3" class="plugin-update">';
125
- echo '<div class="update-message">';
126
-
127
- echo sprintf(__('You are running Slideshow Gallery LITE. Take your slideshows to the next level with %s. Already purchased? %s.', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">Slideshow Gallery PRO</a>', '<a href="https://tribulant.com/docs/wordpress-slideshow-gallery/1758" target="_blank">' . __('See instructions to install PRO', 'slideshow-gallery') . '</a>');
128
- echo ' <a class="button button-primary button-small" href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '"><i class="fa fa-check"></i> ' . __('Upgrade to PRO', 'slideshow-gallery') . '</a>';
129
- echo ' <a class="button button-secondary button-small" href="' . admin_url('admin.php?page=' . $this -> sections -> welcome . '&slideshow_method=hidemessage&message=upgradetopro') . '"><i class="fa fa-times"></i> ' . __('Hide this message', 'slideshow-gallery') . '</a>';
130
-
131
- echo '</div>';
132
- echo '</td>';
133
- echo '</tr>';
134
-
135
- ?>
136
-
137
- <script type="text/javascript">
138
- jQuery(document).ready(function() {
139
- var row = jQuery('#slideshow-plugin-update-tr').closest('tr').prev();
140
- jQuery(row).addClass('update');
141
- });
142
- </script>
143
-
144
- <?php
145
- }
146
- }
147
- }
148
-
149
- /**
150
- * This function outputs the changelog on the 'Plugins' page when the "View Details" link is clicked.
151
- */
152
- function display_changelog() {
153
- if (!empty($_GET['plugin']) && $_GET['plugin'] == $this -> plugin_name) {
154
- $update = $this -> vendor('update');
155
- if ($changelog = $update -> get_changelog()) {
156
- $this -> render('changelog', array('changelog' => $changelog), true, 'admin');
157
- }
158
-
159
- exit();
160
- }
161
- }
162
-
163
- function has_update($cache = true) {
164
- $update = $this -> vendor('update');
165
- $version_info = $update -> get_version_info($cache);
166
- return version_compare($this -> version, $version_info["version"], '<');
167
- }
168
-
169
- /*function check_update($option, $cache = true) {
170
- if ($update = $this -> vendor('update')) {
171
- $version_info = $update -> get_version_info($cache);
172
-
173
- if (!$version_info) { return $option; }
174
- $plugin_path = $this -> plugin_file;
175
-
176
- if(empty($option -> response[$plugin_path])) {
177
- $option -> response[$plugin_path] = new stdClass();
178
- }
179
-
180
- //Empty response means that the key is invalid. Do not queue for upgrade
181
- if(empty($version_info['is_valid_key']) || version_compare($this -> version, $version_info["version"], '>=')){
182
- unset($option -> response[$plugin_path]);
183
- } else {
184
- $option -> response[$plugin_path] -> url = "https://tribulant.com";
185
- $option -> response[$plugin_path] -> slug = $this -> plugin_name;
186
- $option -> response[$plugin_path] -> package = $version_info['url'];
187
- $option -> response[$plugin_path] -> new_version = $version_info["version"];
188
- $option -> response[$plugin_path] -> id = "0";
189
- }
190
- }
191
-
192
- return $option;
193
- }*/
194
-
195
- function ajax_serialkey() {
196
- check_ajax_referer('serialkey', 'security');
197
-
198
- if (!current_user_can('slideshow_welcome')) {
199
- wp_die(__('You do not have permission', 'slideshow-gallery'));
200
- }
201
-
202
- $errors = array();
203
- $success = false;
204
-
205
- if (!empty($_GET['delete'])) {
206
- $this -> delete_option('serialkey');
207
- $errors[] = __('Serial key has been deleted.', 'slideshow-gallery');
208
- } else {
209
- if (!empty($_POST)) {
210
- check_ajax_referer($this -> sections -> submitserial);
211
-
212
- if (empty($_REQUEST['serialkey'])) { $errors[] = __('Please fill in a serial key.', 'slideshow-gallery'); }
213
- else {
214
- $serial = sanitize_text_field($_REQUEST['serialkey']);
215
- $this -> update_option('serialkey', $serial); //update the DB option
216
-
217
- if (!$this -> ci_serial_valid()) { $errors[] = __('Serial key is invalid, please try again.', 'slideshow-gallery'); }
218
- else {
219
- delete_transient($this -> pre . 'update_info');
220
- $success = true;
221
- }
222
- }
223
- }
224
- }
225
-
226
- delete_transient('slideshow_update_info');
227
-
228
- if (empty($_POST)) { ?><div id="slideshow_submitserial"><?php }
229
- $this -> render('submitserial', array('errors' => $errors, 'success' => $success), true, 'admin');
230
- if (empty($_POST)) { ?></div><?php }
231
-
232
- exit();
233
- die();
234
- }
235
-
236
- function ajax_slides_order() {
237
- check_ajax_referer('slides_order', 'security');
238
-
239
- if (!current_user_can('slideshow_slides')) {
240
- wp_die(__('You do not have permission', 'slideshow-gallery'));
241
- }
242
-
243
- if (!empty($_REQUEST['item'])) {
244
- foreach ($_REQUEST['item'] as $order => $slide_id) {
245
- if (empty($_REQUEST['gallery_id'])) {
246
- $this -> Slide() -> save_field('order', ($order + 1), array('id' => $slide_id));
247
- } else {
248
- $this -> GallerySlides() -> save_field('order', ($order + 1), array('slide_id' => $slide_id, 'gallery_id' => $_REQUEST['gallery_id']));
249
- }
250
- }
251
-
252
- echo '<i class="fa fa-check"></i> ' . __('Slides have been ordered', 'slideshow-gallery');
253
- }
254
-
255
- exit();
256
- die();
257
- }
258
-
259
- function ajax_tinymce() {
260
- if (!current_user_can('slideshow_welcome')) {
261
- wp_die(__('You do not have permission', 'slideshow-gallery'));
262
- }
263
-
264
- $this -> render('tinymce-dialog', false, true, 'admin');
265
-
266
- exit();
267
- die();
268
- }
269
-
270
- function replace_https($value = null) {
271
- if (!empty($value)) {
272
- if (is_ssl()) {
273
- if (!is_array($value) && !is_object($value)) {
274
- $value = preg_replace('|/+$|', '', $value);
275
- $value = preg_replace('|http://|', 'https://', $value);
276
- }
277
- }
278
- }
279
-
280
- return apply_filters('slideshow_replace_https', $value);
281
- }
282
-
283
- function init_class($name = null, $params = array()) {
284
- if (!empty($name)) {
285
- $name = $this -> pre . $name;
286
-
287
- if (class_exists($name)) {
288
- if ($class = new $name($params)) {
289
- return $class;
290
- }
291
- }
292
- }
293
-
294
- $this -> init_class('Country');
295
-
296
- return false;
297
- }
298
-
299
- function initialize_classes() {
300
- if (!empty($this -> helpers)) {
301
- foreach ($this -> helpers as $helper) {
302
- $hfile = dirname(__FILE__) . DS . 'helpers' . DS . strtolower($helper) . '.php';
303
-
304
- if (file_exists($hfile)) {
305
- require_once($hfile);
306
-
307
- if (empty($this -> {$helper}) || !is_object($this -> {$helper})) {
308
- $classname = $this -> pre . $helper . 'Helper';
309
-
310
- if (class_exists($classname)) {
311
- $this -> {$helper} = new $classname;
312
- }
313
- }
314
- }
315
- }
316
- }
317
-
318
- include_once(dirname(__FILE__) . DS . 'models' . DS . 'slideshow.php');
319
- }
320
-
321
- function updating_plugin() {
322
- if (!is_admin()) return;
323
-
324
- global $wpdb;
325
-
326
- if (!$this -> get_option('version')) {
327
- $this -> add_option('version', $this -> version);
328
- $this -> initialize_options();
329
- return;
330
- }
331
-
332
- $cur_version = $this -> get_option('version');
333
- $version = $this -> version;
334
-
335
- if (version_compare($this -> version, $cur_version) === 1) {
336
- if (version_compare($cur_version, "1.4.8") < 0) {
337
- $this -> initialize_options();
338
-
339
- $query = "ALTER TABLE `" . $this -> Slide() -> table . "` CHANGE `image` `image` TEXT NOT NULL;";
340
- $wpdb -> query($query);
341
-
342
- $version = "1.4.8";
343
- }
344
-
345
- if (version_compare($cur_version, "1.5.3") < 0) {
346
- $this -> initialize_options();
347
-
348
- $query = "ALTER TABLE `" . $this -> Slide() -> table . "` CHANGE `type` `type` ENUM('media','file','url') NOT NULL DEFAULT 'media'";
349
- $wpdb -> query($query);
350
-
351
-
352
- $version = "1.5.3";
353
- }
354
-
355
- if (version_compare($cur_version, $this->version) < 0) {
356
- $this -> initialize_options();
357
-
358
- $version = $this->version;
359
- }
360
-
361
- //the current version is older.
362
- //lets update the database
363
- $this -> update_option('version', $version);
364
- }
365
- }
366
-
367
- function initialize_options() {
368
- if (!is_admin()) { return; }
369
-
370
- $this -> init_roles();
371
-
372
- $styles = array(
373
- 'layout' => "responsive",
374
- 'width' => "450",
375
- 'height' => "250",
376
- 'resheight' => "50",
377
- 'resheighttype' => "%",
378
- 'border' => "1px solid #CCCCCC",
379
- 'background' => "#000000",
380
- 'infobackground' => "#000000",
381
- 'infocolor' => "#FFFFFF",
382
- 'resizeimages' => "Y",
383
- );
384
-
385
- //$this -> add_option('existing', 1);
386
- $this -> add_option('resizeimagescrop', "Y");
387
- $this -> update_option('imagespath', $this -> Html -> uploads_url() . '/' . $this -> plugin_name . '/');
388
- $this -> add_option('styles', $styles);
389
- $this -> add_option('effect', "fade");
390
- $this -> add_option('easing', "swing");
391
- $this -> add_option('slide_direction', "lr");
392
- $this -> add_option('fadespeed', 20);
393
- $this -> add_option('shownav', "Y");
394
- $this -> add_option('navopacity', 25);
395
- $this -> add_option('navhover', 75);
396
- $this -> add_option('information', "Y");
397
- $this -> add_option('infoposition', "bottom");
398
- $this -> add_option('infoheadingcontent', "title");
399
- $this -> add_option('infospeed', 10);
400
- $this -> add_option('infohideonmobile', 1);
401
- $this -> add_option('thumbnails', "N");
402
- $this -> add_option('thumbwidth', "100");
403
- $this -> add_option('thumbheight', "75");
404
- $this -> add_option('thumbposition', "bottom");
405
- $this -> add_option('thumbopacity', 70);
406
- $this -> add_option('thumbscrollspeed', 5);
407
- $this -> add_option('thumbspacing', 5);
408
- $this -> add_option('thumbactive', "#FFFFFF");
409
- $this -> add_option('thumbhideonmobile', 1);
410
- $this -> add_option('autoslide', "Y");
411
- $this -> add_option('autospeed', 10);
412
- $this -> add_option('alwaysauto', "true");
413
- $this -> add_option('imagesthickbox', "N");
414
- $this -> add_option('jsoutput', "perslideshow");
415
-
416
- $ratereview_scheduled = $this -> get_option('ratereview_scheduled');
417
- if (empty($ratereview_scheduled)) {
418
- wp_schedule_single_event(strtotime("+7 days"), 'slideshow_ratereviewhook', array(7));
419
- wp_schedule_single_event(strtotime("+14 days"), 'slideshow_ratereviewhook', array(14));
420
- wp_schedule_single_event(strtotime("+30 days"), 'slideshow_ratereviewhook', array(30));
421
- wp_schedule_single_event(strtotime("+60 days"), 'slideshow_ratereviewhook', array(60));
422
- wp_schedule_single_event(strtotime("+180 days"), 'slideshow_ratereviewhook', array(180));
423
- wp_schedule_single_event(strtotime("+360 days"), 'slideshow_ratereviewhook', array(360));
424
- $this -> update_option('ratereview_scheduled', true);
425
- }
426
-
427
- return;
428
- }
429
-
430
- function ratereview_hook($days = 7) {
431
- $this -> update_option('showmessage_ratereview', $days);
432
- }
433
-
434
- function check_roles() {
435
- global $wp_roles;
436
- $permissions = $this -> get_option('permissions');
437
-
438
- if ($role = get_role('administrator')) {
439
- if (!empty($this -> sections)) {
440
- foreach ($this -> sections as $section_key => $section_menu) {
441
- if (empty($role -> capabilities['slideshow_' . $section_key])) {
442
- $role -> add_cap('slideshow_' . $section_key);
443
- $permissions['administrator'][] = $section_key;
444
- }
445
- }
446
-
447
- $this -> update_option('permissions', $permissions);
448
- }
449
- }
450
-
451
- return false;
452
- }
453
-
454
- function init_roles($sections = null) {
455
- global $wp_roles;
456
- $sections = $this -> sections;
457
-
458
- /* Get the administrator role. */
459
- $role = get_role('administrator');
460
-
461
- /* If the administrator role exists, add required capabilities for the plugin. */
462
- if (!empty($role)) {
463
- if (!empty($sections)) {
464
- foreach ($sections as $section_key => $section_menu) {
465
- $role -> add_cap('slideshow_' . $section_key);
466
- }
467
- }
468
- } else if (empty($role) && !is_multisite()) {
469
- $newrolecapabilities = array();
470
- $newrolecapabilities[] = 'read';
471
-
472
- if (!empty($sections)) {
473
- foreach ($sections as $section_key => $section_menu) {
474
- $newrolecapabilities[] = 'slideshow_' . $section_key;
475
- }
476
- }
477
-
478
- add_role(
479
- 'slideshow',
480
- _e('Slideshow Manager', 'slideshow-gallery'),
481
- $newrolecapabilities
482
- );
483
- }
484
-
485
- if (!empty($sections)) {
486
- $permissions = array();
487
-
488
- foreach ($sections as $section_key => $section_menu) {
489
- $wp_roles -> add_cap('administrator', 'slideshow_' . $section_key);
490
- $permissions['administrator'][] = $section_key;
491
- }
492
-
493
- $this -> update_option('permissions', $permissions);
494
- }
495
- }
496
-
497
- function render_msg($message = null, $dismissable = null, $escape = true) {
498
- if (!empty($escape)) { $message = wp_kses_post($message); }
499
- $this -> render('msg-top', array('message' => $message, 'dismissable' => $dismissable), true, 'admin');
500
- }
501
-
502
- function render_err($message = null, $dismissable = null, $escape = true) {
503
- if (!empty($escape)) { $message = wp_kses_post($message); }
504
- $this -> render('err-top', array('message' => $message, 'dismissable' => $dismissable), true, 'admin');
505
- }
506
-
507
- function redirect($location = null, $msgtype = null, $message = null, $action = null) {
508
- if (empty($location)) {
509
- $url = remove_query_arg(array('action', 'action2', '_wpnonce', '_wp_http_referer'), wp_get_referer());
510
- } else {
511
- $url = $location;
512
- }
513
-
514
- if ($msgtype == "message") {
515
- $url .= '&' . $this -> pre . 'updated=true';
516
- } elseif ($msgtype == "error") {
517
- $url .= '&' . $this -> pre . 'error=true';
518
- }
519
-
520
- if (!empty($message)) {
521
- $url .= '&' . $this -> pre . 'message=' . urlencode($message);
522
- }
523
-
524
- if (!empty($action)) {
525
- $url = wp_nonce_url($url, $action);
526
- }
527
-
528
- ?>
529
-
530
- <script type="text/javascript">
531
- window.location = '<?php echo (empty($url)) ? esc_url(get_option('home')) : esc_url($url); ?>';
532
- </script>
533
-
534
- <?php
535
- }
536
-
537
- function vendor($name = null, $folder = null) {
538
- if (!empty($name)) {
539
- $filename = 'class.' . strtolower($name) . '.php';
540
- $filepath = rtrim(dirname(__FILE__), DS) . DS . 'vendors' . DS . $folder . '';
541
- $filefull = $filepath . $filename;
542
-
543
- if (file_exists($filefull)) {
544
- require_once($filefull);
545
- $class = 'Gallery' . $name;
546
-
547
- if (${$name} = new $class) {
548
- return ${$name};
549
- }
550
- }
551
- }
552
-
553
- return false;
554
- }
555
-
556
- function check_uploaddir() {
557
- $uploaddir = $this -> Html -> uploads_path() . DS . $this -> plugin_name . DS;
558
- $cachedir = $uploaddir . 'cache' . DS;
559
-
560
- if (!file_exists($uploaddir)) {
561
- if (@mkdir($uploaddir, 0777)) {
562
- @chmod($uploaddir, 0777);
563
- return true;
564
- } else {
565
- $message = sprintf(esc_html__('Uploads folder named "%s" cannot be created inside "%s"', 'slideshow-gallery'), $this -> plugin_name, "wp-content/uploads/");
566
- $this -> render_msg($message);
567
- }
568
- }
569
-
570
- if (!file_exists($cachedir)) {
571
- if (@mkdir($cachedir, 0777)) {
572
- @chmod($cachedir, 0777);
573
- } else {
574
- $message = sprintf(esc_html__('Slideshow cache folder "%s" for resizing images cannot be created inside "%s"', 'slideshow-gallery'), 'cache', 'wp-content/uploads/' . $this -> plugin_name . '/');
575
- $this -> render_msg($message);
576
- }
577
- }
578
-
579
- return false;
580
- }
581
-
582
- function add_action($action, $function = null, $priority = 10, $params = 1) {
583
- if (add_action($action, array($this, (empty($function)) ? $action : $function), $priority, $params)) {
584
- return true;
585
- }
586
-
587
- return false;
588
- }
589
-
590
- function add_filter($filter, $function = null, $priority = 10, $params = 1) {
591
- if (add_filter($filter, array($this, (empty($function)) ? $filter : $function), $priority, $params)) {
592
- return true;
593
- }
594
-
595
- return false;
596
- }
597
-
598
- function ci_print_styles() {
599
- wp_enqueue_style('slideshow', $this -> render_url('css/admin.css'), null, $this -> version, "all");
600
- wp_enqueue_style('colorbox', $this -> render_url('css/colorbox.css'), false, $this -> version, "all");
601
- }
602
-
603
- function ci_print_scripts() {
604
- wp_register_script('slideshow', $this -> render_url('js/admin.js'), array('jquery'), '1.0', true);
605
-
606
- $params = array(
607
- 'ajaxnonce' => array(
608
- 'serialkey' => wp_create_nonce('serialkey'),
609
- )
610
- );
611
-
612
- wp_localize_script('slideshow', 'slideshow', $params);
613
- wp_enqueue_script('slideshow');
614
-
615
- wp_enqueue_script('colorbox', $this -> render_url('js/colorbox.js'), array('jquery'), false, true);
616
- }
617
-
618
- function print_scripts() {
619
- $this -> enqueue_scripts();
620
- }
621
-
622
- function enqueue_scripts() {
623
- wp_enqueue_script('jquery');
624
-
625
- if (is_admin()) {
626
- $page = (!empty($_GET['page'])) ? sanitize_text_field($_GET['page']) : false;
627
- $method = (!empty($_GET['method'])) ? sanitize_text_field($_GET['method']) : false;
628
-
629
- if (!empty($page) && in_array($page, (array) $this -> sections)) {
630
- wp_enqueue_script('iris', admin_url('js/iris.min.js'), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1);
631
- wp_enqueue_script('wp-color-picker', admin_url('js/color-picker.min.js'), array( 'iris' ), false, 1);
632
-
633
- wp_enqueue_script('jquery-ui-tabs');
634
- wp_enqueue_script('jquery-ui-tooltip');
635
- wp_enqueue_script('jquery-ui-slider');
636
- wp_enqueue_script('jquery-ui-datepicker');
637
-
638
- if ($page == 'slideshow-settings') {
639
- wp_enqueue_script('common');
640
- wp_enqueue_script('wp-lists');
641
- wp_enqueue_script('postbox');
642
- wp_enqueue_script('plugin-install');
643
- wp_enqueue_script('updates');
644
- wp_enqueue_script('settings-editor', $this -> render_url('js/settings-editor.js', "admin"), array('jquery'), '1.0');
645
- }
646
-
647
- if ($page == "slideshow-slides" && $method == "order") {
648
- wp_enqueue_script('jquery-ui-sortable');
649
- }
650
-
651
- if ($page == $this -> sections -> slides && ($method == "save" || $method == "save-multiple")) {
652
- wp_enqueue_media();
653
- }
654
-
655
- add_thickbox();
656
- wp_deregister_script('select2');
657
- wp_deregister_script('wc-enhanced-select');
658
- wp_enqueue_script('select2', $this -> render_url('js/select2.js', "admin"), array('jquery'), '4.0.0');
659
- }
660
-
661
- wp_enqueue_script('colorbox', $this -> render_url('js/colorbox.js', "admin"), array('jquery'), '1.6.3');
662
- wp_register_script('slideshow', $this -> render_url('js/admin.js'), array('jquery'), '1.0', true);
663
-
664
- $params = array(
665
- 'ajaxnonce' => array(
666
- 'serialkey' => wp_create_nonce('serialkey'),
667
- )
668
- );
669
-
670
- wp_localize_script('slideshow', 'slideshow', $params);
671
- wp_enqueue_script('slideshow');
672
- } else {
673
- wp_enqueue_script($this -> plugin_name, $this -> render_url('js/gallery.js', "default"), null, '1.0');
674
- wp_enqueue_script('colorbox', $this -> render_url('js/colorbox.js', "default"), array('jquery'), '1.6.3');
675
- wp_enqueue_script('jquery-effects-core');
676
- }
677
-
678
- return true;
679
- }
680
-
681
-
682
- function generate_css($attr = null, $layout = null) {
683
-
684
- $function = (empty($layout) || $layout == "specific") ? 'sg_generate_css' : 'sg_generate_css_responsive';
685
-
686
- $default_attr = $this -> get_option('styles');
687
- $styles = wp_parse_args($attr, $default_attr);
688
-
689
- //$id = $styles['unique'];
690
- //$key = 'slideshow-css-' . $id;
691
- //$data = maybe_serialize($styles);
692
- //set_transient($key, $data, 999);
693
-
694
- if (!function_exists($function)) {
695
- include 'views/default/css-generator-fn.php';
696
- }
697
- $output = '';
698
- $output .= '<style id="style-'.esc_attr($styles['unique']).'">';
699
- ob_start();
700
- $function($styles);
701
- $output .= ob_get_clean();
702
- $output .= '</style>';
703
- return $output;
704
-
705
- }
706
-
707
-
708
-
709
- function get_css_url($attr = null, $layout = null) {
710
- $file = (empty($layout) || $layout == "specific") ? 'css' : 'css-responsive';
711
- $css_url = $this -> render_url($file . '.php', 'default');
712
-
713
- $default_attr = $this -> get_option('styles');
714
- $styles = wp_parse_args($attr, $default_attr);
715
-
716
- $css_url = add_query_arg(array('id' => esc_attr($styles['unique'])), $css_url);
717
-
718
- $key = 'slideshow-css-' . $styles['unique'];
719
- $data = maybe_serialize($styles);
720
- set_transient($key, $data, 999);
721
-
722
- return $css_url;
723
- }
724
-
725
- function print_styles() {
726
- $this -> enqueue_styles();
727
- }
728
-
729
- function enqueue_styles() {
730
- if (is_admin()) {
731
- wp_enqueue_style('fontawesome', $this -> render_url('css/fontawesome.css', "admin"), false, '4.4.0', "all");
732
-
733
- if (isset($_GET['page'])) {
734
- $page = sanitize_text_field($_GET['page']);
735
- } else {
736
- $page = "";
737
- }
738
-
739
- if (!empty($page) && in_array($page, (array) $this -> sections)) {
740
- wp_enqueue_style('wp-color-picker');
741
- wp_enqueue_style('jquery-ui', $this -> render_url('css/jquery-ui.css', "admin"), null, "1.0", "all");
742
- wp_enqueue_style('select2', $this -> render_url('css/select2.css', "admin"), false, '4.0.0', "all");
743
- }
744
-
745
- wp_enqueue_style('colorbox', $this -> render_url('css/colorbox.css', "admin"), null, "1.3.19", "all");
746
- wp_enqueue_style($this -> plugin_name, $this -> render_url('css/admin.css', "admin"), null, "1.0", "all");
747
- } else {
748
- wp_enqueue_style('colorbox', $this -> render_url('css/colorbox.css', "default"), null, "1.3.19", "all");
749
- wp_enqueue_style('fontawesome', $this -> render_url('css/fontawesome.css', "default"), false, '4.4.0', "all");
750
- }
751
-
752
- return true;
753
- }
754
-
755
- function plugin_update_link() {
756
- //https://slideshow.tribulant.co/wp-admin/update.php?action=upgrade-plugin&plugin=slideshow-gallery%2Fslideshow-gallery.php&_wpnonce=6533f071ab
757
- $link = wp_nonce_url(admin_url('update.php?action=upgrade-plugin&plugin=' . $this -> plugin_base()));
758
-
759
- return $link;
760
- }
761
-
762
- function plugin_base() {
763
- return rtrim(dirname(__FILE__), '/');
764
- }
765
-
766
- function url() {
767
- $url = rtrim(plugins_url(false, __FILE__));
768
- return $url;
769
- }
770
-
771
- function add_option($name = '', $value = '') {
772
- if (add_option($this -> pre . $name, $value)) {
773
- return true;
774
- }
775
-
776
- return false;
777
- }
778
-
779
- function update_option($name = null, $value = null) {
780
- if (update_option($this -> pre . $name, $value)) {
781
- return true;
782
- }
783
-
784
- return false;
785
- }
786
-
787
- function get_option($name = null) {
788
- if (!empty($name)) {
789
- if ($value = get_option($this -> pre . $name)) {
790
- return $value;
791
- }
792
- }
793
-
794
- return false;
795
- }
796
-
797
- function delete_option($name = null) {
798
- if (delete_option($this -> pre . $name)) {
799
- return true;
800
- }
801
-
802
- return false;
803
- }
804
-
805
- function debug($var = array()) {
806
- $debugging = get_option('tridebugging');
807
- $this -> debugging = (empty($debugging)) ? $this -> debugging : true;
808
-
809
- if ($this -> debugging) {
810
- echo '<pre>' . print_r(map_deep($var, 'esc_html'), true) . '</pre>';
811
- return true;
812
- }
813
-
814
- return false;
815
- }
816
-
817
- function check_tables() {
818
- global $wpdb;
819
-
820
- if (!empty($this -> models)) {
821
- foreach ($this -> models as $model) {
822
- $this -> check_table($model);
823
- }
824
-
825
- $query = "ALTER TABLE `" . $this -> Slide() -> table . "` CHANGE `type` `type` ENUM('media','file','url') NOT NULL DEFAULT 'media'";
826
- $wpdb -> query($query);
827
- }
828
-
829
- return;
830
- }
831
-
832
- function check_table($model = null) {
833
- global $wpdb;
834
-
835
- $this -> initialize_classes();
836
-
837
- if (!empty($model)) {
838
- if (!empty($this -> fields) && is_array($this -> fields)) {
839
- if (!$wpdb -> get_var("SHOW TABLES LIKE '" . $this -> table . "'")) {
840
- $query = "CREATE TABLE `" . $this -> table . "` (";
841
- $c = 1;
842
-
843
- foreach ($this -> fields as $field => $attributes) {
844
- if ($field != "key") {
845
- $query .= "`" . $field . "` " . $attributes . "";
846
- } else {
847
- $query .= "" . $attributes . "";
848
- }
849
-
850
- if ($c < count($this -> fields)) {
851
- $query .= ",";
852
- }
853
-
854
- $c++;
855
- }
856
-
857
- $query .= ") ENGINE=MyISAM AUTO_INCREMENT=1 CHARSET=UTF8;";
858
-
859
- if (!empty($query)) {
860
- $this -> table_query[] = $query;
861
- }
862
- } else {
863
- $field_array = $this -> get_fields($this -> table);
864
-
865
- foreach ($this -> fields as $field => $attributes) {
866
- if ($field != "key") {
867
- $this -> add_field($this -> table, $field, $attributes);
868
- }
869
- }
870
-
871
- if (!empty($this -> indexes)) {
872
- foreach ($this -> indexes as $index) {
873
- $query = "SHOW INDEX FROM `" . $this -> table . "` WHERE `Key_name` = '" . $index . "'";
874
- if (!$wpdb -> get_row($query)) {
875
- $query = "ALTER TABLE `" . $this -> table . "` ADD INDEX(`" . $index . "`);";
876
- $wpdb -> query($query);
877
- }
878
- }
879
- }
880
- }
881
-
882
- if (!empty($this -> table_query)) {
883
- require_once(ABSPATH . 'wp-admin' . DS . 'upgrade-functions.php');
884
- dbDelta($this -> table_query, true);
885
- }
886
- }
887
- }
888
-
889
- return false;
890
- }
891
-
892
- function get_fields($table = null) {
893
- global $wpdb;
894
-
895
- if (!empty($table)) {
896
- $fullname = $table;
897
- $field_array = array();
898
- if ($fields = $wpdb -> get_results("SHOW COLUMNS FROM " . $fullname)) {
899
- foreach ($fields as $field) {
900
- $field_array[] = $field -> Field;
901
- }
902
-
903
- return $field_array;
904
- }
905
- }
906
-
907
- return false;
908
- }
909
-
910
- function delete_field($table = null, $field = null) {
911
- global $wpdb;
912
-
913
- if (!empty($table)) {
914
- if (!empty($field)) {
915
- $query = "ALTER TABLE `" . $wpdb -> prefix . "" . $table . "` DROP `" . $field . "`";
916
-
917
- if ($wpdb -> query($query)) {
918
- return false;
919
- }
920
- }
921
- }
922
-
923
- return false;
924
- }
925
-
926
- function change_field($table = null, $field = null, $newfield = null, $attributes = "TEXT NOT NULL") {
927
- global $wpdb;
928
-
929
- if (!empty($table)) {
930
- if (!empty($field)) {
931
- if (!empty($newfield)) {
932
- $field_array = $this -> get_fields($table);
933
-
934
- if (!in_array($field, $field_array)) {
935
- if ($this -> add_field($table, $newfield)) {
936
- return true;
937
- }
938
- } else {
939
- $query = "ALTER TABLE `" . $table . "` CHANGE `" . $field . "` `" . $newfield . "` " . $attributes . ";";
940
-
941
- if ($wpdb -> query($query)) {
942
- return true;
943
- }
944
- }
945
- }
946
- }
947
- }
948
-
949
- return false;
950
- }
951
-
952
- function add_field($table = null, $field = null, $attributes = "TEXT NOT NULL") {
953
- global $wpdb;
954
-
955
- if (!empty($table)) {
956
- if (!empty($field)) {
957
- $field_array = $this -> get_fields($table);
958
-
959
- if (!empty($field_array)) {
960
- if (!in_array($field, $field_array)) {
961
- $query = "ALTER TABLE `" . $table . "` ADD `" . $field . "` " . $attributes . ";";
962
-
963
- if ($wpdb -> query($query)) {
964
- return true;
965
- }
966
- }
967
- }
968
- }
969
- }
970
-
971
- return false;
972
- }
973
-
974
- function language_useordefault($content) {
975
- $text = $content;
976
-
977
- if (!empty($text)) {
978
- $current_language = $this -> language_current();
979
- $language = (empty($current_language)) ? $this -> language_default() : $current_language;
980
- $text = $this -> language_use($language, $content, false);
981
- }
982
-
983
- return $text;
984
- }
985
-
986
- function language_use($lang = null, $text = null, $show_available = false) {
987
-
988
- if (!$this -> language_isenabled($lang)) {
989
- return $text;
990
- }
991
-
992
- if (is_array($text) || is_object($text)) {
993
- // handle arrays recursively
994
- if (is_array($text)) {
995
- foreach($text as $key => $t) {
996
- $text[$key] = $this -> language_use($lang, $text[$key], $show_available);
997
- }
998
- } elseif (is_object($text)) {
999
- foreach($text as $key => $t) {
1000
- $text -> {$key} = $this -> language_use($lang, $text -> {$key}, $show_available);
1001
- }
1002
- }
1003
-
1004
- return $text;
1005
- }
1006
-
1007
- if(is_object($text) && get_class($text) == '__PHP_Incomplete_Class') {
1008
- foreach(get_object_vars($text) as $key => $t) {
1009
- $text->$key = $this -> language_use($lang,$text -> $key,$show_available);
1010
- }
1011
- return $text;
1012
- }
1013
-
1014
- // prevent filtering weird data types and save some resources
1015
- if(!is_string($text) || $text == '') {
1016
- return $text;
1017
- }
1018
-
1019
- // get content
1020
- $content = $this -> language_split($text);
1021
-
1022
- if (!is_array($content)) {
1023
- return $content;
1024
- }
1025
-
1026
- // find available languages
1027
- $available_languages = array();
1028
- foreach($content as $language => $lang_text) {
1029
- $lang_text = trim($lang_text);
1030
- if(!empty($lang_text)) $available_languages[] = $language;
1031
- }
1032
-
1033
- // if no languages available show full text
1034
- if(sizeof($available_languages)==0) return $text;
1035
- // if content is available show the content in the requested language
1036
- if(!empty($content[$lang])) {
1037
- return $content[$lang];
1038
- }
1039
- // content not available in requested language (bad!!) what now?
1040
- if(!$show_available){
1041
- // check if content is available in default language, if not return first language found. (prevent empty result)
1042
- if($lang != $this -> language_default()) {
1043
- $str = $this -> language_use($this -> language_default(), $text, $show_available);
1044
-
1045
- if ($q_config['show_displayed_language_prefix'])
1046
- $str = "(". $this -> language_name($this -> language_default()) .") " . $str;
1047
- return $str;
1048
- }
1049
- foreach($content as $language => $lang_text) {
1050
- $lang_text = trim($lang_text);
1051
- if (!empty($lang_text)) {
1052
- $str = $lang_text;
1053
- if ($q_config['show_displayed_language_prefix'])
1054
- $str = "(". $this -> language_name($language) .") " . $str;
1055
- return $str;
1056
- }
1057
- }
1058
- }
1059
- // display selection for available languages
1060
- $available_languages = array_unique($available_languages);
1061
- $language_list = "";
1062
- if(preg_match('/%LANG:([^:]*):([^%]*)%/',$q_config['not_available'][$lang],$match)) {
1063
- $normal_seperator = $match[1];
1064
- $end_seperator = $match[2];
1065
- // build available languages string backward
1066
- $i = 0;
1067
- foreach($available_languages as $language) {
1068
- if($i==1) $language_list = $end_seperator.$language_list;
1069
- if($i>1) $language_list = $normal_seperator.$language_list;
1070
- $language_list = "<a href=\"". $this -> language_converturl('', $language)."\">". $this -> language_name($language) ."</a>".$language_list;
1071
- $i++;
1072
- }
1073
- }
1074
- return "<p>".preg_replace('/%LANG:([^:]*):([^%]*)%/', $language_list, $q_config['not_available'][$lang])."</p>";
1075
- }
1076
-
1077
- function language_converturl($url = null, $language = null) {
1078
- global $slideshow_languageplugin;
1079
-
1080
- if (!empty($url) && !empty($language)) {
1081
- switch ($slideshow_languageplugin) {
1082
- case 'qtranslate' :
1083
- $url = qtrans_convertURL($url, $language);
1084
- break;
1085
- case 'qtranslate-x' :
1086
- $url = qtranxf_convertURL($url, $language);
1087
- break;
1088
- case 'polylang' :
1089
- $url = add_query_arg(array('lang' => $language), $url);
1090
- break;
1091
- case 'wpglobus' :
1092
- if (class_exists('WPGlobus_Utils')) {
1093
- $url = WPGlobus_Utils::localize_url($url, $language);
1094
- }
1095
- break;
1096
- case 'wpml' :
1097
- if (function_exists('icl_get_languages')) {
1098
- $languages = icl_get_languages();
1099
- $language = $this -> language_current();
1100
-
1101
- if (!empty($languages[$language]['url'])) {
1102
- //$url = $languages[$language]['url'];
1103
- }
1104
- }
1105
- break;
1106
- }
1107
- }
1108
-
1109
- return $url;
1110
- }
1111
-
1112
- function language_default() {
1113
- global $slideshow_languageplugin, $slideshow_languagedefault;
1114
- $default = false;
1115
-
1116
- if (!empty($slideshow_languagedefault)) {
1117
- return $slideshow_languagedefault;
1118
- }
1119
-
1120
- switch ($slideshow_languageplugin) {
1121
- case 'qtranslate' :
1122
- case 'qtranslate-x' :
1123
- global $q_config;
1124
- $default = $q_config['default_language'];
1125
- break;
1126
- case 'polylang' :
1127
- if (function_exists('pll_default_language')) {
1128
- $default = pll_default_language();
1129
- }
1130
- break;
1131
- case 'wpglobus' :
1132
- if (class_exists('WPGlobus')) {
1133
- $default = WPGlobus::Config() -> default_language;
1134
- }
1135
- break;
1136
- case 'wpml' :
1137
- global $sitepress;
1138
- $default = $sitepress -> get_default_language();
1139
- break;
1140
- }
1141
-
1142
- $slideshow_languagedefault = $default;
1143
- return $default;
1144
- }
1145
-
1146
- function language_name($language = null) {
1147
- $name = false;
1148
-
1149
- if (!empty($language)) {
1150
- global $slideshow_languageplugin, ${'slideshow_languagename_' . $language};
1151
-
1152
- if (!empty(${'slideshow_languagename_' . $language})) {
1153
- return ${'slideshow_languagename_' . $language};
1154
- }
1155
-
1156
- switch ($slideshow_languageplugin) {
1157
- case 'qtranslate' :
1158
- case 'qtranslate-x' :
1159
- global $q_config;
1160
- $name = $q_config['language_name'][$language];
1161
- break;
1162
- case 'polylang' :
1163
- global $polylang;
1164
- if ($pll_language = $polylang -> model -> get_language($language)) {
1165
- $name = $pll_language -> name;
1166
- }
1167
- break;
1168
- case 'wpglobus' :
1169
- if (class_exists('WPGlobus')) {
1170
- $name = WPGlobus::Config() -> language_name[$language];
1171
- }
1172
- break;
1173
- case 'wpml' :
1174
- if (function_exists('icl_get_languages')) {
1175
- $languages = icl_get_languages();
1176
- if (!empty($languages[$language]['translated_name'])) {
1177
- $name = $languages[$language]['translated_name'];
1178
- }
1179
- }
1180
- break;
1181
- }
1182
- }
1183
-
1184
- ${'slideshow_languagename_' . $language} = $name;
1185
- return $name;
1186
- }
1187
-
1188
- function language_do() {
1189
- global $slideshow_languageplugin;
1190
-
1191
- if (!$this -> ci_serial_valid()) {
1192
- return false;
1193
- }
1194
-
1195
- if (empty($slideshow_languageplugin)) {
1196
- if ($this -> is_plugin_active('qtranslate')) {
1197
- $slideshow_languageplugin = "qtranslate";
1198
- return true;
1199
- } elseif ($this -> is_plugin_active('qtranslate-x')) {
1200
- $slideshow_languageplugin = 'qtranslate-x';
1201
- return true;
1202
- } elseif ($this -> is_plugin_active('wpml')) {
1203
- if (!empty($_GET['lang']) && $_GET['lang'] == "all") {
1204
- return false;
1205
- }
1206
-
1207
- $slideshow_languageplugin = "wpml";
1208
- return true;
1209
- } elseif ($this -> is_plugin_active('polylang')) {
1210
- $slideshow_languageplugin = "polylang";
1211
- $result = true;
1212
- } elseif ($this -> is_plugin_active('wpglobus')) {
1213
- $slideshow_languageplugin = "wpglobus";
1214
- $result = true;
1215
- }
1216
- } else {
1217
- return true;
1218
- }
1219
-
1220
- return false;
1221
- }
1222
-
1223
- function language_set($language = null) {
1224
- global $slideshow_languageplugin, $slideshow_languagecurrent;
1225
- $this -> language_do();
1226
-
1227
- do_action('slideshow_language_set_before', $language, $slideshow_languageplugin);
1228
-
1229
- if (!empty($language) && !empty($slideshow_languageplugin)) {
1230
- $slideshow_languagecurrent = $language;
1231
-
1232
- switch ($slideshow_languageplugin) {
1233
- case 'qtranslate' :
1234
- case 'qtranslate-x' :
1235
- if (function_exists('qtranxf_set_language_cookie')) {
1236
- qtranxf_set_language_cookie($language);
1237
- }
1238
- break;
1239
- case 'polylang' :
1240
- global $polylang;
1241
- if ($pll_language = $polylang -> model -> get_language($language)) {
1242
- $polylang -> curlang = $pll_language;
1243
- }
1244
- break;
1245
- case 'wpglobus' :
1246
- if (class_exists('WPGlobus')) {
1247
- WPGlobus::Config() -> set_language($language);
1248
- }
1249
- break;
1250
- case 'wpml' :
1251
- global $sitepress;
1252
- if (method_exists($sitepress, 'switch_lang')) {
1253
- $sitepress -> switch_lang($language, true);
1254
- }
1255
- break;
1256
- }
1257
-
1258
- do_action('slideshow_language_set_success', $language, $slideshow_languageplugin);
1259
-
1260
- return true;
1261
- }
1262
-
1263
- do_action('slideshow_language_set_failed', $language, $slideshow_languageplugin);
1264
-
1265
- return false;
1266
- }
1267
-
1268
- function language_current() {
1269
- global $slideshow_languageplugin, $slideshow_languagecurrent;
1270
- $current = false;
1271
-
1272
- if (!empty($slideshow_languagecurrent)) {
1273
- return $slideshow_languagecurrent;
1274
- }
1275
-
1276
- switch ($slideshow_languageplugin) {
1277
- case 'qtranslate' :
1278
- if (function_exists('qtrans_getLanguage')) {
1279
- $current = qtrans_getLanguage();
1280
- }
1281
- break;
1282
- case 'qtranslate-x' :
1283
- if (function_exists('qtranxf_getLanguage')) {
1284
- $current = qtranxf_getLanguage();
1285
- }
1286
- break;
1287
- case 'polylang' :
1288
- if (function_exists('pll_current_language') && function_exists('pll_default_language')) {
1289
- $current = pll_current_language();
1290
-
1291
- if (empty($current)) {
1292
- $current = pll_default_language();
1293
- }
1294
- }
1295
- break;
1296
- case 'wpglobus' :
1297
- if (class_exists('WPGlobus')) {
1298
- $current = WPGlobus::Config() -> language;
1299
- }
1300
- break;
1301
- case 'wpml' :
1302
- $current = ICL_LANGUAGE_CODE;
1303
- break;
1304
- }
1305
-
1306
- $slideshow_languagecurrent = $current;
1307
- return $current;
1308
- }
1309
-
1310
- function language_flag($language = null) {
1311
- global $slideshow_languageplugin, ${'slideshow_languageflag_' . $language};
1312
- $flag = false;
1313
-
1314
- if (!empty(${'slideshow_languageflag_' . $language})) {
1315
- return ${'slideshow_languageflag_' . $language};
1316
- }
1317
-
1318
- switch ($slideshow_languageplugin) {
1319
- case 'qtranslate' :
1320
- case 'qtranslate-x' :
1321
- global $q_config;
1322
- $flag = '<img src="' . content_url() . '/' . $q_config['flag_location'] . '/' . $q_config['flag'][$language] . '" alt="' . $language . '" />';
1323
- break;
1324
- case 'polylang' :
1325
- global $polylang;
1326
- $pll_language = $polylang -> model -> get_language($language);
1327
- $flag = $pll_language -> flag;
1328
- break;
1329
- case 'wpglobus' :
1330
- if (class_exists('WPGlobus')) {
1331
- $flag = '<img src="' . WPGlobus::Config() -> flags_url . WPGlobus::Config() -> flag[$language] . '" alt="' . $language . '" />';
1332
- }
1333
- break;
1334
- case 'wpml' :
1335
- if (function_exists('icl_get_languages')) {
1336
- $languages = icl_get_languages();
1337
- $flag = '<img src="' . $languages[$language]['country_flag_url'] . '" alt="' . $language . '" />';
1338
- }
1339
- break;
1340
- }
1341
-
1342
- ${'slideshow_languageflag_' . $language} = $flag;
1343
- return $flag;
1344
- }
1345
-
1346
- function language_isenabled($language = null) {
1347
- $enabled = false;
1348
-
1349
- if (!empty($language)) {
1350
- global $slideshow_languageplugin, ${'slideshow_languageenabled_' . $language};
1351
-
1352
- if (!empty(${'slideshow_languageenabled_' . $language})) {
1353
- return ${'slideshow_languageenabled_' . $language};
1354
- }
1355
-
1356
- switch ($slideshow_languageplugin) {
1357
- case 'qtranslate' :
1358
- $enabled = qtrans_isEnabled($language);
1359
- break;
1360
- case 'qtranslate-x' :
1361
- $enabled = qtranxf_isEnabled($language);
1362
- break;
1363
- case 'polylang' :
1364
- global $polylang;
1365
- if ($pll_language = $polylang -> model -> get_language($language)) {
1366
- if (empty($pll_language -> active) || $pll_language -> active == true) {
1367
- $enabled = true;
1368
- }
1369
- }
1370
- break;
1371
- case 'wpglobus' :
1372
- if (class_exists('WPGlobus_Utils')) {
1373
- if (WPGlobus_Utils::is_enabled($language)) {
1374
- $enabled = true;
1375
- }
1376
- }
1377
- break;
1378
- case 'wpml' :
1379
- if (function_exists('icl_get_languages')) {
1380
- $languages = icl_get_languages();
1381
- if (!empty($languages[$language])) {
1382
- $enabled = true;
1383
- }
1384
- }
1385
- break;
1386
- }
1387
- }
1388
-
1389
- ${'slideshow_languageenabled_' . $language} = $enabled;
1390
- return $enabled;
1391
- }
1392
-
1393
- function language_join($texts = array(), $tagTypeMap = array(), $strip_tags = false) {
1394
- if(!is_array($texts)) $texts = $this -> language_split($texts, false);
1395
- $split_regex = "#<!--more-->#ism";
1396
- $max = 0;
1397
- $text = "";
1398
- $languages = $this -> language_getlanguages();
1399
-
1400
- foreach ($languages as $language) {
1401
- $tagTypeMap[$language] = true;
1402
- }
1403
-
1404
- foreach($languages as $language) {
1405
- if (!empty($texts[$language])) {
1406
- $texts[$language] = preg_split($split_regex, $texts[$language]);
1407
- if(sizeof($texts[$language]) > $max) $max = sizeof($texts[$language]);
1408
- }
1409
- }
1410
-
1411
- for ($i = 0; $i < $max; $i++) {
1412
- if($i>=1) {
1413
- $text .= '<!--more-->';
1414
- }
1415
- foreach($languages as $language) {
1416
- if (isset($texts[$language][$i]) && $texts[$language][$i] !== '') {
1417
-
1418
- if ($strip_tags) {
1419
- $texts[$language][$i] = strip_tags($texts[$language][$i]);
1420
- }
1421
-
1422
- if (empty($tagTypeMap[$language])) {
1423
- $text .= '<!--:'.$language.'-->'.$texts[$language][$i].'<!--:-->';
1424
- } else {
1425
- $text .= "[:{$language}]{$texts[$language][$i]}";
1426
- }
1427
- }
1428
- }
1429
- }
1430
-
1431
- return $text;
1432
- }
1433
-
1434
- function language_split($text, $quicktags = true, array $languageMap = NULL) {
1435
- $array = false;
1436
-
1437
- if (!empty($text)) {
1438
- //init vars
1439
- $split_regex = "#(<!--[^-]*-->|\[:[a-z-]{2,10}\])#ism";
1440
- $current_language = "";
1441
- $result = array();
1442
-
1443
- $languages = $this -> language_getlanguages();
1444
- foreach ($languages as $language) {
1445
- $result[$language] = "";
1446
- }
1447
-
1448
- // split text at all xml comments
1449
- $blocks = preg_split($split_regex, $text, -1, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE);
1450
-
1451
- foreach($blocks as $block) {
1452
- # detect language tags
1453
- if(preg_match("#^<!--:([a-z-]{2,10})-->$#ism", $block, $matches)) {
1454
- if($this -> language_isenabled($matches[1])) {
1455
- $current_language = $matches[1];
1456
- $languageMap[$current_language] = false;
1457
- } else {
1458
- $current_language = "invalid";
1459
- }
1460
- continue;
1461
- // detect quicktags
1462
- } elseif($quicktags && preg_match("#^\[:([a-z-]{2,10})\]$#ism", $block, $matches)) {
1463
- if($this -> language_isenabled($matches[1])) {
1464
- $current_language = $matches[1];
1465
- $languageMap[$current_language] = true;
1466
- } else {
1467
- $current_language = "invalid";
1468
- }
1469
-
1470
- continue;
1471
- } elseif(preg_match("#^<!--:-->$#ism", $block, $matches)) {
1472
- $current_language = "";
1473
- continue;
1474
- } elseif(preg_match("#^<!--more-->$#ism", $block, $matches)) {
1475
- foreach($languages as $language) {
1476
- $result[$language] .= $block;
1477
- }
1478
-
1479
- continue;
1480
- }
1481
-
1482
- if($current_language == "") {
1483
- foreach($languages as $language) {
1484
- $result[$language] .= $block;
1485
- }
1486
- } elseif($current_language != "invalid") {
1487
- $result[$current_language] .= $block;
1488
- }
1489
- }
1490
-
1491
- foreach($result as $lang => $lang_content) {
1492
- $result[$lang] = str_replace('[:]', '', preg_replace("#(<!--more-->|<!--nextpage-->)+$#ism", "", $lang_content));
1493
- }
1494
-
1495
- return $result;
1496
- }
1497
-
1498
- return $array;
1499
- }
1500
-
1501
- function language_getlanguages() {
1502
- global $slideshow_languageplugin, $slideshow_languagelanguages;
1503
- $languages = false;
1504
-
1505
- if (!empty($slideshow_languagelanguages)) {
1506
- return $slideshow_languagelanguages;
1507
- }
1508
-
1509
- switch ($slideshow_languageplugin) {
1510
- case 'qtranslate' :
1511
- if (function_exists('qtrans_getSortedLanguages')) {
1512
- $languages = qtrans_getSortedLanguages();
1513
- }
1514
- break;
1515
- case 'qtranslate-x' :
1516
- if (function_exists('qtranxf_getSortedLanguages')) {
1517
- $languages = qtranxf_getSortedLanguages();
1518
- }
1519
- break;
1520
- case 'polylang' :
1521
- global $polylang;
1522
- if (!empty($polylang -> model) && method_exists($polylang -> model, 'get_languages_list')) {
1523
- if ($pll_languages = $polylang -> model -> get_languages_list()) {
1524
- foreach ($pll_languages as $lang) {
1525
- $languages[] = $lang -> slug;
1526
- }
1527
- }
1528
- }
1529
- break;
1530
- case 'wpglobus' :
1531
- if (class_exists('WPGlobus')) {
1532
- $languages = WPGlobus::Config() -> enabled_languages;
1533
- }
1534
- break;
1535
- case 'wpml' :
1536
- if (function_exists('icl_get_languages')) {
1537
- $icl_languages = icl_get_languages();
1538
- $languages = array();
1539
- foreach ($icl_languages as $lang => $icl_language) {
1540
- $languages[] = $lang;
1541
- }
1542
- }
1543
- break;
1544
- }
1545
-
1546
- $slideshow_languagelanguages = $languages;
1547
- return $languages;
1548
- }
1549
-
1550
- function is_plugin_active($name = null, $orinactive = false) {
1551
- if (!empty($name)) {
1552
- require_once ABSPATH . 'wp-admin' . DS . 'includes' . DS . 'admin.php';
1553
-
1554
- if (empty($path)) {
1555
- switch ($name) {
1556
- case 'qtranslate' :
1557
- $path = 'qtranslate' . DS . 'qtranslate.php';
1558
- break;
1559
- case 'qtranslate-x' :
1560
- $path = 'qtranslate-x' . DS . 'qtranslate.php';
1561
- break;
1562
- case 'polylang' :
1563
- $path = 'polylang' . DS . 'polylang.php';
1564
- break;
1565
- case 'wpglobus' :
1566
- $path = 'wpglobus' . DS . 'wpglobus.php';
1567
- break;
1568
- case 'wpml' :
1569
- $path = 'sitepress-multilingual-cms' . DS . 'sitepress.php';
1570
- break;
1571
- case 'captcha' :
1572
- $path = 'really-simple-captcha' . DS . 'really-simple-captcha.php';
1573
- break;
1574
- default :
1575
- $path = $name;
1576
- break;
1577
- }
1578
- }
1579
-
1580
- $path2 = str_replace("\\", "/", $path);
1581
-
1582
- if (!empty($name) && $name == "qtranslate") {
1583
- $path2 = 'mqtranslate' . DS . 'mqtranslate.php';
1584
- }
1585
-
1586
- if (!empty($path)) {
1587
- $plugins = get_plugins();
1588
-
1589
- if (!empty($plugins)) {
1590
- if (array_key_exists($path, $plugins) || array_key_exists($path2, $plugins)) {
1591
- /* Let's see if the plugin is installed and activated */
1592
- if (is_plugin_active(plugin_basename($path)) ||
1593
- is_plugin_active(plugin_basename($path2))) {
1594
- return true;
1595
- }
1596
-
1597
- /* Maybe the plugin is installed but just not activated? */
1598
- if (!empty($orinactive) && $orinactive == true) {
1599
- if (is_plugin_inactive(plugin_basename($path)) ||
1600
- is_plugin_inactive(plugin_basename($path2))) {
1601
- return true;
1602
- }
1603
- }
1604
- }
1605
- }
1606
- }
1607
- }
1608
-
1609
- return false;
1610
- }
1611
-
1612
- function has_child_theme_folder() {
1613
- $theme_path = get_stylesheet_directory();
1614
- $full_path = $theme_path . DS . 'slideshow';
1615
-
1616
- if (file_exists($full_path)) {
1617
- return true;
1618
- }
1619
-
1620
- return false;
1621
- }
1622
-
1623
- function render_url($file = null, $folder = 'admin', $extension = null) {
1624
- $this -> plugin_name = basename(dirname(__FILE__));
1625
-
1626
- if (!empty($file)) {
1627
- if (!empty($folder) && $folder != "admin") {
1628
- $theme_folder = $this -> get_option('theme_folder');
1629
- $folder = (!empty($theme_folder)) ? $theme_folder : $folder;
1630
- $folderurl = plugins_url() . '/' . $this -> plugin_name . '/views/' . $folder . '/';
1631
-
1632
- $template_url = get_stylesheet_directory_uri();
1633
- $theme_path = get_stylesheet_directory();
1634
- $full_path = $theme_path . DS . 'slideshow' . DS . $file;
1635
-
1636
- if (!empty($theme_path) && file_exists($full_path)) {
1637
- $folderurl = $template_url . '/slideshow/';
1638
- }
1639
- } else {
1640
- $folderurl = plugins_url() . '/' . $this -> plugin_name . '/';
1641
- }
1642
-
1643
- $url = $folderurl . $file;
1644
- return $url;
1645
- }
1646
-
1647
- return false;
1648
- }
1649
-
1650
- function render($file = null, $params = array(), $output = true, $folder = 'admin') {
1651
-
1652
- if (!empty($file)) {
1653
- $this -> plugin_name = basename(dirname(__FILE__));
1654
- $this -> plugin_base = rtrim(dirname(__FILE__), DS);
1655
- $this -> sections = apply_filters('slideshow_sections', (object) $this -> sections);
1656
-
1657
- $theme_serve = false;
1658
- $filename = $file . '.php';
1659
- $filepath = $this -> plugin_base() . DS . 'views' . DS . $folder . DS;
1660
-
1661
- if (!empty($folder) && $folder != "admin") {
1662
- $theme_path = get_stylesheet_directory();
1663
- $full_path = $theme_path . DS . 'slideshow' . DS . $filename;
1664
-
1665
- if (!empty($theme_path) && file_exists($full_path)) {
1666
- $folder = $theme_path . DS . 'slideshow';
1667
- $theme_serve = true;
1668
- }
1669
- }
1670
-
1671
- if (empty($theme_serve)) {
1672
- $filepath = $this -> plugin_base() . DS . 'views' . DS . $folder . DS;
1673
- } else {
1674
- $filepath = $folder . DS;
1675
- }
1676
-
1677
- $filefull = $filepath . $filename;
1678
-
1679
- if (file_exists($filefull)) {
1680
- if (!empty($params)) {
1681
- foreach ($params as $pkey => $pval) {
1682
- ${$pkey} = $pval;
1683
- }
1684
- }
1685
-
1686
- $this -> initialize_classes();
1687
-
1688
- if ($output == false) {
1689
- ob_start();
1690
- }
1691
-
1692
- include($filefull);
1693
-
1694
- if ($output == false) {
1695
- $data = ob_get_clean();
1696
- return $data;
1697
- } else {
1698
- return true;
1699
- }
1700
- }
1701
- }
1702
-
1703
- return false;
1704
- }
1705
- }
1706
-
1707
- ?>
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
+
5
+ class GalleryPlugin extends GalleryCheckinit {
6
+
7
+ var $version = '1.7.5';
8
+ var $plugin_name;
9
+ var $plugin_base;
10
+ var $pre = 'Gallery';
11
+
12
+ var $menus = array();
13
+ var $sections = array(
14
+ 'welcome' => 'slideshow-slides',
15
+ 'submitserial' => 'slideshow-submitserial',
16
+ 'about' => 'slideshow-gallery-about',
17
+ 'slides' => 'slideshow-slides',
18
+ 'galleries' => 'slideshow-galleries',
19
+ 'settings' => 'slideshow-settings',
20
+ 'settings_updates' => 'slideshow-settings-updates',
21
+ );
22
+
23
+ var $helpers = array('Db', 'Html', 'Form', 'Metabox');
24
+ var $models = array('Slide', 'Gallery', 'GallerySlides');
25
+ var $debugging = false; //set to "true" to turn on debugging
26
+ var $debug_level = 2; //set to 2 for PHP and DB errors or 1 for just DB errors
27
+
28
+ function __call($method = null, $args = null) {
29
+ if (!empty($method)) {
30
+ // Model
31
+ if (in_array($method, $this -> models)) {
32
+ $class = $this -> pre . $method;
33
+
34
+ if (!class_exists($class)) {
35
+ $file = $this -> plugin_base() . DS . 'models' . DS . strtolower($method) . '.php';
36
+ if (file_exists($file)) {
37
+ include($file);
38
+ }
39
+ }
40
+ // Helper
41
+ } elseif (in_array($method, $this -> helpers)) {
42
+ $class = $this -> pre . $method . 'Helper';
43
+ if (!class_exists($class)) {
44
+ $file = $this -> plugin_base() . DS . 'helpers' . DS . strtolower($method) . '.php';
45
+ if (file_exists($file)) {
46
+ include($file);
47
+ }
48
+ }
49
+ }
50
+
51
+ if (empty($this -> {$method}) || !is_object($this -> {$method})) {
52
+ if (class_exists($class)) {
53
+ $this -> {$method} = new $class($args);
54
+ return $this -> {$method};
55
+ }
56
+ } else {
57
+ return $this -> {$method};
58
+ }
59
+ }
60
+
61
+ return false;
62
+ }
63
+
64
+ function __construct() {
65
+
66
+ }
67
+
68
+ function register_plugin($name, $base) {
69
+ $this -> plugin_name = $name;
70
+ $this -> plugin_base = rtrim(dirname($base), DS);
71
+ $this -> plugin_file = plugin_basename($base);
72
+ $this -> sections = apply_filters('slideshow_sections', (object) $this -> sections);
73
+ $this -> initialize_classes();
74
+
75
+ if (!defined('SLIDESHOW_LOG_FILE')) { define("SLIDESHOW_LOG_FILE", $this -> plugin_base() . DS . "slideshow.log"); }
76
+
77
+ global $wpdb;
78
+ $debugging = get_option('tridebugging');
79
+ $this -> debugging = (empty($debugging)) ? $this -> debugging : true;
80
+
81
+ if ($this -> debugging == true) {
82
+ $wpdb -> show_errors();
83
+
84
+ /*if ($this -> debug_level == 2) {
85
+ error_reporting(E_ALL & ~(E_STRICT|E_NOTICE));
86
+ @ini_set('display_errors', 1);
87
+ }*/
88
+ } else {
89
+ //$wpdb -> hide_errors();
90
+ //error_reporting(0);
91
+ //@ini_set('display_errors', 0);
92
+ }
93
+
94
+ return true;
95
+ }
96
+
97
+ function log_error($error = null) {
98
+ $debugging = get_option('tridebugging');
99
+ $this -> debugging = (empty($debugging)) ? $this -> debugging : true;
100
+
101
+ if (!empty($error)) {
102
+ if (is_array($error) || is_object($error)) {
103
+ $error = '<pre>' . print_r($error, true) . '</pre>';
104
+ }
105
+
106
+ error_log(date_i18n('[Y-m-d H:i:s] ') . $error . PHP_EOL, 3, SLIDESHOW_LOG_FILE);
107
+
108
+ return true;
109
+ }
110
+
111
+ return false;
112
+ }
113
+
114
+ function after_plugin_row($plugin_name = null) {
115
+ $key = $this -> get_option('serialkey');
116
+ $update = $this -> vendor('update');
117
+ //$version_info = $update -> get_version_info();
118
+ $hidemessage_upgradetopro = $this -> get_option('hidemessage_upgradetopro');
119
+
120
+ if (empty($hidemessage_upgradetopro)) {
121
+ //if (!$this -> ci_serial_valid() && !empty($version_info) && $version_info['is_valid_key'] == "0") {
122
+ if (!$this -> ci_serial_valid()) {
123
+ echo '<tr id="slideshow-plugin-update-tr" class="plugin-update-tr">';
124
+ echo '<td colspan="3" class="plugin-update">';
125
+ echo '<div class="update-message">';
126
+
127
+ echo sprintf(__('You are running Slideshow Gallery LITE. Take your slideshows to the next level with %s. Already purchased? %s.', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">Slideshow Gallery PRO</a>', '<a href="https://tribulant.com/docs/wordpress-slideshow-gallery/1758" target="_blank">' . __('See instructions to install PRO', 'slideshow-gallery') . '</a>');
128
+ echo ' <a class="button button-primary button-small" href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '"><i class="fa fa-check"></i> ' . __('Upgrade to PRO', 'slideshow-gallery') . '</a>';
129
+ echo ' <a class="button button-secondary button-small" href="' . admin_url('admin.php?page=' . $this -> sections -> welcome . '&slideshow_method=hidemessage&message=upgradetopro') . '"><i class="fa fa-times"></i> ' . __('Hide this message', 'slideshow-gallery') . '</a>';
130
+
131
+ echo '</div>';
132
+ echo '</td>';
133
+ echo '</tr>';
134
+
135
+ ?>
136
+
137
+ <script type="text/javascript">
138
+ jQuery(document).ready(function() {
139
+ var row = jQuery('#slideshow-plugin-update-tr').closest('tr').prev();
140
+ jQuery(row).addClass('update');
141
+ });
142
+ </script>
143
+
144
+ <?php
145
+ }
146
+ }
147
+ }
148
+
149
+ /**
150
+ * This function outputs the changelog on the 'Plugins' page when the "View Details" link is clicked.
151
+ */
152
+ function display_changelog() {
153
+ if (!empty($_GET['plugin']) && $_GET['plugin'] == $this -> plugin_name) {
154
+ $update = $this -> vendor('update');
155
+ if ($changelog = $update -> get_changelog()) {
156
+ $this -> render('changelog', array('changelog' => $changelog), true, 'admin');
157
+ }
158
+
159
+ exit();
160
+ }
161
+ }
162
+
163
+ function has_update($cache = true) {
164
+ $update = $this -> vendor('update');
165
+ $version_info = $update -> get_version_info($cache);
166
+ return version_compare($this -> version, $version_info["version"], '<');
167
+ }
168
+
169
+ /*function check_update($option, $cache = true) {
170
+ if ($update = $this -> vendor('update')) {
171
+ $version_info = $update -> get_version_info($cache);
172
+
173
+ if (!$version_info) { return $option; }
174
+ $plugin_path = $this -> plugin_file;
175
+
176
+ if(empty($option -> response[$plugin_path])) {
177
+ $option -> response[$plugin_path] = new stdClass();
178
+ }
179
+
180
+ //Empty response means that the key is invalid. Do not queue for upgrade
181
+ if(empty($version_info['is_valid_key']) || version_compare($this -> version, $version_info["version"], '>=')){
182
+ unset($option -> response[$plugin_path]);
183
+ } else {
184
+ $option -> response[$plugin_path] -> url = "https://tribulant.com";
185
+ $option -> response[$plugin_path] -> slug = $this -> plugin_name;
186
+ $option -> response[$plugin_path] -> package = $version_info['url'];
187
+ $option -> response[$plugin_path] -> new_version = $version_info["version"];
188
+ $option -> response[$plugin_path] -> id = "0";
189
+ }
190
+ }
191
+
192
+ return $option;
193
+ }*/
194
+
195
+ function ajax_serialkey() {
196
+ check_ajax_referer('serialkey', 'security');
197
+
198
+ if (!current_user_can('slideshow_welcome')) {
199
+ wp_die(__('You do not have permission', 'slideshow-gallery'));
200
+ }
201
+
202
+ $errors = array();
203
+ $success = false;
204
+
205
+ if (!empty($_GET['delete'])) {
206
+ $this -> delete_option('serialkey');
207
+ $errors[] = __('Serial key has been deleted.', 'slideshow-gallery');
208
+ } else {
209
+ if (!empty($_POST)) {
210
+ check_ajax_referer($this -> sections -> submitserial);
211
+
212
+ if (empty($_REQUEST['serialkey'])) { $errors[] = __('Please fill in a serial key.', 'slideshow-gallery'); }
213
+ else {
214
+ $serial = sanitize_text_field($_REQUEST['serialkey']);
215
+ $this -> update_option('serialkey', $serial); //update the DB option
216
+
217
+ if (!$this -> ci_serial_valid()) { $errors[] = __('Serial key is invalid, please try again.', 'slideshow-gallery'); }
218
+ else {
219
+ delete_transient($this -> pre . 'update_info');
220
+ $success = true;
221
+ }
222
+ }
223
+ }
224
+ }
225
+
226
+ delete_transient('slideshow_update_info');
227
+
228
+ if (empty($_POST)) { ?><div id="slideshow_submitserial"><?php }
229
+ $this -> render('submitserial', array('errors' => $errors, 'success' => $success), true, 'admin');
230
+ if (empty($_POST)) { ?></div><?php }
231
+
232
+ exit();
233
+ die();
234
+ }
235
+
236
+ function ajax_slides_order() {
237
+ check_ajax_referer('slides_order', 'security');
238
+
239
+ if (!current_user_can('slideshow_slides')) {
240
+ wp_die(__('You do not have permission', 'slideshow-gallery'));
241
+ }
242
+
243
+ if (!empty($_REQUEST['item'])) {
244
+ foreach ($_REQUEST['item'] as $order => $slide_id) {
245
+ if (empty($_REQUEST['gallery_id'])) {
246
+ $this -> Slide() -> save_field('order', ($order + 1), array('id' => $slide_id));
247
+ } else {
248
+ $this -> GallerySlides() -> save_field('order', ($order + 1), array('slide_id' => $slide_id, 'gallery_id' => $_REQUEST['gallery_id']));
249
+ }
250
+ }
251
+
252
+ echo '<i class="fa fa-check"></i> ' . __('Slides have been ordered', 'slideshow-gallery');
253
+ }
254
+
255
+ exit();
256
+ die();
257
+ }
258
+
259
+ function ajax_tinymce() {
260
+ if (!current_user_can('slideshow_welcome')) {
261
+ wp_die(__('You do not have permission', 'slideshow-gallery'));
262
+ }
263
+
264
+ $this -> render('tinymce-dialog', false, true, 'admin');
265
+
266
+ exit();
267
+ die();
268
+ }
269
+
270
+ function replace_https($value = null) {
271
+ if (!empty($value)) {
272
+ if (is_ssl()) {
273
+ if (!is_array($value) && !is_object($value)) {
274
+ $value = preg_replace('|/+$|', '', $value);
275
+ $value = preg_replace('|http://|', 'https://', $value);
276
+ }
277
+ }
278
+ }
279
+
280
+ return apply_filters('slideshow_replace_https', $value);
281
+ }
282
+
283
+ function init_class($name = null, $params = array()) {
284
+ if (!empty($name)) {
285
+ $name = $this -> pre . $name;
286
+
287
+ if (class_exists($name)) {
288
+ if ($class = new $name($params)) {
289
+ return $class;
290
+ }
291
+ }
292
+ }
293
+
294
+ $this -> init_class('Country');
295
+
296
+ return false;
297
+ }
298
+
299
+ function initialize_classes() {
300
+ if (!empty($this -> helpers)) {
301
+ foreach ($this -> helpers as $helper) {
302
+ $hfile = dirname(__FILE__) . DS . 'helpers' . DS . strtolower($helper) . '.php';
303
+
304
+ if (file_exists($hfile)) {
305
+ require_once($hfile);
306
+
307
+ if (empty($this -> {$helper}) || !is_object($this -> {$helper})) {
308
+ $classname = $this -> pre . $helper . 'Helper';
309
+
310
+ if (class_exists($classname)) {
311
+ $this -> {$helper} = new $classname;
312
+ }
313
+ }
314
+ }
315
+ }
316
+ }
317
+
318
+ include_once(dirname(__FILE__) . DS . 'models' . DS . 'slideshow.php');
319
+ }
320
+
321
+ function updating_plugin() {
322
+ if (!is_admin()) return;
323
+
324
+ global $wpdb;
325
+
326
+ if (!$this -> get_option('version')) {
327
+ $this -> add_option('version', $this -> version);
328
+ $this -> initialize_options();
329
+ return;
330
+ }
331
+
332
+ $cur_version = $this -> get_option('version');
333
+ $version = $this -> version;
334
+
335
+ if (version_compare($this -> version, $cur_version) === 1) {
336
+ if (version_compare($cur_version, "1.4.8") < 0) {
337
+ $this -> initialize_options();
338
+
339
+ $query = "ALTER TABLE `" . $this -> Slide() -> table . "` CHANGE `image` `image` TEXT NOT NULL;";
340
+ $wpdb -> query($query);
341
+
342
+ $version = "1.4.8";
343
+ }
344
+
345
+ if (version_compare($cur_version, "1.5.3") < 0) {
346
+ $this -> initialize_options();
347
+
348
+ $query = "ALTER TABLE `" . $this -> Slide() -> table . "` CHANGE `type` `type` ENUM('media','file','url') NOT NULL DEFAULT 'media'";
349
+ $wpdb -> query($query);
350
+
351
+
352
+ $version = "1.5.3";
353
+ }
354
+
355
+ if (version_compare($cur_version, $this->version) < 0) {
356
+ $this -> initialize_options();
357
+
358
+ $version = $this->version;
359
+ }
360
+
361
+ //the current version is older.
362
+ //lets update the database
363
+ $this -> update_option('version', $version);
364
+ }
365
+ }
366
+
367
+ function initialize_options() {
368
+ if (!is_admin()) { return; }
369
+
370
+ $this -> init_roles();
371
+
372
+ $styles = array(
373
+ 'layout' => "responsive",
374
+ 'width' => "450",
375
+ 'height' => "250",
376
+ 'resheight' => "50",
377
+ 'resheighttype' => "%",
378
+ 'border' => "1px solid #CCCCCC",
379
+ 'background' => "#000000",
380
+ 'infobackground' => "#000000",
381
+ 'infocolor' => "#FFFFFF",
382
+ 'resizeimages' => "Y",
383
+ );
384
+
385
+ //$this -> add_option('existing', 1);
386
+ $this -> add_option('resizeimagescrop', "Y");
387
+ $this -> update_option('imagespath', $this -> Html -> uploads_url() . '/' . $this -> plugin_name . '/');
388
+ $this -> add_option('styles', $styles);
389
+ $this -> add_option('effect', "fade");
390
+ $this -> add_option('easing', "swing");
391
+ $this -> add_option('slide_direction', "lr");
392
+ $this -> add_option('fadespeed', 20);
393
+ $this -> add_option('shownav', "Y");
394
+ $this -> add_option('navopacity', 25);
395
+ $this -> add_option('navhover', 75);
396
+ $this -> add_option('information', "Y");
397
+ $this -> add_option('infoposition', "bottom");
398
+ $this -> add_option('infoheadingcontent', "title");
399
+ $this -> add_option('infospeed', 10);
400
+ $this -> add_option('infohideonmobile', 1);
401
+ $this -> add_option('thumbnails', "N");
402
+ $this -> add_option('thumbwidth', "100");
403
+ $this -> add_option('thumbheight', "75");
404
+ $this -> add_option('thumbposition', "bottom");
405
+ $this -> add_option('thumbopacity', 70);
406
+ $this -> add_option('thumbscrollspeed', 5);
407
+ $this -> add_option('thumbspacing', 5);
408
+ $this -> add_option('thumbactive', "#FFFFFF");
409
+ $this -> add_option('thumbhideonmobile', 1);
410
+ $this -> add_option('autoslide', "Y");
411
+ $this -> add_option('autospeed', 10);
412
+ $this -> add_option('alwaysauto', "true");
413
+ $this -> add_option('imagesthickbox', "N");
414
+ $this -> add_option('jsoutput', "perslideshow");
415
+
416
+ $ratereview_scheduled = $this -> get_option('ratereview_scheduled');
417
+ if (empty($ratereview_scheduled)) {
418
+ wp_schedule_single_event(strtotime("+7 days"), 'slideshow_ratereviewhook', array(7));
419
+ wp_schedule_single_event(strtotime("+14 days"), 'slideshow_ratereviewhook', array(14));
420
+ wp_schedule_single_event(strtotime("+30 days"), 'slideshow_ratereviewhook', array(30));
421
+ wp_schedule_single_event(strtotime("+60 days"), 'slideshow_ratereviewhook', array(60));
422
+ wp_schedule_single_event(strtotime("+180 days"), 'slideshow_ratereviewhook', array(180));
423
+ wp_schedule_single_event(strtotime("+360 days"), 'slideshow_ratereviewhook', array(360));
424
+ $this -> update_option('ratereview_scheduled', true);
425
+ }
426
+
427
+ return;
428
+ }
429
+
430
+ function ratereview_hook($days = 7) {
431
+ $this -> update_option('showmessage_ratereview', $days);
432
+ }
433
+
434
+ function check_roles() {
435
+ global $wp_roles;
436
+ $permissions = $this -> get_option('permissions');
437
+
438
+ if ($role = get_role('administrator')) {
439
+ if (!empty($this -> sections)) {
440
+ foreach ($this -> sections as $section_key => $section_menu) {
441
+ if (empty($role -> capabilities['slideshow_' . $section_key])) {
442
+ $role -> add_cap('slideshow_' . $section_key);
443
+ $permissions['administrator'][] = $section_key;
444
+ }
445
+ }
446
+
447
+ $this -> update_option('permissions', $permissions);
448
+ }
449
+ }
450
+
451
+ return false;
452
+ }
453
+
454
+ function init_roles($sections = null) {
455
+ global $wp_roles;
456
+ $sections = $this -> sections;
457
+
458
+ /* Get the administrator role. */
459
+ $role = get_role('administrator');
460
+
461
+ /* If the administrator role exists, add required capabilities for the plugin. */
462
+ if (!empty($role)) {
463
+ if (!empty($sections)) {
464
+ foreach ($sections as $section_key => $section_menu) {
465
+ $role -> add_cap('slideshow_' . $section_key);
466
+ }
467
+ }
468
+ } else if (empty($role) && !is_multisite()) {
469
+ $newrolecapabilities = array();
470
+ $newrolecapabilities[] = 'read';
471
+
472
+ if (!empty($sections)) {
473
+ foreach ($sections as $section_key => $section_menu) {
474
+ $newrolecapabilities[] = 'slideshow_' . $section_key;
475
+ }
476
+ }
477
+
478
+ add_role(
479
+ 'slideshow',
480
+ _e('Slideshow Manager', 'slideshow-gallery'),
481
+ $newrolecapabilities
482
+ );
483
+ }
484
+
485
+ if (!empty($sections)) {
486
+ $permissions = array();
487
+
488
+ foreach ($sections as $section_key => $section_menu) {
489
+ $wp_roles -> add_cap('administrator', 'slideshow_' . $section_key);
490
+ $permissions['administrator'][] = $section_key;
491
+ }
492
+
493
+ $this -> update_option('permissions', $permissions);
494
+ }
495
+ }
496
+
497
+ function render_msg($message = null, $dismissable = null, $escape = true) {
498
+ if (!empty($escape)) { $message = wp_kses_post($message); }
499
+ $this -> render('msg-top', array('message' => $message, 'dismissable' => $dismissable), true, 'admin');
500
+ }
501
+
502
+ function render_err($message = null, $dismissable = null, $escape = true) {
503
+ if (!empty($escape)) { $message = wp_kses_post($message); }
504
+ $this -> render('err-top', array('message' => $message, 'dismissable' => $dismissable), true, 'admin');
505
+ }
506
+
507
+ function redirect($location = null, $msgtype = null, $message = null, $action = null) {
508
+ if (empty($location)) {
509
+ $url = remove_query_arg(array('action', 'action2', '_wpnonce', '_wp_http_referer'), wp_get_referer());
510
+ } else {
511
+ $url = $location;
512
+ }
513
+
514
+ if ($msgtype == "message") {
515
+ $url .= '&' . $this -> pre . 'updated=true';
516
+ } elseif ($msgtype == "error") {
517
+ $url .= '&' . $this -> pre . 'error=true';
518
+ }
519
+
520
+ if (!empty($message)) {
521
+ $url .= '&' . $this -> pre . 'message=' . urlencode($message);
522
+ }
523
+
524
+ if (!empty($action)) {
525
+ $url = wp_nonce_url($url, $action);
526
+ }
527
+
528
+ ?>
529
+
530
+ <script type="text/javascript">
531
+ window.location = '<?php echo (empty($url)) ? esc_url(get_option('home')) : esc_url($url); ?>';
532
+ </script>
533
+
534
+ <?php
535
+ }
536
+
537
+ function vendor($name = null, $folder = null) {
538
+ if (!empty($name)) {
539
+ $filename = 'class.' . strtolower($name) . '.php';
540
+ $filepath = rtrim(dirname(__FILE__), DS) . DS . 'vendors' . DS . $folder . '';
541
+ $filefull = $filepath . $filename;
542
+
543
+ if (file_exists($filefull)) {
544
+ require_once($filefull);
545
+ $class = 'Gallery' . $name;
546
+
547
+ if (${$name} = new $class) {
548
+ return ${$name};
549
+ }
550
+ }
551
+ }
552
+
553
+ return false;
554
+ }
555
+
556
+ function check_uploaddir() {
557
+ $uploaddir = $this -> Html -> uploads_path() . DS . $this -> plugin_name . DS;
558
+ $cachedir = $uploaddir . 'cache' . DS;
559
+
560
+ if (!file_exists($uploaddir)) {
561
+ if (@mkdir($uploaddir, 0777)) {
562
+ @chmod($uploaddir, 0777);
563
+ return true;
564
+ } else {
565
+ $message = sprintf(esc_html__('Uploads folder named "%s" cannot be created inside "%s"', 'slideshow-gallery'), $this -> plugin_name, "wp-content/uploads/");
566
+ $this -> render_msg($message);
567
+ }
568
+ }
569
+
570
+ if (!file_exists($cachedir)) {
571
+ if (@mkdir($cachedir, 0777)) {
572
+ @chmod($cachedir, 0777);
573
+ } else {
574
+ $message = sprintf(esc_html__('Slideshow cache folder "%s" for resizing images cannot be created inside "%s"', 'slideshow-gallery'), 'cache', 'wp-content/uploads/' . $this -> plugin_name . '/');
575
+ $this -> render_msg($message);
576
+ }
577
+ }
578
+
579
+ return false;
580
+ }
581
+
582
+ function add_action($action, $function = null, $priority = 10, $params = 1) {
583
+ if (add_action($action, array($this, (empty($function)) ? $action : $function), $priority, $params)) {
584
+ return true;
585
+ }
586
+
587
+ return false;
588
+ }
589
+
590
+ function add_filter($filter, $function = null, $priority = 10, $params = 1) {
591
+ if (add_filter($filter, array($this, (empty($function)) ? $filter : $function), $priority, $params)) {
592
+ return true;
593
+ }
594
+
595
+ return false;
596
+ }
597
+
598
+ function ci_print_styles() {
599
+ wp_enqueue_style('slideshow', $this -> render_url('css/admin.css'), null, $this -> version, "all");
600
+ wp_enqueue_style('colorbox', $this -> render_url('css/colorbox.css'), false, $this -> version, "all");
601
+ }
602
+
603
+ function ci_print_scripts() {
604
+ wp_register_script('slideshow', $this -> render_url('js/admin.js'), array('jquery'), '1.0', true);
605
+
606
+ $params = array(
607
+ 'ajaxnonce' => array(
608
+ 'serialkey' => wp_create_nonce('serialkey'),
609
+ )
610
+ );
611
+
612
+ wp_localize_script('slideshow', 'slideshow', $params);
613
+ wp_enqueue_script('slideshow');
614
+
615
+ wp_enqueue_script('colorbox', $this -> render_url('js/colorbox.js'), array('jquery'), false, true);
616
+ }
617
+
618
+ function print_scripts() {
619
+ $this -> enqueue_scripts();
620
+ }
621
+
622
+ function enqueue_scripts() {
623
+ wp_enqueue_script('jquery');
624
+
625
+ if (is_admin()) {
626
+ $page = (!empty($_GET['page'])) ? sanitize_text_field($_GET['page']) : false;
627
+ $method = (!empty($_GET['method'])) ? sanitize_text_field($_GET['method']) : false;
628
+
629
+ if (!empty($page) && in_array($page, (array) $this -> sections)) {
630
+ wp_enqueue_script('iris', admin_url('js/iris.min.js'), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1);
631
+ wp_enqueue_script('wp-color-picker', admin_url('js/color-picker.min.js'), array( 'iris' ), false, 1);
632
+
633
+ wp_enqueue_script('jquery-ui-tabs');
634
+ wp_enqueue_script('jquery-ui-tooltip');
635
+ wp_enqueue_script('jquery-ui-slider');
636
+ wp_enqueue_script('jquery-ui-datepicker');
637
+
638
+ if ($page == 'slideshow-settings') {
639
+ wp_enqueue_script('common');
640
+ wp_enqueue_script('wp-lists');
641
+ wp_enqueue_script('postbox');
642
+ wp_enqueue_script('plugin-install');
643
+ wp_enqueue_script('updates');
644
+ wp_enqueue_script('settings-editor', $this -> render_url('js/settings-editor.js', "admin"), array('jquery'), '1.0');
645
+ }
646
+
647
+ if ($page == "slideshow-slides" && $method == "order") {
648
+ wp_enqueue_script('jquery-ui-sortable');
649
+ }
650
+
651
+ if ($page == $this -> sections -> slides && ($method == "save" || $method == "save-multiple")) {
652
+ wp_enqueue_media();
653
+ }
654
+
655
+ add_thickbox();
656
+ wp_deregister_script('select2');
657
+ wp_deregister_script('wc-enhanced-select');
658
+ wp_enqueue_script('select2', $this -> render_url('js/select2.js', "admin"), array('jquery'), '4.0.0');
659
+ }
660
+
661
+ wp_enqueue_script('colorbox', $this -> render_url('js/colorbox.js', "admin"), array('jquery'), '1.6.3');
662
+ wp_register_script('slideshow', $this -> render_url('js/admin.js'), array('jquery'), '1.0', true);
663
+
664
+ $params = array(
665
+ 'ajaxnonce' => array(
666
+ 'serialkey' => wp_create_nonce('serialkey'),
667
+ )
668
+ );
669
+
670
+ wp_localize_script('slideshow', 'slideshow', $params);
671
+ wp_enqueue_script('slideshow');
672
+ } else {
673
+ wp_enqueue_script($this -> plugin_name, $this -> render_url('js/gallery.js', "default"), null, '1.0');
674
+ wp_enqueue_script('colorbox', $this -> render_url('js/colorbox.js', "default"), array('jquery'), '1.6.3');
675
+ wp_enqueue_script('jquery-effects-core');
676
+ }
677
+
678
+ return true;
679
+ }
680
+
681
+
682
+ function generate_css($attr = null, $layout = null) {
683
+
684
+ $function = (empty($layout) || $layout == "specific") ? 'sg_generate_css' : 'sg_generate_css_responsive';
685
+
686
+ $default_attr = $this -> get_option('styles');
687
+ $styles = wp_parse_args($attr, $default_attr);
688
+
689
+ //$id = $styles['unique'];
690
+ //$key = 'slideshow-css-' . $id;
691
+ //$data = maybe_serialize($styles);
692
+ //set_transient($key, $data, 999);
693
+
694
+ if (!function_exists($function)) {
695
+ include 'views/default/css-generator-fn.php';
696
+ }
697
+ $output = '';
698
+ $output .= '<style id="style-'.esc_attr($styles['unique']).'">';
699
+ ob_start();
700
+ $function($styles);
701
+ $output .= ob_get_clean();
702
+ $output .= '</style>';
703
+ return $output;
704
+
705
+ }
706
+
707
+
708
+
709
+ function get_css_url($attr = null, $layout = null) {
710
+ $file = (empty($layout) || $layout == "specific") ? 'css' : 'css-responsive';
711
+ $css_url = $this -> render_url($file . '.php', 'default');
712
+
713
+ $default_attr = $this -> get_option('styles');
714
+ $styles = wp_parse_args($attr, $default_attr);
715
+
716
+ $css_url = add_query_arg(array('id' => esc_attr($styles['unique'])), $css_url);
717
+
718
+ $key = 'slideshow-css-' . $styles['unique'];
719
+ $data = maybe_serialize($styles);
720
+ set_transient($key, $data, 999);
721
+
722
+ return $css_url;
723
+ }
724
+
725
+ function print_styles() {
726
+ $this -> enqueue_styles();
727
+ }
728
+
729
+ function enqueue_styles() {
730
+ if (is_admin()) {
731
+ wp_enqueue_style('fontawesome', $this -> render_url('css/fontawesome.css', "admin"), false, '4.4.0', "all");
732
+
733
+ if (isset($_GET['page'])) {
734
+ $page = sanitize_text_field($_GET['page']);
735
+ } else {
736
+ $page = "";
737
+ }
738
+
739
+ if (!empty($page) && in_array($page, (array) $this -> sections)) {
740
+ wp_enqueue_style('wp-color-picker');
741
+ wp_enqueue_style('jquery-ui', $this -> render_url('css/jquery-ui.css', "admin"), null, "1.0", "all");
742
+ wp_enqueue_style('select2', $this -> render_url('css/select2.css', "admin"), false, '4.0.0', "all");
743
+ }
744
+
745
+ wp_enqueue_style('colorbox', $this -> render_url('css/colorbox.css', "admin"), null, "1.3.19", "all");
746
+ wp_enqueue_style($this -> plugin_name, $this -> render_url('css/admin.css', "admin"), null, "1.0", "all");
747
+ } else {
748
+ wp_enqueue_style('colorbox', $this -> render_url('css/colorbox.css', "default"), null, "1.3.19", "all");
749
+ wp_enqueue_style('fontawesome', $this -> render_url('css/fontawesome.css', "default"), false, '4.4.0', "all");
750
+ }
751
+
752
+ return true;
753
+ }
754
+
755
+ function plugin_update_link() {
756
+ //https://slideshow.tribulant.co/wp-admin/update.php?action=upgrade-plugin&plugin=slideshow-gallery%2Fslideshow-gallery.php&_wpnonce=6533f071ab
757
+ $link = wp_nonce_url(admin_url('update.php?action=upgrade-plugin&plugin=' . $this -> plugin_base()));
758
+
759
+ return $link;
760
+ }
761
+
762
+ function plugin_base() {
763
+ return rtrim(dirname(__FILE__), '/');
764
+ }
765
+
766
+ function url() {
767
+ $url = rtrim(plugins_url(false, __FILE__));
768
+ return $url;
769
+ }
770
+
771
+ function add_option($name = '', $value = '') {
772
+ if (add_option($this -> pre . $name, $value)) {
773
+ return true;
774
+ }
775
+
776
+ return false;
777
+ }
778
+
779
+ function update_option($name = null, $value = null) {
780
+ if (update_option($this -> pre . $name, $value)) {
781
+ return true;
782
+ }
783
+
784
+ return false;
785
+ }
786
+
787
+ function get_option($name = null) {
788
+ if (!empty($name)) {
789
+ if ($value = get_option($this -> pre . $name)) {
790
+ return $value;
791
+ }
792
+ }
793
+
794
+ return false;
795
+ }
796
+
797
+ function delete_option($name = null) {
798
+ if (delete_option($this -> pre . $name)) {
799
+ return true;
800
+ }
801
+
802
+ return false;
803
+ }
804
+
805
+ function debug($var = array()) {
806
+ $debugging = get_option('tridebugging');
807
+ $this -> debugging = (empty($debugging)) ? $this -> debugging : true;
808
+
809
+ if ($this -> debugging) {
810
+ echo '<pre>' . print_r(map_deep($var, 'esc_html'), true) . '</pre>';
811
+ return true;
812
+ }
813
+
814
+ return false;
815
+ }
816
+
817
+ function check_tables() {
818
+ global $wpdb;
819
+
820
+ if (!empty($this -> models)) {
821
+ foreach ($this -> models as $model) {
822
+ $this -> check_table($model);
823
+ }
824
+
825
+ $query = "ALTER TABLE `" . $this -> Slide() -> table . "` CHANGE `type` `type` ENUM('media','file','url') NOT NULL DEFAULT 'media'";
826
+ $wpdb -> query($query);
827
+ }
828
+
829
+ return;
830
+ }
831
+
832
+ function check_table($model = null) {
833
+ global $wpdb;
834
+
835
+ $this -> initialize_classes();
836
+
837
+ if (!empty($model)) {
838
+ if (!empty($this -> fields) && is_array($this -> fields)) {
839
+ if (!$wpdb -> get_var("SHOW TABLES LIKE '" . $this -> table . "'")) {
840
+ $query = "CREATE TABLE `" . $this -> table . "` (";
841
+ $c = 1;
842
+
843
+ foreach ($this -> fields as $field => $attributes) {
844
+ if ($field != "key") {
845
+ $query .= "`" . $field . "` " . $attributes . "";
846
+ } else {
847
+ $query .= "" . $attributes . "";
848
+ }
849
+
850
+ if ($c < count($this -> fields)) {
851
+ $query .= ",";
852
+ }
853
+
854
+ $c++;
855
+ }
856
+
857
+ $query .= ") ENGINE=MyISAM AUTO_INCREMENT=1 CHARSET=UTF8;";
858
+
859
+ if (!empty($query)) {
860
+ $this -> table_query[] = $query;
861
+ }
862
+ } else {
863
+ $field_array = $this -> get_fields($this -> table);
864
+
865
+ foreach ($this -> fields as $field => $attributes) {
866
+ if ($field != "key") {
867
+ $this -> add_field($this -> table, $field, $attributes);
868
+ }
869
+ }
870
+
871
+ if (!empty($this -> indexes)) {
872
+ foreach ($this -> indexes as $index) {
873
+ $query = "SHOW INDEX FROM `" . $this -> table . "` WHERE `Key_name` = '" . $index . "'";
874
+ if (!$wpdb -> get_row($query)) {
875
+ $query = "ALTER TABLE `" . $this -> table . "` ADD INDEX(`" . $index . "`);";
876
+ $wpdb -> query($query);
877
+ }
878
+ }
879
+ }
880
+ }
881
+
882
+ if (!empty($this -> table_query)) {
883
+ require_once(ABSPATH . 'wp-admin' . DS . 'upgrade-functions.php');
884
+ dbDelta($this -> table_query, true);
885
+ }
886
+ }
887
+ }
888
+
889
+ return false;
890
+ }
891
+
892
+ function get_fields($table = null) {
893
+ global $wpdb;
894
+
895
+ if (!empty($table)) {
896
+ $fullname = $table;
897
+ $field_array = array();
898
+ if ($fields = $wpdb -> get_results("SHOW COLUMNS FROM " . $fullname)) {
899
+ foreach ($fields as $field) {
900
+ $field_array[] = $field -> Field;
901
+ }
902
+
903
+ return $field_array;
904
+ }
905
+ }
906
+
907
+ return false;
908
+ }
909
+
910
+ function delete_field($table = null, $field = null) {
911
+ global $wpdb;
912
+
913
+ if (!empty($table)) {
914
+ if (!empty($field)) {
915
+ $query = "ALTER TABLE `" . $wpdb -> prefix . "" . $table . "` DROP `" . $field . "`";
916
+
917
+ if ($wpdb -> query($query)) {
918
+ return false;
919
+ }
920
+ }
921
+ }
922
+
923
+ return false;
924
+ }
925
+
926
+ function change_field($table = null, $field = null, $newfield = null, $attributes = "TEXT NOT NULL") {
927
+ global $wpdb;
928
+
929
+ if (!empty($table)) {
930
+ if (!empty($field)) {
931
+ if (!empty($newfield)) {
932
+ $field_array = $this -> get_fields($table);
933
+
934
+ if (!in_array($field, $field_array)) {
935
+ if ($this -> add_field($table, $newfield)) {
936
+ return true;
937
+ }
938
+ } else {
939
+ $query = "ALTER TABLE `" . $table . "` CHANGE `" . $field . "` `" . $newfield . "` " . $attributes . ";";
940
+
941
+ if ($wpdb -> query($query)) {
942
+ return true;
943
+ }
944
+ }
945
+ }
946
+ }
947
+ }
948
+
949
+ return false;
950
+ }
951
+
952
+ function add_field($table = null, $field = null, $attributes = "TEXT NOT NULL") {
953
+ global $wpdb;
954
+
955
+ if (!empty($table)) {
956
+ if (!empty($field)) {
957
+ $field_array = $this -> get_fields($table);
958
+
959
+ if (!empty($field_array)) {
960
+ if (!in_array($field, $field_array)) {
961
+ $query = "ALTER TABLE `" . $table . "` ADD `" . $field . "` " . $attributes . ";";
962
+
963
+ if ($wpdb -> query($query)) {
964
+ return true;
965
+ }
966
+ }
967
+ }
968
+ }
969
+ }
970
+
971
+ return false;
972
+ }
973
+
974
+ function language_useordefault($content) {
975
+ $text = $content;
976
+
977
+ if (!empty($text)) {
978
+ $current_language = $this -> language_current();
979
+ $language = (empty($current_language)) ? $this -> language_default() : $current_language;
980
+ $text = $this -> language_use($language, $content, false);
981
+ }
982
+
983
+ return $text;
984
+ }
985
+
986
+ function language_use($lang = null, $text = null, $show_available = false) {
987
+
988
+ if (!$this -> language_isenabled($lang)) {
989
+ return $text;
990
+ }
991
+
992
+ if (is_array($text) || is_object($text)) {
993
+ // handle arrays recursively
994
+ if (is_array($text)) {
995
+ foreach($text as $key => $t) {
996
+ $text[$key] = $this -> language_use($lang, $text[$key], $show_available);
997
+ }
998
+ } elseif (is_object($text)) {
999
+ foreach($text as $key => $t) {
1000
+ $text -> {$key} = $this -> language_use($lang, $text -> {$key}, $show_available);
1001
+ }
1002
+ }
1003
+
1004
+ return $text;
1005
+ }
1006
+
1007
+ if(is_object($text) && get_class($text) == '__PHP_Incomplete_Class') {
1008
+ foreach(get_object_vars($text) as $key => $t) {
1009
+ $text->$key = $this -> language_use($lang,$text -> $key,$show_available);
1010
+ }
1011
+ return $text;
1012
+ }
1013
+
1014
+ // prevent filtering weird data types and save some resources
1015
+ if(!is_string($text) || $text == '') {
1016
+ return $text;
1017
+ }
1018
+
1019
+ // get content
1020
+ $content = $this -> language_split($text);
1021
+
1022
+ if (!is_array($content)) {
1023
+ return $content;
1024
+ }
1025
+
1026
+ // find available languages
1027
+ $available_languages = array();
1028
+ foreach($content as $language => $lang_text) {
1029
+ $lang_text = trim($lang_text);
1030
+ if(!empty($lang_text)) $available_languages[] = $language;
1031
+ }
1032
+
1033
+ // if no languages available show full text
1034
+ if(sizeof($available_languages)==0) return $text;
1035
+ // if content is available show the content in the requested language
1036
+ if(!empty($content[$lang])) {
1037
+ return $content[$lang];
1038
+ }
1039
+ // content not available in requested language (bad!!) what now?
1040
+ if(!$show_available){
1041
+ // check if content is available in default language, if not return first language found. (prevent empty result)
1042
+ if($lang != $this -> language_default()) {
1043
+ $str = $this -> language_use($this -> language_default(), $text, $show_available);
1044
+
1045
+ if ($q_config['show_displayed_language_prefix'])
1046
+ $str = "(". $this -> language_name($this -> language_default()) .") " . $str;
1047
+ return $str;
1048
+ }
1049
+ foreach($content as $language => $lang_text) {
1050
+ $lang_text = trim($lang_text);
1051
+ if (!empty($lang_text)) {
1052
+ $str = $lang_text;
1053
+ if ($q_config['show_displayed_language_prefix'])
1054
+ $str = "(". $this -> language_name($language) .") " . $str;
1055
+ return $str;
1056
+ }
1057
+ }
1058
+ }
1059
+ // display selection for available languages
1060
+ $available_languages = array_unique($available_languages);
1061
+ $language_list = "";
1062
+ if(preg_match('/%LANG:([^:]*):([^%]*)%/',$q_config['not_available'][$lang],$match)) {
1063
+ $normal_seperator = $match[1];
1064
+ $end_seperator = $match[2];
1065
+ // build available languages string backward
1066
+ $i = 0;
1067
+ foreach($available_languages as $language) {
1068
+ if($i==1) $language_list = $end_seperator.$language_list;
1069
+ if($i>1) $language_list = $normal_seperator.$language_list;
1070
+ $language_list = "<a href=\"". $this -> language_converturl('', $language)."\">". $this -> language_name($language) ."</a>".$language_list;
1071
+ $i++;
1072
+ }
1073
+ }
1074
+ return "<p>".preg_replace('/%LANG:([^:]*):([^%]*)%/', $language_list, $q_config['not_available'][$lang])."</p>";
1075
+ }
1076
+
1077
+ function language_converturl($url = null, $language = null) {
1078
+ global $slideshow_languageplugin;
1079
+
1080
+ if (!empty($url) && !empty($language)) {
1081
+ switch ($slideshow_languageplugin) {
1082
+ case 'qtranslate' :
1083
+ $url = qtrans_convertURL($url, $language);
1084
+ break;
1085
+ case 'qtranslate-x' :
1086
+ $url = qtranxf_convertURL($url, $language);
1087
+ break;
1088
+ case 'polylang' :
1089
+ $url = add_query_arg(array('lang' => $language), $url);
1090
+ break;
1091
+ case 'wpglobus' :
1092
+ if (class_exists('WPGlobus_Utils')) {
1093
+ $url = WPGlobus_Utils::localize_url($url, $language);
1094
+ }
1095
+ break;
1096
+ case 'wpml' :
1097
+ if (function_exists('icl_get_languages')) {
1098
+ $languages = icl_get_languages();
1099
+ $language = $this -> language_current();
1100
+
1101
+ if (!empty($languages[$language]['url'])) {
1102
+ //$url = $languages[$language]['url'];
1103
+ }
1104
+ }
1105
+ break;
1106
+ }
1107
+ }
1108
+
1109
+ return $url;
1110
+ }
1111
+
1112
+ function language_default() {
1113
+ global $slideshow_languageplugin, $slideshow_languagedefault;
1114
+ $default = false;
1115
+
1116
+ if (!empty($slideshow_languagedefault)) {
1117
+ return $slideshow_languagedefault;
1118
+ }
1119
+
1120
+ switch ($slideshow_languageplugin) {
1121
+ case 'qtranslate' :
1122
+ case 'qtranslate-x' :
1123
+ global $q_config;
1124
+ $default = $q_config['default_language'];
1125
+ break;
1126
+ case 'polylang' :
1127
+ if (function_exists('pll_default_language')) {
1128
+ $default = pll_default_language();
1129
+ }
1130
+ break;
1131
+ case 'wpglobus' :
1132
+ if (class_exists('WPGlobus')) {
1133
+ $default = WPGlobus::Config() -> default_language;
1134
+ }
1135
+ break;
1136
+ case 'wpml' :
1137
+ global $sitepress;
1138
+ $default = $sitepress -> get_default_language();
1139
+ break;
1140
+ }
1141
+
1142
+ $slideshow_languagedefault = $default;
1143
+ return $default;
1144
+ }
1145
+
1146
+ function language_name($language = null) {
1147
+ $name = false;
1148
+
1149
+ if (!empty($language)) {
1150
+ global $slideshow_languageplugin, ${'slideshow_languagename_' . $language};
1151
+
1152
+ if (!empty(${'slideshow_languagename_' . $language})) {
1153
+ return ${'slideshow_languagename_' . $language};
1154
+ }
1155
+
1156
+ switch ($slideshow_languageplugin) {
1157
+ case 'qtranslate' :
1158
+ case 'qtranslate-x' :
1159
+ global $q_config;
1160
+ $name = $q_config['language_name'][$language];
1161
+ break;
1162
+ case 'polylang' :
1163
+ global $polylang;
1164
+ if ($pll_language = $polylang -> model -> get_language($language)) {
1165
+ $name = $pll_language -> name;
1166
+ }
1167
+ break;
1168
+ case 'wpglobus' :
1169
+ if (class_exists('WPGlobus')) {
1170
+ $name = WPGlobus::Config() -> language_name[$language];
1171
+ }
1172
+ break;
1173
+ case 'wpml' :
1174
+ if (function_exists('icl_get_languages')) {
1175
+ $languages = icl_get_languages();
1176
+ if (!empty($languages[$language]['translated_name'])) {
1177
+ $name = $languages[$language]['translated_name'];
1178
+ }
1179
+ }
1180
+ break;
1181
+ }
1182
+ }
1183
+
1184
+ ${'slideshow_languagename_' . $language} = $name;
1185
+ return $name;
1186
+ }
1187
+
1188
+ function language_do() {
1189
+ global $slideshow_languageplugin;
1190
+
1191
+ if (!$this -> ci_serial_valid()) {
1192
+ return false;
1193
+ }
1194
+
1195
+ if (empty($slideshow_languageplugin)) {
1196
+ if ($this -> is_plugin_active('qtranslate')) {
1197
+ $slideshow_languageplugin = "qtranslate";
1198
+ return true;
1199
+ } elseif ($this -> is_plugin_active('qtranslate-x')) {
1200
+ $slideshow_languageplugin = 'qtranslate-x';
1201
+ return true;
1202
+ } elseif ($this -> is_plugin_active('wpml')) {
1203
+ if (!empty($_GET['lang']) && $_GET['lang'] == "all") {
1204
+ return false;
1205
+ }
1206
+
1207
+ $slideshow_languageplugin = "wpml";
1208
+ return true;
1209
+ } elseif ($this -> is_plugin_active('polylang')) {
1210
+ $slideshow_languageplugin = "polylang";
1211
+ $result = true;
1212
+ } elseif ($this -> is_plugin_active('wpglobus')) {
1213
+ $slideshow_languageplugin = "wpglobus";
1214
+ $result = true;
1215
+ }
1216
+ } else {
1217
+ return true;
1218
+ }
1219
+
1220
+ return false;
1221
+ }
1222
+
1223
+ function language_set($language = null) {
1224
+ global $slideshow_languageplugin, $slideshow_languagecurrent;
1225
+ $this -> language_do();
1226
+
1227
+ do_action('slideshow_language_set_before', $language, $slideshow_languageplugin);
1228
+
1229
+ if (!empty($language) && !empty($slideshow_languageplugin)) {
1230
+ $slideshow_languagecurrent = $language;
1231
+
1232
+ switch ($slideshow_languageplugin) {
1233
+ case 'qtranslate' :
1234
+ case 'qtranslate-x' :
1235
+ if (function_exists('qtranxf_set_language_cookie')) {
1236
+ qtranxf_set_language_cookie($language);
1237
+ }
1238
+ break;
1239
+ case 'polylang' :
1240
+ global $polylang;
1241
+ if ($pll_language = $polylang -> model -> get_language($language)) {
1242
+ $polylang -> curlang = $pll_language;
1243
+ }
1244
+ break;
1245
+ case 'wpglobus' :
1246
+ if (class_exists('WPGlobus')) {
1247
+ WPGlobus::Config() -> set_language($language);
1248
+ }
1249
+ break;
1250
+ case 'wpml' :
1251
+ global $sitepress;
1252
+ if (method_exists($sitepress, 'switch_lang')) {
1253
+ $sitepress -> switch_lang($language, true);
1254
+ }
1255
+ break;
1256
+ }
1257
+
1258
+ do_action('slideshow_language_set_success', $language, $slideshow_languageplugin);
1259
+
1260
+ return true;
1261
+ }
1262
+
1263
+ do_action('slideshow_language_set_failed', $language, $slideshow_languageplugin);
1264
+
1265
+ return false;
1266
+ }
1267
+
1268
+ function language_current() {
1269
+ global $slideshow_languageplugin, $slideshow_languagecurrent;
1270
+ $current = false;
1271
+
1272
+ if (!empty($slideshow_languagecurrent)) {
1273
+ return $slideshow_languagecurrent;
1274
+ }
1275
+
1276
+ switch ($slideshow_languageplugin) {
1277
+ case 'qtranslate' :
1278
+ if (function_exists('qtrans_getLanguage')) {
1279
+ $current = qtrans_getLanguage();
1280
+ }
1281
+ break;
1282
+ case 'qtranslate-x' :
1283
+ if (function_exists('qtranxf_getLanguage')) {
1284
+ $current = qtranxf_getLanguage();
1285
+ }
1286
+ break;
1287
+ case 'polylang' :
1288
+ if (function_exists('pll_current_language') && function_exists('pll_default_language')) {
1289
+ $current = pll_current_language();
1290
+
1291
+ if (empty($current)) {
1292
+ $current = pll_default_language();
1293
+ }
1294
+ }
1295
+ break;
1296
+ case 'wpglobus' :
1297
+ if (class_exists('WPGlobus')) {
1298
+ $current = WPGlobus::Config() -> language;
1299
+ }
1300
+ break;
1301
+ case 'wpml' :
1302
+ $current = ICL_LANGUAGE_CODE;
1303
+ break;
1304
+ }
1305
+
1306
+ $slideshow_languagecurrent = $current;
1307
+ return $current;
1308
+ }
1309
+
1310
+ function language_flag($language = null) {
1311
+ global $slideshow_languageplugin, ${'slideshow_languageflag_' . $language};
1312
+ $flag = false;
1313
+
1314
+ if (!empty(${'slideshow_languageflag_' . $language})) {
1315
+ return ${'slideshow_languageflag_' . $language};
1316
+ }
1317
+
1318
+ switch ($slideshow_languageplugin) {
1319
+ case 'qtranslate' :
1320
+ case 'qtranslate-x' :
1321
+ global $q_config;
1322
+ $flag = '<img src="' . content_url() . '/' . $q_config['flag_location'] . '/' . $q_config['flag'][$language] . '" alt="' . $language . '" />';
1323
+ break;
1324
+ case 'polylang' :
1325
+ global $polylang;
1326
+ $pll_language = $polylang -> model -> get_language($language);
1327
+ $flag = $pll_language -> flag;
1328
+ break;
1329
+ case 'wpglobus' :
1330
+ if (class_exists('WPGlobus')) {
1331
+ $flag = '<img src="' . WPGlobus::Config() -> flags_url . WPGlobus::Config() -> flag[$language] . '" alt="' . $language . '" />';
1332
+ }
1333
+ break;
1334
+ case 'wpml' :
1335
+ if (function_exists('icl_get_languages')) {
1336
+ $languages = icl_get_languages();
1337
+ $flag = '<img src="' . $languages[$language]['country_flag_url'] . '" alt="' . $language . '" />';
1338
+ }
1339
+ break;
1340
+ }
1341
+
1342
+ ${'slideshow_languageflag_' . $language} = $flag;
1343
+ return $flag;
1344
+ }
1345
+
1346
+ function language_isenabled($language = null) {
1347
+ $enabled = false;
1348
+
1349
+ if (!empty($language)) {
1350
+ global $slideshow_languageplugin, ${'slideshow_languageenabled_' . $language};
1351
+
1352
+ if (!empty(${'slideshow_languageenabled_' . $language})) {
1353
+ return ${'slideshow_languageenabled_' . $language};
1354
+ }
1355
+
1356
+ switch ($slideshow_languageplugin) {
1357
+ case 'qtranslate' :
1358
+ $enabled = qtrans_isEnabled($language);
1359
+ break;
1360
+ case 'qtranslate-x' :
1361
+ $enabled = qtranxf_isEnabled($language);
1362
+ break;
1363
+ case 'polylang' :
1364
+ global $polylang;
1365
+ if ($pll_language = $polylang -> model -> get_language($language)) {
1366
+ if (empty($pll_language -> active) || $pll_language -> active == true) {
1367
+ $enabled = true;
1368
+ }
1369
+ }
1370
+ break;
1371
+ case 'wpglobus' :
1372
+ if (class_exists('WPGlobus_Utils')) {
1373
+ if (WPGlobus_Utils::is_enabled($language)) {
1374
+ $enabled = true;
1375
+ }
1376
+ }
1377
+ break;
1378
+ case 'wpml' :
1379
+ if (function_exists('icl_get_languages')) {
1380
+ $languages = icl_get_languages();
1381
+ if (!empty($languages[$language])) {
1382
+ $enabled = true;
1383
+ }
1384
+ }
1385
+ break;
1386
+ }
1387
+ }
1388
+
1389
+ ${'slideshow_languageenabled_' . $language} = $enabled;
1390
+ return $enabled;
1391
+ }
1392
+
1393
+ function language_join($texts = array(), $tagTypeMap = array(), $strip_tags = false) {
1394
+ if(!is_array($texts)) $texts = $this -> language_split($texts, false);
1395
+ $split_regex = "#<!--more-->#ism";
1396
+ $max = 0;
1397
+ $text = "";
1398
+ $languages = $this -> language_getlanguages();
1399
+
1400
+ foreach ($languages as $language) {
1401
+ $tagTypeMap[$language] = true;
1402
+ }
1403
+
1404
+ foreach($languages as $language) {
1405
+ if (!empty($texts[$language])) {
1406
+ $texts[$language] = preg_split($split_regex, $texts[$language]);
1407
+ if(sizeof($texts[$language]) > $max) $max = sizeof($texts[$language]);
1408
+ }
1409
+ }
1410
+
1411
+ for ($i = 0; $i < $max; $i++) {
1412
+ if($i>=1) {
1413
+ $text .= '<!--more-->';
1414
+ }
1415
+ foreach($languages as $language) {
1416
+ if (isset($texts[$language][$i]) && $texts[$language][$i] !== '') {
1417
+
1418
+ if ($strip_tags) {
1419
+ $texts[$language][$i] = strip_tags($texts[$language][$i]);
1420
+ }
1421
+
1422
+ if (empty($tagTypeMap[$language])) {
1423
+ $text .= '<!--:'.$language.'-->'.$texts[$language][$i].'<!--:-->';
1424
+ } else {
1425
+ $text .= "[:{$language}]{$texts[$language][$i]}";
1426
+ }
1427
+ }
1428
+ }
1429
+ }
1430
+
1431
+ return $text;
1432
+ }
1433
+
1434
+ function language_split($text, $quicktags = true, array $languageMap = NULL) {
1435
+ $array = false;
1436
+
1437
+ if (!empty($text)) {
1438
+ //init vars
1439
+ $split_regex = "#(<!--[^-]*-->|\[:[a-z-]{2,10}\])#ism";
1440
+ $current_language = "";
1441
+ $result = array();
1442
+
1443
+ $languages = $this -> language_getlanguages();
1444
+ foreach ($languages as $language) {
1445
+ $result[$language] = "";
1446
+ }
1447
+
1448
+ // split text at all xml comments
1449
+ $blocks = preg_split($split_regex, $text, -1, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE);
1450
+
1451
+ foreach($blocks as $block) {
1452
+ # detect language tags
1453
+ if(preg_match("#^<!--:([a-z-]{2,10})-->$#ism", $block, $matches)) {
1454
+ if($this -> language_isenabled($matches[1])) {
1455
+ $current_language = $matches[1];
1456
+ $languageMap[$current_language] = false;
1457
+ } else {
1458
+ $current_language = "invalid";
1459
+ }
1460
+ continue;
1461
+ // detect quicktags
1462
+ } elseif($quicktags && preg_match("#^\[:([a-z-]{2,10})\]$#ism", $block, $matches)) {
1463
+ if($this -> language_isenabled($matches[1])) {
1464
+ $current_language = $matches[1];
1465
+ $languageMap[$current_language] = true;
1466
+ } else {
1467
+ $current_language = "invalid";
1468
+ }
1469
+
1470
+ continue;
1471
+ } elseif(preg_match("#^<!--:-->$#ism", $block, $matches)) {
1472
+ $current_language = "";
1473
+ continue;
1474
+ } elseif(preg_match("#^<!--more-->$#ism", $block, $matches)) {
1475
+ foreach($languages as $language) {
1476
+ $result[$language] .= $block;
1477
+ }
1478
+
1479
+ continue;
1480
+ }
1481
+
1482
+ if($current_language == "") {
1483
+ foreach($languages as $language) {
1484
+ $result[$language] .= $block;
1485
+ }
1486
+ } elseif($current_language != "invalid") {
1487
+ $result[$current_language] .= $block;
1488
+ }
1489
+ }
1490
+
1491
+ foreach($result as $lang => $lang_content) {
1492
+ $result[$lang] = str_replace('[:]', '', preg_replace("#(<!--more-->|<!--nextpage-->)+$#ism", "", $lang_content));
1493
+ }
1494
+
1495
+ return $result;
1496
+ }
1497
+
1498
+ return $array;
1499
+ }
1500
+
1501
+ function language_getlanguages() {
1502
+ global $slideshow_languageplugin, $slideshow_languagelanguages;
1503
+ $languages = false;
1504
+
1505
+ if (!empty($slideshow_languagelanguages)) {
1506
+ return $slideshow_languagelanguages;
1507
+ }
1508
+
1509
+ switch ($slideshow_languageplugin) {
1510
+ case 'qtranslate' :
1511
+ if (function_exists('qtrans_getSortedLanguages')) {
1512
+ $languages = qtrans_getSortedLanguages();
1513
+ }
1514
+ break;
1515
+ case 'qtranslate-x' :
1516
+ if (function_exists('qtranxf_getSortedLanguages')) {
1517
+ $languages = qtranxf_getSortedLanguages();
1518
+ }
1519
+ break;
1520
+ case 'polylang' :
1521
+ global $polylang;
1522
+ if (!empty($polylang -> model) && method_exists($polylang -> model, 'get_languages_list')) {
1523
+ if ($pll_languages = $polylang -> model -> get_languages_list()) {
1524
+ foreach ($pll_languages as $lang) {
1525
+ $languages[] = $lang -> slug;
1526
+ }
1527
+ }
1528
+ }
1529
+ break;
1530
+ case 'wpglobus' :
1531
+ if (class_exists('WPGlobus')) {
1532
+ $languages = WPGlobus::Config() -> enabled_languages;
1533
+ }
1534
+ break;
1535
+ case 'wpml' :
1536
+ if (function_exists('icl_get_languages')) {
1537
+ $icl_languages = icl_get_languages();
1538
+ $languages = array();
1539
+ foreach ($icl_languages as $lang => $icl_language) {
1540
+ $languages[] = $lang;
1541
+ }
1542
+ }
1543
+ break;
1544
+ }
1545
+
1546
+ $slideshow_languagelanguages = $languages;
1547
+ return $languages;
1548
+ }
1549
+
1550
+ function is_plugin_active($name = null, $orinactive = false) {
1551
+ if (!empty($name)) {
1552
+ require_once ABSPATH . 'wp-admin' . DS . 'includes' . DS . 'admin.php';
1553
+
1554
+ if (empty($path)) {
1555
+ switch ($name) {
1556
+ case 'qtranslate' :
1557
+ $path = 'qtranslate' . DS . 'qtranslate.php';
1558
+ break;
1559
+ case 'qtranslate-x' :
1560
+ $path = 'qtranslate-x' . DS . 'qtranslate.php';
1561
+ break;
1562
+ case 'polylang' :
1563
+ $path = 'polylang' . DS . 'polylang.php';
1564
+ break;
1565
+ case 'wpglobus' :
1566
+ $path = 'wpglobus' . DS . 'wpglobus.php';
1567
+ break;
1568
+ case 'wpml' :
1569
+ $path = 'sitepress-multilingual-cms' . DS . 'sitepress.php';
1570
+ break;
1571
+ case 'captcha' :
1572
+ $path = 'really-simple-captcha' . DS . 'really-simple-captcha.php';
1573
+ break;
1574
+ default :
1575
+ $path = $name;
1576
+ break;
1577
+ }
1578
+ }
1579
+
1580
+ $path2 = str_replace("\\", "/", $path);
1581
+
1582
+ if (!empty($name) && $name == "qtranslate") {
1583
+ $path2 = 'mqtranslate' . DS . 'mqtranslate.php';
1584
+ }
1585
+
1586
+ if (!empty($path)) {
1587
+ $plugins = get_plugins();
1588
+
1589
+ if (!empty($plugins)) {
1590
+ if (array_key_exists($path, $plugins) || array_key_exists($path2, $plugins)) {
1591
+ /* Let's see if the plugin is installed and activated */
1592
+ if (is_plugin_active(plugin_basename($path)) ||
1593
+ is_plugin_active(plugin_basename($path2))) {
1594
+ return true;
1595
+ }
1596
+
1597
+ /* Maybe the plugin is installed but just not activated? */
1598
+ if (!empty($orinactive) && $orinactive == true) {
1599
+ if (is_plugin_inactive(plugin_basename($path)) ||
1600
+ is_plugin_inactive(plugin_basename($path2))) {
1601
+ return true;
1602
+ }
1603
+ }
1604
+ }
1605
+ }
1606
+ }
1607
+ }
1608
+
1609
+ return false;
1610
+ }
1611
+
1612
+ function has_child_theme_folder() {
1613
+ $theme_path = get_stylesheet_directory();
1614
+ $full_path = $theme_path . DS . 'slideshow';
1615
+
1616
+ if (file_exists($full_path)) {
1617
+ return true;
1618
+ }
1619
+
1620
+ return false;
1621
+ }
1622
+
1623
+ function render_url($file = null, $folder = 'admin', $extension = null) {
1624
+ $this -> plugin_name = basename(dirname(__FILE__));
1625
+
1626
+ if (!empty($file)) {
1627
+ if (!empty($folder) && $folder != "admin") {
1628
+ $theme_folder = $this -> get_option('theme_folder');
1629
+ $folder = (!empty($theme_folder)) ? $theme_folder : $folder;
1630
+ $folderurl = plugins_url() . '/' . $this -> plugin_name . '/views/' . $folder . '/';
1631
+
1632
+ $template_url = get_stylesheet_directory_uri();
1633
+ $theme_path = get_stylesheet_directory();
1634
+ $full_path = $theme_path . DS . 'slideshow' . DS . $file;
1635
+
1636
+ if (!empty($theme_path) && file_exists($full_path)) {
1637
+ $folderurl = $template_url . '/slideshow/';
1638
+ }
1639
+ } else {
1640
+ $folderurl = plugins_url() . '/' . $this -> plugin_name . '/';
1641
+ }
1642
+
1643
+ $url = $folderurl . $file;
1644
+ return $url;
1645
+ }
1646
+
1647
+ return false;
1648
+ }
1649
+
1650
+ function render($file = null, $params = array(), $output = true, $folder = 'admin') {
1651
+
1652
+ if (!empty($file)) {
1653
+ $this -> plugin_name = basename(dirname(__FILE__));
1654
+ $this -> plugin_base = rtrim(dirname(__FILE__), DS);
1655
+ $this -> sections = apply_filters('slideshow_sections', (object) $this -> sections);
1656
+
1657
+ $theme_serve = false;
1658
+ $filename = $file . '.php';
1659
+ $filepath = $this -> plugin_base() . DS . 'views' . DS . $folder . DS;
1660
+
1661
+ if (!empty($folder) && $folder != "admin") {
1662
+ $theme_path = get_stylesheet_directory();
1663
+ $full_path = $theme_path . DS . 'slideshow' . DS . $filename;
1664
+
1665
+ if (!empty($theme_path) && file_exists($full_path)) {
1666
+ $folder = $theme_path . DS . 'slideshow';
1667
+ $theme_serve = true;
1668
+ }
1669
+ }
1670
+
1671
+ if (empty($theme_serve)) {
1672
+ $filepath = $this -> plugin_base() . DS . 'views' . DS . $folder . DS;
1673
+ } else {
1674
+ $filepath = $folder . DS;
1675
+ }
1676
+
1677
+ $filefull = $filepath . $filename;
1678
+
1679
+ if (file_exists($filefull)) {
1680
+ if (!empty($params)) {
1681
+ foreach ($params as $pkey => $pval) {
1682
+ ${$pkey} = $pval;
1683
+ }
1684
+ }
1685
+
1686
+ $this -> initialize_classes();
1687
+
1688
+ if ($output == false) {
1689
+ ob_start();
1690
+ }
1691
+
1692
+ include($filefull);
1693
+
1694
+ if ($output == false) {
1695
+ $data = ob_get_clean();
1696
+ return $data;
1697
+ } else {
1698
+ return true;
1699
+ }
1700
+ }
1701
+ }
1702
+
1703
+ return false;
1704
+ }
1705
+ }
1706
+
1707
+ ?>
slideshow-gallery.php CHANGED
@@ -1,1211 +1,1211 @@
1
- <?php
2
-
3
- /*
4
- Plugin Name: Slideshow Gallery
5
- Plugin URI: https://tribulant.com/plugins/view/13/wordpress-slideshow-gallery
6
- Author: Tribulant
7
- Author URI: https://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. See the <a href="https://tribulant.com/docs/wordpress-slideshow-gallery/1758/wordpress-slideshow-gallery-plugin/" target="_blank">online documentation</a> for instructions on using and embedding slideshow galleries. Upgrade to the premium version to remove all limitations.
9
- Version: 1.7.4.4
10
- License: GNU General Public License v2 or later
11
- License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
- Tags: slideshow gallery, slideshow, gallery, slider, jquery, bfithumb, galleries, photos, images
13
- Text Domain: slideshow-gallery
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';
22
- if (file_exists($path)) {
23
- require_once(dirname(__FILE__) . DS . 'includes' . DS . 'checkinit.php');
24
- require_once(dirname(__FILE__) . DS . 'includes' . DS . 'constants.php');
25
- require_once($path);
26
- require_once(dirname(__FILE__) . DS . 'includes' . DS . 'errorhandler.php');
27
- require_once(dirname(__FILE__) . DS . 'vendors' . DS . 'otf_regen_thumbs.php');
28
- }
29
-
30
- if (!class_exists('SlideshowGallery')) {
31
- class SlideshowGallery extends GalleryPlugin {
32
-
33
- function __construct() {
34
- $url = explode("&", $_SERVER['REQUEST_URI']);
35
- $this -> url = $url[0];
36
- $this -> referer = (empty($_SERVER['HTTP_REFERER'])) ? $this -> url : $_SERVER['HTTP_REFERER'];
37
- $this -> plugin_name = basename(dirname(__FILE__));
38
- $this -> plugin_file = plugin_basename(__FILE__);
39
- $this -> register_plugin($this -> plugin_name, __FILE__);
40
- $this -> errorhandler = new SlideshowErrorHandler();
41
-
42
- //WordPress action hooks
43
- $this -> add_action('plugins_loaded');
44
- $this -> add_action('wp_head');
45
- $this -> add_action('wp_footer');
46
- $this -> add_action('admin_menu');
47
- $this -> add_action('admin_head');
48
- $this -> add_action('admin_notices');
49
- $this -> add_action('wp_print_styles', 'print_styles');
50
- $this -> add_action('admin_print_styles', 'print_styles');
51
- $this -> add_action('wp_print_scripts', 'print_scripts');
52
- $this -> add_action('admin_print_scripts', 'print_scripts');
53
- $this -> add_action('init', 'init_textdomain', 10, 1);
54
- $this -> add_action('admin_init', 'custom_redirect', 1, 1);
55
-
56
- //WordPress Ajax hooks
57
- $this -> add_action('wp_ajax_slideshow_slides_order', 'ajax_slides_order', 10, 1);
58
- $this -> add_action('wp_ajax_slideshow_tinymce', 'ajax_tinymce', 10, 1);
59
-
60
- //WordPress filter hooks
61
- $this -> add_filter('mce_buttons');
62
- $this -> add_filter('mce_external_plugins');
63
- $this -> add_filter("plugin_action_links_" . $this -> plugin_file, 'plugin_action_links', 10, 4);
64
-
65
- $this -> add_action('slideshow_ratereviewhook', 'ratereview_hook');
66
-
67
- if (!is_admin() || wp_doing_ajax()) {
68
- add_shortcode('slideshow', array($this, 'embed'));
69
- add_shortcode('tribulant_slideshow', array($this, 'embed'));
70
- }
71
-
72
- $this -> updating_plugin();
73
- }
74
-
75
- function excerpt_more($more = null) {
76
- global $slideshow_post;
77
- $excerptsettings = $this -> get_option('excerptsettings');
78
- if (!empty($excerptsettings)) {
79
- $excerpt_readmore = $this -> get_option('excerpt_readmore');
80
- if (!empty($excerpt_readmore)) {
81
- $more = ' <a href="' . get_permalink($slideshow_post -> ID) . '">' . esc_html($excerpt_readmore) . '</a>';
82
- }
83
- }
84
-
85
- return $more;
86
- }
87
-
88
- function excerpt_length($length = null) {
89
- $excerptsettings = $this -> get_option('excerptsettings');
90
- if (!empty($excerptsettings)) {
91
- $excerpt_length = $this -> get_option('excerpt_length');
92
- if (!empty($excerpt_length)) {
93
- $length = $excerpt_length;
94
- }
95
- }
96
-
97
- return $length;
98
- }
99
-
100
- function plugin_action_links($actions = null, $plugin_file = null, $plugin_data = null, $context = null) {
101
- $this_plugin = plugin_basename(__FILE__);
102
-
103
- if (!empty($plugin_file) && $plugin_file == $this_plugin) {
104
- //$actions[] = '<a href="" onclick="jQuery.colorbox({href:ajaxurl + \'?action=slideshow_serialkey&security=' . wp_create_nonce('serialkey') . '\'}); return false;" id="slideshow_submitseriallink"><i class="fa fa-key fa-fw"></i> ' . __('Serial Key', 'slideshow-gallery') . '</a>';
105
- $actions[] = '<a href="' . admin_url('admin.php?page=' . $this -> sections -> settings) . '"><i class="fa fa-cog fa-fw"></i> ' . __('Settings', 'slideshow-gallery') . '</a>';
106
-
107
- /*if ($update = $this -> vendor('update')) {
108
- $version_info = $update -> get_version_info();
109
- if (!empty($version_info['dtype']) && $version_info['dtype'] == "single") {
110
- $actions[] = '<a href="https://tribulant.com/items/upgrade/' . $version_info['item_id'] . '" target="_blank"><i class="fa fa-level-up fa-fw"></i> ' . __('Upgrade', 'slideshow-gallery') . '</a>';
111
- }
112
- }*/
113
- }
114
-
115
- return $actions;
116
- }
117
-
118
- function init() {
119
- }
120
-
121
- function init_textdomain() {
122
- $locale = get_locale();
123
-
124
- if (!empty($locale)) {
125
- if ($locale == "ja" || $locale == "ja_JP") { setlocale(LC_ALL, "ja_JP.UTF8"); }
126
- } else {
127
- setlocale(LC_ALL, apply_filters('slideshow_setlocale', $locale));
128
- }
129
-
130
- $mo_file = $this -> plugin_name . '-' . $locale . '.mo';
131
- $language_external = $this -> get_option('language_external');
132
-
133
- if (!empty($language_external)) {
134
- if (function_exists('load_textdomain')) {
135
- load_textdomain($this -> plugin_name, WP_LANG_DIR . DS . $this -> plugin_name . DS . $mo_file);
136
- }
137
- } else {
138
- if (function_exists('load_plugin_textdomain')) {
139
- load_plugin_textdomain($this -> plugin_name, false, dirname(plugin_basename(__FILE__)) . DS . 'languages' . DS);
140
- }
141
- }
142
- }
143
-
144
- function plugins_loaded() {
145
- $this -> ci_initialize();
146
-
147
- if ($this -> language_do()) {
148
- add_filter('gettext', array($this, 'language_useordefault'), 0);
149
- }
150
- }
151
-
152
- function wp_head() {
153
- global $slideshow_javascript, $slideshow_css;
154
- $slideshow_javascript = array();
155
- $slideshow_css = array();
156
-
157
- $this -> render('head', false, true, 'default');
158
- }
159
-
160
- function wp_footer() {
161
- global $slideshow_javascript, $slideshow_css;
162
- $jsoutput = $this -> get_option('jsoutput');
163
-
164
- if (!empty($slideshow_javascript)) {
165
- if (!empty($jsoutput) && $jsoutput == "footerglobal") {
166
- ?><!-- Slideshow Gallery Javascript BEG --><?php
167
-
168
- foreach ($slideshow_javascript as $javascript) {
169
- //echo wp_unslash($javascript);
170
- echo html_entity_decode(str_replace("\'", "'", str_replace('\n', '', esc_js($javascript))));
171
- }
172
-
173
- ?><!-- Slideshow Gallery Javascript END --><?php
174
- }
175
- }
176
-
177
- if (!empty($slideshow_css)) {
178
- if (!empty($jsoutput) && $jsoutput == "footerglobal") {
179
- ?><!-- Slideshow Gallery CSS BEG --><?php
180
-
181
- foreach ($slideshow_css as $css) {
182
- //echo wp_unslash($css);
183
- echo html_entity_decode(esc_html($css));
184
- }
185
-
186
- ?><!-- Slideshow Gallery CSS END --><?php
187
- }
188
- }
189
- }
190
-
191
- function admin_menu() {
192
- //$update_icon = ($this -> has_update()) ? ' <span class="update-plugins count-1"><span class="update-count">1</span></span>' : '';
193
- $update_icon = '';
194
- $this -> check_roles();
195
-
196
- add_menu_page(__('Slideshow', 'slideshow-gallery'), __('Slideshow', 'slideshow-gallery') . $update_icon, 'slideshow_slides', $this -> sections -> slides, array($this, 'admin_slides'), false, "26.113");
197
- $this -> menus['slideshow-slides'] = add_submenu_page($this -> sections -> slides, __('Manage Slides', 'slideshow-gallery'), __('Manage Slides', 'slideshow-gallery'), 'slideshow_slides', $this -> sections -> slides, array($this, 'admin_slides'));
198
- $this -> menus['slideshow-galleries'] = add_submenu_page($this -> sections -> slides, __('Manage Galleries', 'slideshow-gallery'), __('Manage Galleries', 'slideshow-gallery'), 'slideshow_galleries', $this -> sections -> galleries, array($this, 'admin_galleries'));
199
- $this -> menus['slideshow-settings'] = add_submenu_page($this -> sections -> slides, __('Settings', 'slideshow-gallery'), __('Settings', 'slideshow-gallery'), 'slideshow_settings', $this -> sections -> settings, array($this, 'admin_settings'));
200
- //$this -> menus['slideshow-settings-updates'] = add_submenu_page($this -> sections -> slides, __('Updates', 'slideshow-gallery'), __('Updates', 'slideshow-gallery') . $update_icon, 'slideshow_settings_updates', $this -> sections -> settings_updates, array($this, 'admin_settings_updates'));
201
-
202
- if (!$this -> ci_serial_valid()) {
203
- //$this -> menus['slideshow-submitserial'] = add_submenu_page($this -> sections -> slides, __('Submit Serial Key', 'slideshow-gallery'), __('Submit Serial Key', 'slideshow-gallery'), 'slideshow_submitserial', $this -> sections -> submitserial, array($this, 'admin_submitserial'));
204
- }
205
-
206
- add_action("load-" . $this -> menus['slideshow-slides'], array($this, 'screen_options_slides'));
207
- add_action("load-" . $this -> menus['slideshow-galleries'], array($this, 'screen_options_galleries'));
208
-
209
- do_action('slideshow_admin_menu', $this -> menus);
210
-
211
- add_action('admin_head-' . $this -> menus['slideshow-settings'], array($this, 'admin_head_gallery_settings'));
212
-
213
- add_dashboard_page(sprintf('Slideshow Gallery %s', $this -> version), sprintf('Slideshow Gallery %s', $this -> version), 'read', $this -> sections -> about, array($this, 'slideshow_gallery_about'));
214
- remove_submenu_page('index.php', $this -> sections -> about);
215
- }
216
-
217
- function set_screen_option($status = null, $option = null, $value = null) {
218
- return $value;
219
- }
220
-
221
- function removable_query_args($removable_query_args = array()) {
222
-
223
- $removable_query_args[] = 'Galleryupdated';
224
- $removable_query_args[] = 'Gallerymessage';
225
-
226
- return $removable_query_args;
227
- }
228
-
229
- function screen_options_slides() {
230
- $screen = get_current_screen();
231
-
232
- // get out of here if we are not on our settings page
233
- if (!is_object($screen) || $screen -> id != $this -> menus['slideshow-slides']) {
234
- return;
235
- }
236
-
237
- $args = array(
238
- 'label' => __('Slides per page', 'slideshow-gallery'),
239
- 'default' => 15,
240
- 'option' => 'slideshow_slides_perpage'
241
- );
242
-
243
- add_screen_option('per_page', $args);
244
-
245
- require_once $this -> plugin_base() . DS . 'includes' . DS . 'class.slide-list-table.php';
246
- $Slide_List_Table = new Slide_List_Table;
247
- }
248
-
249
- function screen_options_galleries() {
250
- $screen = get_current_screen();
251
-
252
- // get out of here if we are not on our settings page
253
- if (!is_object($screen) || $screen -> id != $this -> menus['slideshow-galleries']) {
254
- return;
255
- }
256
-
257
- $args = array(
258
- 'label' => __('Galleries per page', 'slideshow-gallery'),
259
- 'default' => 15,
260
- 'option' => 'slideshow_galleries_perpage'
261
- );
262
-
263
- add_screen_option('per_page', $args);
264
-
265
- require_once $this -> plugin_base() . DS . 'includes' . DS . 'class.gallery-list-table.php';
266
- $Gallery_List_Table = new Gallery_List_Table;
267
- }
268
-
269
- function default_hidden_columns($hidden = null, $screen = null) {
270
- if ($current_screen = get_current_screen()) {
271
- if ($current_screen -> id == $screen -> id) {
272
- switch ($screen -> id) {
273
- case $this -> menus['slideshow-slides'] :
274
- $hidden = array(
275
- 'id',
276
- 'link',
277
- 'expiry',
278
- 'order',
279
- );
280
- break;
281
- case $this -> menus['slideshow-galleries'] :
282
- $hidden = array(
283
- 'id',
284
- );
285
- break;
286
- }
287
- }
288
- }
289
-
290
- return $hidden;
291
- }
292
-
293
- function slideshow_gallery_about() {
294
- $this -> render('about', false, true, 'admin');
295
- }
296
-
297
- function admin_head() {
298
- $this -> render('head', false, true, 'admin');
299
- }
300
-
301
- function admin_head_gallery_settings() {
302
- add_meta_box('submitdiv', __('Save Settings', 'slideshow-gallery'), array($this -> Metabox, "settings_submit"), $this -> menus['slideshow-settings'], 'side', 'core');
303
- add_meta_box('pluginsdiv', __('Recommended Plugin', 'slideshow-gallery'), array($this -> Metabox, "settings_plugins"), $this -> menus['slideshow-settings'], 'side', 'core');
304
- add_meta_box('aboutdiv', __('About This Plugin', 'slideshow-gallery') . $this -> Html -> help(__('More about this plugin and the creators of it', 'slideshow-gallery')), array($this -> Metabox, "settings_about"), $this -> menus['slideshow-settings'], 'side', 'core');
305
- add_meta_box('generaldiv', __('General Settings', 'slideshow-gallery') . $this -> Html -> help(__('General settings for the inner workings and some default behaviours', 'slideshow-gallery')), array($this -> Metabox, "settings_general"), $this -> menus['slideshow-settings'], 'normal', 'core');
306
- add_meta_box('postsdiv', __('Posts/Pages Settings', 'slideshow-gallery'), array($this -> Metabox, "settings_postspages"), $this -> menus['slideshow-settings'], 'normal', 'core');
307
- add_meta_box('linksimagesdiv', __('Links &amp; Images Overlay', 'slideshow-gallery') . $this -> Html -> help(__('Configure the way that slides with links are opened', 'slideshow-gallery')), array($this -> Metabox, "settings_linksimages"), $this -> menus['slideshow-settings'], 'normal', 'core');
308
- add_meta_box('stylesdiv', __('Appearance &amp; Styles', 'slideshow-gallery') . $this -> Html -> help(__('Change the way the slideshows look so that it suits your needs', 'slideshow-gallery')), array($this -> Metabox, "settings_styles"), $this -> menus['slideshow-settings'], 'normal', 'core');
309
- add_meta_box('techdiv', __('Technical Settings', 'slideshow-gallery'), array($this -> Metabox, "settings_tech"), $this -> menus['slideshow-settings'], 'normal', 'core');
310
- add_meta_box('wprelateddiv', __('WordPress Related', 'slideshow-gallery') . $this -> Html -> help(__('Settings specifically related to WordPress', 'slideshow-gallery')), array($this -> Metabox, "settings_wprelated"), $this -> menus['slideshow-settings'], 'normal', 'core');
311
-
312
- global $post;
313
- do_action('do_meta_boxes', $this -> menus['slideshow-settings'], 'normal', $post);
314
- do_action('do_meta_boxes', $this -> menus['slideshow-settings'], 'side', $post);
315
- }
316
-
317
- function admin_submitserial() {
318
- $success = false;
319
-
320
- if (!empty($_POST)) {
321
- check_admin_referer($this -> sections -> submitserial);
322
-
323
- $serial = sanitize_text_field($_REQUEST['serial']);
324
-
325
- if (empty($serial)) { $errors[] = __('Please fill in a serial key.', 'slideshow-gallery'); }
326
- else {
327
- $this -> update_option('serialkey', $serial); //update the DB option
328
- $this -> delete_all_cache('all');
329
-
330
- if (!$this -> ci_serial_valid()) { $errors[] = __('Serial key is invalid, please try again.', 'slideshow-gallery'); }
331
- else {
332
- delete_transient($this -> pre . 'update_info');
333
- $success = true;
334
- $this -> redirect(admin_url('admin.php?page=' . $this -> sections -> welcome));
335
- }
336
- }
337
- }
338
-
339
- $this -> render('settings-submitserial', array('success' => $success, 'errors' => $errors), true, 'admin');
340
- }
341
-
342
- function admin_notices() {
343
-
344
- if (is_admin()) {
345
- $this -> check_uploaddir();
346
-
347
- $message = (!empty($_GET[$this -> pre . 'message'])) ? wp_kses_html_error($_GET[$this -> pre . 'message']) : false;
348
- if (!empty($message)) {
349
- $msg_type = (!empty($_GET[$this -> pre . 'updated'])) ? 'msg' : 'err';
350
- call_user_func(array($this, 'render_' . $msg_type), $message);
351
- }
352
-
353
- $showmessage_ratereview = $this -> get_option('showmessage_ratereview');
354
- if (!empty($showmessage_ratereview)) {
355
- $message = sprintf(esc_html__('You have been using the %s for %s days or more. Please consider to %s it or say it %s on %s.', 'slideshow-gallery'),
356
- '<a href="https://wordpress.org/plugins/slideshow-gallery/" target="_blank">Tribulant Slideshow Gallery plugin</a>',
357
- $showmessage_ratereview,
358
- '<a class="button" href="https://wordpress.org/support/plugin/slideshow-gallery/reviews/?rate=5#new-post" target="_blank"><i class="fa fa-star"></i> Rate</a>',
359
- '<a class="button" href="https://wordpress.org/plugins/slideshow-gallery/?compatibility[version]=' . get_bloginfo('version') . '&compatibility[topic_version]=' . $this -> version . '&compatibility[compatible]=1" target="_blank"><i class="fa fa-check"></i> Works</a>',
360
- '<a href="https://wordpress.org/plugins/slideshow-gallery/" target="_blank">WordPress.org</a>');
361
-
362
- $dismissable = admin_url('admin.php?page=' . $this -> sections -> settings . '&slideshow_method=hidemessage&message=ratereview');
363
- $this -> render_msg($message, $dismissable, false);
364
- }
365
-
366
- /* Serial key submission message */
367
- if (isset($_GET['page'])) {
368
- $page = sanitize_text_field($_GET['page']);
369
- } else {
370
- $page = "";
371
- }
372
-
373
- if (!$this -> ci_serial_valid() && (empty($page) || $page != $this -> sections -> submitserial)) {
374
- $hidemessage_upgradetopro = $this -> get_option('hidemessage_upgradetopro');
375
-
376
- if (empty($hidemessage_upgradetopro)) {
377
- $message = sprintf(esc_html__('You are using Slideshow Gallery LITE. Take your slideshows to the next level with %s. Already purchased? %s.', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">Slideshow Gallery PRO</a>', '<a href="https://tribulant.com/docs/wordpress-slideshow-gallery/1758" target="_blank">See instructions to install PRO</a>');
378
- $message .= ' <a class="button button-primary" href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '"><i class="fa fa-check"></i> ' . __('Upgrade to PRO', 'slideshow-gallery') . '</a>';
379
- $message .= ' <a class="button button-secondary" href="' . admin_url('admin.php?page=' . $this -> sections -> welcome . '&slideshow_method=hidemessage&message=upgradetopro') . '"><i class="fa fa-times"></i> ' . __('Hide this message', 'slideshow-gallery') . '</a>';
380
- $dismissable = admin_url('admin.php?page=' . $this -> sections -> welcome . '&slideshow_method=hidemessage&message=upgradetopro');
381
- $this -> render_msg($message, $dismissable, false);
382
-
383
- ?>
384
-
385
- <script type="text/javascript">
386
- jQuery(document).ready(function(e) {
387
- jQuery('#<?php echo esc_attr($this -> pre); ?>submitseriallink').click(function() {
388
- jQuery.colorbox({href:ajaxurl + "?action=slideshow_serialkey&security=<?php echo wp_create_nonce('serialkey'); ?>"});
389
- return false;
390
- });
391
- });
392
- </script>
393
-
394
- <?php
395
- }
396
- }
397
-
398
- // Is an Update Available?
399
- /*if (!empty($page) && in_array($page, (array) $this -> sections)) {
400
- if (apply_filters('slideshow_updates', true)) {
401
- if (current_user_can('edit_plugins') && $this -> has_update() && (empty($page) || (!empty($page) && $page != $this -> sections -> settings_updates))) {
402
- $hideupdate = $this -> get_option('hideupdate');
403
- if (empty($hideupdate) || (!empty($hideupdate) && version_compare($this -> version, $hideupdate, '>'))) {
404
- $update = $this -> vendor('update');
405
- $update_info = $update -> get_version_info();
406
- $this -> render('update', array('update_info' => $update_info), true, 'admin');
407
- }
408
- }
409
- }
410
- }*/
411
- }
412
-
413
- }
414
-
415
- function mce_buttons($buttons) {
416
- array_push($buttons, "separator", "gallery");
417
- return $buttons;
418
- }
419
-
420
- function mce_external_plugins($plugins) {
421
- $plugins['gallery'] = $this -> url() . '/js/tinymce/editor_plugin.js';
422
- return $plugins;
423
- }
424
-
425
- function slideshow($output = true, $post_id = null, $exclude = null) {
426
- $params['post_id'] = $post_id;
427
- $params['exclude'] = $exclude;
428
-
429
- $content = $this -> embed($params, false);
430
-
431
- if ($output == true) {
432
- echo wp_kses_post($content);
433
- } else {
434
- return $content;
435
- }
436
- }
437
-
438
- function embed($atts = array(), $content = null) {
439
- //global variables
440
- global $wpdb;
441
- $styles = $this -> get_option('styles');
442
-
443
- $effect = $this -> get_option('effect');
444
- $slide_direction = $this -> get_option('slide_direction');
445
- $easing = $this -> get_option('easing');
446
- $autoheight = $this -> get_option('autoheight');
447
-
448
- $this -> add_filter('excerpt_more', 'excerpt_more', 999, 1);
449
- $this -> add_filter('excerpt_length', 'excerpt_length', 999, 1);
450
-
451
- // default shortcode parameters
452
- $defaults = array(
453
- 'source' => "slides",
454
- 'products' => false,
455
- 'productsnumber' => 10,
456
- 'featured' => false,
457
- 'featurednumber' => 10,
458
- 'featuredtype' => "post",
459
- 'gallery_id' => false,
460
- 'orderby' => array('order', "ASC"),
461
- 'orderf' => false, // order field
462
- 'orderd' => false, // order direction (ASC/DESC)
463
- 'resizeimages' => (($styles['resizeimages'] == "Y") ? "true" : "false"),
464
- 'imagesoverlay' => (($this -> get_option('imagesthickbox') == "Y") ? "true" : "false"),
465
- 'layout' => ($styles['layout']),
466
- 'width' => ($styles['width']),
467
- 'height' => ((empty($autoheight)) ? $styles['height'] : false),
468
- 'autoheight' => ((!empty($autoheight)) ? "true" : "false"),
469
- 'autoheight_max' => ($this -> get_option('autoheight_max')),
470
- 'resheight' => ($styles['resheight']),
471
- 'resheighttype' => ($styles['resheighttype']),
472
- 'auto' => (($this -> get_option('autoslide') == "Y") ? "true" : "false"),
473
- 'effect' => ((empty($effect) || (!empty($effect) && $effect == "fade")) ? 'fade' : $effect),
474
- 'slide_direction' => ((empty($slide_direction) || (!empty($slide_direction) && $slide_direction == "lr")) ? 'lr' : 'tb'),
475
- 'easing' => ((empty($easing)) ? 'swing' : $easing),
476
- 'autospeed' => ($this -> get_option('autospeed')),
477
- 'alwaysauto' => ($this -> get_option('alwaysauto')),
478
- 'fadespeed' => ($this -> get_option('fadespeed')),
479
- 'shownav' => (($this -> get_option('shownav') == "Y") ? "true" : "false"),
480
- 'navopacity' => ($this -> get_option('navopacity')),
481
- 'navhoveropacity' => ($this -> get_option('navhover')),
482
- 'showinfo' => (($this -> get_option('information') == "Y") ? "true" : "false"),
483
- 'infoheadingcontent' => "title",
484
- 'infoposition' => ($this -> get_option('infoposition')),
485
- 'infoonhover' => ($this -> get_option('infoonhover')),
486
- 'infospeed' => ($this -> get_option('infospeed')),
487
- 'infodelay' => ($this -> get_option('infodelay')),
488
- 'infofade' => ($this -> get_option ('infofade')),
489
- 'infofadedelay' => ($this -> get_option ('infofadedelay')),
490
- 'showthumbs' => (($this -> get_option('thumbnails') == "Y") ? "true" : "false"),
491
- 'thumbsposition' => ($this -> get_option('thumbposition')),
492
- 'thumbsborder' => ($styles['thumbactive']),
493
- 'thumbsspeed' => ($this -> get_option('thumbscrollspeed')),
494
- 'thumbsspacing' => ($this -> get_option('thumbspacing')),
495
- 'post_id' => null,
496
- 'numberposts' => "-1",
497
- 'exclude' => null,
498
- 'custom' => null,
499
- );
500
-
501
- $s = shortcode_atts($defaults, $atts);
502
- extract($s);
503
-
504
- $slideshowtype = false;
505
-
506
- if (!empty($products)) {
507
- include_once(ABSPATH . 'wp-admin/includes/plugin.php');
508
- if (is_plugin_active('wp-checkout' . DS . 'wp-checkout.php')) {
509
- $slides = array();
510
-
511
- if (empty($orderf) && empty($orderd)) {
512
- $orderf = "created";
513
- $orderd = "DESC";
514
- }
515
-
516
- if (class_exists('wpCheckout')) {
517
- if ($wpCheckout = new wpCheckout()) {
518
- global $wpcoDb, $Product;
519
- $wpcoDb -> model = $Product -> model;
520
- $productstype = $products;
521
-
522
- switch ($productstype) {
523
- case 'latest' :
524
- $products = $wpcoDb -> find_all(false, false, array($orderf, $orderd), $productsnumber);
525
- break;
526
- case 'featured' :
527
- $products = $wpcoDb -> find_all(array('featured' => "1"), false, array($orderf, $orderd), $productsnumber);
528
- break;
529
- }
530
- }
531
- }
532
-
533
- if (!empty($products)) {
534
- $slides = $products;
535
- $slideshowtype = "products";
536
- $content = $this -> render('gallery', array('slides' => $slides, 'unique' => 'products' . $productstype . $productsnumber, 'products' => true, 'options' => $s, 'frompost' => false), false, 'default');
537
- } else {
538
- $error = __('No products are available', 'slideshow-gallery');
539
- }
540
- } else {
541
- $error = sprintf(__('You need the %sShopping Cart plugin%s to display products slides.', 'slideshow-gallery'), '<a href="https://tribulant.com/plugins/view/10/wordpress-shopping-cart-plugin" target="_blank">', '</a>');
542
- }
543
- // Featured images
544
- } elseif (!empty($featured)) {
545
- global $post;
546
-
547
- if (empty($orderf) && empty($orderd)) {
548
- $orderf = "date";
549
- $orderd = "DESC";
550
- }
551
-
552
- $args = array(
553
- 'numberposts' => $featurednumber, // should show 5 but only shows 3
554
- 'post_type' => $featuredtype, // posts only
555
- 'meta_key' => '_thumbnail_id', // with thumbnail
556
- 'exclude' => $post -> ID, // exclude current post
557
- 'orderby' => $orderf,
558
- 'order' => $orderd,
559
- );
560
-
561
- if ($posts = get_posts($args)) {
562
- $slides = $posts;
563
- $slideshowtype = "featured";
564
- $content = $this -> render('gallery', array('slides' => $slides, 'unique' => 'featured' . $featuredtype . $featurednumber, 'featured' => true, 'options' => $s, 'frompost' => false), false, 'default');
565
- } else {
566
- $error = sprintf(__('No posts with featured images are available. Ensure your theme includes %s support.', 'slideshow-gallery'), '<code>add_theme_support("post-thumbnails");</code>');
567
- }
568
- // Slides of a gallery
569
- } elseif (!empty($gallery_id)) {
570
- if (!is_array($orderby) || $orderby == "random") {
571
- $orderbystring = "ORDER BY RAND()";
572
- } else {
573
- if (empty($orderf) && empty($orderd)) {
574
- list($orderf, $orderd) = $orderby;
575
- }
576
-
577
- if ($orderf == "order") {
578
- $orderbystring = "ORDER BY " . $this -> GallerySlides() -> table . ".order " . esc_sql($orderd) . "";
579
- } else {
580
- $orderbystring = "ORDER BY " . $this -> Slide() -> table . "." . esc_sql($orderf) . " " . esc_sql($orderd) . "";
581
- }
582
- }
583
-
584
- $slidesquery = "SELECT * FROM " . $this -> Slide() -> table . " LEFT JOIN " . $this -> GallerySlides() -> table .
585
- " ON " . $this -> Slide() -> table . ".id = " . $this -> GallerySlides() -> table . ".slide_id WHERE " .
586
- $this -> GallerySlides() -> table . ".gallery_id = '" . $gallery_id . "' AND (" . $this -> Slide() -> table . ".expiry = NULL OR " . $this -> Slide() -> table . ".expiry > CURDATE() OR " . $this -> Slide() -> table . ".expiry = '0000-00-00') " . $orderbystring;
587
-
588
- $query_hash = md5($slidesquery);
589
- if ($oc_slides = wp_cache_get($query_hash, 'slideshowgallery')) {
590
- $slides = $oc_slides;
591
- } else {
592
- $slides = $wpdb -> get_results($slidesquery);
593
- wp_cache_set($query_hash, $slides, 'slideshowgallery', 0);
594
- }
595
-
596
- if (!empty($slides)) {
597
- $imagespath = $this -> get_option('imagespath');
598
-
599
- foreach ($slides as $skey => $slide) {
600
- $slides[$skey] = $this -> init_class($this -> Slide() -> model, $slide);
601
- //$slides[$skey] -> image_path = $this -> Html -> image_path($slide);
602
- }
603
-
604
- if ($orderby == "random") { shuffle($slides); }
605
- $slideshowtype = "gallery";
606
- $content = $this -> render('gallery', array('slides' => $slides, 'unique' => 'gallery' . $gallery_id . rand(1, 999), 'options' => $s, 'frompost' => false), false, 'default');
607
- } else {
608
- $error = __('No slides are available in this gallery', 'slideshow-gallery');
609
- }
610
- // All slides
611
- } elseif (!empty($custom) || empty($post_id)) {
612
- if (!empty($orderf) && !empty($orderd)) {
613
- $orderby = array($orderf, $orderd);
614
- }
615
-
616
- $slides = $this -> Slide() -> find_all(null, null, $orderby);
617
-
618
- if (!empty($slides)) {
619
- foreach ($slides as $slide_key => $slide) {
620
-
621
- // Check exclude
622
- if (!empty($exclude)) {
623
- $exclude = array_map('trim', explode(',', $exclude));
624
- if (in_array($slide -> id, $exclude)) {
625
- unset($slides[$slide_key]);
626
- }
627
- }
628
-
629
- // Check slide expiration
630
- if (!empty($slide -> expiry)) {
631
- if (strtotime($slide -> expiry) <= time()) {
632
- unset($slides[$slide_key]);
633
- }
634
- }
635
- }
636
- }
637
-
638
- if ($orderby == "random") { shuffle($slides); }
639
- $slideshowtype = "slides";
640
-
641
- if (!empty($slides)) {
642
- $content = $this -> render('gallery', array('slides' => $slides, 'unique' => "custom" . rand(1, 999), 'options' => $s, 'frompost' => false), false, 'default');
643
- } else {
644
- $error = __('No slides are available', 'slideshow-gallery');
645
- }
646
- // Images of a post/page
647
- } else {
648
- global $post;
649
- $pid = (empty($post_id)) ? $post -> ID : $post_id;
650
-
651
- if (!is_numeric($post_id)) {
652
- $pid = $post -> ID;
653
- }
654
-
655
- if (!empty($pid) && $post = get_post($pid)) {
656
- $children_attributes = array(
657
- 'numberposts' => $numberposts,
658
- 'post_parent' => $post -> ID,
659
- 'post_type' => "attachment",
660
- 'post_status' => "any",
661
- 'post_mime_type' => "image",
662
- 'orderby' => ((!empty($orderf)) ? $orderf : "menu_order"),
663
- 'order' => ((!empty($orderd)) ? $orderd : "ASC"),
664
- );
665
-
666
- if ($attachments = get_children($children_attributes)) {
667
- if (!empty($exclude)) {
668
- $exclude = array_map('trim', explode(',', $exclude));
669
-
670
- $a = 0;
671
- foreach ($attachments as $id => $attachment) {
672
- //$attachments[$id] = (object) array_map('esc_attr', (array) $attachment);
673
-
674
- $a++;
675
- if (in_array($a, $exclude)) {
676
- unset($attachments[$id]);
677
- }
678
- }
679
- }
680
-
681
- if ($orderby == "random") { shuffle($attachments); }
682
- $slides = $attachments;
683
-
684
- $slideshowtype = "post";
685
- $content = $this -> render('gallery', array('slides' => $slides, 'unique' => $pid, 'options' => $s, 'frompost' => true), false, 'default');
686
- } else {
687
- $error = __('No attachments on this post/page', 'slideshow-gallery');
688
- }
689
- } else {
690
- $error = __('No post/page ID was specified', 'slideshow-gallery');
691
- }
692
- }
693
-
694
- // Check if this is an RSS Feed?
695
- if (is_feed()) {
696
- $content = '';
697
- ob_start();
698
-
699
- $width = $this -> get_option('thumbwidth');
700
- $height = $this -> get_option('thumbheight');
701
-
702
- if (!empty($slides)) {
703
- switch ($slideshowtype) {
704
- case 'products' :
705
- foreach ($slides as $slide) {
706
- ?>
707
-
708
- <a href="<?php echo get_permalink($slide -> post_id); ?>" title="<?php echo esc_attr($slide -> title); ?>">
709
- <img align="left" hspace="15" src="<?php echo esc_url($this -> Html() -> otf_image_src($slide, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100)); ?>" />
710
- </a>
711
-
712
- <?php
713
- }
714
- break;
715
- case 'gallery' :
716
- foreach ($slides as $slide) {
717
- ?>
718
-
719
- <a href="<?php echo esc_url($slide -> image_path); ?>" title="<?php echo esc_attr($slide -> title); ?>">
720
- <img align="left" hspace="15" src="<?php echo esc_url($this -> Html() -> otf_image_src($slide, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100)); ?>" alt="<?php echo esc_attr($this -> Html -> sanitize($slide -> title)); ?>" />
721
- </a>
722
-
723
- <?php
724
- }
725
- break;
726
- case 'featured' :
727
- foreach ($slides as $slide) {
728
- ?>
729
-
730
- <a href="<?php echo esc_url($slide -> guid); ?>" title="<?php echo esc_attr($slide -> post_title); ?>">
731
- <img align="left" hspace="15" src="<?php echo esc_url($this -> Html() -> otf_image_src($slide, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100)); ?>" alt="<?php echo esc_attr($this -> Html -> sanitize($slide -> post_title)); ?>" />
732
- </a>
733
-
734
- <?php
735
- }
736
- break;
737
- case 'post' :
738
- default :
739
- foreach ($slides as $slide) {
740
- $full_image_href = wp_get_attachment_image_src($slide -> ID, 'full', false);
741
- $full_image_url = wp_get_attachment_url($slide -> ID);
742
-
743
- ?>
744
-
745
- <a href="<?php echo esc_url($full_image_url); ?>" title="<?php echo esc_attr($slide -> post_title); ?>">
746
- <img align="left" hspace="15" src="<?php echo esc_url($this -> Html() -> otf_image_src($slide, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100)); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> post_title); ?>" />
747
- </a>
748
-
749
- <?php
750
- }
751
- break;
752
- }
753
-
754
- ?><hr style="visibility:hidden; height:1px; width:100%; display:block;" /><?php
755
- }
756
-
757
- $content = ob_get_clean();
758
- }
759
-
760
- // Check for error messages
761
- if (!empty($error)) {
762
- $content = '';
763
- $content .= '<p class="slideshow_error slideshow-gallery-error">';
764
- $content .= wp_unslash($error);
765
- $content .= '</p>';
766
- }
767
-
768
- remove_filter('excerpt_more', array($this, 'excerpt_more'));
769
- remove_filter('excerpt_length', array($this, 'excerpt_length'));
770
-
771
- return $content;
772
- }
773
-
774
- function admin_slides() {
775
- global $wpdb;
776
- $method = (!empty($_GET['method'])) ? sanitize_text_field($_GET['method']) : false;
777
- switch ($method) {
778
- case 'delete' :
779
- $id = sanitize_text_field($_GET['id']);
780
- if (!empty($id)) {
781
- if ($this -> Slide() -> delete($id)) {
782
- $msg_type = 'message';
783
- $message = __('Slide has been removed', 'slideshow-gallery');
784
- } else {
785
- $msg_type = 'error';
786
- $message = __('Slide cannot be removed', 'slideshow-gallery');
787
- }
788
- } else {
789
- $msg_type = 'error';
790
- $message = __('No slide was specified', 'slideshow-gallery');
791
- }
792
-
793
- $this -> redirect($this -> referer, $msg_type, $message);
794
- break;
795
- case 'save' :
796
- if (!empty($_POST)) {
797
- check_admin_referer($this -> sections -> slides . '_save');
798
-
799
- if ($this -> Slide() -> save($_POST, true)) {
800
- $message = __('Slide item has been saved', 'slideshow-gallery');
801
-
802
- if (!empty($_POST['continueediting'])) {
803
- $this -> redirect(admin_url('admin.php?page=' . $this -> sections -> slides . '&method=save&id=' . $this -> Slide() -> insertid . '&continueediting=1'), 'message', $message);
804
- } else {
805
- $this -> redirect($this -> url, "message", $message);
806
- }
807
- } else {
808
- $this -> render_err(__('Slide could not be saved', 'slideshow-gallery'));
809
- $this -> render('slides' . DS . 'save', false, true, 'admin');
810
- }
811
- } else {
812
- $this -> Db -> model = $this -> Slide() -> model;
813
- $slideId = (isset($_GET['id'])) ? sanitize_text_field($_GET['id']) : 0;
814
- $this -> Slide() -> find(array('id' => $slideId));
815
- $this -> render('slides' . DS . 'save', false, true, 'admin');
816
- }
817
- break;
818
- case 'save-multiple' :
819
- if (!empty($_POST)) {
820
- check_admin_referer($this -> sections -> slides . '_save-multiple');
821
-
822
- $errors = array();
823
-
824
- if (!empty($_POST['Slide']['slides'])) {
825
- $slides = map_deep($_POST['Slide']['slides'], 'sanitize_text_field');
826
- $galleries = map_deep($_POST['Slide']['galleries'], 'sanitize_text_field');
827
-
828
- $s = 0;
829
-
830
- foreach ($slides as $attachment_id => $slide) {
831
- $slide_data = array(
832
- 'Slide' => array(
833
- 'title' => $slide['title'],
834
- 'description' => $slide['description'],
835
- 'image' => basename($slide['url']),
836
- 'attachment_id' => $attachment_id,
837
- 'type' => 'media',
838
- 'image_url' => $slide['url'],
839
- 'media_file' => $slide['url'],
840
- 'galleries' => $galleries,
841
- )
842
- );
843
-
844
- if (!$this -> Slide() -> save($slide_data)) {
845
- //$errors = array_merge($errors, $this -> Slide() -> errors);
846
- $errors[$s] = $this -> Slide() -> errors;
847
- }
848
-
849
- $s++;
850
- }
851
-
852
- if (empty($errors)) {
853
- $message = __('Slides have been saved', 'slideshow-gallery');
854
- $this -> redirect(admin_url('admin.php?page=' . $this -> sections -> slides), 'message', $message);
855
- }
856
- } else {
857
- $errors[] = __('No slides were selected', 'slideshow-gallery');
858
- }
859
- }
860
-
861
- $this -> render('slides' . DS . 'save-multiple', array('errors' => $errors), true, 'admin');
862
- break;
863
- case 'order' :
864
- if (isset($_GET['gallery_id'])) {
865
- $gallery_id = sanitize_text_field($_GET['gallery_id']);
866
- } else {
867
- $gallery_id = "";
868
- }
869
-
870
- if (!empty($gallery_id)) {
871
- $gallery = $this -> Gallery() -> find(array('id' => $gallery_id));
872
-
873
- $slides = array();
874
- $gsquery = "SELECT gs.slide_id FROM `" . $this -> GallerySlides() -> table . "` gs WHERE `gallery_id` = '" . esc_sql($gallery -> id) . "' ORDER BY gs.order ASC";
875
-
876
- $query_hash = md5($gsquery);
877
- if ($oc_gs = wp_cache_get($query_hash, 'slideshowgallery')) {
878
- $gs = $oc_gs;
879
- } else {
880
- $gs = $wpdb -> get_results($gsquery);
881
- wp_cache_set($query_hash, $gs, 'slideshowgallery', 0);
882
- }
883
-
884
- if (!empty($gs)) {
885
- foreach ($gs as $galleryslide) {
886
- $slides[] = $this -> Slide() -> find(array('id' => $galleryslide -> slide_id));
887
- }
888
- }
889
-
890
- $this -> render('slides' . DS . 'order-gallery', array('gallery' => $gallery, 'slides' => $slides), true, 'admin');
891
- } else {
892
- $slides = $this -> Slide() -> find_all(null, null, array('order', "ASC"));
893
- $this -> render('slides' . DS . 'order', array('slides' => $slides), true, 'admin');
894
- }
895
- break;
896
- default :
897
- $this -> render('slides' . DS . 'index', false, true, 'admin');
898
- break;
899
- }
900
- }
901
-
902
- function admin_galleries() {
903
-
904
- $method = (!empty($_GET['method'])) ? sanitize_text_field($_GET['method']) : false;
905
- switch ($method) {
906
- case 'save' :
907
- if (!empty($_POST)) {
908
- check_admin_referer($this -> sections -> galleries . '_save');
909
-
910
- if ($this -> Gallery() -> save($_POST, true)) {
911
- $message = __('Gallery item has been saved', 'slideshow-gallery');
912
-
913
- if (!empty($_POST['continueediting'])) {
914
- $this -> redirect(admin_url('admin.php?page=' . $this -> sections -> galleries . '&method=save&id=' . $this -> Gallery() -> insertid . '&continueediting=1'), 'message', $message);
915
- } else {
916
- $this -> redirect($this -> url, "message", $message);
917
- }
918
- } else {
919
- $this -> render('galleries' . DS . 'save', false, true, 'admin');
920
- }
921
- } else {
922
- $this -> Db -> model = $this -> Gallery() -> model;
923
- $galleryId = (isset($_GET['id'])) ? sanitize_text_field($_GET['id']) : 0;
924
- $this -> Gallery() -> find(array('id' => $galleryId));
925
- $this -> render('galleries' . DS . 'save', false, true, 'admin');
926
- }
927
- break;
928
- case 'view' :
929
- $this -> Db -> model = $this -> Gallery() -> model;
930
- $gallery = $this -> Gallery() -> find(array('id' => sanitize_text_field($_GET['id'])));
931
- $perpage = (isset($_COOKIE[$this -> pre . 'slidesperpage'])) ? sanitize_text_field($_COOKIE[$this -> pre . 'slidesperpage']) : 25;
932
- $orderfield = (empty($_GET['orderby'])) ? 'modified' : sanitize_text_field($_GET['orderby']);
933
- $orderdirection = (empty($_GET['order'])) ? 'DESC' : strtoupper(sanitize_text_field($_GET['order']));
934
- $order = array($orderfield, $orderdirection);
935
- $data = $this -> paginate('GallerySlides', "*", $this -> sections -> galleries . '&method=view&id=' . $gallery -> id, array('gallery_id' => $gallery -> id), false, $perpage, $order);
936
-
937
- $data['Slide'] = array();
938
- if (!empty($data[$this -> GallerySlides() -> model])) {
939
- foreach ($data[$this -> GallerySlides() -> model] as $galleryslide) {
940
- $this -> Db -> model = $this -> Slide() -> model;
941
- $data['Slide'][] = $this -> Slide() -> find(array('id' => $galleryslide -> slide_id));
942
- }
943
- }
944
-
945
- $this -> render('galleries' . DS . 'view', array('gallery' => $gallery, 'slides' => $data[$this -> Slide() -> model], 'paginate' => $data['Paginate']), true, 'admin');
946
- break;
947
- case 'hardcode' :
948
- $this -> Db -> model = $this -> Gallery() -> model;
949
- $gallery = $this -> Gallery() -> find(array('id' => sanitize_text_field($_GET['id'])));
950
- $this -> render('galleries' . DS . 'hardcode', array('gallery' => $gallery), true, 'admin');
951
- break;
952
- case 'delete' :
953
- $id = sanitize_text_field($_GET['id']);
954
- if (!empty($id)) {
955
- if ($this -> Gallery() -> delete($id)) {
956
- $msg_type = 'message';
957
- $message = __('Gallery has been removed', 'slideshow-gallery');
958
- } else {
959
- $msg_type = 'error';
960
- $message = __('Gallery cannot be removed', 'slideshow-gallery');
961
- }
962
- } else {
963
- $msg_type = 'error';
964
- $message = __('No gallery was specified', 'slideshow-gallery');
965
- }
966
-
967
- $this -> redirect($this -> referer, $msg_type, $message);
968
- break;
969
- default :
970
- $this -> render('galleries' . DS . 'index', false, true, 'admin');
971
- break;
972
- }
973
- }
974
-
975
- function admin_settings() {
976
- global $wpdb;
977
- $method = (!empty($_GET['method'])) ? sanitize_text_field($_GET['method']) : false;
978
-
979
- switch ($method) {
980
- case 'clearlog' :
981
-
982
- check_admin_referer($this -> sections -> settings . '_clearlog');
983
-
984
- @unlink(SLIDESHOW_LOG_FILE);
985
-
986
- $fh = fopen(SLIDESHOW_LOG_FILE, "w");
987
- fwrite($fh, "*** Slideshow Log File *** \r\n\r\n");
988
- fclose($fh);
989
- chmod(SLIDESHOW_LOG_FILE, 0777);
990
-
991
- $msgtype = 'message';
992
- $message = __('Log file has been cleared', 'slideshow-gallery');
993
- $this -> redirect($this -> referer, $msgtype, $message);
994
-
995
- break;
996
- case 'dismiss' :
997
- if (!empty($_GET['dismiss'])) {
998
- $this -> update_option('dismiss_' . sanitize_text_field($_GET['dismiss']), 1);
999
- }
1000
-
1001
- $this -> redirect($this -> referer);
1002
- break;
1003
- case 'checkdb' :
1004
- $this -> check_tables();
1005
-
1006
- if (!empty($this -> models)) {
1007
- foreach ($this -> models as $model) {
1008
- $query = "OPTIMIZE TABLE `" . $this -> {$model}() -> table . "`";
1009
- $wpdb -> query($query);
1010
- }
1011
- }
1012
-
1013
- $this -> redirect($this -> referer, 'message', __('Database tables have been checked and optimized', 'slideshow-gallery'));
1014
- break;
1015
- case 'reset' :
1016
- global $wpdb;
1017
- $query = "DELETE FROM `" . $wpdb -> prefix . "options` WHERE `option_name` LIKE '" . esc_sql($this -> pre) . "%';";
1018
-
1019
- if ($wpdb -> query($query)) {
1020
- $this -> initialize_options();
1021
-
1022
- $message = __('All settings have been reset to their defaults', 'slideshow-gallery');
1023
- $msg_type = 'message';
1024
- $this -> render_msg($message);
1025
- } else {
1026
- $message = __('Settings could not be reset', 'slideshow-gallery');
1027
- $msg_type = 'error';
1028
- $this -> render_err($message);
1029
- }
1030
-
1031
- $this -> redirect($this -> url, $msg_type, $message);
1032
- break;
1033
- default :
1034
- if (!empty($_POST)) {
1035
- check_admin_referer($this -> sections -> settings);
1036
-
1037
- delete_option('tridebugging');
1038
- $this -> delete_option('infohideonmobile');
1039
- $this -> delete_option('autoheight');
1040
- $this -> delete_option('language_external');
1041
- $this -> delete_option('excerptsettings');
1042
- $this -> delete_option('infofade');
1043
- $this -> delete_option('fadedelay');
1044
- $this -> delete_option('infoonhover');
1045
- $this -> delete_option('thumbhideonmobile');
1046
-
1047
- foreach ($_POST as $pkey => $pval) {
1048
- switch ($pkey) {
1049
- case 'styles' :
1050
- $styles = array();
1051
- foreach ($pval as $pvalkey => $pvalval) {
1052
- switch ($pvalkey) {
1053
- case 'layout' :
1054
- if (!$this -> ci_serial_valid()) {
1055
- $styles[$pvalkey] = "specific";
1056
- } else {
1057
- $styles[$pvalkey] = $pvalval;
1058
- }
1059
- break;
1060
- default :
1061
- $styles[$pvalkey] = $pvalval;
1062
- break;
1063
- }
1064
- }
1065
-
1066
- $this -> update_option('styles', $styles);
1067
- break;
1068
- case 'debugging' :
1069
- if (!empty($pval)) {
1070
- update_option('tridebugging', 1);
1071
- }
1072
- break;
1073
- case 'excerpt_readmore' :
1074
- if ($this -> language_do()) {
1075
- $this -> update_option($pkey, $this -> language_join($pval));
1076
- } else {
1077
- $this -> update_option($pkey, $pval);
1078
- }
1079
- break;
1080
- case 'permissions' :
1081
- global $wp_roles;
1082
- $role_names = $wp_roles -> get_names();
1083
-
1084
- if (!empty($_POST['permissions'])) {
1085
- $permissions = map_deep($_POST['permissions'], 'sanitize_text_field');
1086
-
1087
- foreach ($role_names as $role_key => $role_name) {
1088
- foreach ($this -> sections as $section_key => $section_name) {
1089
- $wp_roles -> remove_cap($role_key, 'slideshow_' . $section_key);
1090
-
1091
- if (!empty($permissions[$role_key]) && in_array($section_key, $permissions[$role_key])) {
1092
- $wp_roles -> add_cap($role_key, 'slideshow_' . $section_key);
1093
- }
1094
-
1095
- if ($role_key == "administrator") {
1096
- $wp_roles -> add_cap("administrator", 'slideshow_' . $section_key);
1097
- $permissions[$role_key][] = $section_key;
1098
- }
1099
- }
1100
- }
1101
- }
1102
-
1103
- $this -> update_option('permissions', $permissions);
1104
- break;
1105
- default :
1106
- $this -> update_option($pkey, $pval);
1107
- break;
1108
- }
1109
- }
1110
-
1111
- if (!$this -> ci_serial_valid()) {
1112
- $this -> update_option('effect', "slide");
1113
- $this -> update_option('easing', "swing");
1114
- $this -> update_option('infodelay', "0");
1115
- $this -> delete_option('infohideonmobile');
1116
- $this -> delete_option('excerptsettings');
1117
- $this -> update_option('imagesthickbox', "N");
1118
- $this -> delete_option('thumbhideonmobile');
1119
- }
1120
-
1121
- $message = __('Settings has been saved', 'slideshow-gallery');
1122
- $this -> render_msg($message);
1123
- }
1124
-
1125
- $this -> render('settings', false, true, 'admin');
1126
- break;
1127
- }
1128
- }
1129
-
1130
- function admin_settings_updates() {
1131
- $method = (!empty($_GET['method'])) ? sanitize_text_field($_GET['method']) : false;
1132
- switch ($method) {
1133
- case 'check' :
1134
- delete_transient('slideshow_update_info');
1135
- $this -> redirect($this -> referer);
1136
- break;
1137
- }
1138
-
1139
- $this -> render('settings-updates', false, true, 'admin');
1140
- }
1141
-
1142
- function activation_hook() {
1143
- $this -> add_option('activation_redirect', true);
1144
- }
1145
-
1146
- function custom_redirect() {
1147
-
1148
- $method = (!empty($_GET['slideshow_method'])) ? sanitize_text_field($_GET['slideshow_method']) : false;
1149
- if (!empty($method)) {
1150
- switch ($method) {
1151
- case 'hidemessage' :
1152
- if (!empty($_GET['message'])) {
1153
- switch ($_GET['message']) {
1154
- case 'upgradetopro' :
1155
- $this -> update_option('hidemessage_upgradetopro', true);
1156
- break;
1157
- case 'ratereview' :
1158
- $this -> delete_option('showmessage_ratereview');
1159
- $this -> redirect($this -> referer);
1160
- break;
1161
- }
1162
- }
1163
- break;
1164
- case 'hideupdate' :
1165
- if (!empty($_GET['version'])) {
1166
- $this -> update_option('hideupdate', sanitize_text_field($_GET['version']));
1167
- $this -> redirect($this -> referer);
1168
- }
1169
- break;
1170
- }
1171
- }
1172
-
1173
- $activation_redirect = $this -> get_option('activation_redirect');
1174
- if (is_admin() && !empty($activation_redirect)) {
1175
- $this -> delete_option('activation_redirect');
1176
- wp_cache_flush();
1177
- wp_redirect(admin_url('index.php?page=' . $this -> sections -> about));
1178
- }
1179
- }
1180
- }
1181
- }
1182
-
1183
- if (!function_exists('SG')) {
1184
- function SG($param = null) {
1185
- return new SlideshowGallery($param);
1186
- }
1187
- }
1188
-
1189
- //initialize a Gallery object
1190
- global $Gallery;
1191
- $Gallery = new SlideshowGallery();
1192
- register_activation_hook(plugin_basename(__FILE__), array($Gallery, 'initialize_options'));
1193
- register_activation_hook(plugin_basename(__FILE__), array($Gallery, 'activation_hook'));
1194
-
1195
- if (!function_exists('slideshow')) {
1196
- function slideshow($output = true, $gallery_id = null, $post_id = null, $params = array()) {
1197
- $params['gallery_id'] = $gallery_id;
1198
- $params['post_id'] = $post_id;
1199
-
1200
- $Gallery = new SlideshowGallery();
1201
- $content = $Gallery -> embed($params, false);
1202
-
1203
- if ($output == true) {
1204
- echo wp_kses_post($content);
1205
- } else {
1206
- return $content;
1207
- }
1208
- }
1209
- }
1210
-
1211
- ?>
1
+ <?php
2
+
3
+ /*
4
+ Plugin Name: Slideshow Gallery
5
+ Plugin URI: https://tribulant.com/plugins/view/13/wordpress-slideshow-gallery
6
+ Author: Tribulant
7
+ Author URI: https://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. See the <a href="https://tribulant.com/docs/wordpress-slideshow-gallery/1758/wordpress-slideshow-gallery-plugin/" target="_blank">online documentation</a> for instructions on using and embedding slideshow galleries. Upgrade to the premium version to remove all limitations.
9
+ Version: 1.7.5
10
+ License: GNU General Public License v2 or later
11
+ License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
+ Tags: slideshow gallery, slideshow, gallery, slider, jquery, bfithumb, galleries, photos, images
13
+ Text Domain: slideshow-gallery
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';
22
+ if (file_exists($path)) {
23
+ require_once(dirname(__FILE__) . DS . 'includes' . DS . 'checkinit.php');
24
+ require_once(dirname(__FILE__) . DS . 'includes' . DS . 'constants.php');
25
+ require_once($path);
26
+ require_once(dirname(__FILE__) . DS . 'includes' . DS . 'errorhandler.php');
27
+ require_once(dirname(__FILE__) . DS . 'vendors' . DS . 'otf_regen_thumbs.php');
28
+ }
29
+
30
+ if (!class_exists('SlideshowGallery')) {
31
+ class SlideshowGallery extends GalleryPlugin {
32
+
33
+ function __construct() {
34
+ $url = explode("&", $_SERVER['REQUEST_URI']);
35
+ $this -> url = $url[0];
36
+ $this -> referer = (empty($_SERVER['HTTP_REFERER'])) ? $this -> url : $_SERVER['HTTP_REFERER'];
37
+ $this -> plugin_name = basename(dirname(__FILE__));
38
+ $this -> plugin_file = plugin_basename(__FILE__);
39
+ $this -> register_plugin($this -> plugin_name, __FILE__);
40
+ $this -> errorhandler = new SlideshowErrorHandler();
41
+
42
+ //WordPress action hooks
43
+ $this -> add_action('plugins_loaded');
44
+ $this -> add_action('wp_head');
45
+ $this -> add_action('wp_footer');
46
+ $this -> add_action('admin_menu');
47
+ $this -> add_action('admin_head');
48
+ $this -> add_action('admin_notices');
49
+ $this -> add_action('wp_print_styles', 'print_styles');
50
+ $this -> add_action('admin_print_styles', 'print_styles');
51
+ $this -> add_action('wp_print_scripts', 'print_scripts');
52
+ $this -> add_action('admin_print_scripts', 'print_scripts');
53
+ $this -> add_action('init', 'init_textdomain', 10, 1);
54
+ $this -> add_action('admin_init', 'custom_redirect', 1, 1);
55
+
56
+ //WordPress Ajax hooks
57
+ $this -> add_action('wp_ajax_slideshow_slides_order', 'ajax_slides_order', 10, 1);
58
+ $this -> add_action('wp_ajax_slideshow_tinymce', 'ajax_tinymce', 10, 1);
59
+
60
+ //WordPress filter hooks
61
+ $this -> add_filter('mce_buttons');
62
+ $this -> add_filter('mce_external_plugins');
63
+ $this -> add_filter("plugin_action_links_" . $this -> plugin_file, 'plugin_action_links', 10, 4);
64
+
65
+ $this -> add_action('slideshow_ratereviewhook', 'ratereview_hook');
66
+
67
+ if (!is_admin() || wp_doing_ajax()) {
68
+ add_shortcode('slideshow', array($this, 'embed'));
69
+ add_shortcode('tribulant_slideshow', array($this, 'embed'));
70
+ }
71
+
72
+ $this -> updating_plugin();
73
+ }
74
+
75
+ function excerpt_more($more = null) {
76
+ global $slideshow_post;
77
+ $excerptsettings = $this -> get_option('excerptsettings');
78
+ if (!empty($excerptsettings)) {
79
+ $excerpt_readmore = $this -> get_option('excerpt_readmore');
80
+ if (!empty($excerpt_readmore)) {
81
+ $more = ' <a href="' . get_permalink($slideshow_post -> ID) . '">' . esc_html($excerpt_readmore) . '</a>';
82
+ }
83
+ }
84
+
85
+ return $more;
86
+ }
87
+
88
+ function excerpt_length($length = null) {
89
+ $excerptsettings = $this -> get_option('excerptsettings');
90
+ if (!empty($excerptsettings)) {
91
+ $excerpt_length = $this -> get_option('excerpt_length');
92
+ if (!empty($excerpt_length)) {
93
+ $length = $excerpt_length;
94
+ }
95
+ }
96
+
97
+ return $length;
98
+ }
99
+
100
+ function plugin_action_links($actions = null, $plugin_file = null, $plugin_data = null, $context = null) {
101
+ $this_plugin = plugin_basename(__FILE__);
102
+
103
+ if (!empty($plugin_file) && $plugin_file == $this_plugin) {
104
+ //$actions[] = '<a href="" onclick="jQuery.colorbox({href:ajaxurl + \'?action=slideshow_serialkey&security=' . wp_create_nonce('serialkey') . '\'}); return false;" id="slideshow_submitseriallink"><i class="fa fa-key fa-fw"></i> ' . __('Serial Key', 'slideshow-gallery') . '</a>';
105
+ $actions[] = '<a href="' . admin_url('admin.php?page=' . $this -> sections -> settings) . '"><i class="fa fa-cog fa-fw"></i> ' . __('Settings', 'slideshow-gallery') . '</a>';
106
+
107
+ /*if ($update = $this -> vendor('update')) {
108
+ $version_info = $update -> get_version_info();
109
+ if (!empty($version_info['dtype']) && $version_info['dtype'] == "single") {
110
+ $actions[] = '<a href="https://tribulant.com/items/upgrade/' . $version_info['item_id'] . '" target="_blank"><i class="fa fa-level-up fa-fw"></i> ' . __('Upgrade', 'slideshow-gallery') . '</a>';
111
+ }
112
+ }*/
113
+ }
114
+
115
+ return $actions;
116
+ }
117
+
118
+ function init() {
119
+ }
120
+
121
+ function init_textdomain() {
122
+ $locale = get_locale();
123
+
124
+ if (!empty($locale)) {
125
+ if ($locale == "ja" || $locale == "ja_JP") { setlocale(LC_ALL, "ja_JP.UTF8"); }
126
+ } else {
127
+ setlocale(LC_ALL, apply_filters('slideshow_setlocale', $locale));
128
+ }
129
+
130
+ $mo_file = $this -> plugin_name . '-' . $locale . '.mo';
131
+ $language_external = $this -> get_option('language_external');
132
+
133
+ if (!empty($language_external)) {
134
+ if (function_exists('load_textdomain')) {
135
+ load_textdomain($this -> plugin_name, WP_LANG_DIR . DS . $this -> plugin_name . DS . $mo_file);
136
+ }
137
+ } else {
138
+ if (function_exists('load_plugin_textdomain')) {
139
+ load_plugin_textdomain($this -> plugin_name, false, dirname(plugin_basename(__FILE__)) . DS . 'languages' . DS);
140
+ }
141
+ }
142
+ }
143
+
144
+ function plugins_loaded() {
145
+ $this -> ci_initialize();
146
+
147
+ if ($this -> language_do()) {
148
+ add_filter('gettext', array($this, 'language_useordefault'), 0);
149
+ }
150
+ }
151
+
152
+ function wp_head() {
153
+ global $slideshow_javascript, $slideshow_css;
154
+ $slideshow_javascript = array();
155
+ $slideshow_css = array();
156
+
157
+ $this -> render('head', false, true, 'default');
158
+ }
159
+
160
+ function wp_footer() {
161
+ global $slideshow_javascript, $slideshow_css;
162
+ $jsoutput = $this -> get_option('jsoutput');
163
+
164
+ if (!empty($slideshow_javascript)) {
165
+ if (!empty($jsoutput) && $jsoutput == "footerglobal") {
166
+ ?><!-- Slideshow Gallery Javascript BEG --><?php
167
+
168
+ foreach ($slideshow_javascript as $javascript) {
169
+ //echo wp_unslash($javascript);
170
+ echo html_entity_decode(str_replace("\'", "'", str_replace('\n', '', esc_js($javascript))));
171
+ }
172
+
173
+ ?><!-- Slideshow Gallery Javascript END --><?php
174
+ }
175
+ }
176
+
177
+ if (!empty($slideshow_css)) {
178
+ if (!empty($jsoutput) && $jsoutput == "footerglobal") {
179
+ ?><!-- Slideshow Gallery CSS BEG --><?php
180
+
181
+ foreach ($slideshow_css as $css) {
182
+ //echo wp_unslash($css);
183
+ echo html_entity_decode(esc_html($css));
184
+ }
185
+
186
+ ?><!-- Slideshow Gallery CSS END --><?php
187
+ }
188
+ }
189
+ }
190
+
191
+ function admin_menu() {
192
+ //$update_icon = ($this -> has_update()) ? ' <span class="update-plugins count-1"><span class="update-count">1</span></span>' : '';
193
+ $update_icon = '';
194
+ $this -> check_roles();
195
+
196
+ add_menu_page(__('Slideshow', 'slideshow-gallery'), __('Slideshow', 'slideshow-gallery') . $update_icon, 'slideshow_slides', $this -> sections -> slides, array($this, 'admin_slides'), false, "26.113");
197
+ $this -> menus['slideshow-slides'] = add_submenu_page($this -> sections -> slides, __('Manage Slides', 'slideshow-gallery'), __('Manage Slides', 'slideshow-gallery'), 'slideshow_slides', $this -> sections -> slides, array($this, 'admin_slides'));
198
+ $this -> menus['slideshow-galleries'] = add_submenu_page($this -> sections -> slides, __('Manage Galleries', 'slideshow-gallery'), __('Manage Galleries', 'slideshow-gallery'), 'slideshow_galleries', $this -> sections -> galleries, array($this, 'admin_galleries'));
199
+ $this -> menus['slideshow-settings'] = add_submenu_page($this -> sections -> slides, __('Settings', 'slideshow-gallery'), __('Settings', 'slideshow-gallery'), 'slideshow_settings', $this -> sections -> settings, array($this, 'admin_settings'));
200
+ //$this -> menus['slideshow-settings-updates'] = add_submenu_page($this -> sections -> slides, __('Updates', 'slideshow-gallery'), __('Updates', 'slideshow-gallery') . $update_icon, 'slideshow_settings_updates', $this -> sections -> settings_updates, array($this, 'admin_settings_updates'));
201
+
202
+ if (!$this -> ci_serial_valid()) {
203
+ //$this -> menus['slideshow-submitserial'] = add_submenu_page($this -> sections -> slides, __('Submit Serial Key', 'slideshow-gallery'), __('Submit Serial Key', 'slideshow-gallery'), 'slideshow_submitserial', $this -> sections -> submitserial, array($this, 'admin_submitserial'));
204
+ }
205
+
206
+ add_action("load-" . $this -> menus['slideshow-slides'], array($this, 'screen_options_slides'));
207
+ add_action("load-" . $this -> menus['slideshow-galleries'], array($this, 'screen_options_galleries'));
208
+
209
+ do_action('slideshow_admin_menu', $this -> menus);
210
+
211
+ add_action('admin_head-' . $this -> menus['slideshow-settings'], array($this, 'admin_head_gallery_settings'));
212
+
213
+ add_dashboard_page(sprintf('Slideshow Gallery %s', $this -> version), sprintf('Slideshow Gallery %s', $this -> version), 'read', $this -> sections -> about, array($this, 'slideshow_gallery_about'));
214
+ remove_submenu_page('index.php', $this -> sections -> about);
215
+ }
216
+
217
+ function set_screen_option($status = null, $option = null, $value = null) {
218
+ return $value;
219
+ }
220
+
221
+ function removable_query_args($removable_query_args = array()) {
222
+
223
+ $removable_query_args[] = 'Galleryupdated';
224
+ $removable_query_args[] = 'Gallerymessage';
225
+
226
+ return $removable_query_args;
227
+ }
228
+
229
+ function screen_options_slides() {
230
+ $screen = get_current_screen();
231
+
232
+ // get out of here if we are not on our settings page
233
+ if (!is_object($screen) || $screen -> id != $this -> menus['slideshow-slides']) {
234
+ return;
235
+ }
236
+
237
+ $args = array(
238
+ 'label' => __('Slides per page', 'slideshow-gallery'),
239
+ 'default' => 15,
240
+ 'option' => 'slideshow_slides_perpage'
241
+ );
242
+
243
+ add_screen_option('per_page', $args);
244
+
245
+ require_once $this -> plugin_base() . DS . 'includes' . DS . 'class.slide-list-table.php';
246
+ $Slide_List_Table = new Slide_List_Table;
247
+ }
248
+
249
+ function screen_options_galleries() {
250
+ $screen = get_current_screen();
251
+
252
+ // get out of here if we are not on our settings page
253
+ if (!is_object($screen) || $screen -> id != $this -> menus['slideshow-galleries']) {
254
+ return;
255
+ }
256
+
257
+ $args = array(
258
+ 'label' => __('Galleries per page', 'slideshow-gallery'),
259
+ 'default' => 15,
260
+ 'option' => 'slideshow_galleries_perpage'
261
+ );
262
+
263
+ add_screen_option('per_page', $args);
264
+
265
+ require_once $this -> plugin_base() . DS . 'includes' . DS . 'class.gallery-list-table.php';
266
+ $Gallery_List_Table = new Gallery_List_Table;
267
+ }
268
+
269
+ function default_hidden_columns($hidden = null, $screen = null) {
270
+ if ($current_screen = get_current_screen()) {
271
+ if ($current_screen -> id == $screen -> id) {
272
+ switch ($screen -> id) {
273
+ case $this -> menus['slideshow-slides'] :
274
+ $hidden = array(
275
+ 'id',
276
+ 'link',
277
+ 'expiry',
278
+ 'order',
279
+ );
280
+ break;
281
+ case $this -> menus['slideshow-galleries'] :
282
+ $hidden = array(
283
+ 'id',
284
+ );
285
+ break;
286
+ }
287
+ }
288
+ }
289
+
290
+ return $hidden;
291
+ }
292
+
293
+ function slideshow_gallery_about() {
294
+ $this -> render('about', false, true, 'admin');
295
+ }
296
+
297
+ function admin_head() {
298
+ $this -> render('head', false, true, 'admin');
299
+ }
300
+
301
+ function admin_head_gallery_settings() {
302
+ add_meta_box('submitdiv', __('Save Settings', 'slideshow-gallery'), array($this -> Metabox, "settings_submit"), $this -> menus['slideshow-settings'], 'side', 'core');
303
+ add_meta_box('pluginsdiv', __('Recommended Plugin', 'slideshow-gallery'), array($this -> Metabox, "settings_plugins"), $this -> menus['slideshow-settings'], 'side', 'core');
304
+ add_meta_box('aboutdiv', __('About This Plugin', 'slideshow-gallery') . $this -> Html -> help(__('More about this plugin and the creators of it', 'slideshow-gallery')), array($this -> Metabox, "settings_about"), $this -> menus['slideshow-settings'], 'side', 'core');
305
+ add_meta_box('generaldiv', __('General Settings', 'slideshow-gallery') . $this -> Html -> help(__('General settings for the inner workings and some default behaviours', 'slideshow-gallery')), array($this -> Metabox, "settings_general"), $this -> menus['slideshow-settings'], 'normal', 'core');
306
+ add_meta_box('postsdiv', __('Posts/Pages Settings', 'slideshow-gallery'), array($this -> Metabox, "settings_postspages"), $this -> menus['slideshow-settings'], 'normal', 'core');
307
+ add_meta_box('linksimagesdiv', __('Links &amp; Images Overlay', 'slideshow-gallery') . $this -> Html -> help(__('Configure the way that slides with links are opened', 'slideshow-gallery')), array($this -> Metabox, "settings_linksimages"), $this -> menus['slideshow-settings'], 'normal', 'core');
308
+ add_meta_box('stylesdiv', __('Appearance &amp; Styles', 'slideshow-gallery') . $this -> Html -> help(__('Change the way the slideshows look so that it suits your needs', 'slideshow-gallery')), array($this -> Metabox, "settings_styles"), $this -> menus['slideshow-settings'], 'normal', 'core');
309
+ add_meta_box('techdiv', __('Technical Settings', 'slideshow-gallery'), array($this -> Metabox, "settings_tech"), $this -> menus['slideshow-settings'], 'normal', 'core');
310
+ add_meta_box('wprelateddiv', __('WordPress Related', 'slideshow-gallery') . $this -> Html -> help(__('Settings specifically related to WordPress', 'slideshow-gallery')), array($this -> Metabox, "settings_wprelated"), $this -> menus['slideshow-settings'], 'normal', 'core');
311
+
312
+ global $post;
313
+ do_action('do_meta_boxes', $this -> menus['slideshow-settings'], 'normal', $post);
314
+ do_action('do_meta_boxes', $this -> menus['slideshow-settings'], 'side', $post);
315
+ }
316
+
317
+ function admin_submitserial() {
318
+ $success = false;
319
+
320
+ if (!empty($_POST)) {
321
+ check_admin_referer($this -> sections -> submitserial);
322
+
323
+ $serial = sanitize_text_field($_REQUEST['serial']);
324
+
325
+ if (empty($serial)) { $errors[] = __('Please fill in a serial key.', 'slideshow-gallery'); }
326
+ else {
327
+ $this -> update_option('serialkey', $serial); //update the DB option
328
+ $this -> delete_all_cache('all');
329
+
330
+ if (!$this -> ci_serial_valid()) { $errors[] = __('Serial key is invalid, please try again.', 'slideshow-gallery'); }
331
+ else {
332
+ delete_transient($this -> pre . 'update_info');
333
+ $success = true;
334
+ $this -> redirect(admin_url('admin.php?page=' . $this -> sections -> welcome));
335
+ }
336
+ }
337
+ }
338
+
339
+ $this -> render('settings-submitserial', array('success' => $success, 'errors' => $errors), true, 'admin');
340
+ }
341
+
342
+ function admin_notices() {
343
+
344
+ if (is_admin()) {
345
+ $this -> check_uploaddir();
346
+
347
+ $message = (!empty($_GET[$this -> pre . 'message'])) ? wp_kses_html_error($_GET[$this -> pre . 'message']) : false;
348
+ if (!empty($message)) {
349
+ $msg_type = (!empty($_GET[$this -> pre . 'updated'])) ? 'msg' : 'err';
350
+ call_user_func(array($this, 'render_' . $msg_type), $message);
351
+ }
352
+
353
+ $showmessage_ratereview = $this -> get_option('showmessage_ratereview');
354
+ if (!empty($showmessage_ratereview)) {
355
+ $message = sprintf(esc_html__('You have been using the %s for %s days or more. Please consider to %s it or say it %s on %s.', 'slideshow-gallery'),
356
+ '<a href="https://wordpress.org/plugins/slideshow-gallery/" target="_blank">Tribulant Slideshow Gallery plugin</a>',
357
+ $showmessage_ratereview,
358
+ '<a class="button" href="https://wordpress.org/support/plugin/slideshow-gallery/reviews/?rate=5#new-post" target="_blank"><i class="fa fa-star"></i> Rate</a>',
359
+ '<a class="button" href="https://wordpress.org/plugins/slideshow-gallery/?compatibility[version]=' . get_bloginfo('version') . '&compatibility[topic_version]=' . $this -> version . '&compatibility[compatible]=1" target="_blank"><i class="fa fa-check"></i> Works</a>',
360
+ '<a href="https://wordpress.org/plugins/slideshow-gallery/" target="_blank">WordPress.org</a>');
361
+
362
+ $dismissable = admin_url('admin.php?page=' . $this -> sections -> settings . '&slideshow_method=hidemessage&message=ratereview');
363
+ $this -> render_msg($message, $dismissable, false);
364
+ }
365
+
366
+ /* Serial key submission message */
367
+ if (isset($_GET['page'])) {
368
+ $page = sanitize_text_field($_GET['page']);
369
+ } else {
370
+ $page = "";
371
+ }
372
+
373
+ if (!$this -> ci_serial_valid() && (empty($page) || $page != $this -> sections -> submitserial)) {
374
+ $hidemessage_upgradetopro = $this -> get_option('hidemessage_upgradetopro');
375
+
376
+ if (empty($hidemessage_upgradetopro)) {
377
+ $message = sprintf(esc_html__('You are using Slideshow Gallery LITE. Take your slideshows to the next level with %s. Already purchased? %s.', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">Slideshow Gallery PRO</a>', '<a href="https://tribulant.com/docs/wordpress-slideshow-gallery/1758" target="_blank">See instructions to install PRO</a>');
378
+ $message .= ' <a class="button button-primary" href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '"><i class="fa fa-check"></i> ' . __('Upgrade to PRO', 'slideshow-gallery') . '</a>';
379
+ $message .= ' <a class="button button-secondary" href="' . admin_url('admin.php?page=' . $this -> sections -> welcome . '&slideshow_method=hidemessage&message=upgradetopro') . '"><i class="fa fa-times"></i> ' . __('Hide this message', 'slideshow-gallery') . '</a>';
380
+ $dismissable = admin_url('admin.php?page=' . $this -> sections -> welcome . '&slideshow_method=hidemessage&message=upgradetopro');
381
+ $this -> render_msg($message, $dismissable, false);
382
+
383
+ ?>
384
+
385
+ <script type="text/javascript">
386
+ jQuery(document).ready(function(e) {
387
+ jQuery('#<?php echo esc_attr($this -> pre); ?>submitseriallink').click(function() {
388
+ jQuery.colorbox({href:ajaxurl + "?action=slideshow_serialkey&security=<?php echo wp_create_nonce('serialkey'); ?>"});
389
+ return false;
390
+ });
391
+ });
392
+ </script>
393
+
394
+ <?php
395
+ }
396
+ }
397
+
398
+ // Is an Update Available?
399
+ /*if (!empty($page) && in_array($page, (array) $this -> sections)) {
400
+ if (apply_filters('slideshow_updates', true)) {
401
+ if (current_user_can('edit_plugins') && $this -> has_update() && (empty($page) || (!empty($page) && $page != $this -> sections -> settings_updates))) {
402
+ $hideupdate = $this -> get_option('hideupdate');
403
+ if (empty($hideupdate) || (!empty($hideupdate) && version_compare($this -> version, $hideupdate, '>'))) {
404
+ $update = $this -> vendor('update');
405
+ $update_info = $update -> get_version_info();
406
+ $this -> render('update', array('update_info' => $update_info), true, 'admin');
407
+ }
408
+ }
409
+ }
410
+ }*/
411
+ }
412
+
413
+ }
414
+
415
+ function mce_buttons($buttons) {
416
+ array_push($buttons, "separator", "gallery");
417
+ return $buttons;
418
+ }
419
+
420
+ function mce_external_plugins($plugins) {
421
+ $plugins['gallery'] = $this -> url() . '/js/tinymce/editor_plugin.js';
422
+ return $plugins;
423
+ }
424
+
425
+ function slideshow($output = true, $post_id = null, $exclude = null) {
426
+ $params['post_id'] = $post_id;
427
+ $params['exclude'] = $exclude;
428
+
429
+ $content = $this -> embed($params, false);
430
+
431
+ if ($output == true) {
432
+ echo wp_kses_post($content);
433
+ } else {
434
+ return $content;
435
+ }
436
+ }
437
+
438
+ function embed($atts = array(), $content = null) {
439
+ //global variables
440
+ global $wpdb;
441
+ $styles = $this -> get_option('styles');
442
+
443
+ $effect = $this -> get_option('effect');
444
+ $slide_direction = $this -> get_option('slide_direction');
445
+ $easing = $this -> get_option('easing');
446
+ $autoheight = $this -> get_option('autoheight');
447
+
448
+ $this -> add_filter('excerpt_more', 'excerpt_more', 999, 1);
449
+ $this -> add_filter('excerpt_length', 'excerpt_length', 999, 1);
450
+
451
+ // default shortcode parameters
452
+ $defaults = array(
453
+ 'source' => "slides",
454
+ 'products' => false,
455
+ 'productsnumber' => 10,
456
+ 'featured' => false,
457
+ 'featurednumber' => 10,
458
+ 'featuredtype' => "post",
459
+ 'gallery_id' => false,
460
+ 'orderby' => array('order', "ASC"),
461
+ 'orderf' => false, // order field
462
+ 'orderd' => false, // order direction (ASC/DESC)
463
+ 'resizeimages' => (($styles['resizeimages'] == "Y") ? "true" : "false"),
464
+ 'imagesoverlay' => (($this -> get_option('imagesthickbox') == "Y") ? "true" : "false"),
465
+ 'layout' => ($styles['layout']),
466
+ 'width' => ($styles['width']),
467
+ 'height' => ((empty($autoheight)) ? $styles['height'] : false),
468
+ 'autoheight' => ((!empty($autoheight)) ? "true" : "false"),
469
+ 'autoheight_max' => ($this -> get_option('autoheight_max')),
470
+ 'resheight' => ($styles['resheight']),
471
+ 'resheighttype' => ($styles['resheighttype']),
472
+ 'auto' => (($this -> get_option('autoslide') == "Y") ? "true" : "false"),
473
+ 'effect' => ((empty($effect) || (!empty($effect) && $effect == "fade")) ? 'fade' : $effect),
474
+ 'slide_direction' => ((empty($slide_direction) || (!empty($slide_direction) && $slide_direction == "lr")) ? 'lr' : 'tb'),
475
+ 'easing' => ((empty($easing)) ? 'swing' : $easing),
476
+ 'autospeed' => ($this -> get_option('autospeed')),
477
+ 'alwaysauto' => ($this -> get_option('alwaysauto')),
478
+ 'fadespeed' => ($this -> get_option('fadespeed')),
479
+ 'shownav' => (($this -> get_option('shownav') == "Y") ? "true" : "false"),
480
+ 'navopacity' => ($this -> get_option('navopacity')),
481
+ 'navhoveropacity' => ($this -> get_option('navhover')),
482
+ 'showinfo' => (($this -> get_option('information') == "Y") ? "true" : "false"),
483
+ 'infoheadingcontent' => "title",
484
+ 'infoposition' => ($this -> get_option('infoposition')),
485
+ 'infoonhover' => ($this -> get_option('infoonhover')),
486
+ 'infospeed' => ($this -> get_option('infospeed')),
487
+ 'infodelay' => ($this -> get_option('infodelay')),
488
+ 'infofade' => ($this -> get_option ('infofade')),
489
+ 'infofadedelay' => ($this -> get_option ('infofadedelay')),
490
+ 'showthumbs' => (($this -> get_option('thumbnails') == "Y") ? "true" : "false"),
491
+ 'thumbsposition' => ($this -> get_option('thumbposition')),
492
+ 'thumbsborder' => ($styles['thumbactive']),
493
+ 'thumbsspeed' => ($this -> get_option('thumbscrollspeed')),
494
+ 'thumbsspacing' => ($this -> get_option('thumbspacing')),
495
+ 'post_id' => null,
496
+ 'numberposts' => "-1",
497
+ 'exclude' => null,
498
+ 'custom' => null,
499
+ );
500
+
501
+ $s = shortcode_atts($defaults, $atts);
502
+ extract($s);
503
+
504
+ $slideshowtype = false;
505
+
506
+ if (!empty($products)) {
507
+ include_once(ABSPATH . 'wp-admin/includes/plugin.php');
508
+ if (is_plugin_active('wp-checkout' . DS . 'wp-checkout.php')) {
509
+ $slides = array();
510
+
511
+ if (empty($orderf) && empty($orderd)) {
512
+ $orderf = "created";
513
+ $orderd = "DESC";
514
+ }
515
+
516
+ if (class_exists('wpCheckout')) {
517
+ if ($wpCheckout = new wpCheckout()) {
518
+ global $wpcoDb, $Product;
519
+ $wpcoDb -> model = $Product -> model;
520
+ $productstype = $products;
521
+
522
+ switch ($productstype) {
523
+ case 'latest' :
524
+ $products = $wpcoDb -> find_all(false, false, array($orderf, $orderd), $productsnumber);
525
+ break;
526
+ case 'featured' :
527
+ $products = $wpcoDb -> find_all(array('featured' => "1"), false, array($orderf, $orderd), $productsnumber);
528
+ break;
529
+ }
530
+ }
531
+ }
532
+
533
+ if (!empty($products)) {
534
+ $slides = $products;
535
+ $slideshowtype = "products";
536
+ $content = $this -> render('gallery', array('slides' => $slides, 'unique' => 'products' . $productstype . $productsnumber, 'products' => true, 'options' => $s, 'frompost' => false), false, 'default');
537
+ } else {
538
+ $error = __('No products are available', 'slideshow-gallery');
539
+ }
540
+ } else {
541
+ $error = sprintf(__('You need the %sShopping Cart plugin%s to display products slides.', 'slideshow-gallery'), '<a href="https://tribulant.com/plugins/view/10/wordpress-shopping-cart-plugin" target="_blank">', '</a>');
542
+ }
543
+ // Featured images
544
+ } elseif (!empty($featured)) {
545
+ global $post;
546
+
547
+ if (empty($orderf) && empty($orderd)) {
548
+ $orderf = "date";
549
+ $orderd = "DESC";
550
+ }
551
+
552
+ $args = array(
553
+ 'numberposts' => $featurednumber, // should show 5 but only shows 3
554
+ 'post_type' => $featuredtype, // posts only
555
+ 'meta_key' => '_thumbnail_id', // with thumbnail
556
+ 'exclude' => $post -> ID, // exclude current post
557
+ 'orderby' => $orderf,
558
+ 'order' => $orderd,
559
+ );
560
+
561
+ if ($posts = get_posts($args)) {
562
+ $slides = $posts;
563
+ $slideshowtype = "featured";
564
+ $content = $this -> render('gallery', array('slides' => $slides, 'unique' => 'featured' . $featuredtype . $featurednumber, 'featured' => true, 'options' => $s, 'frompost' => false), false, 'default');
565
+ } else {
566
+ $error = sprintf(__('No posts with featured images are available. Ensure your theme includes %s support.', 'slideshow-gallery'), '<code>add_theme_support("post-thumbnails");</code>');
567
+ }
568
+ // Slides of a gallery
569
+ } elseif (!empty($gallery_id)) {
570
+ if (!is_array($orderby) || $orderby == "random") {
571
+ $orderbystring = "ORDER BY RAND()";
572
+ } else {
573
+ if (empty($orderf) && empty($orderd)) {
574
+ list($orderf, $orderd) = $orderby;
575
+ }
576
+
577
+ if ($orderf == "order") {
578
+ $orderbystring = "ORDER BY " . $this -> GallerySlides() -> table . ".order " . esc_sql($orderd) . "";
579
+ } else {
580
+ $orderbystring = "ORDER BY " . $this -> Slide() -> table . "." . esc_sql($orderf) . " " . esc_sql($orderd) . "";
581
+ }
582
+ }
583
+
584
+ $slidesquery = "SELECT * FROM " . $this -> Slide() -> table . " LEFT JOIN " . $this -> GallerySlides() -> table .
585
+ " ON " . $this -> Slide() -> table . ".id = " . $this -> GallerySlides() -> table . ".slide_id WHERE " .
586
+ $this -> GallerySlides() -> table . ".gallery_id = '" . $gallery_id . "' AND (" . $this -> Slide() -> table . ".expiry = NULL OR " . $this -> Slide() -> table . ".expiry > CURDATE() OR " . $this -> Slide() -> table . ".expiry = '0000-00-00') " . $orderbystring;
587
+
588
+ $query_hash = md5($slidesquery);
589
+ if ($oc_slides = wp_cache_get($query_hash, 'slideshowgallery')) {
590
+ $slides = $oc_slides;
591
+ } else {
592
+ $slides = $wpdb -> get_results($slidesquery);
593
+ wp_cache_set($query_hash, $slides, 'slideshowgallery', 0);
594
+ }
595
+
596
+ if (!empty($slides)) {
597
+ $imagespath = $this -> get_option('imagespath');
598
+
599
+ foreach ($slides as $skey => $slide) {
600
+ $slides[$skey] = $this -> init_class($this -> Slide() -> model, $slide);
601
+ //$slides[$skey] -> image_path = $this -> Html -> image_path($slide);
602
+ }
603
+
604
+ if ($orderby == "random") { shuffle($slides); }
605
+ $slideshowtype = "gallery";
606
+ $content = $this -> render('gallery', array('slides' => $slides, 'unique' => 'gallery' . $gallery_id . rand(1, 999), 'options' => $s, 'frompost' => false), false, 'default');
607
+ } else {
608
+ $error = __('No slides are available in this gallery', 'slideshow-gallery');
609
+ }
610
+ // All slides
611
+ } elseif (!empty($custom) || empty($post_id)) {
612
+ if (!empty($orderf) && !empty($orderd)) {
613
+ $orderby = array($orderf, $orderd);
614
+ }
615
+
616
+ $slides = $this -> Slide() -> find_all(null, null, $orderby);
617
+
618
+ if (!empty($slides)) {
619
+ foreach ($slides as $slide_key => $slide) {
620
+
621
+ // Check exclude
622
+ if (!empty($exclude)) {
623
+ $exclude = array_map('trim', explode(',', $exclude));
624
+ if (in_array($slide -> id, $exclude)) {
625
+ unset($slides[$slide_key]);
626
+ }
627
+ }
628
+
629
+ // Check slide expiration
630
+ if (!empty($slide -> expiry)) {
631
+ if (strtotime($slide -> expiry) <= time()) {
632
+ unset($slides[$slide_key]);
633
+ }
634
+ }
635
+ }
636
+ }
637
+
638
+ if ($orderby == "random") { shuffle($slides); }
639
+ $slideshowtype = "slides";
640
+
641
+ if (!empty($slides)) {
642
+ $content = $this -> render('gallery', array('slides' => $slides, 'unique' => "custom" . rand(1, 999), 'options' => $s, 'frompost' => false), false, 'default');
643
+ } else {
644
+ $error = __('No slides are available', 'slideshow-gallery');
645
+ }
646
+ // Images of a post/page
647
+ } else {
648
+ global $post;
649
+ $pid = (empty($post_id)) ? $post -> ID : $post_id;
650
+
651
+ if (!is_numeric($post_id)) {
652
+ $pid = $post -> ID;
653
+ }
654
+
655
+ if (!empty($pid) && $post = get_post($pid)) {
656
+ $children_attributes = array(
657
+ 'numberposts' => $numberposts,
658
+ 'post_parent' => $post -> ID,
659
+ 'post_type' => "attachment",
660
+ 'post_status' => "any",
661
+ 'post_mime_type' => "image",
662
+ 'orderby' => ((!empty($orderf)) ? $orderf : "menu_order"),
663
+ 'order' => ((!empty($orderd)) ? $orderd : "ASC"),
664
+ );
665
+
666
+ if ($attachments = get_children($children_attributes)) {
667
+ if (!empty($exclude)) {
668
+ $exclude = array_map('trim', explode(',', $exclude));
669
+
670
+ $a = 0;
671
+ foreach ($attachments as $id => $attachment) {
672
+ //$attachments[$id] = (object) array_map('esc_attr', (array) $attachment);
673
+
674
+ $a++;
675
+ if (in_array($a, $exclude)) {
676
+ unset($attachments[$id]);
677
+ }
678
+ }
679
+ }
680
+
681
+ if ($orderby == "random") { shuffle($attachments); }
682
+ $slides = $attachments;
683
+
684
+ $slideshowtype = "post";
685
+ $content = $this -> render('gallery', array('slides' => $slides, 'unique' => $pid, 'options' => $s, 'frompost' => true), false, 'default');
686
+ } else {
687
+ $error = __('No attachments on this post/page', 'slideshow-gallery');
688
+ }
689
+ } else {
690
+ $error = __('No post/page ID was specified', 'slideshow-gallery');
691
+ }
692
+ }
693
+
694
+ // Check if this is an RSS Feed?
695
+ if (is_feed()) {
696
+ $content = '';
697
+ ob_start();
698
+
699
+ $width = $this -> get_option('thumbwidth');
700
+ $height = $this -> get_option('thumbheight');
701
+
702
+ if (!empty($slides)) {
703
+ switch ($slideshowtype) {
704
+ case 'products' :
705
+ foreach ($slides as $slide) {
706
+ ?>
707
+
708
+ <a href="<?php echo get_permalink($slide -> post_id); ?>" title="<?php echo esc_attr($slide -> title); ?>">
709
+ <img align="left" hspace="15" src="<?php echo esc_url($this -> Html() -> otf_image_src($slide, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100)); ?>" />
710
+ </a>
711
+
712
+ <?php
713
+ }
714
+ break;
715
+ case 'gallery' :
716
+ foreach ($slides as $slide) {
717
+ ?>
718
+
719
+ <a href="<?php echo esc_url($slide -> image_path); ?>" title="<?php echo esc_attr($slide -> title); ?>">
720
+ <img align="left" hspace="15" src="<?php echo esc_url($this -> Html() -> otf_image_src($slide, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100)); ?>" alt="<?php echo esc_attr($this -> Html -> sanitize($slide -> title)); ?>" />
721
+ </a>
722
+
723
+ <?php
724
+ }
725
+ break;
726
+ case 'featured' :
727
+ foreach ($slides as $slide) {
728
+ ?>
729
+
730
+ <a href="<?php echo esc_url($slide -> guid); ?>" title="<?php echo esc_attr($slide -> post_title); ?>">
731
+ <img align="left" hspace="15" src="<?php echo esc_url($this -> Html() -> otf_image_src($slide, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100)); ?>" alt="<?php echo esc_attr($this -> Html -> sanitize($slide -> post_title)); ?>" />
732
+ </a>
733
+
734
+ <?php
735
+ }
736
+ break;
737
+ case 'post' :
738
+ default :
739
+ foreach ($slides as $slide) {
740
+ $full_image_href = wp_get_attachment_image_src($slide -> ID, 'full', false);
741
+ $full_image_url = wp_get_attachment_url($slide -> ID);
742
+
743
+ ?>
744
+
745
+ <a href="<?php echo esc_url($full_image_url); ?>" title="<?php echo esc_attr($slide -> post_title); ?>">
746
+ <img align="left" hspace="15" src="<?php echo esc_url($this -> Html() -> otf_image_src($slide, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100)); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> post_title); ?>" />
747
+ </a>
748
+
749
+ <?php
750
+ }
751
+ break;
752
+ }
753
+
754
+ ?><hr style="visibility:hidden; height:1px; width:100%; display:block;" /><?php
755
+ }
756
+
757
+ $content = ob_get_clean();
758
+ }
759
+
760
+ // Check for error messages
761
+ if (!empty($error)) {
762
+ $content = '';
763
+ $content .= '<p class="slideshow_error slideshow-gallery-error">';
764
+ $content .= wp_unslash($error);
765
+ $content .= '</p>';
766
+ }
767
+
768
+ remove_filter('excerpt_more', array($this, 'excerpt_more'));
769
+ remove_filter('excerpt_length', array($this, 'excerpt_length'));
770
+
771
+ return $content;
772
+ }
773
+
774
+ function admin_slides() {
775
+ global $wpdb;
776
+ $method = (!empty($_GET['method'])) ? sanitize_text_field($_GET['method']) : false;
777
+ switch ($method) {
778
+ case 'delete' :
779
+ $id = sanitize_text_field($_GET['id']);
780
+ if (!empty($id)) {
781
+ if ($this -> Slide() -> delete($id)) {
782
+ $msg_type = 'message';
783
+ $message = __('Slide has been removed', 'slideshow-gallery');
784
+ } else {
785
+ $msg_type = 'error';
786
+ $message = __('Slide cannot be removed', 'slideshow-gallery');
787
+ }
788
+ } else {
789
+ $msg_type = 'error';
790
+ $message = __('No slide was specified', 'slideshow-gallery');
791
+ }
792
+
793
+ $this -> redirect($this -> referer, $msg_type, $message);
794
+ break;
795
+ case 'save' :
796
+ if (!empty($_POST)) {
797
+ check_admin_referer($this -> sections -> slides . '_save');
798
+
799
+ if ($this -> Slide() -> save($_POST, true)) {
800
+ $message = __('Slide item has been saved', 'slideshow-gallery');
801
+
802
+ if (!empty($_POST['continueediting'])) {
803
+ $this -> redirect(admin_url('admin.php?page=' . $this -> sections -> slides . '&method=save&id=' . $this -> Slide() -> insertid . '&continueediting=1'), 'message', $message);
804
+ } else {
805
+ $this -> redirect($this -> url, "message", $message);
806
+ }
807
+ } else {
808
+ $this -> render_err(__('Slide could not be saved', 'slideshow-gallery'));
809
+ $this -> render('slides' . DS . 'save', false, true, 'admin');
810
+ }
811
+ } else {
812
+ $this -> Db -> model = $this -> Slide() -> model;
813
+ $slideId = (isset($_GET['id'])) ? sanitize_text_field($_GET['id']) : 0;
814
+ $this -> Slide() -> find(array('id' => $slideId));
815
+ $this -> render('slides' . DS . 'save', false, true, 'admin');
816
+ }
817
+ break;
818
+ case 'save-multiple' :
819
+ if (!empty($_POST)) {
820
+ check_admin_referer($this -> sections -> slides . '_save-multiple');
821
+
822
+ $errors = array();
823
+
824
+ if (!empty($_POST['Slide']['slides'])) {
825
+ $slides = map_deep($_POST['Slide']['slides'], 'sanitize_text_field');
826
+ $galleries = map_deep($_POST['Slide']['galleries'], 'sanitize_text_field');
827
+
828
+ $s = 0;
829
+
830
+ foreach ($slides as $attachment_id => $slide) {
831
+ $slide_data = array(
832
+ 'Slide' => array(
833
+ 'title' => $slide['title'],
834
+ 'description' => $slide['description'],
835
+ 'image' => basename($slide['url']),
836
+ 'attachment_id' => $attachment_id,
837
+ 'type' => 'media',
838
+ 'image_url' => $slide['url'],
839
+ 'media_file' => $slide['url'],
840
+ 'galleries' => $galleries,
841
+ )
842
+ );
843
+
844
+ if (!$this -> Slide() -> save($slide_data)) {
845
+ //$errors = array_merge($errors, $this -> Slide() -> errors);
846
+ $errors[$s] = $this -> Slide() -> errors;
847
+ }
848
+
849
+ $s++;
850
+ }
851
+
852
+ if (empty($errors)) {
853
+ $message = __('Slides have been saved', 'slideshow-gallery');
854
+ $this -> redirect(admin_url('admin.php?page=' . $this -> sections -> slides), 'message', $message);
855
+ }
856
+ } else {
857
+ $errors[] = __('No slides were selected', 'slideshow-gallery');
858
+ }
859
+ }
860
+
861
+ $this -> render('slides' . DS . 'save-multiple', array('errors' => $errors), true, 'admin');
862
+ break;
863
+ case 'order' :
864
+ if (isset($_GET['gallery_id'])) {
865
+ $gallery_id = sanitize_text_field($_GET['gallery_id']);
866
+ } else {
867
+ $gallery_id = "";
868
+ }
869
+
870
+ if (!empty($gallery_id)) {
871
+ $gallery = $this -> Gallery() -> find(array('id' => $gallery_id));
872
+
873
+ $slides = array();
874
+ $gsquery = "SELECT gs.slide_id FROM `" . $this -> GallerySlides() -> table . "` gs WHERE `gallery_id` = '" . esc_sql($gallery -> id) . "' ORDER BY gs.order ASC";
875
+
876
+ $query_hash = md5($gsquery);
877
+ if ($oc_gs = wp_cache_get($query_hash, 'slideshowgallery')) {
878
+ $gs = $oc_gs;
879
+ } else {
880
+ $gs = $wpdb -> get_results($gsquery);
881
+ wp_cache_set($query_hash, $gs, 'slideshowgallery', 0);
882
+ }
883
+
884
+ if (!empty($gs)) {
885
+ foreach ($gs as $galleryslide) {
886
+ $slides[] = $this -> Slide() -> find(array('id' => $galleryslide -> slide_id));
887
+ }
888
+ }
889
+
890
+ $this -> render('slides' . DS . 'order-gallery', array('gallery' => $gallery, 'slides' => $slides), true, 'admin');
891
+ } else {
892
+ $slides = $this -> Slide() -> find_all(null, null, array('order', "ASC"));
893
+ $this -> render('slides' . DS . 'order', array('slides' => $slides), true, 'admin');
894
+ }
895
+ break;
896
+ default :
897
+ $this -> render('slides' . DS . 'index', false, true, 'admin');
898
+ break;
899
+ }
900
+ }
901
+
902
+ function admin_galleries() {
903
+
904
+ $method = (!empty($_GET['method'])) ? sanitize_text_field($_GET['method']) : false;
905
+ switch ($method) {
906
+ case 'save' :
907
+ if (!empty($_POST)) {
908
+ check_admin_referer($this -> sections -> galleries . '_save');
909
+
910
+ if ($this -> Gallery() -> save($_POST, true)) {
911
+ $message = __('Gallery item has been saved', 'slideshow-gallery');
912
+
913
+ if (!empty($_POST['continueediting'])) {
914
+ $this -> redirect(admin_url('admin.php?page=' . $this -> sections -> galleries . '&method=save&id=' . $this -> Gallery() -> insertid . '&continueediting=1'), 'message', $message);
915
+ } else {
916
+ $this -> redirect($this -> url, "message", $message);
917
+ }
918
+ } else {
919
+ $this -> render('galleries' . DS . 'save', false, true, 'admin');
920
+ }
921
+ } else {
922
+ $this -> Db -> model = $this -> Gallery() -> model;
923
+ $galleryId = (isset($_GET['id'])) ? sanitize_text_field($_GET['id']) : 0;
924
+ $this -> Gallery() -> find(array('id' => $galleryId));
925
+ $this -> render('galleries' . DS . 'save', false, true, 'admin');
926
+ }
927
+ break;
928
+ case 'view' :
929
+ $this -> Db -> model = $this -> Gallery() -> model;
930
+ $gallery = $this -> Gallery() -> find(array('id' => sanitize_text_field($_GET['id'])));
931
+ $perpage = (isset($_COOKIE[$this -> pre . 'slidesperpage'])) ? sanitize_text_field($_COOKIE[$this -> pre . 'slidesperpage']) : 25;
932
+ $orderfield = (empty($_GET['orderby'])) ? 'modified' : sanitize_text_field($_GET['orderby']);
933
+ $orderdirection = (empty($_GET['order'])) ? 'DESC' : strtoupper(sanitize_text_field($_GET['order']));
934
+ $order = array($orderfield, $orderdirection);
935
+ $data = $this -> paginate('GallerySlides', "*", $this -> sections -> galleries . '&method=view&id=' . $gallery -> id, array('gallery_id' => $gallery -> id), false, $perpage, $order);
936
+
937
+ $data['Slide'] = array();
938
+ if (!empty($data[$this -> GallerySlides() -> model])) {
939
+ foreach ($data[$this -> GallerySlides() -> model] as $galleryslide) {
940
+ $this -> Db -> model = $this -> Slide() -> model;
941
+ $data['Slide'][] = $this -> Slide() -> find(array('id' => $galleryslide -> slide_id));
942
+ }
943
+ }
944
+
945
+ $this -> render('galleries' . DS . 'view', array('gallery' => $gallery, 'slides' => $data[$this -> Slide() -> model], 'paginate' => $data['Paginate']), true, 'admin');
946
+ break;
947
+ case 'hardcode' :
948
+ $this -> Db -> model = $this -> Gallery() -> model;
949
+ $gallery = $this -> Gallery() -> find(array('id' => sanitize_text_field($_GET['id'])));
950
+ $this -> render('galleries' . DS . 'hardcode', array('gallery' => $gallery), true, 'admin');
951
+ break;
952
+ case 'delete' :
953
+ $id = sanitize_text_field($_GET['id']);
954
+ if (!empty($id)) {
955
+ if ($this -> Gallery() -> delete($id)) {
956
+ $msg_type = 'message';
957
+ $message = __('Gallery has been removed', 'slideshow-gallery');
958
+ } else {
959
+ $msg_type = 'error';
960
+ $message = __('Gallery cannot be removed', 'slideshow-gallery');
961
+ }
962
+ } else {
963
+ $msg_type = 'error';
964
+ $message = __('No gallery was specified', 'slideshow-gallery');
965
+ }
966
+
967
+ $this -> redirect($this -> referer, $msg_type, $message);
968
+ break;
969
+ default :
970
+ $this -> render('galleries' . DS . 'index', false, true, 'admin');
971
+ break;
972
+ }
973
+ }
974
+
975
+ function admin_settings() {
976
+ global $wpdb;
977
+ $method = (!empty($_GET['method'])) ? sanitize_text_field($_GET['method']) : false;
978
+
979
+ switch ($method) {
980
+ case 'clearlog' :
981
+
982
+ check_admin_referer($this -> sections -> settings . '_clearlog');
983
+
984
+ @unlink(SLIDESHOW_LOG_FILE);
985
+
986
+ $fh = fopen(SLIDESHOW_LOG_FILE, "w");
987
+ fwrite($fh, "*** Slideshow Log File *** \r\n\r\n");
988
+ fclose($fh);
989
+ chmod(SLIDESHOW_LOG_FILE, 0777);
990
+
991
+ $msgtype = 'message';
992
+ $message = __('Log file has been cleared', 'slideshow-gallery');
993
+ $this -> redirect($this -> referer, $msgtype, $message);
994
+
995
+ break;
996
+ case 'dismiss' :
997
+ if (!empty($_GET['dismiss'])) {
998
+ $this -> update_option('dismiss_' . sanitize_text_field($_GET['dismiss']), 1);
999
+ }
1000
+
1001
+ $this -> redirect($this -> referer);
1002
+ break;
1003
+ case 'checkdb' :
1004
+ $this -> check_tables();
1005
+
1006
+ if (!empty($this -> models)) {
1007
+ foreach ($this -> models as $model) {
1008
+ $query = "OPTIMIZE TABLE `" . $this -> {$model}() -> table . "`";
1009
+ $wpdb -> query($query);
1010
+ }
1011
+ }
1012
+
1013
+ $this -> redirect($this -> referer, 'message', __('Database tables have been checked and optimized', 'slideshow-gallery'));
1014
+ break;
1015
+ case 'reset' :
1016
+ global $wpdb;
1017
+ $query = "DELETE FROM `" . $wpdb -> prefix . "options` WHERE `option_name` LIKE '" . esc_sql($this -> pre) . "%';";
1018
+
1019
+ if ($wpdb -> query($query)) {
1020
+ $this -> initialize_options();
1021
+
1022
+ $message = __('All settings have been reset to their defaults', 'slideshow-gallery');
1023
+ $msg_type = 'message';
1024
+ $this -> render_msg($message);
1025
+ } else {
1026
+ $message = __('Settings could not be reset', 'slideshow-gallery');
1027
+ $msg_type = 'error';
1028
+ $this -> render_err($message);
1029
+ }
1030
+
1031
+ $this -> redirect($this -> url, $msg_type, $message);
1032
+ break;
1033
+ default :
1034
+ if (!empty($_POST)) {
1035
+ check_admin_referer($this -> sections -> settings);
1036
+
1037
+ delete_option('tridebugging');
1038
+ $this -> delete_option('infohideonmobile');
1039
+ $this -> delete_option('autoheight');
1040
+ $this -> delete_option('language_external');
1041
+ $this -> delete_option('excerptsettings');
1042
+ $this -> delete_option('infofade');
1043
+ $this -> delete_option('fadedelay');
1044
+ $this -> delete_option('infoonhover');
1045
+ $this -> delete_option('thumbhideonmobile');
1046
+
1047
+ foreach ($_POST as $pkey => $pval) {
1048
+ switch ($pkey) {
1049
+ case 'styles' :
1050
+ $styles = array();
1051
+ foreach ($pval as $pvalkey => $pvalval) {
1052
+ switch ($pvalkey) {
1053
+ case 'layout' :
1054
+ if (!$this -> ci_serial_valid()) {
1055
+ $styles[$pvalkey] = "specific";
1056
+ } else {
1057
+ $styles[$pvalkey] = $pvalval;
1058
+ }
1059
+ break;
1060
+ default :
1061
+ $styles[$pvalkey] = $pvalval;
1062
+ break;
1063
+ }
1064
+ }
1065
+
1066
+ $this -> update_option('styles', $styles);
1067
+ break;
1068
+ case 'debugging' :
1069
+ if (!empty($pval)) {
1070
+ update_option('tridebugging', 1);
1071
+ }
1072
+ break;
1073
+ case 'excerpt_readmore' :
1074
+ if ($this -> language_do()) {
1075
+ $this -> update_option($pkey, $this -> language_join($pval));
1076
+ } else {
1077
+ $this -> update_option($pkey, $pval);
1078
+ }
1079
+ break;
1080
+ case 'permissions' :
1081
+ global $wp_roles;
1082
+ $role_names = $wp_roles -> get_names();
1083
+
1084
+ if (!empty($_POST['permissions'])) {
1085
+ $permissions = map_deep($_POST['permissions'], 'sanitize_text_field');
1086
+
1087
+ foreach ($role_names as $role_key => $role_name) {
1088
+ foreach ($this -> sections as $section_key => $section_name) {
1089
+ $wp_roles -> remove_cap($role_key, 'slideshow_' . $section_key);
1090
+
1091
+ if (!empty($permissions[$role_key]) && in_array($section_key, $permissions[$role_key])) {
1092
+ $wp_roles -> add_cap($role_key, 'slideshow_' . $section_key);
1093
+ }
1094
+
1095
+ if ($role_key == "administrator") {
1096
+ $wp_roles -> add_cap("administrator", 'slideshow_' . $section_key);
1097
+ $permissions[$role_key][] = $section_key;
1098
+ }
1099
+ }
1100
+ }
1101
+ }
1102
+
1103
+ $this -> update_option('permissions', $permissions);
1104
+ break;
1105
+ default :
1106
+ $this -> update_option($pkey, $pval);
1107
+ break;
1108
+ }
1109
+ }
1110
+
1111
+ if (!$this -> ci_serial_valid()) {
1112
+ $this -> update_option('effect', "slide");
1113
+ $this -> update_option('easing', "swing");
1114
+ $this -> update_option('infodelay', "0");
1115
+ $this -> delete_option('infohideonmobile');
1116
+ $this -> delete_option('excerptsettings');
1117
+ $this -> update_option('imagesthickbox', "N");
1118
+ $this -> delete_option('thumbhideonmobile');
1119
+ }
1120
+
1121
+ $message = __('Settings has been saved', 'slideshow-gallery');
1122
+ $this -> render_msg($message);
1123
+ }
1124
+
1125
+ $this -> render('settings', false, true, 'admin');
1126
+ break;
1127
+ }
1128
+ }
1129
+
1130
+ function admin_settings_updates() {
1131
+ $method = (!empty($_GET['method'])) ? sanitize_text_field($_GET['method']) : false;
1132
+ switch ($method) {
1133
+ case 'check' :
1134
+ delete_transient('slideshow_update_info');
1135
+ $this -> redirect($this -> referer);
1136
+ break;
1137
+ }
1138
+
1139
+ $this -> render('settings-updates', false, true, 'admin');
1140
+ }
1141
+
1142
+ function activation_hook() {
1143
+ $this -> add_option('activation_redirect', true);
1144
+ }
1145
+
1146
+ function custom_redirect() {
1147
+
1148
+ $method = (!empty($_GET['slideshow_method'])) ? sanitize_text_field($_GET['slideshow_method']) : false;
1149
+ if (!empty($method)) {
1150
+ switch ($method) {
1151
+ case 'hidemessage' :
1152
+ if (!empty($_GET['message'])) {
1153
+ switch ($_GET['message']) {
1154
+ case 'upgradetopro' :
1155
+ $this -> update_option('hidemessage_upgradetopro', true);
1156
+ break;
1157
+ case 'ratereview' :
1158
+ $this -> delete_option('showmessage_ratereview');
1159
+ $this -> redirect($this -> referer);
1160
+ break;
1161
+ }
1162
+ }
1163
+ break;
1164
+ case 'hideupdate' :
1165
+ if (!empty($_GET['version'])) {
1166
+ $this -> update_option('hideupdate', sanitize_text_field($_GET['version']));
1167
+ $this -> redirect($this -> referer);
1168
+ }
1169
+ break;
1170
+ }
1171
+ }
1172
+
1173
+ $activation_redirect = $this -> get_option('activation_redirect');
1174
+ if (is_admin() && !empty($activation_redirect)) {
1175
+ $this -> delete_option('activation_redirect');
1176
+ wp_cache_flush();
1177
+ wp_redirect(admin_url('index.php?page=' . $this -> sections -> about));
1178
+ }
1179
+ }
1180
+ }
1181
+ }
1182
+
1183
+ if (!function_exists('SG')) {
1184
+ function SG($param = null) {
1185
+ return new SlideshowGallery($param);
1186
+ }
1187
+ }
1188
+
1189
+ //initialize a Gallery object
1190
+ global $Gallery;
1191
+ $Gallery = new SlideshowGallery();
1192
+ register_activation_hook(plugin_basename(__FILE__), array($Gallery, 'initialize_options'));
1193
+ register_activation_hook(plugin_basename(__FILE__), array($Gallery, 'activation_hook'));
1194
+
1195
+ if (!function_exists('slideshow')) {
1196
+ function slideshow($output = true, $gallery_id = null, $post_id = null, $params = array()) {
1197
+ $params['gallery_id'] = $gallery_id;
1198
+ $params['post_id'] = $post_id;
1199
+
1200
+ $Gallery = new SlideshowGallery();
1201
+ $content = $Gallery -> embed($params, false);
1202
+
1203
+ if ($output == true) {
1204
+ echo wp_kses_post($content);
1205
+ } else {
1206
+ return $content;
1207
+ }
1208
+ }
1209
+ }
1210
+
1211
+ ?>
vendors/BFI_Thumb.php CHANGED
File without changes
vendors/otf_regen_thumbs.php CHANGED
File without changes
views/default/css-generator-fn.php CHANGED
@@ -1,126 +1,126 @@
1
- <?php
2
-
3
-
4
- function sg_generate_css($styles) {
5
-
6
- //$id = sanitize_text_field($_GET['id']);
7
- //$styles = maybe_unserialize(get_transient('slideshow-css-' . $id));
8
- //$styles = maybe_unserialize($styles);
9
-
10
- $unique = $styles['unique'];
11
-
12
- if (!empty($styles['wrapperid'])) : ?>
13
- ul.slideshow<?php echo esc_url($unique); ?> { list-style:none !important; color:#fff; }
14
- ul.slideshow<?php echo esc_html($unique); ?> span { display:none; }
15
- #<?php echo esc_attr($styles['wrapperid']); ?> { overflow:hidden; position:relative; width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width']) . 'px' : 'auto'; ?>; background:<?php echo esc_html($styles['background']); ?>; padding:0 0 0 0; border:<?php echo esc_html($styles['border']); ?>; margin:0; display:none; }
16
- #<?php echo esc_attr($styles['wrapperid']); ?> * { margin:0; padding:0; }
17
- #<?php echo esc_attr($styles['wrapperid']); ?> #fullsize<?php echo esc_html($unique); ?> { position:relative; z-index:1; overflow:hidden; width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width']) . 'px' : 'auto'; ?>; height:<?php echo ((int) $styles['height']); ?>px; clear:both; border: none; }
18
- #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> { text-align:left; font-family:Verdana, Arial, Helvetica, sans-serif !important; position:absolute; bottom:0; width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width']) . 'px' : '100%'; ?>; height:0; background:<?php echo esc_html($styles['infobackground']); ?>; color:<?php echo esc_html($styles['infocolor']); ?>; overflow:hidden; z-index:300; opacity:.7; filter:alpha(opacity=70); }
19
- #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> h3 { color:<?php echo esc_html($styles['infocolor']); ?>; padding:4px 8px 3px; margin:0 !important; font-size:16px; font-weight:bold; }
20
- #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> a { color:<?php echo esc_html($styles['infocolor']); ?>; }
21
- #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> p { color:<?php echo esc_html($styles['infocolor']); ?>; padding:0 8px 8px; margin:0 !important; font-size: 14px; font-weight:normal; }
22
- #<?php echo esc_attr($styles['wrapperid']); ?> .infotop { margin-bottom:8px !important; top:0; }
23
- #<?php echo esc_attr($styles['wrapperid']); ?> .infobottom { margin-top:8px !important; bottom:0; }
24
- <?php if (empty($styles['resizeimages']) || $styles['resizeimages'] == "Y") : ?>
25
- #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> { width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width']) . 'px' : 'auto'; ?>; }
26
- #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> img { border:none; border-radius:0; box-shadow:none; position:absolute; height:auto; max-width:100%; margin:0 auto; display:block; }
27
- <?php else : ?>
28
- #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> { width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width']) . 'px' : 'auto'; ?>; }
29
- #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> img { border:none; border-radius:0; box-shadow:none; position:absolute; left:0%; right:0%; max-height:100%; max-width:100%; margin:0 auto; display:block; }
30
- <?php endif; ?>
31
- #<?php echo esc_attr($styles['wrapperid']); ?> .imgnav { position:absolute; width:25%; height:100%; cursor:pointer; z-index:250; }
32
- #<?php echo esc_attr($styles['wrapperid']); ?> #imgprev<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content:"\f053"; font-size:30px; color:white; visibility:visible; left:0; text-align:left; width: auto; height:auto; line-height:160%; top:50%; margin:-30px 0 0 0; border-radius:0 10px 10px 0; background:black; padding:3px 10px 0 10px; position: absolute; display: inline-block; }
33
- #<?php echo esc_attr($styles['wrapperid']); ?> #imgprev<?php echo esc_html($unique); ?> { display:none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; left:0; font-size:0px; }
34
- #<?php echo esc_attr($styles['wrapperid']); ?> #imgnext<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content:"\f054"; font-size:30px; color:white; visibility:visible; right:0; text-align:right; width: auto; height:auto; line-height:160%; top:50%; margin:-30px 0 0 0; border-radius:10px 0 0 10px; background:black; padding:3px 10px 0 10px; position: absolute; display: inline-block; }
35
- #<?php echo esc_attr($styles['wrapperid']); ?> #imgnext<?php echo esc_html($unique); ?> { display:none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; right:0; font-size:0px; }
36
- #<?php echo esc_attr($styles['wrapperid']); ?> #imglink<?php echo esc_html($unique); ?> { position:absolute; zoom:1; background-color:#ffffff; height:100%; <?php if (!empty($styles['shownav']) && $styles['shownav'] == "true") : ?>width:50%; left:25%; right:20%;<?php else : ?>width:100%; left:0;<?php endif; ?> z-index:149; opacity:0; filter:alpha(opacity=0); }
37
- #<?php echo esc_attr($styles['wrapperid']); ?> .linkhover:before { font-family:FontAwesome; content:"\f14c"; font-size:30px; text-align:center; height:auto; line-height:160%; width:auto; top:50%; left:auto; right:auto; margin:-30px 0 0 0; padding:0px 12px; display: inline-block; position: relative; background:black; color:white; border-radius:10px; }
38
- #<?php echo esc_attr($styles['wrapperid']); ?> .linkhover { background:transparent !important; opacity:.4 !important; filter:alpha(opacity=40) !important; text-align:center; font-size:0px; }
39
- #<?php echo esc_attr($styles['wrapperid']); ?> #thumbnails<?php echo esc_html($unique); ?> { background:<?php echo esc_html($styles['background']); ?>; }
40
- #<?php echo esc_attr($styles['wrapperid']); ?> .thumbstop { margin-bottom:8px !important; }
41
- #<?php echo esc_attr($styles['wrapperid']); ?> .thumbsbot { margin-top:8px !important; }
42
- #<?php echo esc_attr($styles['wrapperid']); ?> #slideleft<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content: "\f104"; color:#999; position: absolute; height: auto; line-height:160%; width: auto; display: inline-block; top: 50%; font-size: 30px; margin: -30px 0 0 0; padding: 0 5px; }
43
- #<?php echo esc_attr($styles['wrapperid']); ?> #slideleft<?php echo esc_html($unique); ?> { text-align:left; float:left; position:relative; width:20px; height:<?php echo ((int) $styles['thumbheight'] + 14); ?>px; background:#222; }
44
- #<?php echo esc_attr($styles['wrapperid']); ?> #slideleft<?php echo esc_html($unique); ?>:hover { background-color:#333; }
45
- #<?php echo esc_attr($styles['wrapperid']); ?> #slideright<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content: "\f105"; color:#999; position: absolute; height: auto; line-height:160%; width: auto; display: inline-block; top: 50%; font-size: 30px; margin: -30px 0 0 0; padding: 0 5px; }
46
- #<?php echo esc_attr($styles['wrapperid']); ?> #slideright<?php echo esc_html($unique); ?> { text-align:left; float:right; position:relative; width:20px; height:<?php echo ((int) $styles['thumbheight'] + 14); ?>px; background:#222; }
47
- #<?php echo esc_attr($styles['wrapperid']); ?> #slideright<?php echo esc_html($unique); ?>:hover { background-color:#333; }
48
- #<?php echo esc_attr($styles['wrapperid']); ?> #slidearea<?php echo esc_html($unique); ?> { float:left; position:relative; background:<?php echo esc_html($styles['background']); ?>; width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width'] - 55) . 'px' : '90%'; ?>; margin:0 5px; height:<?php echo ((int) $styles['thumbheight'] + 14); ?>px; overflow:hidden; }
49
- #<?php echo esc_attr($styles['wrapperid']); ?> #slider<?php echo esc_html($unique); ?> { position:absolute; width:<?php echo esc_html($styles['sliderwidth']); ?>px !important; left:0; height:<?php echo ((int) $styles['thumbheight'] + 14); ?>px; }
50
- #<?php echo esc_attr($styles['wrapperid']); ?> #slider<?php echo esc_html($unique); ?> img { width:<?php echo esc_html($styles['thumbwidth']); ?>px; height:<?php echo esc_html($styles['thumbheight']); ?>px; cursor:pointer; border:1px solid #666; padding:2px; float:left !important; }
51
- #<?php echo esc_attr($styles['wrapperid']); ?> #spinner<?php echo esc_html($unique); ?> { position:relative; top:50%; left:45%; text-align:left; font-size:30px; }
52
- #<?php echo esc_attr($styles['wrapperid']); ?> #spinner<?php echo esc_html($unique); ?> img { border:none; }
53
- <?php if (!empty($styles['infohideonmobile'])) : ?>
54
- @media (max-width:480px) { .slideshow-information { display: none !important; } }
55
- <?php endif; ?>
56
- <?php if (!empty($styles['thumbhideonmobile'])) : ?>
57
- @media (max-width:480px) { .slideshow-thumbnails { display: none !important; } }
58
- <?php endif; ?>
59
- <?php endif;
60
-
61
- }
62
-
63
-
64
-
65
-
66
-
67
- function sg_generate_css_responsive($styles) {
68
-
69
- //$id = sanitize_text_field($_GET['id']);
70
- //$styles = maybe_unserialize(get_transient('slideshow-css-' . $id));
71
- //$styles = maybe_unserialize($styles);
72
-
73
- $resheight = $styles['resheight'] . $styles['resheighttype'];
74
- $sliderheight = $styles['thumbheight'] + 14;
75
- $unique = $styles['unique'];
76
-
77
- if (!empty($styles['wrapperid'])) : ?>
78
- ul.slideshow<?php echo esc_html($unique); ?> { list-style:none !important; color:#fff; }
79
- ul.slideshow<?php echo esc_html($unique); ?> span { display:none; }
80
- #<?php echo esc_attr($styles['wrapperid']); ?> { overflow: hidden; position:relative; width:100%; background:<?php echo esc_html($styles['background']); ?>; padding:0 0 0 0; border:<?php echo esc_html($styles['border']); ?>; margin:0; display:none; }
81
- #<?php echo esc_attr($styles['wrapperid']); ?> * { margin:0; padding:0; }
82
- #<?php echo esc_attr($styles['wrapperid']); ?> #fullsize<?php echo esc_html($unique); ?> { position:relative; z-index:1; overflow:hidden; width:100%; height:<?php echo esc_html($resheight); ?>; clear:both; border: none; }
83
- #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> { text-align:left; font-family:Verdana, Arial, Helvetica, sans-serif !important; position:absolute; width:100%; height:0; background:<?php echo esc_html($styles['infobackground']); ?>; color:<?php echo esc_html($styles['infocolor']); ?>; overflow:hidden; z-index:300; opacity:.7; filter:alpha(opacity=70); }
84
- #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> h3 { color:<?php echo esc_html($styles['infocolor']); ?>; padding:4px 8px 3px; margin:0 !important; font-size:16px; font-weight:bold; }
85
- #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> a { color:<?php echo esc_html($styles['infocolor']); ?>; }
86
- #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> p { color:<?php echo esc_html($styles['infocolor']); ?>; padding:0 8px 8px; margin:0 !important; font-size: 14px; font-weight:normal; }
87
- #<?php echo esc_attr($styles['wrapperid']); ?> .infotop { margin-bottom:8px !important; top:0!important; }
88
- #<?php echo esc_attr($styles['wrapperid']); ?> .infobottom { margin-top:8px !important; bottom:0!important; }
89
- <?php if (empty($styles['resizeimages']) || $styles['resizeimages'] == "Y") : ?>
90
- #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> { width:100%; }
91
- #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> img { border:none; border-radius:0; box-shadow:none; position:absolute; height:auto; width:100%; margin:0 auto; display:block; }
92
- <?php else : ?>
93
- #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> { width:100%; }
94
- #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> img { border:none; border-radius:0; box-shadow:none; position:absolute; left:0%; right:0%; max-height:100%; max-width:100%; margin:0 auto; display:block; }
95
- <?php endif; ?>
96
- #<?php echo esc_attr($styles['wrapperid']); ?> .imgnav { position:absolute; width:25%; height:100%; cursor:pointer; z-index:250; }
97
- #<?php echo esc_attr($styles['wrapperid']); ?> #imgprev<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content:"\f053"; font-size:30px; color:white; visibility:visible; left:0; text-align:left; width: auto; height:auto; line-height:160%; top:50%; margin:-30px 0 0 0; border-radius:0 10px 10px 0; background:black; padding:3px 10px 0 10px; position: absolute; display: inline-block; }
98
- #<?php echo esc_attr($styles['wrapperid']); ?> #imgprev<?php echo esc_html($unique); ?> { display:none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; left:0; font-size:0px; }
99
- #<?php echo esc_attr($styles['wrapperid']); ?> #imgnext<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content:"\f054"; font-size:30px; color:white; visibility:visible; right:0; text-align:right; width: auto; height:auto; line-height:160%; top:50%; margin:-30px 0 0 0; border-radius:10px 0 0 10px; background:black; padding:3px 10px 0 10px; position: absolute; display: inline-block; }
100
- #<?php echo esc_attr($styles['wrapperid']); ?> #imgnext<?php echo esc_html($unique); ?> { display:none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; right:0; font-size:0px; }
101
- #<?php echo esc_attr($styles['wrapperid']); ?> #imglink<?php echo esc_html($unique); ?> { position:absolute; zoom:1; background-color:#ffffff; height:100%; <?php if (!empty($styles['shownav']) && $styles['shownav'] == "true") : ?>width:50%; left:25%; right:20%;<?php else : ?>width:100%; left:0;<?php endif; ?> z-index:149; opacity:0; filter:alpha(opacity=0); }
102
- #<?php echo esc_attr($styles['wrapperid']); ?> .linkhover:before { font-family:FontAwesome; content:"\f14c"; font-size:30px; text-align:center; height:auto; line-height:160%; width:auto; top:50%; left:auto; right:auto; margin:-30px 0 0 0; padding:0px 12px; display: inline-block; position: relative; background:black; color:white; border-radius:10px; }
103
- #<?php echo esc_attr($styles['wrapperid']); ?> .linkhover { background:transparent !important; opacity:.4 !important; filter:alpha(opacity=40) !important; text-align:center; font-size:0px; }
104
- #<?php echo esc_attr($styles['wrapperid']); ?> #thumbnails<?php echo esc_html($unique); ?> { background:<?php echo esc_html($styles['background']); ?>; height:<?php echo esc_html($sliderheight); ?>px; width:100%; position:relative; overflow:hidden; }
105
- #<?php echo esc_attr($styles['wrapperid']); ?> .thumbstop { margin-bottom:8px !important; }
106
- #<?php echo esc_attr($styles['wrapperid']); ?> .thumbsbot { margin-top:8px !important; }
107
- #<?php echo esc_attr($styles['wrapperid']); ?> #slideleft<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content: "\f104"; color:#999; position: absolute; height: auto; line-height:160%; width: auto; display: inline-block; top: 50%; font-size: 30px; margin: -30px 0 0 0; padding: 0 5px; }
108
- #<?php echo esc_attr($styles['wrapperid']); ?> #slideleft<?php echo esc_html($unique); ?> { text-align:left; float:left; position:absolute; left:0; z-index:150; width:20px; height:<?php echo esc_html($sliderheight); ?>px; background:#222; }
109
- #<?php echo esc_attr($styles['wrapperid']); ?> #slideleft<?php echo esc_html($unique); ?>:hover { background-color:#333; }
110
- #<?php echo esc_attr($styles['wrapperid']); ?> #slideright<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content: "\f105"; color:#999; position: absolute; height: auto; line-height:160%; width: auto; display: inline-block; top: 50%; font-size: 30px; margin: -30px 0 0 0; padding: 0 5px; }
111
- #<?php echo esc_attr($styles['wrapperid']); ?> #slideright<?php echo esc_html($unique); ?> { text-align:left; float:right; position:absolute; right:0; z-index:150; width:20px; height:<?php echo esc_html($sliderheight); ?>px; background:#222; }
112
- #<?php echo esc_attr($styles['wrapperid']); ?> #slideright<?php echo esc_html($unique); ?>:hover { background-color:#333; }
113
- #<?php echo esc_attr($styles['wrapperid']); ?> #slidearea<?php echo esc_html($unique); ?> { float:left; position:absolute; z-index:149; background:<?php echo esc_html($styles['background']); ?>; width:100%; margin:0; height:<?php echo esc_html($sliderheight); ?>px; overflow:hidden; }
114
- #<?php echo esc_attr($styles['wrapperid']); ?> #slider<?php echo esc_html($unique); ?> { position:absolute; width:<?php echo esc_html($styles['sliderwidth']); ?>px !important; left:0; height:<?php echo esc_html($sliderheight); ?>px; padding:3px 20px 0 25px; }
115
- #<?php echo esc_attr($styles['wrapperid']); ?> #slider<?php echo esc_html($unique); ?> img { width:<?php echo esc_html($styles['thumbwidth']); ?>px; height:<?php echo esc_html($styles['thumbheight']); ?>px; cursor:pointer; border:1px solid #666; padding:2px; float:left !important; }
116
- #<?php echo esc_attr($styles['wrapperid']); ?> #spinner<?php echo esc_html($unique); ?> { position:relative; top:50%; left:45%; text-align:left; font-size:30px; }
117
- #<?php echo esc_attr($styles['wrapperid']); ?> #spinner<?php echo esc_html($unique); ?> img { border:none; }
118
-
119
- <?php if (!empty($styles['infohideonmobile'])) : ?>
120
- @media (max-width:480px) { .slideshow-information { display: none !important; } }
121
- <?php endif; ?>
122
- <?php if (!empty($styles['thumbhideonmobile'])) : ?>
123
- @media (max-width:480px) { .slideshow-thumbnails { display: none !important; } }
124
- <?php endif; ?>
125
- <?php endif;
126
- }
1
+ <?php
2
+
3
+
4
+ function sg_generate_css($styles) {
5
+
6
+ //$id = sanitize_text_field($_GET['id']);
7
+ //$styles = maybe_unserialize(get_transient('slideshow-css-' . $id));
8
+ //$styles = maybe_unserialize($styles);
9
+
10
+ $unique = $styles['unique'];
11
+
12
+ if (!empty($styles['wrapperid'])) : ?>
13
+ ul.slideshow<?php echo esc_url($unique); ?> { list-style:none !important; color:#fff; }
14
+ ul.slideshow<?php echo esc_html($unique); ?> span { display:none; }
15
+ #<?php echo esc_attr($styles['wrapperid']); ?> { overflow:hidden; position:relative; width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width']) . 'px' : 'auto'; ?>; background:<?php echo esc_html($styles['background']); ?>; padding:0 0 0 0; border:<?php echo esc_html($styles['border']); ?>; margin:0; display:none; }
16
+ #<?php echo esc_attr($styles['wrapperid']); ?> * { margin:0; padding:0; }
17
+ #<?php echo esc_attr($styles['wrapperid']); ?> #fullsize<?php echo esc_html($unique); ?> { position:relative; z-index:1; overflow:hidden; width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width']) . 'px' : 'auto'; ?>; height:<?php echo ((int) $styles['height']); ?>px; clear:both; border: none; }
18
+ #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> { text-align:left; font-family:Verdana, Arial, Helvetica, sans-serif !important; position:absolute; bottom:0; width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width']) . 'px' : '100%'; ?>; height:0; background:<?php echo esc_html($styles['infobackground']); ?>; color:<?php echo esc_html($styles['infocolor']); ?>; overflow:hidden; z-index:300; opacity:.7; filter:alpha(opacity=70); }
19
+ #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> h3 { color:<?php echo esc_html($styles['infocolor']); ?>; padding:4px 8px 3px; margin:0 !important; font-size:16px; font-weight:bold; }
20
+ #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> a { color:<?php echo esc_html($styles['infocolor']); ?>; }
21
+ #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> p { color:<?php echo esc_html($styles['infocolor']); ?>; padding:0 8px 8px; margin:0 !important; font-size: 14px; font-weight:normal; }
22
+ #<?php echo esc_attr($styles['wrapperid']); ?> .infotop { margin-bottom:8px !important; top:0; }
23
+ #<?php echo esc_attr($styles['wrapperid']); ?> .infobottom { margin-top:8px !important; bottom:0; }
24
+ <?php if (empty($styles['resizeimages']) || $styles['resizeimages'] == "Y") : ?>
25
+ #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> { width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width']) . 'px' : 'auto'; ?>; }
26
+ #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> img { border:none; border-radius:0; box-shadow:none; position:absolute; height:auto; max-width:100%; margin:0 auto; display:block; }
27
+ <?php else : ?>
28
+ #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> { width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width']) . 'px' : 'auto'; ?>; }
29
+ #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> img { border:none; border-radius:0; box-shadow:none; position:absolute; left:0%; right:0%; max-height:100%; max-width:100%; margin:0 auto; display:block; }
30
+ <?php endif; ?>
31
+ #<?php echo esc_attr($styles['wrapperid']); ?> .imgnav { position:absolute; width:25%; height:100%; cursor:pointer; z-index:250; }
32
+ #<?php echo esc_attr($styles['wrapperid']); ?> #imgprev<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content:"\f053"; font-size:30px; color:white; visibility:visible; left:0; text-align:left; width: auto; height:auto; line-height:160%; top:50%; margin:-30px 0 0 0; border-radius:0 10px 10px 0; background:black; padding:3px 10px 0 10px; position: absolute; display: inline-block; }
33
+ #<?php echo esc_attr($styles['wrapperid']); ?> #imgprev<?php echo esc_html($unique); ?> { display:none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; left:0; font-size:0px; }
34
+ #<?php echo esc_attr($styles['wrapperid']); ?> #imgnext<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content:"\f054"; font-size:30px; color:white; visibility:visible; right:0; text-align:right; width: auto; height:auto; line-height:160%; top:50%; margin:-30px 0 0 0; border-radius:10px 0 0 10px; background:black; padding:3px 10px 0 10px; position: absolute; display: inline-block; }
35
+ #<?php echo esc_attr($styles['wrapperid']); ?> #imgnext<?php echo esc_html($unique); ?> { display:none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; right:0; font-size:0px; }
36
+ #<?php echo esc_attr($styles['wrapperid']); ?> #imglink<?php echo esc_html($unique); ?> { position:absolute; zoom:1; background-color:#ffffff; height:100%; <?php if (!empty($styles['shownav']) && $styles['shownav'] == "true") : ?>width:50%; left:25%; right:20%;<?php else : ?>width:100%; left:0;<?php endif; ?> z-index:149; opacity:0; filter:alpha(opacity=0); }
37
+ #<?php echo esc_attr($styles['wrapperid']); ?> .linkhover:before { font-family:FontAwesome; content:"\f14c"; font-size:30px; text-align:center; height:auto; line-height:160%; width:auto; top:50%; left:auto; right:auto; margin:-30px 0 0 0; padding:0px 12px; display: inline-block; position: relative; background:black; color:white; border-radius:10px; }
38
+ #<?php echo esc_attr($styles['wrapperid']); ?> .linkhover { background:transparent !important; opacity:.4 !important; filter:alpha(opacity=40) !important; text-align:center; font-size:0px; }
39
+ #<?php echo esc_attr($styles['wrapperid']); ?> #thumbnails<?php echo esc_html($unique); ?> { background:<?php echo esc_html($styles['background']); ?>; }
40
+ #<?php echo esc_attr($styles['wrapperid']); ?> .thumbstop { margin-bottom:8px !important; }
41
+ #<?php echo esc_attr($styles['wrapperid']); ?> .thumbsbot { margin-top:8px !important; }
42
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slideleft<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content: "\f104"; color:#999; position: absolute; height: auto; line-height:160%; width: auto; display: inline-block; top: 50%; font-size: 30px; margin: -30px 0 0 0; padding: 0 5px; }
43
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slideleft<?php echo esc_html($unique); ?> { text-align:left; float:left; position:relative; width:20px; height:<?php echo ((int) $styles['thumbheight'] + 14); ?>px; background:#222; }
44
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slideleft<?php echo esc_html($unique); ?>:hover { background-color:#333; }
45
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slideright<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content: "\f105"; color:#999; position: absolute; height: auto; line-height:160%; width: auto; display: inline-block; top: 50%; font-size: 30px; margin: -30px 0 0 0; padding: 0 5px; }
46
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slideright<?php echo esc_html($unique); ?> { text-align:left; float:right; position:relative; width:20px; height:<?php echo ((int) $styles['thumbheight'] + 14); ?>px; background:#222; }
47
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slideright<?php echo esc_html($unique); ?>:hover { background-color:#333; }
48
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slidearea<?php echo esc_html($unique); ?> { float:left; position:relative; background:<?php echo esc_html($styles['background']); ?>; width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width'] - 55) . 'px' : '90%'; ?>; margin:0 5px; height:<?php echo ((int) $styles['thumbheight'] + 14); ?>px; overflow:hidden; }
49
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slider<?php echo esc_html($unique); ?> { position:absolute; width:<?php echo esc_html($styles['sliderwidth']); ?>px !important; left:0; height:<?php echo ((int) $styles['thumbheight'] + 14); ?>px; }
50
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slider<?php echo esc_html($unique); ?> img { width:<?php echo esc_html($styles['thumbwidth']); ?>px; height:<?php echo esc_html($styles['thumbheight']); ?>px; cursor:pointer; border:1px solid #666; padding:2px; float:left !important; }
51
+ #<?php echo esc_attr($styles['wrapperid']); ?> #spinner<?php echo esc_html($unique); ?> { position:relative; top:50%; left:45%; text-align:left; font-size:30px; }
52
+ #<?php echo esc_attr($styles['wrapperid']); ?> #spinner<?php echo esc_html($unique); ?> img { border:none; }
53
+ <?php if (!empty($styles['infohideonmobile'])) : ?>
54
+ @media (max-width:480px) { .slideshow-information { display: none !important; } }
55
+ <?php endif; ?>
56
+ <?php if (!empty($styles['thumbhideonmobile'])) : ?>
57
+ @media (max-width:480px) { .slideshow-thumbnails { display: none !important; } }
58
+ <?php endif; ?>
59
+ <?php endif;
60
+
61
+ }
62
+
63
+
64
+
65
+
66
+
67
+ function sg_generate_css_responsive($styles) {
68
+
69
+ //$id = sanitize_text_field($_GET['id']);
70
+ //$styles = maybe_unserialize(get_transient('slideshow-css-' . $id));
71
+ //$styles = maybe_unserialize($styles);
72
+
73
+ $resheight = $styles['resheight'] . $styles['resheighttype'];
74
+ $sliderheight = $styles['thumbheight'] + 14;
75
+ $unique = $styles['unique'];
76
+
77
+ if (!empty($styles['wrapperid'])) : ?>
78
+ ul.slideshow<?php echo esc_html($unique); ?> { list-style:none !important; color:#fff; }
79
+ ul.slideshow<?php echo esc_html($unique); ?> span { display:none; }
80
+ #<?php echo esc_attr($styles['wrapperid']); ?> { overflow: hidden; position:relative; width:100%; background:<?php echo esc_html($styles['background']); ?>; padding:0 0 0 0; border:<?php echo esc_html($styles['border']); ?>; margin:0; display:none; }
81
+ #<?php echo esc_attr($styles['wrapperid']); ?> * { margin:0; padding:0; }
82
+ #<?php echo esc_attr($styles['wrapperid']); ?> #fullsize<?php echo esc_html($unique); ?> { position:relative; z-index:1; overflow:hidden; width:100%; height:<?php echo esc_html($resheight); ?>; clear:both; border: none; }
83
+ #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> { text-align:left; font-family:Verdana, Arial, Helvetica, sans-serif !important; position:absolute; width:100%; height:0; background:<?php echo esc_html($styles['infobackground']); ?>; color:<?php echo esc_html($styles['infocolor']); ?>; overflow:hidden; z-index:300; opacity:.7; filter:alpha(opacity=70); }
84
+ #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> h3 { color:<?php echo esc_html($styles['infocolor']); ?>; padding:4px 8px 3px; margin:0 !important; font-size:16px; font-weight:bold; }
85
+ #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> a { color:<?php echo esc_html($styles['infocolor']); ?>; }
86
+ #<?php echo esc_attr($styles['wrapperid']); ?> #information<?php echo esc_html($unique); ?> p { color:<?php echo esc_html($styles['infocolor']); ?>; padding:0 8px 8px; margin:0 !important; font-size: 14px; font-weight:normal; }
87
+ #<?php echo esc_attr($styles['wrapperid']); ?> .infotop { margin-bottom:8px !important; top:0!important; }
88
+ #<?php echo esc_attr($styles['wrapperid']); ?> .infobottom { margin-top:8px !important; bottom:0!important; }
89
+ <?php if (empty($styles['resizeimages']) || $styles['resizeimages'] == "Y") : ?>
90
+ #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> { width:100%; }
91
+ #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> img { border:none; border-radius:0; box-shadow:none; position:absolute; height:auto; width:100%; margin:0 auto; display:block; }
92
+ <?php else : ?>
93
+ #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> { width:100%; }
94
+ #<?php echo esc_attr($styles['wrapperid']); ?> #image<?php echo esc_html($unique); ?> img { border:none; border-radius:0; box-shadow:none; position:absolute; left:0%; right:0%; max-height:100%; max-width:100%; margin:0 auto; display:block; }
95
+ <?php endif; ?>
96
+ #<?php echo esc_attr($styles['wrapperid']); ?> .imgnav { position:absolute; width:25%; height:100%; cursor:pointer; z-index:250; }
97
+ #<?php echo esc_attr($styles['wrapperid']); ?> #imgprev<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content:"\f053"; font-size:30px; color:white; visibility:visible; left:0; text-align:left; width: auto; height:auto; line-height:160%; top:50%; margin:-30px 0 0 0; border-radius:0 10px 10px 0; background:black; padding:3px 10px 0 10px; position: absolute; display: inline-block; }
98
+ #<?php echo esc_attr($styles['wrapperid']); ?> #imgprev<?php echo esc_html($unique); ?> { display:none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; left:0; font-size:0px; }
99
+ #<?php echo esc_attr($styles['wrapperid']); ?> #imgnext<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content:"\f054"; font-size:30px; color:white; visibility:visible; right:0; text-align:right; width: auto; height:auto; line-height:160%; top:50%; margin:-30px 0 0 0; border-radius:10px 0 0 10px; background:black; padding:3px 10px 0 10px; position: absolute; display: inline-block; }
100
+ #<?php echo esc_attr($styles['wrapperid']); ?> #imgnext<?php echo esc_html($unique); ?> { display:none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; right:0; font-size:0px; }
101
+ #<?php echo esc_attr($styles['wrapperid']); ?> #imglink<?php echo esc_html($unique); ?> { position:absolute; zoom:1; background-color:#ffffff; height:100%; <?php if (!empty($styles['shownav']) && $styles['shownav'] == "true") : ?>width:50%; left:25%; right:20%;<?php else : ?>width:100%; left:0;<?php endif; ?> z-index:149; opacity:0; filter:alpha(opacity=0); }
102
+ #<?php echo esc_attr($styles['wrapperid']); ?> .linkhover:before { font-family:FontAwesome; content:"\f14c"; font-size:30px; text-align:center; height:auto; line-height:160%; width:auto; top:50%; left:auto; right:auto; margin:-30px 0 0 0; padding:0px 12px; display: inline-block; position: relative; background:black; color:white; border-radius:10px; }
103
+ #<?php echo esc_attr($styles['wrapperid']); ?> .linkhover { background:transparent !important; opacity:.4 !important; filter:alpha(opacity=40) !important; text-align:center; font-size:0px; }
104
+ #<?php echo esc_attr($styles['wrapperid']); ?> #thumbnails<?php echo esc_html($unique); ?> { background:<?php echo esc_html($styles['background']); ?>; height:<?php echo esc_html($sliderheight); ?>px; width:100%; position:relative; overflow:hidden; }
105
+ #<?php echo esc_attr($styles['wrapperid']); ?> .thumbstop { margin-bottom:8px !important; }
106
+ #<?php echo esc_attr($styles['wrapperid']); ?> .thumbsbot { margin-top:8px !important; }
107
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slideleft<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content: "\f104"; color:#999; position: absolute; height: auto; line-height:160%; width: auto; display: inline-block; top: 50%; font-size: 30px; margin: -30px 0 0 0; padding: 0 5px; }
108
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slideleft<?php echo esc_html($unique); ?> { text-align:left; float:left; position:absolute; left:0; z-index:150; width:20px; height:<?php echo esc_html($sliderheight); ?>px; background:#222; }
109
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slideleft<?php echo esc_html($unique); ?>:hover { background-color:#333; }
110
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slideright<?php echo esc_html($unique); ?>:before { font-family:FontAwesome; content: "\f105"; color:#999; position: absolute; height: auto; line-height:160%; width: auto; display: inline-block; top: 50%; font-size: 30px; margin: -30px 0 0 0; padding: 0 5px; }
111
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slideright<?php echo esc_html($unique); ?> { text-align:left; float:right; position:absolute; right:0; z-index:150; width:20px; height:<?php echo esc_html($sliderheight); ?>px; background:#222; }
112
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slideright<?php echo esc_html($unique); ?>:hover { background-color:#333; }
113
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slidearea<?php echo esc_html($unique); ?> { float:left; position:absolute; z-index:149; background:<?php echo esc_html($styles['background']); ?>; width:100%; margin:0; height:<?php echo esc_html($sliderheight); ?>px; overflow:hidden; }
114
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slider<?php echo esc_html($unique); ?> { position:absolute; width:<?php echo esc_html($styles['sliderwidth']); ?>px !important; left:0; height:<?php echo esc_html($sliderheight); ?>px; padding:3px 20px 0 25px; }
115
+ #<?php echo esc_attr($styles['wrapperid']); ?> #slider<?php echo esc_html($unique); ?> img { width:<?php echo esc_html($styles['thumbwidth']); ?>px; height:<?php echo esc_html($styles['thumbheight']); ?>px; cursor:pointer; border:1px solid #666; padding:2px; float:left !important; }
116
+ #<?php echo esc_attr($styles['wrapperid']); ?> #spinner<?php echo esc_html($unique); ?> { position:relative; top:50%; left:45%; text-align:left; font-size:30px; }
117
+ #<?php echo esc_attr($styles['wrapperid']); ?> #spinner<?php echo esc_html($unique); ?> img { border:none; }
118
+
119
+ <?php if (!empty($styles['infohideonmobile'])) : ?>
120
+ @media (max-width:480px) { .slideshow-information { display: none !important; } }
121
+ <?php endif; ?>
122
+ <?php if (!empty($styles['thumbhideonmobile'])) : ?>
123
+ @media (max-width:480px) { .slideshow-thumbnails { display: none !important; } }
124
+ <?php endif; ?>
125
+ <?php endif;
126
+ }
views/default/css/colorbox.css CHANGED
File without changes
views/default/images/colorbox/border.png CHANGED
File without changes
views/default/images/colorbox/controls.png CHANGED
File without changes
views/default/images/colorbox/ie6/borderBottomCenter.png CHANGED
File without changes
views/default/images/colorbox/ie6/borderBottomLeft.png CHANGED
File without changes
views/default/images/colorbox/ie6/borderBottomRight.png CHANGED
File without changes
views/default/images/colorbox/ie6/borderMiddleLeft.png CHANGED
File without changes
views/default/images/colorbox/ie6/borderMiddleRight.png CHANGED
File without changes
views/default/images/colorbox/ie6/borderTopCenter.png CHANGED
File without changes
views/default/images/colorbox/ie6/borderTopLeft.png CHANGED
File without changes
views/default/images/colorbox/ie6/borderTopRight.png CHANGED
File without changes
views/default/images/colorbox/loading.gif CHANGED
File without changes
views/default/images/colorbox/loading_background.png CHANGED
File without changes
views/default/images/colorbox/overlay.png CHANGED
File without changes