WP-Cycle - Version 0.1.2

Version Description

Download this release

Release Info

Developer nathanrice
Plugin Icon wp plugin WP-Cycle
Version 0.1.2
Comparing to
See all releases

Code changes from version 0.1.1 to 0.1.2

Files changed (2) hide show
  1. readme.txt +1 -1
  2. wp-cycle.php +22 -8
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: slideshow, images, jquery cycle
5
  Requires at least: 2.7
6
  Tested up to: 2.8
7
- Stable tag: 0.1.1
8
 
9
  This plugin creates an image slideshow in your theme, using the jQuery Cycle plugin. You can upload/delete images via the administration panel, and display the images in your theme by using the <code>wp_cycle();</code> template tag, which will generate all the necessary HTML for outputting the rotating images.
10
 
4
  Tags: slideshow, images, jquery cycle
5
  Requires at least: 2.7
6
  Tested up to: 2.8
7
+ Stable tag: 0.1.2
8
 
9
  This plugin creates an image slideshow in your theme, using the jQuery Cycle plugin. You can upload/delete images via the administration panel, and display the images in your theme by using the <code>wp_cycle();</code> template tag, which will generate all the necessary HTML for outputting the rotating images.
10
 
wp-cycle.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-Cycle
4
  Plugin URI: http://www.nathanrice.net/plugins/wp-cycle/
5
  Description: This plugin creates an image slideshow from the images you upload using the jQuery Cycle plugin. You can upload/delete images via the administration panel, and display the images in your theme by using the <code><?php wp_cycle(); ?></code> template tag, which will generate all the necessary HTML for outputting the rotating images.
6
- Version: 0.1.1
7
  Author: Nathan Rice
8
  Author URI: http://www.nathanrice.net/
9
 
