Plugin Directory

Changeset 159034


Ignore:
Timestamp:
09/29/2009 05:33:58 PM (17 years ago)
Author:
jeff_
Message:

adding display on sidebar + parsing shortcodes on WP Text Widget

Location:
frontpage-slideshow/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • frontpage-slideshow/trunk/frontpage-slideshow.php

    r159001 r159034  
    44Plugin URI: http://www.modulaweb.fr/blog/wp-plugins/frontside-slideshow/en/
    55Description: Frontpage Slideshow provides a slide show like you can see on <a href="http://linux.com">linux.com</a> or <a href="http://modulaweb.fr/">modulaweb.fr</a> front page. <a href="options-general.php?page=frontpage-slideshow">Configuration Page</a>
    6 Version: 0.6.1
     6Version: 0.7
    77Author: Jean-François VIAL
    88Author URI: http://www.modulaweb.fr/
     
    177177    color: <?php echo $options['values']['fs_font_color']?>;
    178178    font-family: Verdana, Sans, Helvetica, Arial, sans-serif!important;
     179    text-align: left;
    179180}
    180181#fs-slide {
     
    328329    return frontpageSlideshow('',true,$options);
    329330}
     331
     332class frontpageSlideshow_Widget extends WP_Widget {
     333
     334    function frontpageSlideshow_Widget() {
     335        $widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML'));
     336        $control_ops = array('width' => 400, 'height' => 350);
     337        $this->WP_Widget('text', __('Text'), $widget_ops, $control_ops);
     338    }
     339
     340    function widget( $args, $instance ) {
     341        extract($args);
     342        $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title']);
     343        $text = apply_filters( 'widget_text', $instance['text'] );
     344        echo $before_widget;
     345        if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>
     346            <div class="textwidget"><?php echo $instance['filter'] ? wpautop(do_shortcode($text)) : do_shortcode($text); ?></div>
     347        <?php
     348        echo $after_widget;
     349    }
     350
     351    function update( $new_instance, $old_instance ) {
     352        $instance = $old_instance;
     353        $instance['title'] = strip_tags($new_instance['title']);
     354        if ( current_user_can('unfiltered_html') )
     355            $instance['text'] =  $new_instance['text'];
     356        else
     357            $instance['text'] = wp_filter_post_kses( $new_instance['text'] );
     358        $instance['filter'] = isset($new_instance['filter']);
     359        return $instance;
     360    }
     361
     362    function form( $instance ) {
     363        $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'text' => '' ) );
     364        $title = strip_tags($instance['title']);
     365        $text = format_to_edit($instance['text']);
     366?>
     367        <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
     368        <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
     369
     370        <textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo $text; ?></textarea>
     371
     372        <p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked($instance['filter']); ?> />&nbsp;<label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs.'); ?></label></p>
     373<?php
     374    }
     375}
     376
     377
     378
    330379
    331380function frontpageSlideshow_get_options($get_defaults=false,$return_unique=null) {
     
    762811    add_action('admin_menu', 'frontpageSlideshow_admin_menu');
    763812}
    764 
     813function frontpageSlideshow_Widget_init() {
     814    register_widget('frontpageSlideshow_Widget');
     815}
     816add_action('widgets_init', 'frontpageSlideshow_Widget_init');
    765817?>
  • frontpage-slideshow/trunk/readme.txt

    r159016 r159034  
    33Donate link: http://www.modulaweb.fr/blog/wp-plugins-en/
    44Tags: slideshow, pictures, no-flash, css, javascript
    5 Requires at least: 2.0
     5Requires at least: 2.8.0
    66Tested up to: 2.8.4
    7 Stable tag: 0.6.1
     7Stable tag: 0.7
    88
    99Frontpage Slideshow provides a slide show like you can see in linux.com front page
     
    4242* v 0.6 : improving the loading of javascript frameworks needed, the shortcode funtionnality added, alternative picture option added, when no link is set, the URL of the post can be used
    4343* v 0.6.1 : minor bug correction (replacing php short tags by long ones)
     44* v 0.7 : allow to use the WP Text Widget to display the slideshow by inserting the shortcode onto the text itself, modify the original WP Text Widget to allow the use of all other shortcodes
    4445
    4546== Screenshots ==
     
    7273[/FrontpageSlideshow]`
    7374
     75You can use this shortcode into a Text Widget to display the slideshow into the sidebar
     76
     77=== Inserting the slideshow anywhere into your text ===
     78
     79You can insert the slideshow anywhere you want by inserting the following php code where you want it to be displayed :
     80`<?php echo do_shortcode('[FrontpageSlideshow]'); ?>`
     81Note that you can use all the features that shortcodes offers : for example, you can specify an alternative content (as the example before) this way.
     82
     83Note that FrontpageSlideshow modifies the normal Text Widget and allow you to use all the shortcodes in Text Widget.
     84
    7485If you need a new functionality, you can ask for it by contacting the author directly or by posting a feature request on related forum on wordpress.org website.
    7586If those functionnlity can't wait, consider making a donation.
     
    8697    4. allow to change the slide display duration <= work in progress
    87982. allow the use of multiples categories to find slides <= done
    88 3. widgetize the slider to allow to put it on sidebar an create small sliders
     993. widgetize the slider to allow to put it on sidebar an create small sliders <= done
    891004. Allowing the use of shortcode to add the slideshow <= done
    90101
Note: See TracChangeset for help on using the changeset viewer.