Changeset 414224
- Timestamp:
- 07/23/2011 01:58:22 PM (15 years ago)
- Location:
- infinite-scroll/branches/Beta
- Files:
-
- 3 edited
-
infinitescroll.init.js.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
wp_infinite_scroll.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
infinite-scroll/branches/Beta/infinitescroll.init.js.php
r411180 r414224 1 1 <?php 2 /* 3 Plugin Name: Infinite Scroll 4 Version: 2.0b2.110716 5 Plugin URI: http://www.infinite-scroll.com 6 Description: Automatically loads the next page of posts into the bottom of the initial page. 7 Author: Beaver6813, dirkhaim, Paul Irish 8 Author URI: http://www.infinite-scroll.com 9 License : http://creativecommons.org/licenses/GPL/2.0/ 10 */ 11 define('infscr_version' , '2.0b2.110716'); 2 define('infscr_version' , '2.0b2.110723'); 12 3 13 4 header('Content-Type: application/javascript'); … … 31 22 "; 32 23 } 33 24 function slashOnlyDouble($text) 25 { 26 return addcslashes(stripslashes($text), '"'); 27 } 28 34 29 //Get pathParse and validate it. 35 30 $error = false; … … 55 50 $loading_image = $scheme.$noscheme['host'].$noscheme['path']; 56 51 57 $loading_text = s tripslashes(get_option("infscr_text"));58 $donetext = s tripslashes(get_option("infscr_donetext"));52 $loading_text = slashOnlyDouble(get_option("infscr_text")); 53 $donetext = slashOnlyDouble(get_option("infscr_donetext")); 59 54 $content_selector = stripslashes(get_option("infscr_content_selector")); 60 55 $navigation_selector= stripslashes(get_option("infscr_nav_selector")); -
infinite-scroll/branches/Beta/readme.txt
r411053 r414224 49 49 50 50 == Changelog == 51 = 2.0b2.110723 = 52 * Improved escaping on settings to allow greater flexibility. 53 * Fixed issue with jQuery not loading if WP version is up to date. 54 * Fixed issue with plugin showing twice on plugin list. 55 51 56 = 2.0b2.110716 = 52 57 * Moved init script from direct page insertion to seperate script. -
infinite-scroll/branches/Beta/wp_infinite_scroll.php
r411180 r414224 2 2 /* 3 3 Plugin Name: Infinite Scroll 4 Version: 2.0b2.1107 164 Version: 2.0b2.110723 5 5 Plugin URI: http://www.infinite-scroll.com 6 6 Description: Automatically loads the next page of posts into the bottom of the initial page. … … 9 9 License : http://creativecommons.org/licenses/GPL/2.0/ 10 10 */ 11 define('infscr_version' , '2.0b2.1107 16');11 define('infscr_version' , '2.0b2.110723'); 12 12 // constants for enables/disabled 13 13 define('infscr_enabled' , 'enabled'); … … 42 42 43 43 // adding actions 44 add_action('template_redirect' , 'wp_inf_scroll_ pre_init');44 add_action('template_redirect' , 'wp_inf_scroll_init'); 45 45 add_action('admin_menu' , 'add_wp_inf_scroll_options_page'); 46 46 add_action("wp" , 'wp_inf_scroll_404'); … … 49 49 add_action('admin_notices', 'wp_inf_scroll_setup_warning'); 50 50 51 function wp_inf_scroll_ pre_init($wp)51 function wp_inf_scroll_jquery() 52 52 { 53 53 global $wp_scripts; … … 69 69 else 70 70 wp_register_script( 'jquery', plugins_url('infinite-scroll')."/js/jquery-1.6.2.min.js", array(), '1.6.2', false ); 71 wp_enqueue_script( 'jquery' );72 71 } 73 wp_inf_scroll_init(); 72 wp_enqueue_script( 'jquery' ); 73 return true; 74 74 } 75 75 /* … … 85 85 } 86 86 } 87 88 87 function add_wp_inf_scroll_options_page() 89 88 { … … 151 150 function wp_inf_scroll_init() 152 151 { 153 global $user_level ;152 global $user_level,$wp_query; 154 153 $load_infinite_scroll = true; 155 154 /* Lets start our pre-flight checks */ 156 if (get_option(key_infscr_state) == infscr_disabled || (is_page() || is_single()) || (get_option(key_infscr_state) == infscr_maint && $user_level >= 8) || (get_option(key_infscr_state) == infscr_config && $user_level <= 8) || (!have_posts()))155 if (get_option(key_infscr_state) == infscr_disabled || is_page() || is_single() || (get_option(key_infscr_state) == infscr_maint && $user_level >= 8) || (get_option(key_infscr_state) == infscr_config && $user_level <= 8) || !have_posts()) 157 156 $load_infinite_scroll = false; 158 157 … … 168 167 if ( !$max_page || $max_page >= $nextpage ) 169 168 { 169 wp_inf_scroll_jquery(); 170 170 //We have to pass pathInfo to the script as the script can't determine the path itself. 171 171 //We have to introduce some form of validation, so we can validate/sign the pathInfo we create. … … 191 191 if ($infscr_state != infscr_enabled && $infscr_state != infscr_disabled && $infscr_state != infscr_maint && $infscr_state != infscr_config) 192 192 $infscr_state = infscr_state_default; 193 update_option(key_infscr_state, $infscr_state);193 update_option(key_infscr_state, esc_js($infscr_state)); 194 194 195 195 // update debug 196 196 $infscr_debug = $_POST[key_infscr_debug]; 197 update_option(key_infscr_debug, $infscr_debug);197 update_option(key_infscr_debug, esc_js($infscr_debug)); 198 198 199 199 // update js calls field … … 231 231 // update content selector 232 232 $content_selector = $_POST[key_infscr_content_selector]; 233 update_option(key_infscr_content_selector, $content_selector);233 update_option(key_infscr_content_selector, esc_js($content_selector)); 234 234 235 235 // update the navigation selector 236 236 $navigation_selector = $_POST[key_infscr_nav_selector]; 237 update_option(key_infscr_nav_selector, $navigation_selector);237 update_option(key_infscr_nav_selector, esc_js($navigation_selector)); 238 238 239 239 // update the post selector 240 240 $post_selector = $_POST[key_infscr_post_selector]; 241 update_option(key_infscr_post_selector, $post_selector);241 update_option(key_infscr_post_selector, esc_js($post_selector)); 242 242 243 243 // update the next selector 244 244 $next_selector = $_POST[key_infscr_next_selector]; 245 update_option(key_infscr_next_selector, $next_selector);245 update_option(key_infscr_next_selector, esc_js($next_selector)); 246 246 247 247 … … 441 441 <td> 442 442 <?php 443 echo "<input name='".key_infscr_text."' id='".key_infscr_text."' value='".stripslashes(get_option(key_infscr_text))."' size='30' type='text'>\n"; 443 echo "<textarea name='".key_infscr_text."' id='".key_infscr_text."' rows='2' style='width: 95%;'>\n"; 444 echo stripslashes(get_option(key_infscr_text)); 445 echo "</textarea>\n"; 444 446 ?> 445 447 </td> … … 455 457 <td> 456 458 <?php 457 echo '<input name="'.key_infscr_donetext.'" id="'.key_infscr_donetext.'" value="'.stripslashes(get_option(key_infscr_donetext)).'" size="30" type="text">'; 459 echo "<textarea name='".key_infscr_donetext."' id='".key_infscr_donetext."' rows='2' style='width: 95%;'>\n"; 460 echo stripslashes(get_option(key_infscr_donetext)); 461 echo "</textarea>\n"; 458 462 ?> 459 463 </td>
Note: See TracChangeset
for help on using the changeset viewer.