Slideshow Gallery - Version 1.0.5

Version Description

Download this release

Release Info

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

Code changes from version 1.0.4 to 1.0.5

css/gallery-css.php CHANGED
@@ -7,8 +7,8 @@
7
 
8
  #slideshow { list-style:none; color:#fff; }
9
  #slideshow span { display:none; }
10
- #wrapper { width:<?php echo ((int) $styles['width'] - 6); ?>px; background:<?php echo $styles['background']; ?>; padding:2px; border:<?php echo $styles['border']; ?>; margin:25px auto; display:none; }
11
- #wrapper * { margin:0; padding:0; }
12
  #fullsize { position:relative; z-index:1; overflow:hidden; width:<?php echo ((int) $styles['width'] - 6); ?>px; height:<?php echo $styles['height']; ?>px; }
13
  #information { position:absolute; bottom:0; width:<?php echo ((int) $styles['width'] - 6); ?>px; height:0; background:<?php echo $styles['infobackground']; ?>; color:<?php echo $styles['infocolor']; ?>; overflow:hidden; z-index:200; opacity:.7; filter:alpha(opacity=70); }
14
  #information h3 { color:<?php echo $styles['infocolor']; ?>; padding:4px 8px 3px; font-size:14px; }
@@ -29,4 +29,4 @@
29
  #slideright:hover { background-color:#333; }
30
  #slidearea { float:left; background:<?php echo $styles['background']; ?>; position:relative; width:<?php echo ((int) $styles['width'] - 55); ?>px; margin-left:5px; height:81px; overflow:hidden; }
31
  #slider { position:absolute; left:0; height:81px; }
32
- #slider img { cursor:pointer; border:1px solid #666; padding:2px; -moz-border-radius:4px; -webkit-border-radius:4px; float:left; }
7
 
8
  #slideshow { list-style:none; color:#fff; }
9
  #slideshow span { display:none; }
10
+ #slideshow-wrapper { width:<?php echo ((int) $styles['width'] - 6); ?>px; background:<?php echo $styles['background']; ?>; padding:2px; border:<?php echo $styles['border']; ?>; margin:25px auto; display:none; }
11
+ #slideshow-wrapper * { margin:0; padding:0; }
12
  #fullsize { position:relative; z-index:1; overflow:hidden; width:<?php echo ((int) $styles['width'] - 6); ?>px; height:<?php echo $styles['height']; ?>px; }
13
  #information { position:absolute; bottom:0; width:<?php echo ((int) $styles['width'] - 6); ?>px; height:0; background:<?php echo $styles['infobackground']; ?>; color:<?php echo $styles['infocolor']; ?>; overflow:hidden; z-index:200; opacity:.7; filter:alpha(opacity=70); }
14
  #information h3 { color:<?php echo $styles['infocolor']; ?>; padding:4px 8px 3px; font-size:14px; }
29
  #slideright:hover { background-color:#333; }
30
  #slidearea { float:left; background:<?php echo $styles['background']; ?>; position:relative; width:<?php echo ((int) $styles['width'] - 55); ?>px; margin-left:5px; height:81px; overflow:hidden; }
31
  #slider { position:absolute; left:0; height:81px; }
32
+ #slider img { cursor:pointer; border:1px solid #666; padding:2px; -moz-border-radius:4px; -webkit-border-radius:4px; float:left !important; }
languages/slideshow-gallery-en_US.mo CHANGED
Binary file
languages/slideshow-gallery-en_US.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WordPress Slideshow Gallery v1.0.3\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2009-12-15 23:30+0200\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Antonie Potgieter <antonie.potgieter@gmail.com>\n"
8
  "Language-Team: Tribulant Software <support@tribulant.com>\n"
@@ -20,63 +20,103 @@ msgstr ""
20
  msgid "Slides have been ordered"
21
  msgstr ""
22
 
23
- #: ../slideshow-gallery/slideshow-gallery-plugin.php:213
24
  msgid "Uploads folder named \""
25
  msgstr ""
26
 
27
- #: ../slideshow-gallery/slideshow-gallery.php:32
28
  msgid "Slideshow"
29
  msgstr ""
30
 
31
- #: ../slideshow-gallery/slideshow-gallery.php:33
32
  msgid "Manage Slides"
33
  msgstr ""
34
 
35
- #: ../slideshow-gallery/slideshow-gallery.php:34
36
  msgid "Configuration"
37
  msgstr ""
38
 
39
- #: ../slideshow-gallery/slideshow-gallery.php:94
 
 
 
 
 
 
 
 
 
 
 
 
40
  msgid "Slide has been saved"
41
  msgstr ""
42
 
43
- #: ../slideshow-gallery/slideshow-gallery.php:114
44
  msgid "Selected slides have been removed"
45
  msgstr ""
46
 
47
- #: ../slideshow-gallery/slideshow-gallery.php:119
48
  msgid "No slides were selected"
49
  msgstr ""
50
 