@@ -20,6 +20,8 @@ will be used throughout the plugin
20
  $wp_cycle_defaults = apply_filters('wp_cycle_defaults', array(
21
  'rotate' => 1,
22
  'effect' => 'fade',
 
 
23
  'img_width' => 300,
24
  'img_height' => 200,
25
  'div' => 'rotator'
@@ -287,11 +289,11 @@ function wp_cycle_settings_admin() { ?>
287
  <?php global $wp_cycle_settings; $options = $wp_cycle_settings; ?>
288
  <table class="form-table">
289
 
290
- <tr valign="top"><th scope="row">Effects Enabled</th>
291
- <td><input name="wp_cycle_settings[rotate]" type="checkbox" value="1" <?php checked('1', $options['rotate']); ?> /> <label for="wp_cycle_settings[rotate]">Check this box if you want to enable the rotating effects</td>
292
  </tr>
293
 
294
- <tr><th scope="row">Animation Effect</th>
295
  <td>Please select the effect you would like to use when your images rotate (if applicable):<br />
296
  <select name="wp_cycle_settings[effect]">
297
  <option value="fade" <?php selected('fade', $options['effect']); ?>>fade</option>
@@ -305,6 +307,18 @@ function wp_cycle_settings_admin() { ?>
305
  </select>
306
  </td></tr>
307
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  <tr><th scope="row">Image Dimensions</th>
309
  <td>Please input the width of the image rotator:<br />
310
  <input type="text" name="wp_cycle_settings[img_width]" value="<?php echo $options['img_width'] ?>" size="4" />
@@ -315,7 +329,7 @@ function wp_cycle_settings_admin() { ?>
315
  <label for="wp_cycle_settings[img_height]">px</label>
316
  </td></tr>
317
 
318
- <tr><th scope="row">Rotator DIV ID</th>
319
  <td>Please indicate what you would like the rotator DIV ID to be:<br />
320
  <input type="text" name="wp_cycle_settings[div]" value="<?php echo $options['div'] ?>" />
321
  </td></tr>
@@ -380,7 +394,7 @@ this final section generates all the code that
380
  is displayed on the front-end of the WP Theme
381
  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
382
  */
383
- function wp_cycle($atts = array(), $content = null) {
384
  global $wp_cycle_settings, $wp_cycle_images;
385
 
386
  // possible future use
@@ -426,8 +440,8 @@ function wp_cycle_head() {
426
  jQuery(document).ready(function($) {
427
  $("#<?php echo $wp_cycle_settings['div']; ?>").cycle({
428
  fx: '<?php echo $wp_cycle_settings['effect']; ?>',
429
- timeout: 3000,
430
- speed: 1000,
431
  pause: 1,
432
  fit: 1
433
  });
3
  Plugin Name: WP-Cycle
4
  Plugin URI: http://www.nathanrice.net/plugins/wp-cycle/
5
  Description: This plugin creates an image slideshow from the images you upload using the jQuery Cycle plugin. You can upload/delete images via the administration panel, and display the images in your theme by using the <code><?php wp_cycle(); ?></code> template tag, which will generate all the necessary HTML for outputting the rotating images.
6
+ Version: 0.1.2
7
  Author: Nathan Rice
8
  Author URI: http://www.nathanrice.net/
9
 
20
  $wp_cycle_defaults = apply_filters('wp_cycle_defaults', array(
21
  'rotate' => 1,
22
  'effect' => 'fade',
23
+ 'delay' => 3000,
24
+ 'duration' => 1000,
25
  'img_width' => 300,
26
  'img_height' => 200,
27
  'div' => 'rotator'
289
  <?php global $wp_cycle_settings; $options = $wp_cycle_settings; ?>
290
  <table class="form-table">
291
 
292
+ <tr valign="top"><th scope="row">Transition Enabled</th>
293
+ <td><input name="wp_cycle_settings[rotate]" type="checkbox" value="1" <?php checked('1', $options['rotate']); ?> /> <label for="wp_cycle_settings[rotate]">Check this box if you want to enable the transition effects</td>
294
  </tr>
295
 
296
+ <tr><th scope="row">Transition Effect</th>
297
  <td>Please select the effect you would like to use when your images rotate (if applicable):<br />
298
  <select name="wp_cycle_settings[effect]">
299
  <option value="fade" <?php selected('fade', $options['effect']); ?>>fade</option>
307
  </select>
308
  </td></tr>
309
 
310
+ <tr><th scope="row">Transition Delay</th>
311
+ <td>Length of time (in seconds) you would like each image to be visible:<br />
312
+ <input type="text" name="wp_cycle_settings[delay]" value="<?php echo $options['delay'] ?>" size="4" />
313
+ <label for="wp_cycle_settings[delay]">seconds</label>
314
+ </td></tr>
315
+
316
+ <tr><th scope="row">Transition Length</th>
317
+ <td>Length of time (in seconds) you would like the transition length to be:<br />
318
+ <input type="text" name="wp_cycle_settings[duration]" value="<?php echo $options['duration'] ?>" size="4" />
319
+ <label for="wp_cycle_settings[duration]">seconds</label>
320
+ </td></tr>
321
+
322
  <tr><th scope="row">Image Dimensions</th>
323
  <td>Please input the width of the image rotator:<br />
324
  <input type="text" name="wp_cycle_settings[img_width]" value="<?php echo $options['img_width'] ?>" size="4" />
329
  <label for="wp_cycle_settings[img_height]">px</label>
330
  </td></tr>
331
 
332
+ <tr><th scope="row">Image Rotator DIV ID</th>
333
  <td>Please indicate what you would like the rotator DIV ID to be:<br />
334
  <input type="text" name="wp_cycle_settings[div]" value="<?php echo $options['div'] ?>" />
335
  </td></tr>
394
  is displayed on the front-end of the WP Theme
395
  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
396
  */
397
+ function wp_cycle($atts = array(), $content) {
398
  global $wp_cycle_settings, $wp_cycle_images;
399
 
400
  // possible future use
440
  jQuery(document).ready(function($) {
441
  $("#<?php echo $wp_cycle_settings['div']; ?>").cycle({
442
  fx: '<?php echo $wp_cycle_settings['effect']; ?>',
443
+ timeout: <?php echo ($wp_cycle_settings['delay'] * 1000); ?>,
444
+ speed: <?php echo ($wp_cycle_settings['duration'] * 1000); ?>,
445
  pause: 1,
446
  fit: 1
447
  });