Plugin Directory

Changeset 201969


Ignore:
Timestamp:
02/04/2010 09:54:57 PM (16 years ago)
Author:
eswhite
Message:

added support for exclude and include options

Location:
wordcycle
Files:
7 added
4 edited

Legend:

Unmodified
Added
Removed
  • wordcycle/tags/0.1.5/wordcycle.php

    r185704 r201969  
    33 * @package WordCycle
    44 * @author Esther S White
    5  * @version 0.1.4
     5 * @version 0.1.5
    66 */
    77/*
     
    1010Description: WordCycle is a wrapper for the popular <a href="http://malsup.com/jquery/cycle/">jQuery Cycle Plugin</a> by Mike Alsup. Use the [slideshow] shortcode to insert a Cycle slideshow into your WordPress post or page.
    1111Author: Esther S White
    12 Version: 0.1.4.1
     12Version: 0.1.5
    1313Author URI: http://blog.estherswhite.net
    1414*/
  • wordcycle/trunk/css/wordcycle.css

    r119806 r201969  
    1010    */
    1111
    12 .wordcycle { margin:0 0 22px 0; }
     12.wordcycle { margin:0 0 22px 0; overflow:hidden; }
    1313.cycle-item { margin:0 22px; }
    1414.cycle-item img { border: solid 8px #EFEFEF; margin:0 0 9px 0;}
    15 .cycle-caption { font-size:80%; background:#EFEFEF;}
     15.cycle-caption { font-size:80%; background:#EFEFEF; }
  • wordcycle/trunk/readme.txt

    r185699 r201969  
    55Requires at least: 2.5
    66Tested up to: 2.9
    7 Stable tag: 0.1.4.1
     7Stable tag: 0.1.6
    88   
    99WordCycle is a WordPress plugin that acts as a wrapper for the popular jQuery Cycle Plugin by Mike Alsup.
     
    4141== Options & Defaults == 
    4242     
    43 * orderby // slide order by: menu_order ID (default), see list in codex: http://codex.wordpress.org/Template_Tags/get_posts 
    44 * order     // slide order: ASC (default), DESC, RAND 
     43* orderby       // slide order by: menu_order ID (default), see list in codex: http://codex.wordpress.org/Template_Tags/get_posts 
     44* order         // slide order: ASC (default), DESC, RAND 
    4545* id        // post id: #, current (default) 
    46 * link  //  image link: file, attachment
    47 * size  // image size: thumbnail, small, medium (default), large, full-size 
    48 * float // slideshow position: left, right, none (default) 
    49 * speed // effect speed: slow (default), normal, fast 
    50 * fx        // slideshow effect (view the [jQuery Cycle Plugin Effects Browser][4] for a complete list) 
     46* link          // image link: file, attachment
     47* size          // image size: thumbnail, small, medium (default), large, full-size 
     48* include       // include image by ID
     49* exclude       // exclude image by ID
     50* float         // slideshow position: left, right, none (default) 
     51* speed         // effect speed: slow (default), normal, fast 
     52* fx            // slideshow effect (view the [jQuery Cycle Plugin Effects Browser][4] for a complete list) 
    5153* timeout   // time on each slide: miliseconds: 8000 (default) 
    52 * pause // pause on mouse-over: 0 (default) or 1
    53 * next  // selector of element to use as click trigger for next slide : null (default) or DOM element ID
     54* pause         // pause on mouse-over: 0 (default) or 1
     55* next          // selector of element to use as click trigger for next slide : null (default) or DOM element ID
    5456* prev  // selector of element to use as click trigger for previous slide : null (default) or DOM element ID
    5557
  • wordcycle/trunk/wordcycle.php

    r185699 r201969  
    33 * @package WordCycle
    44 * @author Esther S White
    5  * @version 0.1.4
     5 * @version 0.1.6
    66 */
    77/*
     
    1010Description: WordCycle is a wrapper for the popular <a href="http://malsup.com/jquery/cycle/">jQuery Cycle Plugin</a> by Mike Alsup. Use the [slideshow] shortcode to insert a Cycle slideshow into your WordPress post or page.
    1111Author: Esther S White
    12 Version: 0.1.4.1
     12Version: 0.1.6
    1313Author URI: http://blog.estherswhite.net
    1414*/
     
    6363                'id'         => $post->ID,
    6464                'size'       => 'medium',
     65                'include'    => '',
     66                'exclude'    => '',
    6567                'float'      => 'none',
    6668                'speed'      => 'slow',
     
    7274            ), $attr));
    7375
    74             return wordcycle_plugin::print_wordcycle($id, $order, $orderby, $size, $speed, $float, $fx, $timeout, $pause, $next, $prev, $attr['link']);
     76            return wordcycle_plugin::print_wordcycle($id, $order, $orderby, $size, $include, $exclude, $speed, $float, $fx, $timeout, $pause, $next, $prev, $attr['link']);
    7577           
    7678        } // End shortcode_cycle()
     
    7981        Returns WordCycle Slideshow and Footer Script
    8082        =======================*/
    81         function print_wordcycle($id, $order, $orderby, $size, $speed, $float, $fx, $timeout=NULL, $pause=NULL, $next=NULL, $prev=NULL,$linktype=NULL){
     83        function print_wordcycle($id, $order, $orderby, $size, $include, $exclude, $speed, $float, $fx, $timeout=NULL, $pause=NULL, $next=NULL, $prev=NULL,$linktype=NULL){
    8284           
    8385            global $post;
    8486       
    8587            $id = intval($id);
    86             $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
     88           
     89            /* Logic for include/exclude options, contributed by Mathew Simo based on Gallery Shortcode /wp-includes/media.php */
     90            if ( !empty($include) ) {
     91                $include = preg_replace( '/[^0-9,]+/', '', $include );
     92                $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
    8793       
     94                $attachments = array();
     95                foreach ( $_attachments as $key => $val ) {
     96                    $attachments[$val->ID] = $_attachments[$key];
     97                }
     98            } elseif ( !empty($exclude) ) {
     99                $exclude = preg_replace( '/[^0-9,]+/', '', $exclude );
     100                $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
     101            } else {
     102                $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
     103            }       
     104           
    88105            if ( empty($attachments) )
    89106                return '';
     
    110127                                prev: '".$prev."'
    111128                            });
    112                         })(jQuery);
     129                        });
    113130                        </script>
    114131                        <style type='text/css'>
Note: See TracChangeset for help on using the changeset viewer.