51
- #: ../slideshow-gallery/slideshow-gallery.php:123
52
  msgid "No action was specified"
53
  msgstr ""
54
 
55
- #: ../slideshow-gallery/slideshow-gallery.php:145
56
  msgid "All configuration settings have been reset to their defaults"
57
  msgstr ""
58
 
59
- #: ../slideshow-gallery/slideshow-gallery.php:149
60
  msgid "Configuration settings could not be reset"
61
  msgstr ""
62
 
63
- #: ../slideshow-gallery/slideshow-gallery.php:162
64
  msgid "Configuration has been saved"
65
  msgstr ""
66
 
67
- #: ../slideshow-gallery/models/slide.php:62
68
- msgid "Please fill in a title"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  msgstr ""
70
 
71
  #: ../slideshow-gallery/models/slide.php:63
72
- msgid "Please fill in a description"
73
  msgstr ""
74
 
75
  #: ../slideshow-gallery/models/slide.php:64
 
 
 
 
76
  msgid "Please specify an image"
77
  msgstr ""
78
 
79
- #: ../slideshow-gallery/models/slide.php:91
80
  msgid "No data was posted"
81
  msgstr ""
82
 
@@ -100,19 +140,7 @@ msgstr ""
100
  msgid "Next Page"
101
  msgstr ""
102
 
103
- #: ../slideshow-gallery/views/admin/settings.php:7
104
- msgid "Save Settings"
105
- msgstr ""
106
-
107
- #: ../slideshow-gallery/views/admin/settings.php:8
108
- msgid "General Settings"
109
- msgstr ""
110
-
111
- #: ../slideshow-gallery/views/admin/settings.php:9
112
- msgid "Appearance &amp; Styles"
113
- msgstr ""
114
-
115
- #: ../slideshow-gallery/views/admin/settings.php:18
116
  msgid "Configuration Settings"
117
  msgstr ""
118
 
@@ -123,12 +151,16 @@ msgstr ""
123
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:6
124
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:53
125
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:79
 
 
126
  msgid "Yes"
127
  msgstr ""
128
 
129
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:7
130
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:54
131
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:80
 
 
132
  msgid "No"
133
  msgstr ""
134
 
@@ -240,6 +272,8 @@ msgid "Thumbnail Spacing"
240
  msgstr ""
241
 
242
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:120
 
 
243
  msgid "px"
244
  msgstr ""
245
 
@@ -287,24 +321,24 @@ msgstr ""
287
  msgid "Information Text Color"
288
  msgstr ""
289
 
290
- #: ../slideshow-gallery/views/admin/metaboxes/settings-submit.php:6
291
  msgid "Reset all configuration settings to their default values"
292
  msgstr ""
293
 
294
- #: ../slideshow-gallery/views/admin/metaboxes/settings-submit.php:6
295
  msgid "Are you sure you wish to reset all configuration settings?"
296
  msgstr ""
297
 
298
- #: ../slideshow-gallery/views/admin/metaboxes/settings-submit.php:6
299
  msgid "Reset to Defaults"
300
  msgstr ""
301
 
302
- #: ../slideshow-gallery/views/admin/metaboxes/settings-submit.php:13
303
  msgid "Save Configuration"
304
  msgstr ""
305
 
306
  #: ../slideshow-gallery/views/admin/slides/index.php:2
307
- msgid "add new"
308
  msgstr ""
309
 
310
  #: ../slideshow-gallery/views/admin/slides/index.php:7
@@ -379,10 +413,14 @@ msgid "Image URL"
379
  msgstr ""
380
 
381
  #: ../slideshow-gallery/views/admin/slides/save.php:32
 
 
 
 
382
  msgid "Link To"
383
  msgstr ""
384
 
385
- #: ../slideshow-gallery/views/admin/slides/save.php:39
386
  msgid "Save Slide"
387
  msgstr ""
388
 
@@ -400,3 +438,7 @@ msgstr ""
400
  msgid "Styles"
401
  msgstr ""
402
 
 
 
 
 
2
  msgstr ""
3
  "Project-Id-Version: WordPress Slideshow Gallery v1.0.3\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-01-07 22:56+0200\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Antonie Potgieter <antonie.potgieter@gmail.com>\n"
8
  "Language-Team: Tribulant Software <support@tribulant.com>\n"
20
  msgid "Slides have been ordered"
21
  msgstr ""
22
 
23
+ #: ../slideshow-gallery/slideshow-gallery-plugin.php:221
24
  msgid "Uploads folder named \""
25
  msgstr ""
26
 
27
+ #: ../slideshow-gallery/slideshow-gallery.php:36
28
  msgid "Slideshow"
29
  msgstr ""
30
 
31
+ #: ../slideshow-gallery/slideshow-gallery.php:37
32
  msgid "Manage Slides"
33
  msgstr ""
34
 
35
+ #: ../slideshow-gallery/slideshow-gallery.php:38
36
  msgid "Configuration"
37
  msgstr ""
38
 
