Changeset 171120
- Timestamp:
- 11/07/2009 05:02:31 AM (16 years ago)
- Location:
- frontpage-slideshow/trunk
- Files:
-
- 2 edited
-
frontpage-slideshow.php (modified) (21 diffs)
-
readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
frontpage-slideshow/trunk/frontpage-slideshow.php
r169308 r171120 4 4 Plugin URI: http://www.modulaweb.fr/blog/wp-plugins/frontside-slideshow/en/ 5 5 Description: 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. 36 Version: 0.7.4 7 7 Author: Jean-François VIAL 8 8 Author URI: http://www.modulaweb.fr/ … … 24 24 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 25 25 */ 26 define ('FRONTPAGE_SLIDESHOW_VERSION', '0.7. 3');26 define ('FRONTPAGE_SLIDESHOW_VERSION', '0.7.4'); 27 27 $fs_already_displayed = false; // the slideshow dont have been displayed yet 28 28 function frontpageSlideshow($content,$force_display=false,$options=array()) { … … 39 39 $fs_already_displayed = true; 40 40 // 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']); 42 42 // put post in more logical order 43 43 $fsposts = array_reverse($fsposts); … … 45 45 foreach ($fsposts as $fspost) { 46 46 // format informations 47 $title = $fspost->post_title; 47 $title = get_post_meta($fspost->ID,'fs-title',true); 48 if ($title == '') $title = $fspost->post_title; 48 49 $comment = get_post_meta($fspost->ID,'fs-comment',true); 49 50 $buttoncomment = get_post_meta($fspost->ID,'fs-button-comment',true); … … 96 97 97 98 function frontpageSlideshow_header($force_display=false,$options=array()) { 98 if (true || $force_display) {99 99 if (!count($options)) $options = frontpageSlideshow_get_options(); 100 100 if (!$options['values']['fs_is_activated'] && !$force_display) return; … … 108 108 frontpageSlideshow_CSS($options,$force_display); 109 109 } 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 112 function frontpageSlideshow_JS($options,$fslast) { 115 113 ?> 116 114 <!-- added by plugin FrontpageSlideshow --> … … 124 122 fsid=id; 125 123 window.clearInterval(fsinterval); 126 new Effect.Opacity('fs-slide',{ duration: 0.5, from: 1, to: 0, afterFinish: fsChangeSlide2 }); 124 <?php 125 switch ($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 ?> 127 140 } 128 141 function fsChangeSlide2() { … … 130 143 $('fs-title').innerHTML=$('fs-entry-title-'+fsid).innerHTML; 131 144 $('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}); 133 146 $('fs-entry-'+fsid).addClassName('fs-current'); 134 147 frontpageSlideshow(); … … 147 160 <!-- /added by plugin FrontpageSlideshow --> 148 161 <?php 149 } 150 } 151 152 function frontpageSlideshow_CSS($options,$force_display=false) { 153 if (true || $force_display) { 162 } 163 164 function frontpageSlideshow_CSS($options) { 154 165 /* 155 166 Here comes the CSS ruleset … … 210 221 width: 100%; 211 222 text-decoration: none; 223 color: transparent; 224 border: none; 212 225 } 213 226 #fs-placeholder a:hover { … … 215 228 } 216 229 #fs-text { 230 <?php if ($options['values']['fs_show_comment']) {?> 217 231 opacity: <?php echo intval(str_replace('%','',$options['values']['fs_text_opacity'])) / 100; ?>; 218 232 background-color: <?php echo $options['values']['fs_text_bgcolor']?>; 219 233 /*margin-top: 10px;*/ 220 234 padding: 10px; 235 <?php } else { ?> 236 display: none; 237 <?php } ?> 221 238 } 222 239 #fs-text a { … … 321 338 322 339 <?php 323 }324 340 } 325 341 … … 414 430 'fs_font_color' => '#fff', 415 431 'fs_main_border_color' => '#444', 432 'fs_transition' => 'fade', 433 'fs_orderby' => 'ID', 434 'fs_order' => 'DESC', 435 'fs_show_comment' => 1, 416 436 )); 417 437 $infos = array ( … … 438 458 'fs_font_color' => 'css-color', 439 459 'fs_main_border_color' => 'css-color', 460 'fs_transition' => 'transition', 461 'fs_orderby' => 'orderby', 462 'fs_order' => 'order', 463 'fs_show_comment' => 'bool', 440 464 ), 441 465 'names' => array ( … … 461 485 'fs_font_color' => __('The font color','frontpage-slideshow'), 462 486 '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'), 463 491 ), 464 492 ); … … 569 597 $insertModes = array('frontpage', 'shortcode'); 570 598 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)) { 571 626 $bad_values[] = $options['names'][$key]; 572 627 } else { … … 693 748 </ul> 694 749 <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> 696 751 <br /> 697 752 <p><big><strong><?php _e('In case of trouble:','frontpage-slideshow'); ?></strong></big></p> 698 753 <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> 699 755 <li><?php _e('Read this page: ','frontpage-slideshow'); ?> <a href="http://wordpress.org/support/topic/322689">http://wordpress.org/support/topic/322689</a></li> 700 756 <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> … … 712 768 $req = file_get_contents('https://www.modulaweb.fr/wp-plugins-support/?args='.urlencode(json_encode($args))); 713 769 $req = json_decode($req, true); 714 715 770 $plugin_ID = $req['ID']; 716 771 ?> … … 788 843 <div class="postbox closed"> 789 844 <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> 791 846 <div class="inside" style="padding: 5px;"> 792 847 <p><?php _e('Frontpage Slideshow will look for posts to display as slides into these categories : ','frontpage-slideshow')?></p> … … 806 861 ?> 807 862 </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> 808 875 <p><input type="submit" name="fs_preview" class="button-primary" value="<?php _e('Preview'); ?>" /></p> 809 876 </div> … … 814 881 <div class="inside" style="padding: 5px;"> 815 882 <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> 819 896 </select></p> 820 897 <p><input type="submit" name="fs_preview" class="button-primary" value="<?php _e('Preview'); ?>" /></p> -
frontpage-slideshow/trunk/readme.txt
r169310 r171120 5 5 Requires at least: 2.8.0 6 6 Tested up to: 2.8.5 7 Stable tag: 0.7. 37 Stable tag: 0.7.4 8 8 9 9 Frontpage Slideshow provides a slide show like you can see in linux.com front page … … 28 28 1. Go to the plugin's administration page and configure it as you want it 29 29 1. Activate the plugin when you are ready to 30 1. No short-tag is needed : the plugin work as soon as activated 30 31 When installed : make sure you have read the <a href="../other_notes/">"how to use" section</a> 31 32 32 33 == Frequently Asked Questions == … … 46 47 * v 0.7.2 : uses javascript to include specific css rather than plain html allowing to validate to XHTML 47 48 * 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 48 50 49 51 == Screenshots == … … 59 61 Then you got to addd thoses custom parameters to each slide-posts : 60 62 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) 63 66 * 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 64 67 * fs-picture : the URL of the picture to display, the first picture on post-content is used if this parameter is missing … … 101 104 1. calculate the buttons height automatically <= work in progress 102 105 2. allow to not display buttons <= done 103 3. allow to display a previ ewand next button on side of slider106 3. allow to display a previous and next button on side of slider 104 107 2. allow to change the size of the slider <= done 105 108 3. allow to fine tune the appearance of buttons <= partially done
Note: See TracChangeset
for help on using the changeset viewer.