Plugin Directory

Changeset 171120


Ignore:
Timestamp:
11/07/2009 05:02:31 AM (16 years ago)
Author:
jeff_
Message:

fixing bugs introduced in 0.7.3 that causes no start of the slideshow sometimes + possibility to change slide transitions + order of slides + putting a different title on slides + option to hide the comment zone

Location:
frontpage-slideshow/trunk
Files:
2 edited

Legend:

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

    r169308 r171120  
    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.7.3
     6Version: 0.7.4
    77Author: Jean-François VIAL
    88Author URI: http://www.modulaweb.fr/
     
    2424    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2525*/
    26 define ('FRONTPAGE_SLIDESHOW_VERSION', '0.7.3');
     26define ('FRONTPAGE_SLIDESHOW_VERSION', '0.7.4');
    2727$fs_already_displayed = false; // the slideshow dont have been displayed yet
    2828function frontpageSlideshow($content,$force_display=false,$options=array()) {
     
    3939        $fs_already_displayed = true;
    4040        // get the 4th newer posts
    41         $fsposts = get_posts('category='.$fscategories.'&orderby=ID&numberposts='.$options['values']['fs_slides'].'&order=DESC');
     41        $fsposts = get_posts('category='.$fscategories.'&orderby='.$options['values']['fs_orderby'].'&numberposts='.$options['values']['fs_slides'].'&order='.$options['values']['fs_order']);
    4242        // put post in more logical order
    4343        $fsposts = array_reverse($fsposts);
     
    4545        foreach ($fsposts as $fspost) {
    4646            // format informations
    47             $title = $fspost->post_title;
     47            $title = get_post_meta($fspost->ID,'fs-title',true);
     48            if ($title == '') $title = $fspost->post_title;
    4849            $comment = get_post_meta($fspost->ID,'fs-comment',true);
    4950            $buttoncomment = get_post_meta($fspost->ID,'fs-button-comment',true);
     
    9697
    9798function frontpageSlideshow_header($force_display=false,$options=array()) {
    98     if (true || $force_display) {
    9999        if (!count($options)) $options = frontpageSlideshow_get_options();
    100100        if (!$options['values']['fs_is_activated'] && !$force_display) return;
     
    108108            frontpageSlideshow_CSS($options,$force_display);
    109109        }
    110     }
    111 }
    112 
    113 function frontpageSlideshow_JS($options,$fslast,$force_display=false) {
    114     if ((!is_feed() && is_front_page() && is_page()) || $force_display) {
     110}
     111
     112function frontpageSlideshow_JS($options,$fslast) {
    115113?>
    116114<!--  added by plugin FrontpageSlideshow -->
     
    124122    fsid=id;
    125123    window.clearInterval(fsinterval);
    126     new Effect.Opacity('fs-slide',{ duration: 0.5, from: 1, to: 0, afterFinish: fsChangeSlide2 });
     124<?php
     125switch ($options['values']['fs_transition']) {
     126    case 'fade':
     127        echo "\tnew Effect.Fade('fs-slide',{ duration: 0.5, afterFinish: fsChangeSlide2 });\n";
     128        break;
     129    case 'shrink':
     130        echo "\tnew Effect.Shrink('fs-slide',{ duration: 0.5, afterFinish: fsChangeSlide2 });\n";
     131        break;
     132    case 'dropout':
     133        echo "\tnew Effect.DropOut('fs-slide',{ duration: 0.5, afterFinish: fsChangeSlide2 });\n";
     134        break;
     135    case 'jumpup':
     136        echo "\tnew Effect.toggle('fs-slide','slide',{ duration: 0.5, afterFinish: fsChangeSlide2 });\n";
     137        break;
     138}
     139?>
    127140}
    128141function fsChangeSlide2() {
     
    130143    $('fs-title').innerHTML=$('fs-entry-title-'+fsid).innerHTML;
    131144    $('fs-excerpt').innerHTML=$('fs-entry-comment-'+fsid).innerHTML;
    132     new Effect.Opacity('fs-slide',{ duration: 0.5, from: 0, to: 1 });
     145    new Effect.Appear('fs-slide',{ duration: 0.5});
    133146    $('fs-entry-'+fsid).addClassName('fs-current');
    134147    frontpageSlideshow();
     
    147160<!--  /added by plugin FrontpageSlideshow -->
    148161<?php
    149     }
    150 }
    151 
    152 function frontpageSlideshow_CSS($options,$force_display=false) {
    153     if (true || $force_display) {
     162}
     163
     164function frontpageSlideshow_CSS($options) {
    154165/*
    155166    Here comes the CSS ruleset
     
    210221    width: 100%;
    211222    text-decoration: none;
     223    color: transparent;
     224    border: none;
    212225}
    213226#fs-placeholder a:hover {
     
    215228}
    216229#fs-text {
     230<?php if ($options['values']['fs_show_comment']) {?>
    217231    opacity: <?php  echo intval(str_replace('%','',$options['values']['fs_text_opacity'])) / 100; ?>;
    218232    background-color: <?php echo $options['values']['fs_text_bgcolor']?>;
    219233    /*margin-top: 10px;*/
    220234    padding: 10px;
     235<?php } else { ?>
     236    display: none;
     237<?php } ?>
    221238}
    222239#fs-text a {
     
    321338
    322339<?php
    323     }
    324340}
    325341
     
    414430                    'fs_font_color'         => '#fff',
    415431                    'fs_main_border_color'      => '#444',
     432                    'fs_transition'         => 'fade',
     433                    'fs_orderby'            => 'ID',
     434                    'fs_order'          => 'DESC',
     435                    'fs_show_comment'       => 1,
    416436                ));
    417437    $infos = array (
     
    438458                    'fs_font_color'         => 'css-color',
    439459                    'fs_main_border_color'      => 'css-color',
     460                    'fs_transition'         => 'transition',
     461                    'fs_orderby'            => 'orderby',
     462                    'fs_order'          => 'order',
     463                    'fs_show_comment'       => 'bool',
    440464                ),
    441465                'names' => array (
     
    461485                    'fs_font_color'         => __('The font color','frontpage-slideshow'),
    462486                    'fs_main_border_color'      => __('The slideshow border color','frontpage-slideshow'),
     487                    'fs_transition'         => __('The transition mode','frontpage-slideshow'),
     488                    'fs_orderby'            => __('The slide order base','frontpage-slideshow'),
     489                    'fs_order'          => __('The slide order','frontpage-slideshow'),
     490                    'fs_order'          => __('The show comment option','frontpage-slideshow'),
    463491                ),
    464492              );
     
    569597                    $insertModes = array('frontpage', 'shortcode');
    570598                    if (!in_array(trim($val),$insertModes)) {
     599                        $bad_values[] = $options['names'][$key];
     600                    } else {
     601                        $val = trim($val);
     602                        $value_ok = true;
     603                    }
     604                    break;
     605                case 'transition':
     606                    $transitions = array('fade', 'shrink', 'dropout', 'jumpup');
     607                    if (!in_array(trim($val),$transitions)) {
     608                        $bad_values[] = $options['names'][$key];
     609                    } else {
     610                        $val = trim($val);
     611                        $value_ok = true;
     612                    }
     613                    break;
     614                case 'orderby':
     615                    $orderby = array('date', 'modified', 'menu_order', 'ID', 'rand');
     616                    if (!in_array(trim($val),$orderby)) {
     617                        $bad_values[] = $options['names'][$key];
     618                    } else {
     619                        $val = trim($val);
     620                        $value_ok = true;
     621                    }
     622                    break;
     623                case 'order':
     624                    $order = array('ASC', 'DESC');
     625                    if (!in_array(trim($val),$order)) {
    571626                        $bad_values[] = $options['names'][$key];
    572627                    } else {
     
    693748                        </ul>
    694749                        <br />
    695                         <p><?php _e('Note that this plugin is using the Wordpress API In order to include its needed Javascript files. Some other plugins or themes that are not using that API could mess up with this plugin.','frontpage-slideshow'); ?></p>
     750                        <p><strong><?php _e('Note that this plugin is using the Wordpress API In order to include its needed Javascript files. Some other plugins or themes that are not using that API could mess up with this plugin.','frontpage-slideshow'); ?></strong></p>
    696751                        <br />
    697752                        <p><big><strong><?php _e('In case of trouble:','frontpage-slideshow'); ?></strong></big></p>
    698753                        <ul style="list-style: disc; padding-left: 20px;">
     754                            <li><?php _e('Make sure you have read the "How to use": ','frontpage-slideshow'); ?> <a href="http://wordpress.org/extend/plugins/frontpage-slideshow/other_notes/">http://wordpress.org/extend/plugins/frontpage-slideshow/other_notes/</a></li>
    699755                            <li><?php _e('Read this page: ','frontpage-slideshow'); ?> <a href="http://wordpress.org/support/topic/322689">http://wordpress.org/support/topic/322689</a></li>
    700756                            <li><?php _e('Look at the other support questions there: ','frontpage-slideshow'); ?> <a href="http://wordpress.org/tags/frontpage-slideshow">http://wordpress.org/tags/frontpage-slideshow</a></li>
     
    712768    $req = file_get_contents('https://www.modulaweb.fr/wp-plugins-support/?args='.urlencode(json_encode($args)));
    713769    $req = json_decode($req, true);
    714 
    715770    $plugin_ID = $req['ID'];
    716771?>
     
    788843                <div class="postbox closed">
    789844                    <div class="handlediv" title="<?php _e('Click to open/close','frontpage-slideshow')?>"><br /></div>
    790                     <h3><span><?php _e('About categories','frontpage-slideshow')?></span></h3>
     845                    <h3><span><?php _e('About categories and posts','frontpage-slideshow')?></span></h3>
    791846                    <div class="inside" style="padding: 5px;">
    792847                        <p><?php _e('Frontpage Slideshow will look for posts to display as slides into these categories : ','frontpage-slideshow')?></p>
     
    806861                ?>
    807862                        </ul>
     863                        <p><label for="fs_orderby"><?php _e('Slides / Posts order:','frontpage-slideshow')?> <select id="fs_orderby" name="fs_orderby">
     864                            <option value="date"<?php  if ($options['values']['fs_orderby']=='date') echo ' selected="selected"'?>><?php  _e('date','frontpage-slideshow'); ?></option>
     865                            <option value="modified"<?php  if ($options['values']['fs_orderby']=='modified') echo ' selected="selected"'?>><?php  _e('modification date','frontpage-slideshow'); ?></option>
     866                            <option value="menu_order"<?php  if ($options['values']['fs_orderby']=='menu_order') echo ' selected="selected"'?>><?php  _e('specified order (menu order)','frontpage-slideshow'); ?></option>
     867                            <option value="ID"<?php  if ($options['values']['fs_orderby']=='ID') echo ' selected="selected"'?>><?php  _e('ID','frontpage-slideshow'); ?></option>
     868                            <option value="rand"<?php  if ($options['values']['fs_orderby']=='rand') echo ' selected="selected"'?>><?php  _e('random','frontpage-slideshow'); ?></option>
     869                        </select></label>
     870                        <select id="fs_order" name="fs_order">
     871                            <option value="ASC"<?php  if ($options['values']['fs_order']=='ASC') echo ' selected="selected"'?>><?php  _e('ascending','frontpage-slideshow'); ?></option>
     872                            <option value="DESC"<?php  if ($options['values']['fs_order']=='DESC') echo ' selected="selected"'?>><?php  _e('descending','frontpage-slideshow'); ?></option>
     873                        </select>
     874                        </p>
    808875                        <p><input type="submit" name="fs_preview" class="button-primary" value="<?php  _e('Preview'); ?>" /></p>
    809876                    </div>
     
    814881                    <div class="inside" style="padding: 5px;">
    815882                        <p><label for="fs_slides"><?php _e('How many slides to show ?','frontpage-slideshow')?> <input type="text" id="fs_slides" name="fs_slides" size="2" maxlength="2" value="<?php echo $options['values']['fs_slides']?>" /></label></p>
    816                         <p><label for="fs_show_buttons"><select id="fs_show_buttons" name="fs_show_buttons">
    817                             <option value="1"<?php  if ($options['values']['fs_show_buttons']) echo ' selected="selected"'?>><?php  _e('Show buttons','frontpage-slideshow'); ?></option>
    818                             <option value="0"<?php  if (!$options['values']['fs_show_buttons']) echo ' selected="selected"'?>><?php  _e('Hide buttons','frontpage-slideshow'); ?></option>
     883                        <p><label for="fs_show_buttons"><?php _e('Show buttons ?','frontpage-slideshow')?> <select id="fs_show_buttons" name="fs_show_buttons">
     884                            <option value="1"<?php  if ($options['values']['fs_show_buttons']) echo ' selected="selected"'?>><?php  _e('Yes','frontpage-slideshow'); ?></option>
     885                            <option value="0"<?php  if (!$options['values']['fs_show_buttons']) echo ' selected="selected"'?>><?php  _e('No','frontpage-slideshow'); ?></option>
     886                        </select></p>
     887                        <p><label for="fs_transition"><?php _e('Tansition mode between slides to use','frontpage-slideshow')?> <select id="fs_transition" name="fs_transition">
     888                            <option value="fade"<?php  if ($options['values']['fs_transition']=='fade') echo ' selected="selected"'?>><?php  _e('fade','frontpage-slideshow'); ?></option>
     889                            <option value="shrink"<?php  if ($options['values']['fs_transition']=='shrink') echo ' selected="selected"'?>><?php  _e('shrink','frontpage-slideshow'); ?></option>
     890                            <option value="dropout"<?php  if ($options['values']['fs_transition']=='dropout') echo ' selected="selected"'?>><?php  _e('drop out','frontpage-slideshow'); ?></option>
     891                            <option value="jumpup"<?php  if ($options['values']['fs_transition']=='jumpup') echo ' selected="selected"'?>><?php  _e('jump up','frontpage-slideshow'); ?></option>
     892                        </select></p>
     893                        <p><label for="fs_show_comment"><?php _e('Show slide comment zone ?','frontpage-slideshow')?> <select id="fs_show_comment" name="fs_show_comment">
     894                            <option value="1"<?php  if ($options['values']['fs_show_comment']) echo ' selected="selected"'?>><?php  _e('Yes','frontpage-slideshow'); ?></option>
     895                            <option value="0"<?php  if (!$options['values']['fs_show_comment']) echo ' selected="selected"'?>><?php  _e('No','frontpage-slideshow'); ?></option>
    819896                        </select></p>
    820897                        <p><input type="submit" name="fs_preview" class="button-primary" value="<?php  _e('Preview'); ?>" /></p>
  • frontpage-slideshow/trunk/readme.txt

    r169310 r171120  
    55Requires at least: 2.8.0
    66Tested up to: 2.8.5
    7 Stable tag: 0.7.3
     7Stable tag: 0.7.4
    88
    99Frontpage Slideshow provides a slide show like you can see in linux.com front page
     
    28281. Go to the plugin's administration page and configure it as you want it
    29291. Activate the plugin when you are ready to
    30 1. No short-tag is needed : the plugin work as soon as activated
     30
     31When installed : make sure you have read the <a href="../other_notes/">"how to use" section</a>
    3132
    3233== Frequently Asked Questions ==
     
    4647* v 0.7.2 : uses javascript to include specific css rather than plain html allowing to validate to XHTML
    4748* v 0.7.3 : fixing bug introduced in 0.7.2 that was messing up the slideshow display in IE + XHTML validation improvements
     49* v 0.7.4 : fixing bugs introduced in 0.7.3 that causes no start of the slideshow sometimes + possibility to change slide transitions + order of slides + putting a different title on slides + option to hide the comment zone
    4850
    4951== Screenshots ==
     
    5961Then you got to addd thoses custom parameters to each slide-posts :
    6062
    61     * fs-button-comment : the button specific message
    62     * fs-comment : the comment
     63    * fs-title : the slide title (default is the post title)
     64    * fs-button-comment : the button specific message (default : none)
     65    * fs-comment : the comment (default: none)
    6366    * fs-link : the URL of page where to redirect users when they click on the picture, can be set to the page URL if none is given
    6467    * fs-picture : the URL of the picture to display, the first picture on post-content is used if this parameter is missing
     
    101104        1. calculate the buttons height automatically <= work in progress
    102105        2. allow to not display buttons  <= done
    103         3. allow to display a preview and next button on side of slider
     106        3. allow to display a previous and next button on side of slider
    104107    2. allow to change the size of the slider <= done
    105108    3. allow to fine tune the appearance of buttons <= partially done
Note: See TracChangeset for help on using the changeset viewer.