39
+ #: ../slideshow-gallery/slideshow-gallery.php:48
40
+ msgid "Save Settings"
41
+ msgstr ""
42
+
43
+ #: ../slideshow-gallery/slideshow-gallery.php:49
44
+ msgid "General Settings"
45
+ msgstr ""
46
+
47
+ #: ../slideshow-gallery/slideshow-gallery.php:50
48
+ msgid "Appearance &amp; Styles"
49
+ msgstr ""
50
+
51
+ #: ../slideshow-gallery/slideshow-gallery.php:145
52
  msgid "Slide has been saved"
53
  msgstr ""
54
 
55
+ #: ../slideshow-gallery/slideshow-gallery.php:165
56
  msgid "Selected slides have been removed"
57
  msgstr ""
58
 
59
+ #: ../slideshow-gallery/slideshow-gallery.php:170
60
  msgid "No slides were selected"
61
  msgstr ""
62
 
63
+ #: ../slideshow-gallery/slideshow-gallery.php:174
64
  msgid "No action was specified"
65
  msgstr ""
66
 
67
+ #: ../slideshow-gallery/slideshow-gallery.php:196
68
  msgid "All configuration settings have been reset to their defaults"
69
  msgstr ""
70
 
71
+ #: ../slideshow-gallery/slideshow-gallery.php:200
72
  msgid "Configuration settings could not be reset"
73
  msgstr ""
74
 
75
+ #: ../slideshow-gallery/slideshow-gallery.php:213
76
  msgid "Configuration has been saved"
77
  msgstr ""
78
 
79
+ #: ../slideshow-gallery/js/tinymce/dialog.php:17
80
+ msgid "Insert a slideshow"
81
+ msgstr ""
82
+
83
+ #: ../slideshow-gallery/js/tinymce/dialog.php:70
84
+ msgid "Images From a Post"
85
+ msgstr ""
86
+
87
+ #: ../slideshow-gallery/js/tinymce/dialog.php:71
88
+ msgid "Custom Added Slides"
89
+ msgstr ""
90
+
91
+ #: ../slideshow-gallery/js/tinymce/dialog.php:75
92
+ msgid "Post"
93
+ msgstr ""
94
+
95
+ #: ../slideshow-gallery/js/tinymce/dialog.php:78
96
+ msgid "Select a Post"
97
+ msgstr ""
98
+
99
+ #: ../slideshow-gallery/js/tinymce/dialog.php:87
100
+ msgid "Exclude"
101
+ msgstr ""
102
+
103
+ #: ../slideshow-gallery/js/tinymce/dialog.php:89
104
+ msgid "comma separated IDs of attachments to exclude"
105
  msgstr ""
106
 
107
  #: ../slideshow-gallery/models/slide.php:63
108
+ msgid "Please fill in a title"
109
  msgstr ""
110
 
111
  #: ../slideshow-gallery/models/slide.php:64
112
+ msgid "Please fill in a description"
113
+ msgstr ""
114
+
115
+ #: ../slideshow-gallery/models/slide.php:65
116
  msgid "Please specify an image"
117
  msgstr ""
118
 
119
+ #: ../slideshow-gallery/models/slide.php:92
120
  msgid "No data was posted"
121
  msgstr ""
122
 
140
  msgid "Next Page"
141
  msgstr ""
142
 
143
+ #: ../slideshow-gallery/views/admin/settings.php:12
 
 
 
 
 
 
 
 
 
 
 
 
144
  msgid "Configuration Settings"
145
  msgstr ""
146
 
151
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:6
152
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:53
153
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:79
154
+ #: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:8
155
+ #: ../slideshow-gallery/views/admin/slides/save.php:34
156
  msgid "Yes"
157
  msgstr ""
158
 
159
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:7
160
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:54
161
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:80
162
+ #: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:9
163
+ #: ../slideshow-gallery/views/admin/slides/save.php:35
164
  msgid "No"
165
  msgstr ""
166
 
272
  msgstr ""
273
 
274
  #: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:120
275
+ #: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:16
276
+ #: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:23
277
  msgid "px"
278
  msgstr ""
279
 
321
  msgid "Information Text Color"
322
  msgstr ""
323
 
324
+ #: ../slideshow-gallery/views/admin/metaboxes/settings-submit.php:5
325
  msgid "Reset all configuration settings to their default values"
326
  msgstr ""
327
 
328
+ #: ../slideshow-gallery/views/admin/metaboxes/settings-submit.php:5
329
  msgid "Are you sure you wish to reset all configuration settings?"
330
  msgstr ""
331
 
332
+ #: ../slideshow-gallery/views/admin/metaboxes/settings-submit.php:5
333
  msgid "Reset to Defaults"
334
  msgstr ""
335
 
336
+ #: ../slideshow-gallery/views/admin/metaboxes/settings-submit.php:11
337
  msgid "Save Configuration"
338
  msgstr ""
339
 
340
  #: ../slideshow-gallery/views/admin/slides/index.php:2
