WordPress.org

Plugin Directory

Changeset 444746


Ignore:
Timestamp:
09/28/11 12:30:59 (3 years ago)
Author:
butterflymedia
Message:
 
Location:
sticky-slider/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sticky-slider/trunk/readme.txt

    r402960 r444746  
    11=== Sticky Slider === 
    2 Contributors: butterflymedia 
    3 Donate link: http://www.getbutterfly.com/ 
     2Contributors: butterflymedia, getbutterfly 
     3Donate link: http://getbutterfly.com/ 
    44Tags: slider, slides, sticky, featured, cycle, jquery 
    55Requires at least: 2.7 
    6 Tested up to: 3.1 
    7 Stable tag: 1.1.2.1 
     6Tested up to: 3.3 
     7Stable tag: 1.1.2.2 
    88 
    99== Description == 
     
    1313In order to add a post to the slider, just mark it as sticky. Edit its Visibility in the Publish block while in the post writing page and check "Stick this post to the front page". 
    1414 
    15 Check the [official homepage](http://www.getbutterfly.com/wordpress-plugins/sticky-slider/ "getButterfly") for feedback and support. 
     15Check the [official homepage](http://getbutterfly.com/wordpress-plugins/sticky-slider/ "getButterfly") for feedback and support. 
    1616 
    1717== Installation == 
     
    3535== Changelog == 
    3636 
     37= 1.1.2.2 = 
     38* Changed author URL address, again 
     39* Fixed sticky posts behaviour 
     40* Removed categories from options panel 
     41 
    3742= 1.1.2.1 = 
    3843* Changed author URL address 
  • sticky-slider/trunk/sticky-slider.php

    r402960 r444746  
    22/* 
    33Plugin Name: Sticky Slider 
    4 Plugin URI: http://www.getbutterfly.com/wordpress-plugins/sticky-slider/ 
     4Plugin URI: http://getbutterfly.com/wordpress-plugins/sticky-slider/ 
    55Description: WordPress provides a way to mark certain posts as featured or sticky posts. Sticky posts will appear before other posts when listing them in index.php. This plugin creates a slider from sticky posts. 
    6 Version: 1.1.2.1 
     6Version: 1.1.2.2 
    77Author: Ciprian Popescu 
    8 Author URI: http://www.getbutterfly.com/ 
     8Author URI: http://getbutterfly.com/ 
    99License: GNU General Public License v3.0 
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    2828version 2, as published by the Free Software Foundation. 
    2929*/ 
    30 if(!defined('WP_CONTENT_URL')) define('WP_CONTENT_URL', get_option('siteurl').'/wp-content'); 
    31 if(!defined( 'WP_PLUGIN_URL')) define('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins'); 
    32 if(!defined('WP_CONTENT_DIR')) define('WP_CONTENT_DIR', ABSPATH.'wp-content'); 
    33 if(!defined('WP_PLUGIN_DIR')) define('WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins'); 
     30if(!defined('WP_CONTENT_URL'))  define('WP_CONTENT_URL', get_option('siteurl').'/wp-content'); 
     31if(!defined('WP_PLUGIN_URL'))   define('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins'); 
     32if(!defined('WP_CONTENT_DIR'))  define('WP_CONTENT_DIR', ABSPATH.'wp-content'); 
     33if(!defined('WP_PLUGIN_DIR'))   define('WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins'); 
    3434 
    3535define('STICKY_SLIDER_URL', WP_PLUGIN_URL.'/sticky-slider'); 
     
    3838// Begin display functions 
    3939function sticky_slider_scripts() { 
    40     $sticky_timer = get_option('sticky_timer'); 
    41     $sticky_timer = $sticky_timer * 1000; 
    4240    ?> 
    4341    <!-- // Begin Sticky Slider Head Options --> 
     
    5452    #slider-nav a:focus { outline: none; } 
    5553    </style> 
    56  
     54    <?php 
     55    wp_enqueue_script('jquery'); 
     56} 
     57function sticky_slider_cycle() { 
     58    $sticky_timer = get_option('sticky_timer'); 
     59    $sticky_timer = $sticky_timer * 1000; 
     60    ?> 
     61    <!-- // Begin Sticky Slider Head Options --> 
    5762    <script type="text/javascript" src="<?php echo STICKY_SLIDER_URL;?>/jquery.cycle.min.js"></script> 
    5863    <script type="text/javascript"> 
    5964    jQuery(document).ready(function(){ 
    60         jQuery("#featured").cycle({ 
     65        jQuery('#featured').cycle({ 
    6166            next: '#slider-next', 
    6267            prev: '#slider-prev', 
     
    7176    <!-- // End Sticky Slider Head Options --> 
    7277    <?php 
    73     wp_enqueue_script('jquery'); 
    7478} 
    7579// End display functions 
     
    9296    $data_field_name_1 = 'sticky_slides'; 
    9397    $data_field_name_2 = 'sticky_timer'; 
    94     $data_field_name_3 = 'sticky_category'; 
    9598 
    9699    // read in existing option value from database 
    97100    $option_value_data_1 = get_option('sticky_slides'); 
    98101    $option_value_data_2 = get_option('sticky_timer'); 
    99     $option_value_data_3 = get_option('sticky_category'); 
    100  
    101     // create a categories dropdown 
    102     $cat_select = wp_dropdown_categories('show_option_none=Select category&show_count=1&orderby=name&echo=0'); 
    103102 
    104103    // See if the user has posted us some information // if yes, this hidden field will be set to 'Y' 
     
    106105        $option_value_data_1 = $_POST[$data_field_name_1]; 
    107106        $option_value_data_2 = $_POST[$data_field_name_2]; 
    108         $option_value_data_3 = $_POST['cat']; 
    109107 
    110108        update_option('sticky_slides', $option_value_data_1); 
    111109        update_option('sticky_timer', $option_value_data_2); 
    112         update_option('sticky_category', $option_value_data_3); 
    113110        ?> 
    114111        <div class="updated"><p><strong>Settings saved</strong></p></div> 
     
    131128            <p> 
    132129            <p><span class="description">How long should a sticky post display before sliding the next one? Default is 4.</span></p> 
    133             <p> 
    134                 <?php echo $cat_select;?> Selected: <?php echo $option_value_data_3;?> 
    135             </p> 
    136             <p><span class="description">Selecting a category above will bypass all sticky posts and show posts from the selected category.</span></p> 
    137130            <p class="submit"> 
    138                 <input type="submit" name="submit" class="button-primary" value="<?php esc_attr_e('Save Changes');?>" /> 
     131                <input type="submit" name="submit" class="button-primary" value="Save Changes" /> 
    139132            </p> 
    140133        </form> 
     
    143136        <p>Add the <code>&lt;?php if(function_exists('sticky_slider')) sticky_slider();?&gt;</code> function to your index.php before <code>&lt;?php if(have_posts()) : while(have_posts()) : the_post();?&gt;</code> line.</p> 
    144137 
    145         <p>For support, feature requests and bug reporting, please visit the <a href="http://www.getbutterfly.com/wordpress-plugins/sticky-slider/" rel="external">official web site</a>, or rate it on <a href="http://wordpress.org/extend/plugins/sticky-slider/" rel="external">WordPress plugin repository.</a></p> 
     138        <p>For support, feature requests and bug reporting, please visit the <a href="http://getbutterfly.com/wordpress-plugins/sticky-slider/" rel="external">official web site</a>, or rate it on <a href="http://wordpress.org/extend/plugins/sticky-slider/" rel="external">WordPress plugin repository.</a></p> 
    146139    </div> 
    147140<?php 
    148141} 
    149142 
    150 add_action('wp_head', 'sticky_slider_scripts'); 
     143add_action('init', 'sticky_slider_scripts'); 
     144add_action('wp_footer', 'sticky_slider_cycle'); 
    151145 
    152146function sticky_slider() { 
     
    163157                <?php 
    164158                $sticky_slides = get_option('sticky_slides'); 
    165                 $sticky_category = get_option('sticky_category'); 
    166159                $sticky_posts = get_option('sticky_posts'); 
    167  
    168  
    169 //              if($sticky_category == '-1') 
    170 //                  $loop = new WP_Query('post_type=post&showposts='.$sticky_slides.'&post__in='.$sticky_posts); 
    171 //              if($sticky_category != '-1') 
    172 //                  $loop = new WP_Query($args); 
    173  
    174160 
    175161                $loop = new WP_Query(array( 
    176162                    'post_type' => 'post', 
    177163                    'showposts' => '2', 
    178                     //'post__in'  => $sticky_posts, 
    179                     'post__in'  => array(30) 
     164                    'post__in'  => $sticky_posts, 
    180165                )); 
    181166                while($loop->have_posts()) : $loop->the_post(); 
Note: See TracChangeset for help on using the changeset viewer.