Plugin Directory

Changeset 675574


Ignore:
Timestamp:
03/03/2013 01:49:33 AM (13 years ago)
Author:
thiagosf
Message:

Added short code support

Location:
wp-skitter-slideshow/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-skitter-slideshow/trunk/readme.txt

    r644725 r675574  
    77Contributors: thiagosf
    88Requires at least: 2.9
    9 Tested up to: 3.5
    10 Stable tag: 2.0
     9Tested up to: 3.5.1
     10Stable tag: 2.1
    1111
    1212Slideshow flexible with many options for customizations.
     
    1919
    2020To use the Skitter Slideshow, go to Settings -> Skitter Slideshow. Then select a category that will display images, and customize the way you see fit. Add a post in the category you choose, and remember to choose an image highlighted, it will be what will appear on the slides. The plugin crops the image for better presentation of slides.
     21
     22EXAMPLE AND DOCUMENTATION
     23
     24http://www.skitter-slider.net/
    2125
    2226== Screenshots ==
     
    3236* You can either use the automatic plugin installer or your FTP program to upload it to your wp-content/plugins directory the top-level folder. Don't just upload all the php files and put them in /wp-content/plugins/.
    3337* Activate the plugin through the 'Plugins' menu in WordPress
    34 * Insert <code>&lt;?php if ( function_exists('show_skitter') )  { show_skitter(); } ?&gt;</code> into your template file.
     38* Insert <code>&lt;?php if ( function_exists('show_skitter') )  { show_skitter(); } ?&gt;</code> into your template file. OR
     39* Insert shortcode [skitter] in post or page
    3540* Add a post thumb to a desired post.
    3641* And voila!
    3742
    3843== Changelog ==
     44
     45= version 2.1 =
     46
     47* Add Shortcode
     48* Background configuration
    3949
    4050= version 2.0 =
  • wp-skitter-slideshow/trunk/wp-skitter-slideshow.php

    r644749 r675574  
    44Plugin URI: http://thiagosf.net/projects/jquery/skitter
    55Description: jQuery Slideshow for Wordpress using Skitter Slideshow
    6 Version: 2.0
     6Version: 2.1
    77Author: Thiago Silva Ferreira
    88Author URI: http://thiagosf.net
     
    136136        'wp_skitter_with_animations',
    137137        'wp_skitter_auto_play',
     138        'wp_skitter_background',
    138139    );
    139140    return $wp_skitter_settings;
     
    167168    add_option('wp_skitter_stop_over','false');
    168169    add_option('wp_skitter_auto_play','true');
     170    add_option('wp_skitter_background','#000');
    169171   
    170172    add_option('wp_skitter_attachments', array(
     
    209211        'wp_skitter_controls_position',
    210212        'wp_skitter_focus_position',
     213        'wp_skitter_background',
    211214        //'wp_skitter_with_animations',
    212215    );
     
    307310    $width_skitter = get_option('wp_skitter_width');
    308311    $height_skitter = get_option('wp_skitter_height');
     312    $background_skitter = get_option('wp_skitter_background');
    309313   
    310314    $category = get_option('wp_skitter_category');
     
    314318
    315319<style type="text/css">
    316     .box_skitter {width:<?php echo $width_skitter; ?>px;height:<?php echo $height_skitter; ?>px;}
     320    .box_skitter {
     321        width:<?php echo $width_skitter; ?>px;
     322        height:<?php echo $height_skitter; ?>px;
     323        background: <?php echo $background_skitter; ?>;
     324    }
     325    .box_skitter img {
     326        width: auto !important;
     327        max-width: none !important;
     328    }
    317329</style>
    318330
     
    463475                    if ($option == 'wp_skitter_xml' && get_option('wp_skitter_type') != 'xml') continue;
    464476                    if ($option == 'wp_skitter_animation' && !empty($remove_animation_option)) continue;
     477                    if ($option == 'wp_skitter_background') continue;
    465478                    $options[] = str_replace('wp_skitter_', '', $option).': '.$get_option;
    466479                }
     
    651664    <form method="post" action="options.php" id="form_skitter">
    652665        <?php settings_fields( 'wp_skitter_settings' ); ?>
    653         <input type="hidden" value="<?=$wp_skitter_type;?>" name="wp_skitter_type" id="wp_skitter_type" />
     666        <input type="hidden" value="<?php echo $wp_skitter_type;?>" name="wp_skitter_type" id="wp_skitter_type" />
    654667       
    655668        <?php
     
    665678        ?>
    666679        <div id="tabs_sk">
    667             <a href="#library" rel="tab_media_library_sk" <?=$selected_library;?>>Media Library</a>
    668             <a href="#posts" rel="tab_posts_sk" <?=$selected_posts;?>>Posts</a>
    669             <a href="#xml" rel="tab_xml_sk" <?=$selected_xml;?>>XML</a>
     680            <a href="#library" rel="tab_media_library_sk" <?php echo $selected_library;?>>Media Library</a>
     681            <a href="#posts" rel="tab_posts_sk" <?php echo $selected_posts;?>>Posts</a>
     682            <a href="#xml" rel="tab_xml_sk" <?php echo $selected_xml;?>>XML</a>
    670683        </div>
    671684       
    672         <div id="tab_posts_sk" class="tab_item_sk<?=$tab_selected_posts;?>">
     685        <div id="tab_posts_sk" class="tab_item_sk<?php echo $tab_selected_posts;?>">
    673686            <table class="form-table">
    674687                <tr valign="top">
     
    704717        </div>
    705718       
    706         <div id="tab_xml_sk" class="tab_item_sk<?=$tab_selected_xml;?>">
     719        <div id="tab_xml_sk" class="tab_item_sk<?php echo $tab_selected_xml;?>">
    707720            <table class="form-table">
    708721                <tr valign="top">
     
    715728        </div>
    716729       
    717         <div id="tab_media_library_sk" class="tab_item_sk<?=$tab_selected_library;?>">
     730        <div id="tab_media_library_sk" class="tab_item_sk<?php echo $tab_selected_library;?>">
    718731            <div id="box_list_images">
    719732                <div id="loading_list_sk">Loading...</div>
     
    730743                ?>
    731744                    <div class="item_list_sk">
    732                         <a href="#<?=$id;?>" title="Add"<?=$style;?>><?=wp_get_attachment_image( $id, array(50, 50) );?></a>
     745                        <a href="#<?php echo $id;?>" title="Add"<?php echo $style;?>><?php echo wp_get_attachment_image( $id, array(50, 50) );?></a>
    733746                    </div>
    734747                <?php
     
    760773                       
    761774                ?>
    762                     <div class="box_image_sk" id="box_image_sk_<?=$id;?>" style="display:block;">
     775                    <div class="box_image_sk" id="box_image_sk_<?php echo $id;?>" style="display:block;">
    763776                        <div class="item_image_sk">
    764                             <?=wp_get_attachment_image( $id, array(150, 150) );?>
    765                             <input class="attachments_image" type="checkbox" value="<?=$id;?>" name="wp_skitter_attachments[image][]" id="wp_skitter_attachment_<?=$id;?>" checked="checked" style="display:none;" />
     777                            <?php echo wp_get_attachment_image( $id, array(150, 150) );?>
     778                            <input class="attachments_image" type="checkbox" value="<?php echo $id;?>" name="wp_skitter_attachments[image][]" id="wp_skitter_attachment_<?php echo $id;?>" checked="checked" style="display:none;" />
    766779                        </div>
    767780                        <div class="settings_slide">
    768                             <label for="wp_skitter_attachment_label_<?=$id;?>">Label</label>
    769                             <input class="attachments_label" type="text" name="wp_skitter_attachments[label][<?=$id;?>]" id="wp_skitter_attachment_label_<?=$id;?>" size="50" value="<?=$label;?>" />
    770                             <label for="wp_skitter_attachment_link_<?=$id;?>">Link</label>
    771                             <input class="attachments_link" type="text" name="wp_skitter_attachments[link][<?=$id;?>]" id="wp_skitter_attachment_link_<?=$id;?>" size="50" value="<?=$link;?>" />
    772                             <label for="wp_skitter_attachment_animation_<?=$id;?>">Animation</label>
    773                             <?=getSelectAnimations(array(
     781                            <label for="wp_skitter_attachment_label_<?php echo $id;?>">Label</label>
     782                            <input class="attachments_label" type="text" name="wp_skitter_attachments[label][<?php echo $id;?>]" id="wp_skitter_attachment_label_<?php echo $id;?>" size="50" value="<?php echo $label;?>" />
     783                            <label for="wp_skitter_attachment_link_<?php echo $id;?>">Link</label>
     784                            <input class="attachments_link" type="text" name="wp_skitter_attachments[link][<?php echo $id;?>]" id="wp_skitter_attachment_link_<?php echo $id;?>" size="50" value="<?php echo $link;?>" />
     785                            <label for="wp_skitter_attachment_animation_<?php echo $id;?>">Animation</label>
     786                            <?php echo getSelectAnimations(array(
    774787                                'name' => 'wp_skitter_attachments[animation]['.$id.']',
    775788                                'id' => 'wp_skitter_attachment_animation_'.$id,
     
    793806                   
    794807                ?>
    795                     <div class="box_image_sk" id="box_image_sk_<?=$id;?>">
     808                    <div class="box_image_sk" id="box_image_sk_<?php echo $id;?>">
    796809                        <div class="item_image_sk">
    797                             <?=wp_get_attachment_image( $id, array(150, 150) );?>
    798                             <input class="attachments_image" type="checkbox" value="<?=$id;?>" name="wp_skitter_attachments[image][]" id="wp_skitter_attachment_<?=$id;?>" checked="checked" style="display:none;" />
     810                            <?php echo wp_get_attachment_image( $id, array(150, 150) );?>
     811                            <input class="attachments_image" type="checkbox" value="<?php echo $id;?>" name="wp_skitter_attachments[image][]" id="wp_skitter_attachment_<?php echo $id;?>" checked="checked" style="display:none;" />
    799812                        </div>
    800813                        <div class="settings_slide">
    801                             <label for="wp_skitter_attachment_label_<?=$id;?>">Label</label>
    802                             <input class="attachments_label" type="text" name="wp_skitter_attachments[label][<?=$id;?>]" id="wp_skitter_attachment_label_<?=$id;?>" size="50" />
    803                             <label for="wp_skitter_attachment_link_<?=$id;?>">Link</label>
    804                             <input class="attachments_link" type="text" name="wp_skitter_attachments[link][<?=$id;?>]" id="wp_skitter_attachment_link_<?=$id;?>" size="50" />
    805                             <label for="wp_skitter_attachment_animation_<?=$id;?>">Animation</label>
    806                             <?=getSelectAnimations(array(
     814                            <label for="wp_skitter_attachment_label_<?php echo $id;?>">Label</label>
     815                            <input class="attachments_label" type="text" name="wp_skitter_attachments[label][<?php echo $id;?>]" id="wp_skitter_attachment_label_<?php echo $id;?>" size="50" />
     816                            <label for="wp_skitter_attachment_link_<?php echo $id;?>">Link</label>
     817                            <input class="attachments_link" type="text" name="wp_skitter_attachments[link][<?php echo $id;?>]" id="wp_skitter_attachment_link_<?php echo $id;?>" size="50" />
     818                            <label for="wp_skitter_attachment_animation_<?php echo $id;?>">Animation</label>
     819                            <?php echo getSelectAnimations(array(
    807820                                'name' => 'wp_skitter_attachments[animation]['.$id.']',
    808821                                'id' => 'wp_skitter_attachment_animation_'.$id,
     
    888901               
    889902                <tr valign="top" style="border-top:1px solid #ccc;">
     903                    <th scope="row">background</th>
     904                    <td><input type="text" name="wp_skitter_background" id="wp_skitter_background" size="20" value="<?php echo get_option('wp_skitter_background'); ?>" /></td>
     905                </tr>
     906               
     907                <tr valign="top" style="border-top:1px solid #ccc;">
    890908                    <th scope="row">crop image</th>
    891909                    <td><input type="checkbox" value="true" name="wp_skitter_crop" id="wp_skitter_crop" <?php echo (get_option('wp_skitter_crop') == 'true' ? ' checked="checked"' : ''); ?> /></td>
     
    925943               
    926944                <tr valign="top" style="border-top:1px solid #ccc;">
    927                     <th scope="row"><?=$linha[0];?></th>
     945                    <th scope="row"><?php echo $linha[0];?></th>
    928946                    <td>
    929947                        <?php
     
    934952                           
    935953                        ?>
    936                         <input type="checkbox" value="true" name="wp_skitter_<?=$linha[0];?>" <?php echo $selected;?> />
     954                        <input type="checkbox" value="true" name="wp_skitter_<?php echo $linha[0];?>" <?php echo $selected;?> />
    937955                        <?php
    938956                           
     
    941959                       
    942960                        ?>
    943                         <input type="text" name="wp_skitter_<?=$linha[0];?>" id="wp_skitter_<?=$linha[0];?>" size="50" value="<?php echo get_option('wp_skitter_'.$linha[0]); ?>" />
     961                        <input type="text" name="wp_skitter_<?php echo $linha[0];?>" id="wp_skitter_<?php echo $linha[0];?>" size="50" value="<?php echo get_option('wp_skitter_'.$linha[0]); ?>" />
    944962                        <?php
    945963                       
     
    951969       
    952970                <tr valign="top" style="background-color:#eee;border-bottom:1px solid #ccc;">
    953                     <td scope="row" style="padding-left:20px;">Default: <strong><?=$linha[2];?></strong></td>
    954                     <td>Example: <strong><?=$linha[3];?></strong></td>
     971                    <td scope="row" style="padding-left:20px;">Default: <strong><?php echo $linha[2];?></strong></td>
     972                    <td>Example: <strong><?php echo $linha[3];?></strong></td>
    955973                </tr>
    956974               
     
    970988</div>
    971989
    972 <?php } ?>
     990<?php
     991
     992}
     993
     994/**
     995 * Shortcode
     996 */
     997function skitter_shortcode( $atts )
     998{
     999    return show_skitter( $atts );
     1000}
     1001add_shortcode( 'skitter', 'skitter_shortcode' );
     1002
     1003?>
Note: See TracChangeset for help on using the changeset viewer.