341
+ msgid "Add New"
342
  msgstr ""
343
 
344
  #: ../slideshow-gallery/views/admin/slides/index.php:7
413
  msgstr ""
414
 
415
  #: ../slideshow-gallery/views/admin/slides/save.php:32
416
+ msgid "Use Link"
417
+ msgstr ""
418
+
419
+ #: ../slideshow-gallery/views/admin/slides/save.php:45
420
  msgid "Link To"
421
  msgstr ""
422
 
423
+ #: ../slideshow-gallery/views/admin/slides/save.php:53
424
  msgid "Save Slide"
425
  msgstr ""
426
 
438
  msgid "Styles"
439
  msgstr ""
440
 
441
+ #: ../slideshow-gallery.1/tags/1.0/trunk/views/admin/slides/index.php:2
442
+ msgid "add new"
443
+ msgstr ""
444
+
readme.txt CHANGED
@@ -25,20 +25,21 @@ Installing the WordPress slideshow gallery plugin is very easy. Simply follow th
25
  1. Activate the plugin through the 'Plugins' menu in WordPress
26
  1. Configure the settings according to your needs through the 'Slideshow' > 'Configuration' menu
27
  1. Add and manage your slides in the 'Slideshow' section
28
- 1. Put `[slideshow post_id=X]` into your posts/pages or `<?php if (class_exists('Gallery')) { $Gallery = new Gallery(); $Gallery -> slideshow($output = true, $post_id = null); }; ?>` into your WordPress theme
29
 
30
  == Frequently Asked Questions ==
31
 
32
  = Can I display/embed multiple instances of the slideshow gallery? =
33
 
34
- Yes, you can
35
 
36
  == Screenshots ==
37
 
38
- 1. Slideshow gallery with thumbnails at the bottom
39
- 2. Slideshow gallery with thumbnails turned OFF
40
- 3. Slideshow gallery with thumbnails at the top
41
- 4. Different styles/colors
 
42
 
43
  == Changelog ==
44
 
@@ -56,4 +57,11 @@ Yes, you can
56
 
57
  = 1.0.4 =
58
  * COMPATIBILITY: WordPress 2.9
59
- * FIXED: #fullsize z-index to keep below other elements such as drop down menus.
 
 
 
 
 
 
 
25
  1. Activate the plugin through the 'Plugins' menu in WordPress
26
  1. Configure the settings according to your needs through the 'Slideshow' > 'Configuration' menu
27
  1. Add and manage your slides in the 'Slideshow' section
28
+ 1. Put `[slideshow post_id="X" exclude=""]` to embed a slideshow with the images of a post into your posts/pages or use `[slideshow custom=1]` to embed a slideshow with your custom added slides or `<?php if (class_exists('Gallery')) { $Gallery = new Gallery(); $Gallery -> slideshow($output = true, $post_id = null); }; ?>` into your WordPress theme
29
 
30
  == Frequently Asked Questions ==
31
 
32
  = Can I display/embed multiple instances of the slideshow gallery? =
33
 
34
+ Yes, you can, but only one slideshow per page.
35
 
36
  == Screenshots ==
37
 
38
+ 1. Slideshow gallery with thumbnails at the bottom.
39
+ 2. Slideshow gallery with thumbnails turned OFF.
40
+ 3. Slideshow gallery with thumbnails at the top.
41
+ 4. Different styles/colors.
42
+ 5. TinyMCE editor button to insert shortcodes.
43
 
44
  == Changelog ==
45
 
57
 
58
  = 1.0.4 =
59
  * COMPATIBILITY: WordPress 2.9
60
+ * FIXED: #fullsize z-index to keep below other elements such as drop down menus.
61
+
62
+ = 1.0.4 =
63
+ * IMPROVED: WordPress 2.9 sortable meta boxes.
64
+ * FIXED: `wp_redirect()` fatal error in dashboard.
65
+ * ADDED: TinyMCE editor button to quickly insert slideshows into posts/pages.
66
+ * ADDED: `exclude` parameter to use in conjunction with the `post_id` parameter to exclude attachments by order.
67
+ * CHANGED: Changed `#wrapper` in the HTML markup to `#slideshow-wrapper` due to some theme conflicts.
screenshot-5.png ADDED
Binary file
slideshow-gallery-ajax.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
 
3
- define('DS', DIRECTORY_SEPARATOR);
4
- include_once('../../../wp-config.php');
5
- include_once(ABSPATH . 'wp-admin' . DS . 'admin-functions.php');
6
 
