Changeset 415746
- Timestamp:
- 07/27/2011 02:56:11 AM (15 years ago)
- Location:
- frontpage-slideshow/trunk
- Files:
-
- 1 deleted
- 3 edited
-
frontpage-slideshow.php (modified) (41 diffs)
-
js/jquery-ui-interactions.js (deleted)
-
readme.txt (modified) (7 diffs)
-
templates/default/template.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
frontpage-slideshow/trunk/frontpage-slideshow.php
r280410 r415746 4 4 Plugin URI: http://wordpress.org/extend/plugins/frontpage-slideshow/ 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.9.9.3. 46 Version: 0.9.9.3.5 7 7 Author: Jean-François VIAL 8 8 Author URI: http://www.modulaweb.fr/ … … 10 10 */ 11 11 /* Copyright 2009 Jean-François VIAL (email : [email protected]) 12 12 13 13 This program is free software; you can redistribute it and/or modify 14 14 it under the terms of the GNU General Public License as published by … … 25 25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 26 */ 27 define ('FRONTPAGE_SLIDESHOW_VERSION', '0.9.9.3. 4');27 define ('FRONTPAGE_SLIDESHOW_VERSION', '0.9.9.3.5'); 28 28 $fs_already_displayed = false; // the slideshow dont have been displayed yet 29 29 … … 31 31 $template = 'default'; 32 32 $options = frontpageSlideshow_get_options(); 33 if (is_file (dirname(__FILE__).'/templates/'.$options['values']['fs_template'].'/template.php')) 34 $template = $options['values']['fs_template']; 33 if (isset($options['values']['fs_template'])) { 34 if (is_file (dirname(__FILE__).'/templates/'.$options['values']['fs_template'].'/template.php')) 35 $template = $options['values']['fs_template']; 36 } 35 37 include (dirname(__FILE__).'/templates/'.$template.'/template.php'); 36 38 … … 64 66 if ($image == '') { // if no image : use the first image on the post 65 67 $image = $fspost->post_content; 66 if (preg_match('/<img[^>]*src="([^"]*)"/i',$image,$matches)) { 68 if (has_post_thumbnail($fspost->ID)) { 69 $image = wp_get_attachment_image_src(get_post_thumbnail_id($fspost->ID),'large'); 70 $image = $image[0]; 71 } elseif (preg_match('/<img[^>]*src="([^"]*)"/i',$image,$matches)) { 67 72 $image = $matches[1]; 68 73 } else { 69 (is_ssl()) ? $url = str_replace('http://','https://',get_bloginfo('url')) : $url = str_replace('https://','http://',get_bloginfo('url')); 74 (is_ssl()) ? $url = str_replace('http://','https://',get_bloginfo('url')) : $url = str_replace('https://','http://',get_bloginfo('url')); 70 75 $image = $url.'/wp-content/plugins/frontpage-slideshow/images/one_transparent_pixel.gif'; 71 76 } … … 78 83 // put infos into an array 79 84 80 $fsentries[] = array('title' => $title.' ', 'image' => $image, 'comment' => $comment.' ', 'button-comment' => $buttoncomment.' ', 'link' => $link );85 $fsentries[] = array('title' => $title.' ', 'image' => $image, 'comment' => $comment.' ', 'button-comment' => $buttoncomment.' ', 'link' => $link, 'post_id' => $fspost->ID); 81 86 } 82 87 // construct the slider 83 88 $fscontent = ''; 84 89 $fslast = count($fsentries) -1; 85 if (count($fsentries)) 90 if (count($fsentries)) 86 91 $fscontent = frontpageSlideshow_TPL($fsentries); 87 92 $header = frontpageSlideshow_header(true,$options); 88 93 return "\n<!-- Frontpage Slideshow begin -->\n{$fscontent}\n{$header}\n<!-- Frontpage Slideshow end -->\n{$content}"; 89 94 90 95 } else { 91 96 return $content; … … 95 100 function frontpageSlideshow_init() { 96 101 // loads the needed frameworks to load as a safe way 97 // now using jQuery framework instead of Prototype+Scriptaculous98 102 wp_register_script('jquery-ui-effects',WP_PLUGIN_URL .'/frontpage-slideshow/js/jquery-ui-effects.js', array('jquery-ui-core')); 99 103 wp_enqueue_script('jquery-ui-effects'); 100 104 } 101 function frontpageSlideshow_admin_ init() {105 function frontpageSlideshow_admin_enqueue_scripts() { 102 106 // loads the needed frameworks to load as a safe way into admin page 103 // now using jQuery framework instead of Prototype+Scriptaculous 104 wp_register_script('jquery-ui-interactions',WP_PLUGIN_URL .'/frontpage-slideshow/js/jquery-ui-interactions.js', array('jquery-ui-core')); 105 wp_enqueue_script('jquery-ui-interactions'); 107 wp_enqueue_script('jquery-ui-draggable'); 108 wp_enqueue_script('jquery-ui-droppable'); 109 wp_enqueue_script('jquery-ui-selectable'); 110 wp_enqueue_script('jquery-ui-sortable'); 106 111 } 107 112 … … 171 176 } 172 177 173 function frontpageSlideshow_dedicated_shortcode ($attributes , $content=null) {178 function frontpageSlideshow_dedicated_shortcode ($attributes=array(), $content=null) { 174 179 global $fs_already_displayed; 175 180 … … 184 189 185 190 $options['values'] = shortcode_atts($options['values'], $attributes); 186 $options['values']['fs_cats'] = explode(',',$attributes['fs_cats']); 191 if (is_array($attributes)) { 192 if (array_key_exists('fs_cats',$attributes)) 193 $options['values']['fs_cats'] = explode(',',$attributes['fs_cats']); 194 } 187 195 $force_display_if_shortcode = true; 188 196 $force_display_if_shortcode = true; … … 253 261 'fs_main_width' => '732px', 254 262 'fs_main_height' => '260px', 255 'fs_slide_width' => ' 80%',256 'fs_buttons_width' => ' 20%',263 'fs_slide_width' => '585px', 264 'fs_buttons_width' => '147px', 257 265 'fs_placeholder_height' => '195px', 258 266 'fs_button_normal_color' => '#000', … … 393 401 394 402 function frontpageSlideshow_admin_menu() { 395 add_options_page('Frontpage Slideshow', 'Frontpage Slideshow', 8, 'frontpage-slideshow', 'frontpageSlideshow_admin_options');403 add_options_page('Frontpage Slideshow', 'Frontpage Slideshow', 'edit_posts', 'frontpage-slideshow', 'frontpageSlideshow_admin_options'); 396 404 } 397 405 function frontpageSlideshow_validate_options() { … … 403 411 $value_ok = false; 404 412 switch ($options['types'][$key]) { 405 case 'array of cats': 413 case 'array of cats': 406 414 if (!is_array($val)) { 407 415 $bad_values[] = $options['names'][$key]; … … 424 432 } 425 433 break; 426 case 'integer': 434 case 'integer': 427 435 if (!preg_match('/^[1-9][0-9]*$/',trim($val))) { 428 436 $bad_values[] = $options['names'][$key]; … … 431 439 } 432 440 break; 433 case 'bool': 441 case 'bool': 434 442 if (is_bool($val) || $val == 1 || $val == 0) { 435 443 $value_ok = true; … … 572 580 $dont_add=array('fs_is_activated','fs_shortcode','fs_insert'); 573 581 foreach ($opt['values'] as $k=>$v) { 574 if (!in_array($k,$dont_add) && $def['values'][$k] != $v && $k != 'fs_cats') 582 if (!in_array($k,$dont_add) && $def['values'][$k] != $v && $k != 'fs_cats') 575 583 $argz .= " {$k}={$v}"; 576 584 elseif ($k == 'fs_cats') { … … 585 593 $options = frontpageSlideshow_get_options(); 586 594 $message = ''; 587 if( $_POST['fs_submit']) {595 if(isset($_POST['fs_submit'])) { 588 596 $test = frontpageSlideshow_validate_options(); 589 597 $options = $test['options']; … … 595 603 } 596 604 unset($test); 597 } else if ( $_POST['fs_preview']) {605 } else if (isset($_POST['fs_preview'])) { 598 606 $test = frontpageSlideshow_validate_options(); 599 607 $options = $test['options']; … … 604 612 } 605 613 unset($test); 606 } else if ( $_POST['fs_reset_preview']) {614 } else if (isset($_POST['fs_reset_preview'])) { 607 615 $options = frontpageSlideshow_get_options(); 608 616 $message = '<p>'.__('The preview have been updated with actual values.', 'frontpage-slideshow').'</p>'; 609 617 $message .= '<p>'.__('Note that the preview has been reseted to the ACTUAL values, not with default ones.', 'frontpage-slideshow').'</p>'; 610 } else if ( $_POST['fs_reset']) {618 } else if (isset($_POST['fs_reset'])) { 611 619 $options = frontpageSlideshow_get_options(true); 612 620 delete_option('frontpage-slideshow'); 613 621 update_option('frontpage-slideshow', array('values'=>$options['values'])); 614 622 $message = '<p>'.__('The plugins runs now with default values.', 'frontpage-slideshow').'</p>'; 615 } else if ( $_POST['fs_disable']) {623 } else if (isset($_POST['fs_disable'])) { 616 624 $options['values']['fs_is_activated'] = 0; 617 625 update_option('frontpage-slideshow', array('values'=>$options['values'])); 618 626 $message = '<p>'.__('The plugins has been disabled.', 'frontpage-slideshow').'</p>'; 619 } else if ( $_POST['fs_enable']) {627 } else if (isset($_POST['fs_enable'])) { 620 628 $options['values']['fs_is_activated'] = 1; 621 629 update_option('frontpage-slideshow', array('values'=>$options['values'])); … … 702 710 <h3><span><?php _e('Preview')?></span></h3> 703 711 <div class="inside" style="padding: 5px;"> 704 <?php 712 <?php 705 713 frontpageSlideshow_header(true,$options); 706 714 echo frontpageSlideshow('',true,$options); … … 711 719 <input name="hosted_button_id" value="9112063" type="hidden"> 712 720 <p> 713 <?php _e('If you find this plugin useful, you can support his author by making a donation.','frontpage-slideshow'); ?> 721 <?php _e('If you find this plugin useful, you can support his author by making a donation.','frontpage-slideshow'); ?> 714 722 <input name="submit" type="submit" class="button-primary" value="<?php _e('Donate to this plugin','frontpage-slideshow'); ?>" /> 715 723 </p> … … 718 726 <pre style="overflow: auto; background-color: #f5f5f5; border: 1px solid #dadada; padding: 11px; font-size: 11px; line-height: 1.3em;"> 719 727 <?php echo frontpageSlideshow_createShortcodeString($options); ?></pre> 720 728 721 729 </div> 722 730 </div> … … 726 734 <h3><span><?php if ($options['values']['fs_is_activated']) _e('Disable the plugin','frontpage-slideshow'); else _e('Enable the plugin','frontpage-slideshow');?></span></h3> 727 735 <div class="inside" style="padding: 5px;"> 728 <p><?php 736 <p><?php 729 737 if ($options['values']['fs_is_activated']) { 730 ?><label for="fs_disable"><?php 731 _e('The plugin is currently ENABLED : you can use the following button to disable it.','frontpage-slideshow')?> 738 ?><label for="fs_disable"><?php 739 _e('The plugin is currently ENABLED : you can use the following button to disable it.','frontpage-slideshow')?> 732 740 <input type="submit" class="button-primary" id="fs_disable" name="fs_disable" size="2" maxlength="2" value="<?php _e('Disable the plugin','frontpage-slideshow')?>" /> 733 <?php 741 <?php 734 742 } else { 735 ?><label for="fs_enable"><?php 736 _e('The plugin is currently DISABLED : you can use the following button to enable it.','frontpage-slideshow')?> 743 ?><label for="fs_enable"><?php 744 _e('The plugin is currently DISABLED : you can use the following button to enable it.','frontpage-slideshow')?> 737 745 <input type="submit" class="button-primary" id="fs_enable" name="fs_enable" size="2" maxlength="2" value="<?php _e('Enable the plugin now !!','frontpage-slideshow')?>" /> 738 <?php 746 <?php 739 747 } 740 748 ?> … … 753 761 <li><label for="fs_insert_2"><input type="radio" id="fs_insert_2" name="fs_insert" value="shortcode"<?php if ($options['values']['fs_insert']=='shortcode') echo ' checked="checked"'; ?> /> <?php _e('Everywhere on content post (using the dedicated shortcode)','frontpage-slideshow')?></label><br /> 754 762 <label for="fs_insert_shortcode">→ <?php _e('Shortcode','frontpage-slideshow')?> : [<input id="fs_shortcode" name="fs_shortcode" value="<?php echo $options['values']['fs_shortcode']?>" />]</label> 755 <br /> → <?php _e('Actual complete shortcode (to insert a slideshow with the actual settins):','frontpage-slideshow')?> 763 <br /> → <?php _e('Actual complete shortcode (to insert a slideshow with the actual settins):','frontpage-slideshow')?> 756 764 <pre style="margin-left: 47px; overflow: auto; background-color: #f5f5f5; border: 1px solid #dadada; padding: 11px; font-size: 11px; line-height: 1.3em;"> 757 765 <?php echo frontpageSlideshow_createShortcodeString($options); ?></pre> … … 771 779 <p><?php _e('Frontpage Slideshow will look for posts to display as slides into these categories : ','frontpage-slideshow')?></p> 772 780 <ul style="list-style: none"> 773 <?php 781 <?php 774 782 $cats = get_categories('hide_empty=0&depth=1'); 775 783 $count=1; … … 912 920 <h3><span><?php _e('About background images / textures and loader animation','frontpage-slideshow')?></span></h3> 913 921 <div class="inside" style="padding: 5px;"> 914 922 915 923 <?php 916 924 $attachments = get_children(array( … … 930 938 echo '<p>'._e('Drag\'n\'drop a picture to the place you want it to be to specify a background image/texture or loader.','frontpage-slideshow').'</p>'; 931 939 echo '<textarea id="fs-pictures-chooser-keeper" style="display: none!important;">'.$pics.'</textarea><div id="background_images_selector" style="display: block; width: 100%; border: 1px solid #dfdfdf;"><a href="#" onclick="jQuery(this).parent().html(jQuery(\'#fs-pictures-chooser-keeper\').val()); return false;">'.__('Click here to load the image selector and choose an image.','frontpage-slideshow').'</a></div>'; 932 940 933 941 $image_selectors = array( 934 942 array( … … 985 993 ?> 986 994 <div id="<?php echo $selector['id']; ?>_droppable" class="droppable" style="width: <?php echo $size; ?>%; margin: 0.2%; padding: 3px; border: solid 1px #aaa; text-align: center; float: left; height: 170px;"> 987 <label for="<?php echo $selector['id']; ?>"><?php 995 <label for="<?php echo $selector['id']; ?>"><?php 988 996 if ($options['values'][$selector['id']]!='') { 989 echo $selector['name']; 997 echo $selector['name']; 990 998 } else { 991 echo $selector['message']; 999 echo $selector['message']; 992 1000 } 993 1001 ?></label> … … 1011 1019 case 'fs_previous_image': 1012 1020 case 'fs_next_image': 1013 (is_ssl()) ? $url = str_replace('http://','https://',$url) : $url = str_replace('https://','http://',$url); 1021 (is_ssl()) ? $url = str_replace('http://','https://',$url) : $url = str_replace('https://','http://',$url); 1014 1022 echo ' background-image: url('.$url.'); background-repeat: '.$selector['repeat'].'!important; background-position: center center;'; 1015 1023 $options['values'][$selector['id']] = $url; … … 1052 1060 <div><?php _e('You can use the following service to create a custom loader animation :','frontpage-slideshow'); ?> <a href="http://www.ajaxload.info/" target="_blank">Ajaxload</a></div> 1053 1061 <script type="text/javascript"> 1054 // <![CDATA[ 1055 jQuery(".droppable").each(function() { 1062 // <![CDATA[ 1063 jQuery(document).ready(function(){ 1064 1065 jQuery('.droppable').each(function() { 1056 1066 jQuery(this).droppable({ 1057 1067 accept: '#background_images_selector img', … … 1075 1085 } 1076 1086 ?> 1077 1087 1078 1088 } 1079 1089 jQuery(this).find('label').html('<?php _e('Slideshow background image','frontpage-slideshow')?>'); … … 1092 1102 }); 1093 1103 }); 1094 //]]> 1104 }); 1105 //]]> 1095 1106 </script> 1096 1107 <p><input type="submit" name="fs_preview" class="button-primary" value="<?php _e('Preview'); ?>" /></p> … … 1140 1151 </script> 1141 1152 1142 <?php 1153 <?php 1143 1154 } 1144 1155 /******************************************************************************/ … … 1175 1186 function frontpageSlideshow_meta_boxes() { 1176 1187 global $post, $frontpageSlideshow_meta_boxes; 1177 1188 1178 1189 ?> 1179 <p><?php _e('All those options will be savend when you will save the changes made on this post');?></p> 1180 <?php echo '<input type="hidden" name="'.$meta_box['name'].'_noncename" id="'.$meta_box['name'].'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />'; ?> 1190 <p><?php _e('All those options will be saved when you will save the changes made on this post');?></p> 1181 1191 <table class="widefat" cellspacing="0" width="100%" id="inactive-plugins-table"> 1182 1192 1183 1193 <tbody class="plugins"> 1184 1194 <?php 1185 1195 1186 1196 foreach ($frontpageSlideshow_meta_boxes as $meta_box) { 1187 $meta_box_value = get_post_meta($post->ID, $pre.'_value', true);1188 1189 if ($meta_box_value == "")1190 $meta_box_value = $meta_box['std'];1191 1192 1197 ?><tr> 1193 1198 <td width="100" align="center" style="border-bottom: 1px solid #dfdfdf; overflow: auto;"> … … 1198 1203 <?php 1199 1204 echo '<input type="hidden" name="'.$meta_box['name'].'_noncename" id="'.$meta_box['name'].'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />'; 1200 if ( $meta_box['type'] == 'picture') {1205 if (isset($meta_box['type']) && $meta_box['type'] == 'picture') { 1201 1206 $attachments = get_children(array( 1202 1207 'post_type' => 'attachment', … … 1209 1214 foreach ($attachments as $attachment) { 1210 1215 $pics.= '<img style="border: 1px solid transparent; cursor: pointer;'; 1211 if (get_post_meta($post->ID, $meta_box['name'], true) == $attachment->guid) $pics.= ' border-color: red; ';1212 $pics.= '" onclick="jQuery(\'#'.$meta_box['name'].'\').val(this.src); this.style.borderColor=\'red\';" onmouseout="if (jQuery(\'#'.$meta_box['name'].'\').val() != this.src) this.style.borderColor=\'transparent\';" onmouseover="if (jQuery(\'#'.$meta_box['name'].'\').val() != this.src) this.style.borderColor=\'cyan\';" src="'.$attachment->guid.'" width="100" /> ';1216 if (get_post_meta($post->ID, $meta_box['name'], true) == $attachment->guid) $pics.= ' border-color: red;" _actual="true'; 1217 $pics.= '" onclick="jQuery(\'#'.$meta_box['name'].'\').val(this.src); jQuery(this).siblings(\'img\').css(\'border-color\',\'transparent\'); this.style.borderColor=\'red\';" onmouseout="if (jQuery(\'#'.$meta_box['name'].'\').val() != this.src) this.style.borderColor=\'transparent\';" onmouseover="if (jQuery(\'#'.$meta_box['name'].'\').val() != this.src) this.style.borderColor=\'cyan\';" src="'.$attachment->guid.'" width="100" /> '; 1213 1218 } 1214 1219 } else { … … 1237 1242 $posts .= '>'.$attachment->post_title.'</option>'; 1238 1243 } 1239 if (get_post_meta($post->ID, $meta_box['name'], true) == '') 1244 if (get_post_meta($post->ID, $meta_box['name'], true) == '') 1240 1245 $posts = '<option value="" disabled="disabled" selected="selected">'.__('Choose a page on this blog').'</option>'.$posts; 1241 1246 echo '<select onchange="document.getElementById(\''.$meta_box['name'].'\').value = this.options[this.selectedIndex].value">'.$posts.'</select>'; … … 1250 1255 </tbody> 1251 1256 </table> 1252 <?php 1257 <?php 1253 1258 } 1254 1259 … … 1261 1266 function frontpageSlideshow_save_postdata( $post_id ) { 1262 1267 global $post,$frontpageSlideshow_meta_boxes; 1263 1268 1264 1269 foreach($frontpageSlideshow_meta_boxes as $meta_box) { 1265 1270 // Verify … … 1267 1272 return $post_id; 1268 1273 } 1269 1274 1270 1275 if ( 'page' == $_POST['post_type'] ) { 1271 1276 if ( !current_user_can( 'edit_page', $post_id )) … … 1275 1280 return $post_id; 1276 1281 } 1277 1282 1278 1283 $data = $_POST[$meta_box['name']]; 1279 1284 1280 1285 if(get_post_meta($post_id, $meta_box['name']) == '') 1281 1286 add_post_meta($post_id, $meta_box['name'], $data, true); … … 1295 1300 if (frontpageSlideshow_get_options(false,'fs_insert') == 'shortcode') { 1296 1301 add_shortcode(frontpageSlideshow_get_options(false,'fs_shortcode'), 'frontpageSlideshow_dedicated_shortcode'); 1297 if (function_exists('add_action')) { 1298 add_filter('init', 'frontpageSlideshow_init',1); 1299 } 1302 add_filter('init', 'frontpageSlideshow_init',1); 1300 1303 } else { 1301 if (function_exists('add_action')) { 1302 add_filter('the_content', 'frontpageSlideshow'); 1303 add_filter('init', 'frontpageSlideshow_init',1); 1304 } 1305 } 1306 if (function_exists('add_action')) { 1307 add_action('admin_menu', 'frontpageSlideshow_admin_menu'); 1308 add_action('admin_init', 'frontpageSlideshow_admin_init'); 1309 add_action('admin_menu', 'frontpageSlideshow_create_meta_box'); 1310 add_action('save_post', 'frontpageSlideshow_save_postdata'); 1311 } 1304 add_filter('the_content', 'frontpageSlideshow'); 1305 add_filter('init', 'frontpageSlideshow_init',1); 1306 } 1307 add_action('admin_menu', 'frontpageSlideshow_admin_menu'); 1308 add_action('admin_enqueue_scripts', 'frontpageSlideshow_admin_enqueue_scripts'); 1309 add_action('admin_menu', 'frontpageSlideshow_create_meta_box'); 1310 add_action('save_post', 'frontpageSlideshow_save_postdata'); 1311 1312 1312 function frontpageSlideshow_Widget_init() { 1313 1313 register_widget('frontpageSlideshow_Widget'); -
frontpage-slideshow/trunk/readme.txt
r280410 r415746 2 2 Contributors: Jean-François “Jeff” VIAL 3 3 Donate link: http://www.modulaweb.fr/blog/wp-plugins-en/ 4 Tags: frontpage, slideshow, pictures, no-flash, css, javascript, XHTML, 4 Tags: frontpage, slideshow, pictures, no-flash, css, javascript, XHTML, slider, 5 5 Requires at least: 2.7.0 6 Tested up to: 3. 17 Stable tag: 0.9.9.3. 46 Tested up to: 3.2.1 7 Stable tag: 0.9.9.3.5 8 8 9 9 Frontpage Slideshow provides a slide show like you can see in linux.com front page … … 24 24 * Each slide is made from an article taken from one or more categories 25 25 * Admin box added on New/Edit articles formulars 26 * Complete admin page for whole slider parameters with preview 26 * Complete admin page for whole slider parameters with preview and easy drag'n'drop system to change background images and more 27 27 * Automatic insertion on frontpage or shortcode every where you want (on post bodies and sidebar text box or with small simple PHP snipet) 28 28 * Very high customization allowed by template system that allow to to control the HTML part but also the javascript and CSS parts ! 29 * Native support of posts thumbnails 30 * Template system that allow you to create your very own slider 29 31 30 = Usages = 32 = Usages = 31 33 32 34 * As an articles slideshow to present hot news … … 52 54 53 55 See the <a href="http://wordpress.org/tags/frontpage-slideshow">frontpage slideshow forum</a>, look for some topics tha could match your problem or question, then if no topic helps you, create a new topic. 54 56 55 57 = May I use more than one slideshow on my site ? = 56 58 … … 67 69 = Hey ! Your plugin is messing up my beautiful website ! Can you fix it now ? = 68 70 69 This plugin uses the Wordpress API to include the javascript frameworks properly, so that this plugin does not cause problems if other plugins or themes you use are properly encoded. 71 This plugin uses the Wordpress API to include the javascript frameworks properly, so that this plugin does not cause problems if other plugins or themes you use are properly encoded. 70 72 71 73 Otherwise, you got to troubleshoot by yourself (de-activate all plugins then re-active them one by one to determine if its the theme or a plugin, and wich plugin is messing up) then contact the guilty's author and ask him to use the Wordpress API to include javascript frameworks. … … 116 118 * v 0.9.9.3.3 : fix a bug that avoided the use of excerpt as slide comment and a bug introduced in 0.9.9.3.1 that disabled buttons use 117 119 * v 0.9.9.3.4 : fix a bug that not allowed to specify 1 or multiple categories by using shortcode ; silent the warning when the internet cannot be reached to get the plugin ID and add a message instead (+translation to french of this message) 120 * v 0.9.9.3.5 : fix the «always loading» bug, suppress PHP notices messages, don't use deprecated functions any more, admin page bugs, uses px per default for image and button sizes, use now WP integrated jQuery-UI files + add support of post thumbnails 118 121 119 122 == Screenshots == … … 135 138 136 139 `<?php 137 // added by <yourname > in order to add the slideshow using the frontpage-slideshow plugin140 // added by <yourname here> in order to add the slideshow using the frontpage-slideshow plugin 138 141 echo do_shortcode('[FrontpageSlideshow]'); 139 142 ?>` … … 158 161 If you need help to troubleshoot, don't forget to transmit your plugin unique ID. 159 162 You can find this plugin unique ID by visiting the plugin admin page at the very end of the "How to use / Getting help" section 163 -
frontpage-slideshow/trunk/templates/default/template.php
r256566 r415746 8 8 */ 9 9 /* Copyright 2009 Jean-François VIAL (email : [email protected]) 10 10 11 11 This program is free software; you can redistribute it and/or modify 12 12 it under the terms of the GNU General Public License as published by … … 26 26 How to create your own template: 27 27 1) copy/paste this file into another folder in the template folder. 28 2) modify thos 2 functions to feet your needs.28 2) modify those 2 functions to feet your needs. 29 29 3) choose this new template to use it into the plugin's admin page 30 30 … … 70 70 ?> 71 71 var fslast = <?php echo $fslast?>; 72 var fsid = -1; 72 var fsid = -1; 73 73 var fsinterval = 0; 74 74 var clicked = false; … … 83 83 window.clearInterval(fsinterval); 84 84 <?php echo frontpageSlideshow_JS_effect($options['values']['fs_transition']); ?> 85 85 86 86 } 87 87 } … … 94 94 jQuery('#fs-excerpt').html(jQuery('#fs-entry-comment-'+fsid).html()); 95 95 <?php echo frontpageSlideshow_JS_effect($options['values']['fs_transition_on'],'In'); ?> 96 96 97 97 jQuery("#fs-entry-"+fsid).addClass('fs-current'); 98 98 frontpageSlideshow(); … … 100 100 function fsDoSlide() { 101 101 jQuery("#fs-slide").css({width : jQuery("#fs-slide").css('width')}); 102 102 103 103 if (fsid>-1) jQuery("#fs-entry-"+fsid).removeClass("fs-current"); 104 104 fsid++; … … 122 122 fsChangeSlide(id); 123 123 } 124 jQuery('#fs-prev').click(function() {fsPrevNext(-1); return false;}); 125 jQuery('#fs-next').click(function() {fsPrevNext(1); return false;}); 126 jQuery('#fs-prev,#fs-next').hover( 127 function(){jQuery(this).stop(true, true).fadeTo('fast',0.6);}, 128 function(){jQuery(this).stop(true, true).fadeTo('fast',0.15);} 129 ); 130 jQuery('.fs-img').last().load(function() {fsDoSlide()}); 124 jQuery(document).ready(function () { 125 126 jQuery('#fs-prev').click(function() {fsPrevNext(-1); return false;}); 127 jQuery('#fs-next').click(function() {fsPrevNext(1); return false;}); 128 jQuery('#fs-prev,#fs-next').hover( 129 function(){jQuery(this).stop(true, true).fadeTo('fast',0.6);}, 130 function(){jQuery(this).stop(true, true).fadeTo('fast',0.15);} 131 ); 132 jQuery('.fs-img').last().load(function() {fsDoSlide()}); 131 133 <?php 132 134 for ($i=0;$i<=$fslast;$i++) 133 135 echo "jQuery('#fs-entry-{$i}').click(function() {fsChangeSlide({$i})});\n"; 134 136 ?> 135 <?php 137 }); 138 <?php 136 139 $js = ob_get_contents(); 137 140 define('FS_JS',$js); … … 157 160 ?> 158 161 overflow: hidden; 159 background: <?php echo $options['values']['fs_main_color']?> <?php 162 background: <?php echo $options['values']['fs_main_color']?> <?php 160 163 if ($options['values']['fs_main_background_image'] != '' && $options['values']['fs_main_background_image'] != 'none') { 161 164 $url = $options['values']['fs_main_background_image']; … … 320 323 height: 100%; 321 324 list-style: none!important; 322 background: <?php echo $options['values']['fs_ul_background_color']?> <?php 325 background: <?php echo $options['values']['fs_ul_background_color']?> <?php 323 326 if ($options['values']['fs_ul_background_image'] != '' && $options['values']['fs_ul_background_image'] != 'none') { 324 327 $url = $options['values']['fs_ul_background_image']; … … 348 351 $number = str_replace('px','',str_replace('%','',$fslast)); 349 352 $height = str_replace('px','',str_replace('%','',trim($options['values']['fs_main_height']))); 350 353 351 354 $h = floor($height/$number); 352 355 353 356 echo $h.'px'; 354 357 ?>!important; … … 369 372 370 373 .fs-entry { 371 background: <?php echo $options['values']['fs_button_normal_color']?> <?php 374 background: <?php echo $options['values']['fs_button_normal_color']?> <?php 372 375 if ($options['values']['fs_button_background_image'] != '' && $options['values']['fs_button_background_image'] != 'none') { 373 376 $url = $options['values']['fs_button_background_image']; … … 381 384 } 382 385 .fs-entry:hover { 383 background: <?php echo $options['values']['fs_button_hover_color']?> <?php 386 background: <?php echo $options['values']['fs_button_hover_color']?> <?php 384 387 if ($options['values']['fs_button_hover_background_image'] != '' && $options['values']['fs_button_hover_background_image'] != 'none') { 385 388 $url = $options['values']['fs_button_hover_background_image']; … … 391 394 } 392 395 .fs-current { 393 background: <?php echo $options['values']['fs_button_current_color']?> <?php 396 background: <?php echo $options['values']['fs_button_current_color']?> <?php 394 397 if ($options['values']['fs_current_button_background_image'] != '' && $options['values']['fs_current_button_background_image'] != 'none') { 395 398 $url = $options['values']['fs_current_button_background_image'];
Note: See TracChangeset
for help on using the changeset viewer.