Slideshow - Version 1.0.0

Version Description

  • Initial release

=

Download this release

Release Info

Developer stefanboonstra
Plugin Icon 128x128 Slideshow
Version 1.0.0
Comparing to
See all releases

Code changes from version 1.3.0 to 1.0.0

classes/Slideshow.php CHANGED
@@ -4,32 +4,21 @@
4
  * Responsible for outputting the slideshow's HTML, CSS and Javascript.
5
  *
6
  * @author: Stefan Boonstra
7
- * @version: 23-06-12
8
  */
9
  class Slideshow {
10
 
11
- /**
12
- * Function deploy prints out the prepared html
13
- *
14
- * @param int $postId
15
- */
16
- static function deploy($postId = ''){
17
- echo self::prepare($postId);
18
- }
19
 
20
  /**
21
- * Function prepare returns the required html and enqueues
22
  * the scripts and stylesheets necessary for displaying the slideshow
23
- *
24
- * Passing this function no parameter or passing it a negative one will
25
- * result in a random pick of slideshow
26
- *
27
- * @param int $postId
28
- * @return String $output
29
  */
30
- static function prepare($postId = ''){
31
- // Check if defined which Slideshow to use
32
- if(empty($postId) || !is_numeric($postId) || $postId < 0){
33
  $post = get_posts(array(
34
  'numberposts' => 1,
35
  'orderby' => 'rand',
@@ -41,16 +30,29 @@ class Slideshow {
41
  }else
42
  $post = wp_get_single_post($postId);
43
 
44
- // Exit function on error
45
  if(empty($post))
46
  return;
47
 
 
 
 
48
  // Get settings
49
- $settings = SlideshowPostType::getSettings($post->ID);
 
 
 
 
 
 
 
 
 
 
 
 
50
 
51
  // Load images into array
52
  $images = array();
53
- $imageObjects = SlideshowPostType::getAttachments($post->ID);
54
  foreach($imageObjects as $key => $imageObject){
55
  $images[$key] = array(
56
  'img' => $imageObject->guid,
@@ -60,32 +62,27 @@ class Slideshow {
60
  );
61
  }
62
 
63
- // Check in what way the stylesheet needs to be loaded, .css can be enqueued, custom styles need to be printed.
64
- $printStyle = '';
65
- if($settings['style'] == 'custom-style') // Enqueue stylesheet
66
- $printStyle = $settings['custom-style'];
67
- else // Custom style, print it.
68
- wp_enqueue_style(
69
- 'slideshow_style',
70
- SlideshowMain::getPluginUrl() . '/style/' . __CLASS__ . '/' . $settings['style']
71
- );
72
-
73
- // Include output file that stores output in $output.
74
- $output = '';
75
- ob_start();
76
- include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/slideshow.php');
77
- $output .= ob_get_clean();
78
 
79
- // Enqueue slideshow script
80
  wp_enqueue_script(
81
  'slideshow_script',
82
- SlideshowMain::getPluginUrl() . '/js/' . __CLASS__ . '/slideshow.js',
83
- array('jquery'),
84
- false,
85
  true
86
  );
87
 
88
- // Return output
89
- return $output;
 
 
 
90
  }
91
  }
4
  * Responsible for outputting the slideshow's HTML, CSS and Javascript.
5
  *
6
  * @author: Stefan Boonstra
7
+ * @version: 25-5-12
8
  */
9
  class Slideshow {
10
 
11
+ /** Variables */
12
+ private static $stylesheet = '/style/style.css';
13
+ private static $scriptfile = '/js/slideshow.js';
14
+ private static $htmlfile = 'slideshow.html';
 
 
 
 
15
 
16
  /**
17
+ * Function initialize prints out the required html and enqueues
18
  * the scripts and stylesheets necessary for displaying the slideshow
 
 
 
 
 
 
19
  */
20
+ static function initialize($postId = ''){
21
+ if(empty($postId) || !is_numeric($postId)){
 
22
  $post = get_posts(array(
23
  'numberposts' => 1,
24
  'orderby' => 'rand',
30
  }else
31
  $post = wp_get_single_post($postId);
32
 
 
33
  if(empty($post))
34
  return;
35
 
36
+ // Output basic html
37
+ echo file_get_contents(SlideshowMain::getPluginUrl() . '/views/' . __CLASS__ . '/' . self::$htmlfile);
38
+
39
  // Get settings
40
+ $settings = SlideshowPostType::$defaults;
41
+ foreach($settings as $key => $value){
42
+ $metaValue = get_post_meta($post->ID, $key, true);
43
+ if(!empty($metaValue))
44
+ $settings[$key] = $metaValue;
45
+ }
46
+
47
+ // Get images
48
+ $imageObjects = get_posts(array(
49
+ 'post_type' => 'attachment',
50
+ 'numberposts' => null,
51
+ 'post_parent' => $post->ID
52
+ ));
53
 
54
  // Load images into array
55
  $images = array();
 
56
  foreach($imageObjects as $key => $imageObject){
57
  $images[$key] = array(
58
  'img' => $imageObject->guid,
62
  );
63
  }
64
 
65
+ // Output settings and images
66
+ echo '
67
+ <script type="text/javascript">
68
+ var slideshow_images = ' . json_encode($images) . ';
69
+ var slideshow_settings = ' . json_encode($settings) . ';
70
+ </script>
71
+ ';
 
 
 
 
 
 
 
 
72
 
73
+ // Enqueue script
74
  wp_enqueue_script(
75
  'slideshow_script',
76
+ SlideshowMain::getPluginUrl() . self::$scriptfile,
77
+ array(),
78
+ '',
79
  true
80
  );
81
 
82
+ // Enqueue stylesheet
83
+ wp_enqueue_style(
84
+ 'slideshow_style',
85
+ SlideshowMain::getPluginUrl() . self::$stylesheet
86
+ );
87
  }
88
  }
classes/SlideshowFeedback.php DELETED
@@ -1,54 +0,0 @@
1
- <?php
2
- /**
3
- * Class SlideshowFeedback collects plugin feedback which helps resolving plugin-related issues faster.
4
- *
5
- * @author: Stefan Boonstra
6
- * @version: 23-6-12
7
- */
8
- class SlideshowFeedback {
9
-
10
- /** Variables */
11
- static $method = 'alter';
12
- static $access = 'OQvsxI4EV1ifIEGW';
13
- static $address = 'http://stefanboonstra.com/API/Wordpress/Plugin/Slideshow/feedback.php';
14
- static $feedbackInterval = 7;
15
-
16
- /**
17
- * Called on admin_init hook. Feedback that doesn't need to be collected
18
- * particularly on the live website shouldn't slow it down either.
19
- */
20
- static function adminInitialize(){
21
- add_action('admin_head', array(__CLASS__, 'generalInformation'));
22
- }
23
-
24
- /**
25
- * Collects general information about the slideshow
26
- */
27
- static function generalInformation(){
28
- $dateFormat = 'Y-m-d';
29
- $feedbackDateKey = 'slideshow-feedback-date';
30
- $lastFeedback = get_option($feedbackDateKey);
31
- if($lastFeedback !== false && ((strtotime(date($dateFormat)) - strtotime($lastFeedback)) / (60 * 60 * 24)) <= $feedbackDateKey)
32
- return;
33
- else
34
- update_option($feedbackDateKey, date($dateFormat));
35
-
36
- $settings = array(
37
- 'address' => self::$address,
38
- 'method' => self::$method,
39
- 'access' => self::$access,
40
- 'host' => $_SERVER['HTTP_HOST'],
41
- 'version' => SlideshowMain::$version
42
- );
43
-
44
- echo '<script type="text/javascript">var slideshowFeedback = ' . json_encode($settings) . '</script>';
45
-
46
- wp_enqueue_script(
47
- 'slideshow-feedback',
48
- SlideshowMain::getPluginUrl() . '/js/' . __CLASS__ . '/feedback.js',
49
- array('jquery'),
50
- false,
51
- true
52
- );
53
- }
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/SlideshowPostType.php CHANGED
@@ -4,40 +4,25 @@
4
  * slideshows and their individual settings
5
  *
6
  * @author: Stefan Boonstra
7
- * @version: 23-06-12
8
  */
9
  class SlideshowPostType {
10
 
11
  /** Variables */
12
  private static $adminIcon = 'images/adminIcon.png';
13
- static $postType = 'slideshow';
14
- static $settings = null;
15
- static $settingsMetaKey = 'settings';
16
- static $defaultSettings = array(
17
  'slideSpeed' => 1,
18
  'descriptionSpeed' => 0.3,
19
  'intervalSpeed' => 5,
20
  'width' => 0,
21
  'height' => 200,
22
- 'stretch' => 'false',
23
- 'controllable' => 'true',
24
- 'urlsActive' => 'false',
25
- 'showText' => 'true'
26
- );
27
- static $defaultStyleSettings = array(
28
- 'style' => 'style-dark.css',
29
- 'custom-style' => ''
30
  );
31
 
32
- /**
33
- * Initialize Slideshow post type.
34
- * Called on load of plugin
35
- */
36
- static function initialize(){
37
- add_action('init', array(__CLASS__, 'registerSlideshowPostType'));
38
- add_action('save_post', array(__CLASS__, 'save'));
39
- }
40
-
41
  /**
42
  * Registers new posttype slideshow
43
  */
@@ -56,7 +41,7 @@ class SlideshowPostType {
56
  'not_found' => __('No slideshows found', 'slideshow-plugin'),
57
  'not_found_in_trash' => __('No slideshows found', 'slideshow-plugin')
58
  ),
59
- 'public' => false,
60
  'publicly_queryable' => false,
61
  'show_ui' => true,
62
  'show_in_menu' => true,
@@ -91,17 +76,8 @@ class SlideshowPostType {
91
  __('Slides List', 'slideshow-plugin'),
92
  array(__CLASS__, 'slidesMetaBox'),
93
  self::$postType,
94
- 'side',
95
- 'default'
96
- );
97
-
98
- add_meta_box(
99
- 'style',
100
- __('Slideshow Style', 'slideshow-plugin'),
101
- array(__CLASS__, 'styleMetaBox'),
102
- self::$postType,
103
  'normal',
104
- 'low'
105
  );
106
 
107
  add_meta_box(
@@ -110,7 +86,7 @@ class SlideshowPostType {
110
  array(__CLASS__, 'settingsMetaBox'),
111
  self::$postType,
112
  'normal',
113
- 'low'
114
  );
115
  }
116
 
@@ -121,7 +97,6 @@ class SlideshowPostType {
121
  global $post;
122
 
123
  $snippet = htmlentities(sprintf('<?php do_action(\'slideshow_deploy\', \'%s\'); ?>', $post->ID));
124
- $shortCode = htmlentities(sprintf('[' . SlideshowShortcode::$shortCode . ' id=%s]', $post->ID));
125
 
126
  include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/information.php');
127
  }
@@ -132,165 +107,55 @@ class SlideshowPostType {
132
  static function slidesMetaBox(){
133
  global $post;
134
 
135
- // Media upload button
136
- $uploadButton = SlideshowUpload::getUploadButton();
137
-
138
- // Get slideshow attachments
139
- $attachments = self::getAttachments($post->ID);
140
-
141
- // Set url from which a substitute icon can be fetched
142
- $noPreviewIcon = SlideshowMain::getPluginUrl() . '/images/no-img.png';
143
 
144
- // Include slides preview file
145
  include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/slides.php');
146
  }
147
 
148
- /**
149
- * Shows style used for slideshow
150
- */
151
- static function styleMetaBox(){
152
- global $post;
153
-
154
- // Get settings
155
- $defaultSettings = self::$defaultStyleSettings;
156
- $settings = self::getSettings($post->ID);
157
-
158
- // Get styles from style folder
159
- $styles = array();
160
- $cssExtension = '.css';
161
- if($handle = opendir(SlideshowMain::getPluginPath() . '/style/Slideshow/'))
162
- while(($file = readdir($handle)) !== false)
163
- if(strlen($file) >= strlen($cssExtension) && substr($file, strlen($file) - strlen($cssExtension)) === $cssExtension)
164
- // Converts the css file's name (style-mystyle.css) and converts it to a user readable name by
165
- // cutting the style- prefix off, replacing hyphens with spaces and getting rid of the .css.
166
- // Then it capitalizes every word and saves it to the $styles array under the original $file name.
167
- $styles[$file] = ucwords(str_replace(
168
- '-',
169
- ' ',
170
- preg_replace(
171
- '/style-/',
172
- '',
173
- substr(
174
- $file,
175
- 0,
176
- '-' . strlen($cssExtension)),
177
- 1
178
- )));
179
-
180
- // Fill custom style with default css if empty
181
- if(empty($settings['custom-style']))
182
- $settings['custom-style'] = file_get_contents(SlideshowMain::getPluginUrl() . '/style/Slideshow/style-dark.css');
183
-
184
- // Enqueue associating script
185
- wp_enqueue_script(
186
- 'style-settings',
187
- SlideshowMain::getPluginUrl() . '/js/' . __CLASS__ . '/style-settings.js',
188
- array('jquery'),
189
- false,
190
- true
191
- );
192
-
193
- // Include style settings file
194
- include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/style-settings.php');
195
- }
196
-
197
  /**
198
  * Shows settings for particular slideshow
199
  */
200
  static function settingsMetaBox(){
201
  global $post;
202
 
203
- // Get settings
204
- $defaultSettings = self::$defaultSettings;
205
- $settings = self::getSettings($post->ID);
206
-
207
- // Include
208
- include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/settings.php');
209
- }
210
-
211
- /**
212
- * Called for saving metaboxes
213
- *
214
- * @param int $postId
215
- * @return int $postId On failure
216
- */
217
- static function save($postId){
218
- // Verify nonce, check if user has sufficient rights and return on auto-save.
219
- if((isset($_POST['nonce']) && !wp_verify_nonce($_POST['nonce'], plugin_basename(__FILE__))) ||
220
- !current_user_can('edit_post', $postId) ||
221
- defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
222
- return $postId;
223
-
224
- // Get old settings
225
- $oldSettings = get_post_meta($postId, self::$settingsMetaKey, true);
226
- if(!is_array($oldSettings))
227
- $oldSettings = array();
228
-
229
- // Filter post results, otherwise we'd save all post variables like post_id and ping_status.
230
- $settings = array();
231
- $defaultSettings = array_merge(
232
- self::$defaultSettings,
233
- self::$defaultStyleSettings);
234
- foreach($_POST as $key => $value)
235
- if(isset($defaultSettings[$key]))
236
- $settings[$key] = $value;
237
-
238
- // Save settings
239
- update_post_meta(
240
- $postId,
241
- self::$settingsMetaKey,
242
- array_merge(
243
- self::$defaultSettings,
244
- self::$defaultStyleSettings,
245
- $oldSettings,
246
- $settings
247
- ));
248
- }
249
-
250
- /**
251
- * Gets settings for the slideshow with the settings meta key
252
- *
253
- * @return mixed $settings
254
- */
255
- static function getSettings($postId){
256
- if(!isset(self::$settings)){
257
- // Get settings
258
- $currentSettings = get_post_meta(
259
- $postId,
260
- self::$settingsMetaKey,
261
- true
262
- );
263
-
264
- if(empty($currentSettings))
265
- $currentSettings = array();
266
 
267
- // Merge settings
268
- self::$settings = $settings = array_merge(
269
- self::$defaultSettings,
270
- self::$defaultStyleSettings,
271
- $currentSettings
272
- );
273
- }else
274
- $settings = self::$settings;
275
 
276
- return $settings;
277
  }
278
 
279
  /**
280
- * Get all attachments attached to the parsed postId
281
  *
282
- * @param int $postId
283
- * @return mixed $attachments
284
  */
285
- static function getAttachments($postId){
286
- if(!is_numeric($postId))
287
- return array();
288
-
289
- return get_posts(array(
290
- 'post_type' => 'attachment',
291
- 'numberposts' => -1,
292
- 'post_status' => null,
293
- 'post_parent' => $postId
294
- ));
295
  }
296
  }
4
  * slideshows and their individual settings
5
  *
6
  * @author: Stefan Boonstra
7
+ * @version: 04-06-12
8
  */
9
  class SlideshowPostType {
10
 
11
  /** Variables */
12
  private static $adminIcon = 'images/adminIcon.png';
13
+ public static $postType = 'slideshow';
14
+ public static $defaults = array(
 
 
15
  'slideSpeed' => 1,
16
  'descriptionSpeed' => 0.3,
17
  'intervalSpeed' => 5,
18
  'width' => 0,
19
  'height' => 200,
20
+ 'stretch' => 0,
21
+ 'controllable' => 1,
22
+ 'urlsActive' => 0,
23
+ 'showText' => 1
 
 
 
 
24
  );
25
 
 
 
 
 
 
 
 
 
 
26
  /**
27
  * Registers new posttype slideshow
28
  */
41
  'not_found' => __('No slideshows found', 'slideshow-plugin'),
42
  'not_found_in_trash' => __('No slideshows found', 'slideshow-plugin')
43
  ),
44
+ 'public' => true,
45
  'publicly_queryable' => false,
46
  'show_ui' => true,
47
  'show_in_menu' => true,
76
  __('Slides List', 'slideshow-plugin'),
77
  array(__CLASS__, 'slidesMetaBox'),
78
  self::$postType,
 
 
 
 
 
 
 
 
 
79
  'normal',
80
+ 'high'
81
  );
82
 
83
  add_meta_box(
86
  array(__CLASS__, 'settingsMetaBox'),
87
  self::$postType,
88
  'normal',
89
+ 'core'
90
  );
91
  }
92
 
97
  global $post;
98
 
99
  $snippet = htmlentities(sprintf('<?php do_action(\'slideshow_deploy\', \'%s\'); ?>', $post->ID));
 
100
 
101
  include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/information.php');
102
  }
107
  static function slidesMetaBox(){
108
  global $post;
109
 
110
+ $attachments = get_posts(array(
111
+ 'post_type' => 'attachment',
112
+ 'numberposts' => null,
113
+ 'post_status' => null,
114
+ 'post_parent' => $post->ID
115
+ ));
 
 
116
 
 
117
  include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/slides.php');
118
  }
119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  /**
121
  * Shows settings for particular slideshow
122
  */
123
  static function settingsMetaBox(){
124
  global $post;
125
 
126
+ $defaults = self::$defaults;
127
+
128
+ $settings = array(
129
+ 'slideSpeed' => get_post_meta($post->ID, 'slideSpeed', true),
130
+ 'descriptionSpeed' => get_post_meta($post->ID, 'descriptionSpeed', true),
131
+ 'intervalSpeed' => get_post_meta($post->ID, 'intevalSpeed', true),
132
+ 'width' => get_post_meta($post->ID, 'width', true),
133
+ 'height' => get_post_meta($post->ID, 'height', true),
134
+ 'stretch' => get_post_meta($post->ID, 'stretch', true),
135
+ 'controllable' => get_post_meta($post->ID, 'controllable', true),
136
+ 'urlsActive' => get_post_meta($post->ID, 'urlsActive', true),
137
+ 'showText' => get_post_meta($post->ID, 'showText', true)
138
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
 
140
+ foreach($settings as $key => $value)
141
+ if(empty($value))
142
+ $settings[$key] = $defaults[$key];
 
 
 
 
 
143
 
144
+ include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/settings.php');
145
  }
146
 
147
  /**
148
+ * Called for saving settings
149
  *
150
+ * @param stdObject $post
 
151
  */
152
+ static function save($post){
153
+ foreach(self::$defaults as $key => $default){
154
+ $value = $default;
155
+ if(isset($_POST[$key]) && ($_POST[$key] != $value || !empty($_POST[$key])))
156
+ $value = $_POST[$key];
157
+
158
+ update_post_meta($post, $key, $value);
159
+ }
 
 
160
  }
161
  }
classes/SlideshowShortcode.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- /**
3
- * Class SlideshowShortcode is called on use of shortcode anywhere on the website.
4
- *
5
- * @author: Stefan Boonstra
6
- * @version: 15-06-12
7
- */
8
- class SlideshowShortcode {
9
-
10
- /** Variables */
11
- static $shortCode = 'slideshow_deploy';
12
-
13
- /**
14
- * Function slideshowDeploy uses the prepare method of class Slideshow
15
- * to deploy the slideshow on location of the [slideshow] shortcode.
16
- *
17
- * @param mixed $atts
18
- * @return String $output
19
- */
20
- static function slideshowDeploy($atts){
21
- $postId = '';
22
- if(isset($atts['id']))
23
- $postId = $atts['id'];
24
-
25
- return Slideshow::prepare($postId);
26
- }
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/SlideshowUpload.php DELETED
@@ -1,51 +0,0 @@
1
- <?php
2
- /**
3
- * Class SlideshowUpload provides the code for an upload button that can be used
4
- * anywhere on a website.
5
- *
6
- * @author: Stefan Boonstra
7
- * @version: 21-6-12
8
- */
9
- class SlideshowUpload {
10
-
11
- /**
12
- * Returns the html for showing the upload button.
13
- * Enqueues scripts unless $enqueueFiles is set to false.
14
- *
15
- * @param boolean $enqueueFiles
16
- * @return String $button
17
- */
18
- static function getUploadButton($enqueueFiles = true){
19
- if($enqueueFiles)
20
- self::enqueueFiles();
21
-
22
- // Return button html
23
- ob_start();
24
- include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/upload-button.php');
25
- return ob_get_clean();
26
- }
27
-
28
- /**
29
- * Enqueues styles and scripts necessary for the media upload button.
30
- */
31
- static function enqueueFiles(){
32
- // Enqueue styles
33
- wp_enqueue_style('thickbox');
34
-
35
- // Enqueue Wordpress scripts
36
- wp_enqueue_script('media-upload', false, array(), false, true);
37
- wp_enqueue_script('thickbox', false, array(), false, true);
38
-
39
- // Enqueue slideshow upload button script
40
- wp_enqueue_script(
41
- 'slideshow-upload-button',
42
- SlideshowMain::getPluginUrl() . '/js/' . __CLASS__ . '/upload-button.js',
43
- array(
44
- 'jquery',
45
- 'media-upload',
46
- 'thickbox'),
47
- false,
48
- true
49
- );
50
- }
51
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/SlideshowWidget.php DELETED
@@ -1,105 +0,0 @@
1
- <?php
2
- /**
3
- * Class SlideshowWidget allows showing one of your slideshows in your widget area.
4
- *
5
- * @author: Stefan Boonstra
6
- * @version: 21-06-12
7
- */
8
- class SlideshowWidget extends WP_Widget {
9
-
10
- /** Variables */
11
- static $widgetName = 'Slideshow Widget';
12
-
13
- /**
14
- * Initializes the widget
15
- */
16
- function SlideshowWidget(){
17
- // Settings
18
- $options = array(
19
- 'classname' => 'SlideshowWidget',
20
- 'description' => __('Enables you to show your slideshows in the widget area of your website.', 'slideshow-plugin')
21
- );
22
-
23
- // Create the widget.
24
- $this->WP_Widget(
25
- 'slideshowWidget',
26
- __('Slideshow Widget', 'slideshow-plugin'),
27
- $options
28
- );
29
- }
30
-
31
- /**
32
- * The widget as shown to the user.
33
- *
34
- * @param mixed array $args
35
- * @param mixed array $instance
36
- */
37
- function widget($args, $instance){
38
- // Get slideshowId
39
- $slideshowId = '';
40
- if(isset($instance['slideshowId']))
41
- $slideshowId = $instance['slideshowId'];
42
-
43
- // Get title
44
- $title = self::$widgetName;
45
- if(isset($instance['title']))
46
- $title = $instance['title'];
47
-
48
- // Prepare slideshow for output to website.
49
- $output = Slideshow::prepare($slideshowId);
50
-
51
- // Include widget html
52
- include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/widget.php');
53
- }
54
-
55
- /**
56
- * The form shown on the admins widget page. Here settings can be changed.
57
- *
58
- * @param mixed array $instance
59
- */
60
- function form($instance){
61
- // Defaults
62
- $defaults = array(
63
- 'title' => __(self::$widgetName, 'slideshow-plugin'),
64
- 'slideshowId' => -1
65
- );
66
-
67
- // Merge database settings with defaults
68
- $instance = wp_parse_args((array) $instance, $defaults);
69
-
70
- // Get slideshows
71
- $slideshows = get_posts(array(
72
- 'numberposts' => null,
73
- 'post_type' => SlideshowPostType::$postType
74
- ));
75
-
76
- // Include form
77
- include(SlideshowMain::getPluginPath() . '/views/' . __CLASS__ . '/form.php');
78
- }
79
-
80
- /**
81
- * Updates widget's settings.
82
- *
83
- * @param mixed array $newInstance
84
- * @param mixed array $instance
85
- */
86
- function update($newInstance, $instance){
87
- // Update title
88
- if(isset($newInstance['title']) && !empty($newInstance['title']))
89
- $instance['title'] = $newInstance['title'];
90
-
91
- // Update slideshowId
92
- if(isset($newInstance['slideshowId']) && !empty($newInstance['slideshowId']))
93
- $instance['slideshowId'] = $newInstance['slideshowId'];
94
-
95
- // Save
96
- return $instance;
97
- }
98
-
99
- /**
100
- * Registers this widget (should be called upon widget_init action hook)
101
- */
102
- static function registerWidget(){
103
- register_widget(__CLASS__);
104
- }
105
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
images/no-img.png CHANGED
Binary file
js/SlideshowFeedback/feedback.js DELETED
@@ -1,12 +0,0 @@
1
- jQuery(document).ready(function(){
2
- jQuery.ajax({
3
- url: slideshowFeedback['address'],
4
- dataType: 'jsonp',
5
- data: {
6
- method: slideshowFeedback['method'],
7
- access: slideshowFeedback['access'],
8
- host: slideshowFeedback['host'],
9
- version: slideshowFeedback['version']
10
- }
11
- });
12
- });
 
 
 
 
 
 
 
 
 
 
 
 
js/SlideshowPostType/style-settings.js DELETED
@@ -1,21 +0,0 @@
1
- jQuery(document).ready(function(){
2
- //if(jQuery('.custom-style-textarea').val() == '')
3
- // jQuery.get('./css/' + this.val(), function(data) { $('#myTextbox').val(data); });
4
-
5
- var currentlyEdited = '.' + jQuery('.style-list').val();
6
- setVisible(currentlyEdited, true);
7
-
8
- jQuery('.style-list').change(function(){
9
- setVisible(currentlyEdited, false);
10
-
11
- currentlyEdited = '.' + jQuery('.style-list').val();
12
- setVisible(currentlyEdited, true);
13
- });
14
-
15
- function setVisible(element, visible){
16
- if(visible)
17
- jQuery(element).css({'display': 'inline'});
18
- else
19
- jQuery(element).css({'display': 'none'});
20
- }
21
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/SlideshowUpload/upload-button.js DELETED
@@ -1,8 +0,0 @@
1
- jQuery(document).ready(function(){
2
- jQuery('#upload_image_button').click(function() {
3
- formfield = jQuery('#upload_image').attr('name');
4
- post_id = jQuery('#post_ID').val();
5
- tb_show('', 'media-upload.php?post_id='+post_id+'&amp;type=image&amp;TB_iframe=true');
6
- return false;
7
- });
8
- });
 
 
 
 
 
 
 
 
js/{Slideshow/slideshow.js → slideshow.js} RENAMED
@@ -115,25 +115,13 @@ var Slideshow = {
115
 
116
  // Miscellaneous settings
117
  if(settings['stretch'] != '')
118
- if(settings['stretch'] == 'true')
119
- slideShow.stretch = true;
120
- else
121
- slideShow.stretch = false;
122
  if(settings['controllable'] != '')
123
- if(settings['controllable'] == 'true')
124
- slideShow.controllable = true;
125
- else
126
- slideShow.controllable = false;
127
  if(settings['urlsActive'] != '')
128
- if(settings['urlsActive'] == 'true')
129
- slideShow.urlsActive = true;
130
- else
131
- slideShow.urlsActive = false;
132
  if(settings['showText'] != '')
133
- if(settings['showText'] == 'true')
134
- slideShow.showText = true;
135
- else
136
- slideShow.showText = false;
137
  },
138
 
139
  /**
115
 
116
  // Miscellaneous settings
117
  if(settings['stretch'] != '')
118
+ slideShow.stretch = settings['stretch'];
 
 
 
119
  if(settings['controllable'] != '')
120
+ slideShow.controllable = settings['controllable'];
 
 
 
121
  if(settings['urlsActive'] != '')
122
+ slideShow.urlsActive = settings['urlsActive'];
 
 
 
123
  if(settings['showText'] != '')
124
+ slideShow.showText = settings['showText'];
 
 
 
125
  },
126
 
127
  /**
languages/slideshow-plugin-nl_NL.mo DELETED
Binary file
languages/slideshow-plugin-nl_NL.po DELETED
@@ -1,196 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Slideshow Plugin\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2012-06-23 17:41+0100\n"
6
- "PO-Revision-Date: 2012-06-23 17:41+0100\n"
7
- "Last-Translator: Stefan Boonstra <stefanboonstra@hotmail.com>\n"
8
- "Language-Team: Boonstra <stefanboonstra@hotmail.com>\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-KeywordsList: _;_e;__\n"
13
- "X-Poedit-Basepath: C:\\xampp\\htdocs\\wordpress\\vanderlei-showproductions\\wp-content\\plugins\\slideshow-jquery-image-gallery\n"
14
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
15
- "X-Poedit-Language: Dutch\n"
16
- "X-Poedit-Country: NETHERLANDS\n"
17
- "X-Poedit-SearchPath-0: .\n"
18
-
19
- #: classes/SlideshowPostType.php:49
20
- msgid "Slideshows"
21
- msgstr "Slideshows"
22
-
23
- #: classes/SlideshowPostType.php:50
24
- #: views/SlideshowWidget/form.php:7
25
- msgid "Slideshow"
26
- msgstr "Slideshow"
27
-
28
- #: classes/SlideshowPostType.php:51
29
- msgid "Add New Slideshow"
30
- msgstr "Nieuwe Slideshow Toevoegen"
31
-
32
- #: classes/SlideshowPostType.php:52
33
- msgid "Edit slideshow"
34
- msgstr "Slideshow bewerken"
35
-
36
- #: classes/SlideshowPostType.php:53
37
- msgid "New slideshow"
38
- msgstr "Nieuwe slideshow"
39
-
40
- #: classes/SlideshowPostType.php:54
41
- msgid "View slideshow"
42
- msgstr "Slideshow bekijken"
43
-
44
- #: classes/SlideshowPostType.php:55
45
- msgid "Search slideshows"
46
- msgstr "Slideshows zoeken"
47
-
48
- #: classes/SlideshowPostType.php:56
49
- #: classes/SlideshowPostType.php:57
50
- msgid "No slideshows found"
51
- msgstr "Geen slideshows gevonden"
52
-
53
- #: classes/SlideshowPostType.php:82
54
- msgid "Information"
55
- msgstr "Informatie"
56
-
57
- #: classes/SlideshowPostType.php:91
58
- msgid "Slides List"
59
- msgstr "Slides Lijst"
60
-
61
- #: classes/SlideshowPostType.php:100
62
- msgid "Slideshow Style"
63
- msgstr "Slideshow Stijl"
64
-
65
- #: classes/SlideshowPostType.php:109
66
- msgid "Slideshow Settings"
67
- msgstr "Slideshow Instellingen"
68
-
69
- #: classes/SlideshowWidget.php:20
70
- msgid "Enables you to show your slideshows in the widget area of your website."
71
- msgstr "Maakt het mogelijk je slideshows te bijken in het wigdet gebied van je website."
72
-
73
- #: classes/SlideshowWidget.php:26
74
- msgid "Slideshow Widget"
75
- msgstr "Slideshow Widget"
76
-
77
- #: views/SlideshowPostType/information.php:3
78
- msgid "To use this slideshow in your website either add this piece of shortcode to your posts or pages"
79
- msgstr "Om deze slideshow op je website te gebruiken voeg je of dit stukje shortcode aan je pagina of post toe"
80
-
81
- #: views/SlideshowPostType/information.php:5
82
- msgid "Or add this piece of code to where ever in your website you want to place the slideshow"
83
- msgstr "Of je voegt dit stuk code toe aan je broncode op de plaats waar je wilt dat de slideshow te zien is"
84
-
85
- #: views/SlideshowPostType/settings.php:3
86
- msgid "Number of seconds the slide takes to slide in"
87
- msgstr "Aantal seconden dat de animatie van het inschuiven van de volgende slide duurt"
88
-
89
- #: views/SlideshowPostType/settings.php:5
90
- #: views/SlideshowPostType/settings.php:10
91
- #: views/SlideshowPostType/settings.php:15
92
- #: views/SlideshowPostType/settings.php:20
93
- #: views/SlideshowPostType/settings.php:25
94
- #: views/SlideshowPostType/settings.php:33
95
- #: views/SlideshowPostType/settings.php:41
96
- #: views/SlideshowPostType/settings.php:49
97
- #: views/SlideshowPostType/settings.php:57
98
- msgid "Default"
99
- msgstr "Standaard"
100
-
101
- #: views/SlideshowPostType/settings.php:8
102
- msgid "Number of seconds the description takes to slide in"
103
- msgstr "Aantal seconden dat het inschuiven van de beschrijving duurt"
104
-
105
- #: views/SlideshowPostType/settings.php:13
106
- msgid "Seconds between changing slides"
107
- msgstr "Seconden tussen het wisselen van de slides"
108
-
109
- #: views/SlideshowPostType/settings.php:18
110
- msgid "Width of the slideshow"
111
- msgstr "Breedte van de slideshow"
112
-
113
- #: views/SlideshowPostType/settings.php:20
114
- msgid "Defaults to parent's width."
115
- msgstr "Standaard ingesteld op de breedte van het bovenliggende element."
116
-
117
- #: views/SlideshowPostType/settings.php:23
118
- msgid "Height of the slideshow"
119
- msgstr "Hoogte van de slideshow"
120
-
121
- #: views/SlideshowPostType/settings.php:28
122
- msgid "Fit image into slideshow (stretching it)"
123
- msgstr "Pas afbeelding in de slideshow (oprekken)"
124
-
125
- #: views/SlideshowPostType/settings.php:30
126
- #: views/SlideshowPostType/settings.php:33
127
- #: views/SlideshowPostType/settings.php:38
128
- #: views/SlideshowPostType/settings.php:41
129
- #: views/SlideshowPostType/settings.php:46
130
- #: views/SlideshowPostType/settings.php:49
131
- #: views/SlideshowPostType/settings.php:54
132
- #: views/SlideshowPostType/settings.php:57
133
- msgid "Yes"
134
- msgstr "Ja"
135
-
136
- #: views/SlideshowPostType/settings.php:31
137
- #: views/SlideshowPostType/settings.php:33
138
- #: views/SlideshowPostType/settings.php:39
139
- #: views/SlideshowPostType/settings.php:41
140
- #: views/SlideshowPostType/settings.php:47
141
- #: views/SlideshowPostType/settings.php:49
142
- #: views/SlideshowPostType/settings.php:55
143
- #: views/SlideshowPostType/settings.php:57
144
- msgid "No"
145
- msgstr "Nee"
146
-
147
- #: views/SlideshowPostType/settings.php:36
148
- msgid "Activate buttons (so the user can scroll through the slides)"
149
- msgstr "Knoppen activeren (zodat de gebruiker door de slides kan scrollen)"
150
-
151
- #: views/SlideshowPostType/settings.php:44
152
- msgid "Send user to image URL on click"
153
- msgstr "Wanner de gebruiker op de afbeelding klikt, stuur hem naar de URL van het plaatje"
154
-
155
- #: views/SlideshowPostType/settings.php:52
156
- msgid "Show title and description"
157
- msgstr "Toon titel en beschrijving"
158
-
159
- #: views/SlideshowPostType/slides.php:4
160
- msgid "Add slides to this slideshow by using the button above or attaching images from the media page."
161
- msgstr "Voeg slides toe door afbeeldingen te uploaden met de bovenstaande knop of ze te koppelen aan deze slideshow via de media pagina."
162
-
163
- #: views/SlideshowPostType/style-settings.php:3
164
- msgid "Style"
165
- msgstr "Style"
166
-
167
- #: views/SlideshowPostType/style-settings.php:9
168
- msgid "Custom Style"
169
- msgstr "Aangepaste Stijl"
170
-
171
- #: views/SlideshowPostType/style-settings.php:12
172
- msgid "The style used for this slideshow"
173
- msgstr "De stijl te gebruiken voor deze slidehsow"
174
-
175
- #: views/SlideshowPostType/style-settings.php:18
176
- msgid "Custom Style Editor"
177
- msgstr "Aangepaste Stijl Bewerker"
178
-
179
- #: views/SlideshowPostType/style-settings.php:22
180
- msgid "Custom style"
181
- msgstr "Aangepaste stijl"
182
-
183
- #: views/SlideshowUpload/upload-button.php:1
184
- msgid "Upload/Manage Images"
185
- msgstr "Upload/Beheer Afbeeldingen"
186
-
187
- #: views/SlideshowWidget/form.php:2
188
- msgid "Title"
189
- msgstr "Titel"
190
-
191
- #: views/SlideshowWidget/form.php:9
192
- msgid "Random Slideshow"
193
- msgstr "Willekeurige Slideshow"
194
-
195
- #~ msgid "Leave any field open to use default value."
196
- #~ msgstr "Een veld dat open wordt gelaten neemt de standaardwaarde aan."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,8 +3,8 @@
3
  Contributors: stefanboonstra
4
  Tags: slideshow, slider, slide, images, image, photo, gallery, galleries
5
  Requires at least: 3.0
6
- Tested up to: 3.4
7
- Stable tag: 1.3.0
8
  License: GPLv2
9
 
10
  Integrate a fancy slideshow in just five steps. - Rainbows. Rainbows everywhere.
@@ -29,57 +29,28 @@ different images and settings for each one of them.
29
 
30
  2. After activating Slideshow, you can create a new slideshow.
31
 
32
- 3. Upload images to your newly created slideshow with the upload button in the slides list.
33
 
34
- 4. Use the shortcode or code snippet visible in your slideshow admin panel to deploy your slideshow anywhere on your website.
35
- You can also use the widget to show any of your slideshows in your sidebar.
36
 
37
  5. Feel like a sir.
38
 
39
 
40
  == Screenshots ==
41
 
42
- 1. Create a new slideshow. A shortcode and a code snippet of how to call it is already visible.
43
 
44
  2. Attach images to the slideshow for the media menu.
45
 
46
  3. The attached images are now visible in your newly created slideshow.
47
 
48
- 4. Using the shortcode or code snippet the slideshow shows you, you can enjoy your slides in style.
49
 
50
 
51
  == Changelog ==
52
 
53
- = 1.3.0 =
54
- * Added Dutch translation.
55
- * Custom styles for each slideshow are now available to be more compatable with every theme. (Black and transparent scheme)
56
- * Encapsulated a css class so that it does not interfere with anything outside the slideshow_container.
57
- * Moved slides list to the side, saving space on the slideshow specific settings page.
58
- * Settings bugs completely fixed, finally. (Previous version deleted post-meta on auto-save)
59
- * Moved Slideshow settings and images script to inside the slideshow_container, outputting a more coherent whole.
60
- * Settings moved from multiple meta keys to a single one. (This resets everyone's settings)
61
- * Added a Wordpress media upload button to the slides list, this simplifies attaching images to a slideshow.
62
- * Better way of including the jQuery library is now being used.
63
- * Fixed bug with the number of slides shown in the slideshow stuck at the default value of five.
64
-
65
- = 1.2.1 =
66
- * Fixed: Slideshow specific settings not saving.
67
-
68
- = 1.2.0 =
69
- * Slideshows can now be placed in posts as well, using shortcode [slideshow id=*SlideshowPostId*].
70
- * Added a widget that can be loaded with an existing slideshow of choice.
71
- * Tested up to version 3.4
72
-
73
- = 1.1.0 =
74
- * Added jQuery library as Wordpress websites don't seem to load them by default.
75
- * Slideshow script now depends on by the plugin enqueued jQuery script.
76
-
77
- = 1.0.1 =
78
- * Added documentary comments.
79
- * Fixed error with directory paths causing Slideshows post type page to generate warnings.
80
-
81
  = 1.0.0 =
82
- * Initial release.
83
 
84
 
85
  == Links ==
3
  Contributors: stefanboonstra
4
  Tags: slideshow, slider, slide, images, image, photo, gallery, galleries
5
  Requires at least: 3.0
6
+ Tested up to: 3.2.2
7
+ Stable tag: 1.0.0
8
  License: GPLv2
9
 
10
  Integrate a fancy slideshow in just five steps. - Rainbows. Rainbows everywhere.
29
 
30
  2. After activating Slideshow, you can create a new slideshow.
31
 
32
+ 3. Attach images from the media page to your newly created slideshow.
33
 
34
+ 4. Use the code snippet visible in your slideshow admin panel to deploy your slideshow anywhere on your website.
 
35
 
36
  5. Feel like a sir.
37
 
38
 
39
  == Screenshots ==
40
 
41
+ 1. Create a new slideshow. A code snippet of how to call it is already visible.
42
 
43
  2. Attach images to the slideshow for the media menu.
44
 
45
  3. The attached images are now visible in your newly created slideshow.
46
 
47
+ 4. Using the code snippet the slideshow shows you, you can enjoy your slides in style.
48
 
49
 
50
  == Changelog ==
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  = 1.0.0 =
53
+ * Initial release
54
 
55
 
56
  == Links ==
slideshow.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Slideshow
4
  Plugin URI: http://stefanboonstra.com
5
  Description: This plugin offers a slideshow that is easily deployable in your website. Images can be assigned through the media page. Options are customizable for every single slideshow on your website.
6
- Version: 1.3.0
7
  Requires at least: 3.0
8
  Author: StefanBoonstra
9
  Author URI: http://stefanboonstra.com
@@ -16,13 +16,10 @@
16
  * base path/url returning method.
17
  *
18
  * @author Stefan Boonstra
19
- * @version 23-06-12
20
  */
21
  class SlideshowMain {
22
 
23
- /** Variables */
24
- static $version = '1.3.0';
25
-
26
  /**
27
  * Bootstraps the application by assigning the right functions to
28
  * the right action hooks.
@@ -30,29 +27,21 @@ class SlideshowMain {
30
  static function bootStrap(){
31
  self::autoInclude();
32
 
33
- // Initialize localization on init
34
- add_action('init', array(__CLASS__, 'localize'));
35
 
36
  // Deploy slide show on do_action('slideshow_deploy'); hook.
37
- add_action('slideshow_deploy', array('Slideshow', 'deploy'));
38
-
39
- // Add shortcode
40
- add_shortcode(SlideshowShortcode::$shortCode, array('SlideshowShortcode', 'slideshowDeploy'));
41
-
42
- // Register widget
43
- add_action('widgets_init', array('SlideshowWidget', 'registerWidget'));
44
 
45
  // Register slideshow post type
46
- SlideshowPostType::initialize();
47
-
48
- // Plugin feedback
49
- add_action('admin_init', array('SlideshowFeedback', 'adminInitialize'));
50
  }
51
 
52
  /**
53
  * Translates the plugin
54
  */
55
- static function localize(){
56
  load_plugin_textdomain(
57
  'slideshow-plugin',
58
  false,
3
  Plugin Name: Slideshow
4
  Plugin URI: http://stefanboonstra.com
5
  Description: This plugin offers a slideshow that is easily deployable in your website. Images can be assigned through the media page. Options are customizable for every single slideshow on your website.
6
+ Version: 1.0.0
7
  Requires at least: 3.0
8
  Author: StefanBoonstra
9
  Author URI: http://stefanboonstra.com
16
  * base path/url returning method.
17
  *
18
  * @author Stefan Boonstra
19
+ * @version 04-06-12
20
  */
21
  class SlideshowMain {
22
 
 
 
 
23
  /**
24
  * Bootstraps the application by assigning the right functions to
25
  * the right action hooks.
27
  static function bootStrap(){
28
  self::autoInclude();
29
 
30
+ // Initialize translation on init
31
+ add_action('init', array(__CLASS__, 'translator'));
32
 
33
  // Deploy slide show on do_action('slideshow_deploy'); hook.
34
+ add_action('slideshow_deploy', array('Slideshow', 'initialize'));
 
 
 
 
 
 
35
 
36
  // Register slideshow post type
37
+ add_action('init', array('SlideshowPostType', 'registerSlideshowPostType'));
38
+ add_action('save_post', array('SlideshowPostType', 'save'));
 
 
39
  }
40
 
41
  /**
42
  * Translates the plugin
43
  */
44
+ static function translator(){
45
  load_plugin_textdomain(
46
  'slideshow-plugin',
47
  false,
style/Slideshow/style-dark.css DELETED
@@ -1,66 +0,0 @@
1
- .slideshow_container { /** Contains all slideshow elements */
2
- background: #000;
3
- }
4
-
5
- .slideshow { /** Contains all slides */
6
- overflow: hidden;
7
- }
8
-
9
- .slideshow .slideshow_div { /** This is a slide */
10
- width: 0;
11
- overflow: hidden;
12
- float: left;
13
- }
14
-
15
- .slideshow_container .button { /** Style for both buttons */
16
- visibility: hidden;
17
- width: 24px;
18
- height: 100px;
19
- cursor: pointer;
20
-
21
- position: relative;
22
- z-index: 2;
23
- }
24
-
25
- .slideshow_container .next { /** Style for the 'next' button */
26
- float: right;
27
- background: url('../../images/button-next.png');
28
- margin-right: 10px;
29
- }
30
-
31
- .slideshow_container .previous { /** Style for the 'previous' button */
32
- float: left;
33
- background: url('../../images/button-previous.png');
34
- margin-left: 10px;
35
- }
36
-
37
- .slideshow_container .transparent { /** Items with this class are transparent */
38
- zoom: 1;
39
- filter: alpha(opacity = 50);
40
- opacity: 0.5;
41
- }
42
-
43
- .slideshow_container .transparent:hover { /** On hover over transparent items */
44
- zoom: 1;
45
- filter: alpha(opacity = 80);
46
- opacity: 0.8;
47
- }
48
-
49
- .slideshow_container .descriptionbox { /** Descriptionbox */
50
- background: #000;
51
- color: #fff;
52
- float: right;
53
- margin-top: 0;
54
- margin-right: 44px;
55
- height: 0;
56
- width: 300px;
57
- overflow: hidden;
58
-
59
- position: relative;
60
- z-index: 1;
61
- }
62
-
63
- .slideshow_container .descriptionbox h2,
64
- .slideshow_container .descriptionbox p { /** Text inside descriptionbox */
65
- padding: 10px;
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
style/{Slideshow/style-transparent.css → style.css} RENAMED
@@ -1,4 +1,6 @@
1
- .slideshow_container { }
 
 
2
 
3
  .slideshow {
4
  overflow: hidden;
@@ -22,13 +24,13 @@
22
 
23
  .slideshow_container .next {
24
  float: right;
25
- background: url('../../images/button-next.png');
26
  margin-right: 10px;
27
  }
28
 
29
  .slideshow_container .previous {
30
  float: left;
31
- background: url('../../images/button-previous.png');
32
  margin-left: 10px;
33
  }
34
 
@@ -58,7 +60,7 @@
58
  z-index: 1;
59
  }
60
 
61
- .slideshow_container .descriptionbox h2,
62
- .slideshow_container .descriptionbox p {
63
- padding: 10px;
64
  }
1
+ .slideshow_container {
2
+ background: #000;
3
+ }
4
 
5
  .slideshow {
6
  overflow: hidden;
24
 
25
  .slideshow_container .next {
26
  float: right;
27
+ background: url('../images/button-next.png');
28
  margin-right: 10px;
29
  }
30
 
31
  .slideshow_container .previous {
32
  float: left;
33
+ background: url('../images/button-previous.png');
34
  margin-left: 10px;
35
  }
36
 
60
  z-index: 1;
61
  }
62
 
63
+ .descriptionbox h2,
64
+ .descriptionbox p {
65
+ padding: 10px; /* Conflicts with local styles, */
66
  }
views/Slideshow/slideshow.html ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <div class="slideshow_container">
2
+ <div class="slideshow"></div>
3
+ <div class="descriptionbox transparent"></div>
4
+ <a class="button next transparent"></a>
5
+ <a class="button previous transparent"></a>
6
+ </div>
views/Slideshow/slideshow.php DELETED
@@ -1,17 +0,0 @@
1
- <div class="slideshow_container">
2
- <div class="slideshow"></div>
3
- <div class="descriptionbox transparent"></div>
4
- <a class="button next transparent"></a>
5
- <a class="button previous transparent"></a>
6
-
7
- <script type="text/javascript">
8
- var slideshow_images = <? echo json_encode($images); ?>;
9
- var slideshow_settings = <? echo json_encode($settings); ?>;
10
- </script>
11
-
12
- <? if(!empty($printStyle)): ?>
13
- <style type="text/css">
14
- <? echo $printStyle; ?>
15
- </style>
16
- <? endif; ?>
17
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/SlideshowPostType/information.php CHANGED
@@ -1,10 +1,3 @@
1
  <p>
2
- <? echo sprintf(
3
- '<p>' . __('To use this slideshow in your website either add this piece of shortcode to your posts or pages', 'slideshow-plugin') . ':</p>
4
- <p><i>%s<i></p>
5
- <p>' . __('Or add this piece of code to where ever in your website you want to place the slideshow', 'slideshow-plugin') . ':</p>
6
- <p><i>%s</i></p>',
7
- $shortCode,
8
- $snippet
9
- ); ?>
10
  </p>
1
  <p>
2
+ <? _e(sprintf('To use this slideshow in your website add this piece of code: <i>"%s"</i> to where ever in your theme you want to place the slideshow.', $snippet), 'slideshow-plugin'); ?>
 
 
 
 
 
 
 
3
  </p>
views/SlideshowPostType/settings.php CHANGED
@@ -1,59 +1,51 @@
 
 
 
 
1
  <table border="0">
2
  <tr>
3
  <td><? _e('Number of seconds the slide takes to slide in', 'slideshow-plugin'); ?></td>
4
  <td><input type="text" name="slideSpeed" value="<? echo $settings['slideSpeed']; ?>" size="5" /></td>
5
- <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaultSettings['slideSpeed'] ?></i></td>
6
  </tr>
7
  <tr>
8
  <td><? _e('Number of seconds the description takes to slide in', 'slideshow-plugin'); ?></td>
9
  <td><input type="text" name="descriptionSpeed" value="<? echo $settings['descriptionSpeed']; ?>" size="5" /></td>
10
- <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaultSettings['descriptionSpeed'] ?></i></td>
11
  </tr>
12
  <tr>
13
  <td><? _e('Seconds between changing slides', 'slideshow-plugin'); ?></td>
14
  <td><input type="text" name="intervalSpeed" value="<? echo $settings['intervalSpeed']; ?>" size="5" /></td>
15
- <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaultSettings['intervalSpeed'] ?></i></td>
16
  </tr>
17
  <tr>
18
  <td><? _e('Width of the slideshow', 'slideshow-plugin'); ?></td>
19
  <td><input type="text" name="width" value="<? echo $settings['width']; ?>" size="5" /></td>
20
- <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaultSettings['width'] ?> - <? _e('Defaults to parent\'s width.', 'slideshow-plugin'); ?></i></td>
21
  </tr>
22
  <tr>
23
  <td><? _e('Height of the slideshow', 'slideshow-plugin'); ?></td>
24
  <td><input type="text" name="height" value="<? echo $settings['height']; ?>" size="5" /></td>
25
- <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaultSettings['height'] ?></i></td>
26
  </tr>
27
  <tr>
28
- <td><? _e('Fit image into slideshow (stretching it)', 'slideshow-plugin'); ?></td>
29
- <td>
30
- <label><input type="radio" name="stretch" value="true" <? checked($settings['stretch'], 'true'); ?> /> <? _e('Yes', 'slideshow-plugin'); ?></label><br />
31
- <label><input type="radio" name="stretch" value="false" <? checked($settings['stretch'], 'false'); ?> /> <? _e('No', 'slideshow-plugin'); ?></label>
32
- </td>
33
- <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? if($defaultSettings['stretch'] == 'true') _e('Yes', 'slideshow-plugin'); else _e('No', 'slideshow-plugin'); ?></i></td>
34
  </tr>
35
  <tr>
36
  <td><? _e('Activate buttons (so the user can scroll through the slides)', 'slideshow-plugin'); ?></td>
37
- <td>
38
- <label><input type="radio" name="controllable" value="true" <? checked($settings['controllable'], 'true'); ?> /> <? _e('Yes', 'slideshow-plugin'); ?></label><br />
39
- <label><input type="radio" name="controllable" value="false" <? checked($settings['controllable'], 'false'); ?> /> <? _e('No', 'slideshow-plugin'); ?></label>
40
- </td>
41
- <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? if($defaultSettings['controllable'] == 'true') _e('Yes', 'slideshow-plugin'); else _e('No', 'slideshow-plugin'); ?></i></td>
42
  </tr>
43
  <tr>
44
  <td><? _e('Send user to image URL on click', 'slideshow-plugin'); ?></td>
45
- <td>
46
- <label><input type="radio" name="urlsActive" value="true" <? checked($settings['urlsActive'], 'true'); ?> /> <? _e('Yes', 'slideshow-plugin'); ?></label><br />
47
- <label><input type="radio" name="urlsActive" value="false" <? checked($settings['urlsActive'], 'false'); ?> /> <? _e('No', 'slideshow-plugin'); ?></label>
48
- </td>
49
- <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? if($defaultSettings['urlsActive'] == 'true') _e('Yes', 'slideshow-plugin'); else _e('No', 'slideshow-plugin'); ?></i></td>
50
  </tr>
51
  <tr>
52
  <td><? _e('Show title and description', 'slideshow-plugin'); ?></td>
53
- <td>
54
- <label><input type="radio" name="showText" value="true" <? checked($settings['showText'], 'true'); ?> /> <? _e('Yes', 'slideshow-plugin'); ?></label><br />
55
- <label><input type="radio" name="showText" value="false" <? checked($settings['showText'], 'false'); ?> /> <? _e('No', 'slideshow-plugin'); ?></label>
56
- </td>
57
- <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? if($defaultSettings['showText'] == 'true') _e('Yes', 'slideshow-plugin'); else _e('No', 'slideshow-plugin'); ?></i></td>
58
  </tr>
59
  </table>
1
+ <p>
2
+ <strong>Leave any field open to use default value.</strong>
3
+ </p>
4
+
5
  <table border="0">
6
  <tr>
7
  <td><? _e('Number of seconds the slide takes to slide in', 'slideshow-plugin'); ?></td>
8
  <td><input type="text" name="slideSpeed" value="<? echo $settings['slideSpeed']; ?>" size="5" /></td>
9
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaults['slideSpeed'] ?></i></td>
10
  </tr>
11
  <tr>
12
  <td><? _e('Number of seconds the description takes to slide in', 'slideshow-plugin'); ?></td>
13
  <td><input type="text" name="descriptionSpeed" value="<? echo $settings['descriptionSpeed']; ?>" size="5" /></td>
14
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaults['descriptionSpeed'] ?></i></td>
15
  </tr>
16
  <tr>
17
  <td><? _e('Seconds between changing slides', 'slideshow-plugin'); ?></td>
18
  <td><input type="text" name="intervalSpeed" value="<? echo $settings['intervalSpeed']; ?>" size="5" /></td>
19
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaults['intervalSpeed'] ?></i></td>
20
  </tr>
21
  <tr>
22
  <td><? _e('Width of the slideshow', 'slideshow-plugin'); ?></td>
23
  <td><input type="text" name="width" value="<? echo $settings['width']; ?>" size="5" /></td>
24
+ <td><i><? _e('Defaults to parent\'s width.', 'slideshow-plugin'); ?></i></td>
25
  </tr>
26
  <tr>
27
  <td><? _e('Height of the slideshow', 'slideshow-plugin'); ?></td>
28
  <td><input type="text" name="height" value="<? echo $settings['height']; ?>" size="5" /></td>
29
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? echo $defaults['height'] ?></i></td>
30
  </tr>
31
  <tr>
32
+ <td><? _e('Fit image into slideshow (making it smaller)', 'slideshow-plugin'); ?></td>
33
+ <td><input type="checkbox" name="stretch" value="1" <? checked($settings['stretch'], 1); ?> /></td>
34
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? if($defaults['stretch']) _e('Checked', 'slideshow-plugin'); else _e('Not checked', 'slideshow-plugin'); ?></i></td>
 
 
 
35
  </tr>
36
  <tr>
37
  <td><? _e('Activate buttons (so the user can scroll through the slides)', 'slideshow-plugin'); ?></td>
38
+ <td><input type="checkbox" name="controllable" value="1" <? checked($settings['controllable'], 1); ?> /></td>
39
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? if($defaults['controllable']) _e('Checked', 'slideshow-plugin'); else _e('Not checked', 'slideshow-plugin'); ?></i></td>
 
 
 
40
  </tr>
41
  <tr>
42
  <td><? _e('Send user to image URL on click', 'slideshow-plugin'); ?></td>
43
+ <td><input type="checkbox" name="urlsActive" value="1" <? checked($settings['urlsActive'], 1); ?> /></td>
44
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? if($defaults['urlsActive']) _e('Checked', 'slideshow-plugin'); else _e('Not checked', 'slideshow-plugin'); ?></i></td>
 
 
 
45
  </tr>
46
  <tr>
47
  <td><? _e('Show title and description', 'slideshow-plugin'); ?></td>
48
+ <td><input type="checkbox" name="showText" value="1" <? checked($settings['showText'], 1); ?> /></td>
49
+ <td><i><? _e('Default', 'slideshow-plugin'); ?>: <? if($defaults['showText']) _e('Checked', 'slideshow-plugin'); else _e('Not checked', 'slideshow-plugin'); ?></i></td>
 
 
 
50
  </tr>
51
  </table>
views/SlideshowPostType/slides.php CHANGED
@@ -1,45 +1,38 @@
1
- <p><? echo $uploadButton; ?></p>
2
-
3
- <? if(count($attachments) <= 0): ?>
4
- <p></p><? _e('Add slides to this slideshow by using the button above or attaching images from the media page.', 'slideshow-plugin'); ?></p>
5
-
6
- <? else: ?>
7
- <table class="wp-list-table widefat fixed media" cellspacing="0">
8
- <tbody id="the-list">
9
-
10
- <? foreach($attachments as $attachment):?>
11
- <? $editUrl = admin_url() . '/media.php?attachment_id=' . $attachment->ID . '&amp;action=edit'; ?>
12
- <? $image = wp_get_attachment_image_src($attachment->ID); ?>
13
- <? if(!$image[3]) $image[0] = $noPreviewIcon; ?>
14
-
15
- <tr id="post-<? echo $attachment->ID; ?>" class="alternate author-self status-inherit" valign="top">
16
-
17
- <td class="column-icon media-icon">
18
- <a href="<? echo $editUrl; ?>" title="Edit &#34;<? echo $attachment->post_title; ?>&#34;">
19
- <img
20
- width="80"
21
- height="60"
22
- src="<? echo $image[0]; ?>"
23
- class="attachment-80x60"
24
- alt="<? echo $attachment->post_title; ?>"
25
- title="<? echo $attachment->post_title; ?>"
26
- />
27
- </a>
28
- </td>
29
-
30
- <td class="title column-title">
31
- <strong>
32
- <a href="<? echo $editUrl; ?>" title="Edit &#34;<? echo $attachment->post_title; ?>&#34;"><? echo $attachment->post_title; ?></a>
33
- </strong>
34
-
35
- <p>
36
- <? echo $attachment->post_content; ?>
37
- </p>
38
- </td>
39
- </tr>
40
-
41
- <? endforeach; ?>
42
-
43
- </tbody>
44
- </table>
45
- <? endif; ?>
1
+ <table class="wp-list-table widefat fixed media" cellspacing="0">
2
+ <tbody id="the-list">
3
+
4
+ <? foreach($attachments as $attachment): ?>
5
+ <? $editUrl = admin_url() . '/media.php?attachment_id=' . $attachment->ID . '&amp;action=edit'; ?>
6
+ <? $image = wp_get_attachment_image_src($attachment->ID); ?>
7
+ <? if(!$image[3]) continue; ?>
8
+
9
+ <tr id="post-<? echo $attachment->ID; ?>" class="alternate author-self status-inherit" valign="top">
10
+
11
+ <td class="column-icon media-icon">
12
+ <a href="<? echo $editUrl; ?>" title="Edit &#34;<? echo $attachment->post_title; ?>&#34;">
13
+ <img
14
+ width="80"
15
+ height="60"
16
+ src="<? echo $image[0]; ?>"
17
+ class="attachment-80x60"
18
+ alt="<? echo $attachment->post_title; ?>"
19
+ title="<? echo $attachment->post_title; ?>"
20
+ />
21
+ </a>
22
+ </td>
23
+
24
+ <td class="title column-title">
25
+ <strong>
26
+ <a href="<? echo $editUrl; ?>" title="Edit &#34;<? echo $attachment->post_title; ?>&#34;"><? echo $attachment->post_title; ?></a>
27
+ </strong>
28
+
29
+ <p>
30
+ <? echo $attachment->post_content; ?>
31
+ </p>
32
+ </td>
33
+ </tr>
34
+
35
+ <? endforeach; ?>
36
+
37
+ </tbody>
38
+ </table>
 
 
 
 
 
 
 
views/SlideshowPostType/style-settings.php DELETED
@@ -1,32 +0,0 @@
1
- <table border="0">
2
- <tr>
3
- <td><? _e('Style', 'slideshow-plugin'); ?></td>
4
- <td>
5
- <select class="style-list" name="style">
6
- <? foreach($styles as $key => $name): ?>
7
- <option value="<? echo $key; ?>" <? selected($settings['style'], $key); ?>><? echo $name; ?></option>
8
- <? endforeach; ?>
9
- <option value="custom-style" <? selected($settings['style'], 'custom-style'); ?>><? _e('Custom Style', 'slideshow-plugin') ?></option>
10
- </select>
11
- </td>
12
- <td><i><? _e('The style used for this slideshow', 'slideshow-plugin'); ?></i></td>
13
- </tr>
14
- </table>
15
-
16
- <table border="0" class="custom-style">
17
- <tr>
18
- <td><strong><? _e('Custom Style Editor', 'slideshow-plugin'); ?></strong></td>
19
- <td></td>
20
- </tr>
21
- <tr>
22
- <td><? _e('Custom style', 'slideshow-plugin'); ?></td>
23
- <td><textarea rows="20" cols="60" class="custom-style-textarea" name="custom-style"><? echo $settings['custom-style']; ?></textarea></td>
24
- <input type="hidden" class="custom-style-default-css-url" value="<? ?>" />
25
- </tr>
26
- </table>
27
-
28
- <style type="text/css">
29
- .custom-style{
30
- display: none;
31
- }
32
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/SlideshowUpload/upload-button.php DELETED
@@ -1 +0,0 @@
1
- <input type="button" id="upload_image_button" class="button" value="<? _e('Upload/Manage Images', 'slideshow-plugin'); ?>" />
 
views/SlideshowWidget/form.php DELETED
@@ -1,14 +0,0 @@
1
- <p>
2
- <label for="<? echo $this->get_field_id('title'); ?>"><? _e('Title', 'slideshow-plugin'); ?></label>
3
- <input class="widefat" id="<? echo $this->get_field_id('title'); ?>" name="<? echo $this->get_field_name('title'); ?>" value="<? echo $instance['title']; ?>" style="width:100%" />
4
- </p>
5
-
6
- <p>
7
- <label for="<? echo $this->get_field_id('slideshowId'); ?>"><? _e('Slideshow', 'slideshow-plugin'); ?></label>
8
- <select class="widefat" id="<? echo $this->get_field_id('slideshowId'); ?>" name="<? echo $this->get_field_name('slideshowId'); ?>" value="<? echo $instance['slideshowId']; ?>" style="width:100%">
9
- <option value="-1" <? selected($instance['slideshowId'], -1); ?>><? _e('Random Slideshow', 'slideshow-plugin'); ?></option>
10
- <? foreach($slideshows as $slideshow): ?>
11
- <option value="<? echo $slideshow->ID ?>" <? selected($instance['slideshowId'], $slideshow->ID); ?>><? echo $slideshow->post_title ?></option>
12
- <? endforeach; ?>
13
- </select>
14
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/SlideshowWidget/widget.php DELETED
@@ -1,2 +0,0 @@
1
- <h3 class="widget-title"><? echo $title; ?></h3>
2
- <? echo $output; ?>