7
  class GalleryAjax extends GalleryPlugin {
8
 
9
  var $safecommands = array('slides_order');
10
 
11
  function GalleryAjax($cmd) {
12
- $this -> register_plugin('gallery', __FILE__);
13
 
14
  if (!empty($cmd)) {
15
  if (in_array($cmd, $this -> safecommands) || current_user_can('edit_plugins')) {
1
  <?php
2
 
3
+ if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); }
4
+ require_once($_SERVER['DOCUMENT_ROOT'] . DS . 'wp-config.php');
5
+ require_once(ABSPATH . 'wp-admin' . DS . 'admin-functions.php');
6
 
7
  class GalleryAjax extends GalleryPlugin {
8
 
9
  var $safecommands = array('slides_order');
10
 
11
  function GalleryAjax($cmd) {
12
+ $this -> register_plugin('slideshow-gallery', __FILE__);
13
 
14
  if (!empty($cmd)) {
15
  if (in_array($cmd, $this -> safecommands) || current_user_can('edit_plugins')) {
slideshow-gallery-plugin.php CHANGED
@@ -2,11 +2,12 @@
2
 
3
  class GalleryPlugin {
4
 
5
- var $version = '1.0.4';
6
  var $plugin_name;
7
  var $plugin_base;
8
  var $pre = 'Gallery';
9
  var $debugging = false;
 
10
 
11
  var $helpers = array('Db', 'Html', 'Form', 'Metabox');
12
  var $models = array('Slide');
@@ -31,6 +32,13 @@ class GalleryPlugin {
31
  }
32
  }
33
 
 
 
 
 
 
 
 
34
  return true;
35
  }
36
 
@@ -58,7 +66,7 @@ class GalleryPlugin {
58
  if (file_exists($hfile)) {
59
  require_once($hfile);
60
 
61
- if (!is_object($this -> {$helper})) {
62
  $classname = $this -> pre . $helper . 'Helper';
63
 
64
  if (class_exists($classname)) {
@@ -76,7 +84,7 @@ class GalleryPlugin {
76
  if (file_exists($mfile)) {
77
  require_once($mfile);
78
 
79
- if (!is_object($this -> {$model})) {
80
  $classname = $this -> pre . $model;
81
 
82
  if (class_exists($classname)) {
@@ -226,36 +234,37 @@ class GalleryPlugin {
226
  return false;
227
  }
228
 
 
 
 
 
 
 
 
 
229
  function enqueue_scripts() {
230
  wp_enqueue_script('jquery');
231
 
232
  if (is_admin()) {
233
- require_once(ABSPATH . 'wp-admin' . DS . 'admin.php');
234
-
235
  if (!empty($_GET['page'])) {
236
- if ($_GET['page'] == "slideshow-gallery-settings" || ($_GET['page'] == $this -> plugin_name . ".php" && $_GET['method'] == "order")) {
237
- wp_enqueue_script('utils');
238
- wp_enqueue_script('autosave');
239
- wp_enqueue_script('editor');
240
- wp_enqueue_script('media-upload');
241
- wp_enqueue_script('word-count');
242
- wp_enqueue_script('suggest');
243
- wp_enqueue_script('jquery-ui-core');
244
- wp_enqueue_script('jquery-ui-tabs');
245
  wp_enqueue_script('wp-lists');
246
- wp_enqueue_script('jquery-ui-sortable');
247
- wp_enqueue_script('jquery-ui-draggable');
248
- wp_enqueue_script('jquery-ui-droppable');
249
  wp_enqueue_script('postbox');
250
- wp_enqueue_script('post');
251
- wp_enqueue_script('admin-widgets');
 
 
 
 
252
  }
253
  }
254
-
255
  wp_enqueue_script($this -> plugin_name . 'admin', '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/admin.js', null, '1.0');
256
- add_thickbox();
257
  } else {
258
- wp_enqueue_script($this -> plugin_name, '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/gallery.js', null, "1.0");
259
  }
260
 
261
  return true;
2
 
3
  class GalleryPlugin {
4
 
5
+ var $version = '1.0.5';
6
  var $plugin_name;
7
  var $plugin_base;
8
  var $pre = 'Gallery';
9
  var $debugging = false;
10
+ var $menus = array();
11
 
12
  var $helpers = array('Db', 'Html', 'Form', 'Metabox');
13
  var $models = array('Slide');
32
  }
33
  }
34
 
35
+ if ($this -> debugging == true) {
36
+ global $wpdb;
37
+ $wpdb -> show_errors();
38
+ error_reporting(E_ALL);
39
+ @ini_set('display_errors', 1);
40
+ }
41
+
42
  return true;
43
  }
44
 
66
  if (file_exists($hfile)) {
67
  require_once($hfile);
68
 
69
+ if (empty($this -> {$helper}) || !is_object($this -> {$helper})) {
70
  $classname = $this -> pre . $helper . 'Helper';
71
 
72
  if (class_exists($classname)) {
84
  if (file_exists($mfile)) {
85
  require_once($mfile);
86
 
87
+ if (empty($this -> {$model}) || !is_object($this -> {$model})) {
88
  $classname = $this -> pre . $model;
89
 
90
  if (class_exists($classname)) {
234
  return false;
235
  }
236
 
237
+ function add_filter($filter, $function = null, $priority = 10, $params = 1) {
238
+ if (add_filter($filter, array($this, (empty($function)) ? $filter : $function), $priority, $params)) {
239
+ return true;
240
+ }
241
+
242
+ return false;
243
+ }
244
+
245
  function enqueue_scripts() {
246
  wp_enqueue_script('jquery');
247
 
248
  if (is_admin()) {
 
 
249
  if (!empty($_GET['page'])) {
250
+ wp_enqueue_script('autosave');
251
+
252
+ if ($_GET['page'] == 'gallery-settings') {
253
+ wp_enqueue_script('common');
 
 
 
 
 
254
  wp_enqueue_script('wp-lists');
 
 
 
255
  wp_enqueue_script('postbox');
256
+
257
+ wp_enqueue_script('settings-editor', '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/settings-editor.js', array('jquery'), '1.0');
258
+ }
259
+
260
+ if ($_GET['page'] == "gallery" && $_GET['method'] == "order") {
261
+ wp_enqueue_script('jquery-ui-sortable');
262
  }
263
  }
264
+
265
  wp_enqueue_script($this -> plugin_name . 'admin', '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/admin.js', null, '1.0');
 
266
  } else {
267
+ wp_enqueue_script($this -> plugin_name, '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/gallery.js', null, '1.0');
268
  }
269
 
270
  return true;
slideshow-gallery.php CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://wpgallery.tribulant.net
6
  Author: Antonie Potgieter
7
  Author URI: http://tribulant.com
8
  Description: Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website. The slideshow is flexible and all aspects can easily be configured. Embedding or hardcoding the slideshow gallery is a breeze. To embed into a post/page, simply insert <code>[slideshow]</code> into its content with an optional <code>post_id</code> parameter. To hardcode into any PHP file of your WordPress theme, simply use <code>&lt;?php if (class_exists('Gallery')) { $Gallery = new Gallery(); $Gallery -> slideshow($output = true, $post_id = null); } ?&gt;</code> and specify the required <code>$post_id</code> parameter accordingly.
9
- Version: 1.0.4
10
  */
11
 
12
  define('DS', DIRECTORY_SEPARATOR);
@@ -25,19 +25,34 @@ class Gallery extends GalleryPlugin {
25
  $this -> add_action('admin_head');
26
  $this -> add_action('admin_notices');
27
 
 
 
 
 
28
  add_shortcode('slideshow', array($this, 'embed'));
29
  }
30
 
31
  function admin_menu() {
32
- add_menu_page(__('Slideshow', $this -> plugin_name), __('Slideshow', $this -> plugin_name), 10, basename(__FILE__), array($this, 'admin_slides'), $this -> url() . '/images/icon.png');
33
- add_submenu_page(basename(__FILE__), __('Manage Slides', $this -> plugin_name), __('Manage Slides', $this -> plugin_name), 10, $this -> plugin_name . '.php', array($this, 'admin_slides'));
34
- add_submenu_page(basename(__FILE__), __('Configuration', $this -> plugin_name), __('Configuration', $this -> plugin_name), 10, $this -> plugin_name . '-settings', array($this, 'admin_settings'));
 
 
35
  }
36
 
37
  function admin_head() {
38
  $this -> render('head', false, true, 'admin');
39
  }
40
 
 
 
 
 
 
 
 
 
 
41
  function admin_notices() {
42
  $this -> check_uploaddir();
43
 
@@ -47,11 +62,34 @@ class Gallery extends GalleryPlugin {
47
  }
48
  }
49
 
50
- function slideshow($output = true, $post_id = null) {
 
 
 
 
 
 
 
 
 
 
51
  global $wpdb;
52
 
53
  if (!empty($post_id) && $post = get_post($post_id)) {
54
  if ($attachments = get_children("post_parent=" . $post -> ID . "&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC")) {
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  $content = $this -> render('gallery', array('slides' => $attachments, 'frompost' => true), false, 'default');
56
  }
57
  } else {
@@ -66,7 +104,7 @@ class Gallery extends GalleryPlugin {
66
  //global variables
67
  global $wpdb;
68
 
69
- $defaults = array('post_id' => null, 'custom' => null);
70
  extract(shortcode_atts($defaults, $atts));
71
 
72
  if (!empty($custom)) {
@@ -78,6 +116,19 @@ class Gallery extends GalleryPlugin {
78
 
79
  if (!empty($pid) && $post = get_post($pid)) {
80
  if ($attachments = get_children("post_parent=" . $post -> ID . "&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC")) {
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  $content = $this -> render('gallery', array('slides' => $attachments, 'frompost' => true), false, 'default');
82
  }
83
  }
6
  Author: Antonie Potgieter
7
  Author URI: http://tribulant.com
8
  Description: Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website. The slideshow is flexible and all aspects can easily be configured. Embedding or hardcoding the slideshow gallery is a breeze. To embed into a post/page, simply insert <code>[slideshow]</code> into its content with an optional <code>post_id</code> parameter. To hardcode into any PHP file of your WordPress theme, simply use <code>&lt;?php if (class_exists('Gallery')) { $Gallery = new Gallery(); $Gallery -> slideshow($output = true, $post_id = null); } ?&gt;</code> and specify the required <code>$post_id</code> parameter accordingly.
9
+ Version: 1.0.5
10
  */
11
 
12
  define('DS', DIRECTORY_SEPARATOR);
25
  $this -> add_action('admin_head');
26
  $this -> add_action('admin_notices');
27
 
28
+ //WordPress filter hooks
29
+ $this -> add_filter('mce_buttons');
30
+ $this -> add_filter('mce_external_plugins');
31
+
32
  add_shortcode('slideshow', array($this, 'embed'));
33
  }
34
 
35
  function admin_menu() {
36
+ add_menu_page(__('Slideshow', $this -> plugin_name), __('Slideshow', $this -> plugin_name), 10, "gallery", array($this, 'admin_slides'), $this -> url() . '/images/icon.png');
37
+ $this -> menus['gallery'] = add_submenu_page("gallery", __('Manage Slides', $this -> plugin_name), __('Manage Slides', $this -> plugin_name), 10, "gallery", array($this, 'admin_slides'));
38
+ $this -> menus['gallery-settings'] = add_submenu_page("gallery", __('Configuration', $this -> plugin_name), __('Configuration', $this -> plugin_name), 10, "gallery-settings", array($this, 'admin_settings'));
39
+
40
+ add_action('admin_head-' . $this -> menus['gallery-settings'], array($this, 'admin_head_gallery_settings'));
41
  }
42
 
43
  function admin_head() {
44
  $this -> render('head', false, true, 'admin');
45
  }
46
 
47
+ function admin_head_gallery_settings() {
48
+ add_meta_box('submitdiv', __('Save Settings', $this -> plugin_name), array($this -> Metabox, "settings_submit"), $this -> menus['gallery-settings'], 'side', 'core');
49
+ add_meta_box('generaldiv', __('General Settings', $this -> plugin_name), array($this -> Metabox, "settings_general"), $this -> menus['gallery-settings'], 'normal', 'core');
50
+ add_meta_box('stylesdiv', __('Appearance &amp; Styles', $this -> plugin_name), array($this -> Metabox, "settings_styles"), $this -> menus['gallery-settings'], 'normal', 'core');
51
+
52
+ do_action('do_meta_boxes', $this -> menus['gallery-settings'], 'normal');
53
+ do_action('do_meta_boxes', $this -> menus['gallery-settings'], 'side');
54
+ }
55
+
56
  function admin_notices() {
57
  $this -> check_uploaddir();
58
 
62
  }
63
  }
64
 
65
+ function mce_buttons($buttons) {
66
+ array_push($buttons, "separator", "gallery");
67
+ return $buttons;
68
+ }
69
+
70
+ function mce_external_plugins($plugins) {
71
+ $plugins['gallery'] = $this -> url() . '/js/tinymce/editor_plugin.js';
72
+ return $plugins;
73
+ }
74
+
75
+ function slideshow($output = true, $post_id = null, $exclude = null) {
76
  global $wpdb;
77
 
78
  if (!empty($post_id) && $post = get_post($post_id)) {
79
  if ($attachments = get_children("post_parent=" . $post -> ID . "&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC")) {
80
+ if (!empty($exclude)) {
81
+ $exclude = array_map('trim', explode(',', $exclude));
82
+
83
+ $a = 0;
84
+ foreach ($attachments as $id => $attachment) {
85
+
86
+ $a++;
87
+ if (in_array($a, $exclude)) {
88
+ unset($attachments[$id]);
89
+ }
90
+ }
91
+ }
92
+
93
  $content = $this -> render('gallery', array('slides' => $attachments, 'frompost' => true), false, 'default');
94
  }
95
  } else {
104
  //global variables
105
  global $wpdb;
106
 
107
+ $defaults = array('post_id' => null, 'exclude' => null, 'custom' => null);
108
  extract(shortcode_atts($defaults, $atts));
109
 
110
  if (!empty($custom)) {
116
 
117
  if (!empty($pid) && $post = get_post($pid)) {
118
  if ($attachments = get_children("post_parent=" . $post -> ID . "&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC")) {
119
+ if (!empty($exclude)) {
120
+ $exclude = array_map('trim', explode(',', $exclude));
121
+
122
+ $a = 0;
123
+ foreach ($attachments as $id => $attachment) {
124
+
125
+ $a++;
126
+ if (in_array($a, $exclude)) {
127
+ unset($attachments[$id]);
128
+ }
129
+ }
130
+ }
131
+
132
  $content = $this -> render('gallery', array('slides' => $attachments, 'frompost' => true), false, 'default');
133
  }
134
  }
views/admin/settings.php CHANGED
@@ -1,18 +1,9 @@
1
  <?php
2
 
3
- global $user_ID, $post_ID, $post, $wp_meta_boxes;
4
  $post_ID = 1;
5
- $post = get_default_post_to_edit();
6
- $wp_meta_boxes = false;
7
 
8
- add_meta_box('submitdiv', __('Save Settings', $this -> plugin_name), array($this -> Metabox, "settings_submit"), 'post', 'side', 'core');
9
- add_meta_box('generaldiv', __('General Settings', $this -> plugin_name), array($this -> Metabox, "settings_general"), 'post', 'normal', 'core');
10
- add_meta_box('stylesdiv', __('Appearance &amp; Styles', $this -> plugin_name), array($this -> Metabox, "settings_styles"), 'post', 'normal', 'core');
11
-
12
- wp_nonce_field('autosave', 'autosavenonce', false);
13
  wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
14
- wp_nonce_field('getpermalink', 'getpermalinknonce', false);
15
- wp_nonce_field('samplepermalink', 'samplepermalinknonce', false);
16
  wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
17
 
18
  ?>
@@ -22,12 +13,13 @@ wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
22
 
23
  <form action="<?php echo $this -> url; ?>" name="post" id="post" method="post">
24
  <div id="poststuff" class="metabox-holder has-right-sidebar">
25
- <div id="side-info-column" class="inner-sidebar">
26
- <?php do_meta_boxes('post', 'side', $post); ?>
 
27
  </div>
28
  <div id="post-body">
29
  <div id="post-body-content">
30
- <?php do_meta_boxes('post', 'normal', $post); ?>
31
  </div>
32
  </div>
33
  <br class="clear" />
1
  <?php
2
 
3
+ global $post, $post_ID;
4
  $post_ID = 1;
 
 
5
 
 
 
 
 
 
6
  wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
 
 
7
  wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
8
 
9
  ?>
13
 
14
  <form action="<?php echo $this -> url; ?>" name="post" id="post" method="post">
15
  <div id="poststuff" class="metabox-holder has-right-sidebar">
16
+ <div id="side-info-column" class="inner-sidebar">
17
+ <?php do_action('submitpage_box'); ?>
18
+ <?php do_meta_boxes($this -> menus['gallery-settings'], 'side', $post); ?>
19
  </div>
20
  <div id="post-body">
21
  <div id="post-body-content">
22
+ <?php do_meta_boxes($this -> menus['gallery-settings'], 'normal', $post); ?>
23
  </div>
24
  </div>
25
  <br class="clear" />
views/admin/slides/index.php CHANGED
@@ -13,7 +13,7 @@
13
  <form onsubmit="if (!confirm('<?php _e('Are you sure you wish to execute this action on the selected slides?', $this -> plugin_name); ?>')) { return false; }" action="<?php echo $this -> url; ?>&amp;method=mass" method="post">
14
  <div class="tablenav">
15
  <div class="alignleft actions">
16
- <a href="<?php echo $this -> url; ?>&amp;method=order" title="<?php _e('Order all your slides', $this -> plugin_name); ?>" class="button button-secondary"><?php _e('Order Slides', $this -> plugin_name); ?></a>
17
 
18
  <select name="action" class="action">
19
  <option value="">- <?php _e('Bulk Actions', $this -> plugin_name); ?> -</option>
13
  <form onsubmit="if (!confirm('<?php _e('Are you sure you wish to execute this action on the selected slides?', $this -> plugin_name); ?>')) { return false; }" action="<?php echo $this -> url; ?>&amp;method=mass" method="post">
14
  <div class="tablenav">
15
  <div class="alignleft actions">
16
+ <a href="<?php echo $this -> url; ?>&amp;method=order" title="<?php _e('Order all your slides', $this -> plugin_name); ?>" class="button"><?php _e('Order Slides', $this -> plugin_name); ?></a>
17
 
18
  <select name="action" class="action">
19
  <option value="">- <?php _e('Bulk Actions', $this -> plugin_name); ?> -</option>
views/default/gallery.php CHANGED
@@ -39,7 +39,7 @@
39
  <?php endif; ?>
40
  </ul>
41
 
42
- <div id="wrapper">
43
  <?php if ($this -> get_option('thumbnails') == "Y" && $this -> get_option('thumbposition') == "top") : ?>
44
  <div id="thumbnails" class="thumbstop">
45
  <div id="slideleft" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
@@ -79,7 +79,7 @@
79
  <script type="text/javascript">
80
  jQuery.noConflict();
81
  tid('slideshow').style.display = "none";
82
- tid('wrapper').style.display = 'block';
83
 
84
  var slideshow = new TINY.slideshow("slideshow");
85
 
39
  <?php endif; ?>
40
  </ul>
41
 
42
+ <div id="slideshow-wrapper">
43
  <?php if ($this -> get_option('thumbnails') == "Y" && $this -> get_option('thumbposition') == "top") : ?>
44
  <div id="thumbnails" class="thumbstop">
45
  <div id="slideleft" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
79
  <script type="text/javascript">
80
  jQuery.noConflict();
81
  tid('slideshow').style.display = "none";
82
+ tid('slideshow-wrapper').style.display = 'block';
83
 
84
  var slideshow = new TINY.slideshow("slideshow");
85