Changeset 402270
- Timestamp:
- 06/28/2011 10:35:51 PM (15 years ago)
- Location:
- wp-htaccess-control/trunk
- Files:
-
- 3 edited
-
readme.txt (modified) (2 diffs)
-
wp-htaccess-control-ui.php (modified) (1 diff)
-
wp-htaccess-control.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-htaccess-control/trunk/readme.txt
r400660 r402270 7 7 Requires at least: 2.7 8 8 Tested up to: 3.1.3 9 Stable tag: 2.5. 49 Stable tag: 2.5.5 10 10 11 11 Interface to customize the permalinks (author, category, archives and pagination) and htaccess file generated by Wordpress. … … 73 73 == Changelog == 74 74 75 = 2.5.5 (27/06/2011) = 76 * *Fix:* fixed search pagination using custom search base; (better regex should be put in place or maybe go for an alternative solution). 77 75 78 = 2.5.4 (23/06/2011) = 76 79 * *Fix:* fixed search feed using custom search base. -
wp-htaccess-control/trunk/wp-htaccess-control-ui.php
r390830 r402270 7 7 $WPhtc->wphtc_page_action(); 8 8 $WPhtc_data=get_option('WPhtc_data'); 9 // $nonce= wp_create_nonce('WPhtc_settings');9 //global $wp_rewrite;print_r($wp_rewrite); 10 10 ?> 11 11 <div id="wphtc-page" class="wrap"> -
wp-htaccess-control/trunk/wp-htaccess-control.php
r400579 r402270 4 4 Plugin URI: http://dardna.com/wp-htaccess-control 5 5 Description: Interface to customize the permalinks (author, category, archives and pagination) and htaccess file generated by Wordpress. 6 Version: 2.5. 46 Version: 2.5.5 7 7 Author: António Andrade 8 8 Author URI: http://dardna.com … … 44 44 # redirect "?s=*" to "/search-base/*" 45 45 if($_GET['s']){ 46 wp_redirect( home_url( $WPhtc_data['custom_search_permalink']. "/" . urlencode(get_query_var( 's' )) ) );46 wp_redirect( home_url( $WPhtc_data['custom_search_permalink']. "/" . rawurlencode(get_query_var( 's' )) ) ); 47 47 } 48 48 # rewrite query 49 50 49 51 if(strpos($_SERVER["REQUEST_URI"], $WPhtc_data['custom_search_permalink'])){ 50 52 global $wp_query; … … 58 60 } 59 61 } 60 $page_base=($WPhtc_data['cpp']!='')?$WPhtc_data['cpp']:'page'; 61 # in need of better regex 62 if(!strpos($_SERVER["REQUEST_URI"], '/feed')&&!strpos($_SERVER["REQUEST_URI"],$page_base)){ 63 $pattern="/\/".$WPhtc_data['custom_search_permalink']."\/(.+)/"; 64 } 65 else{ 66 $pattern="/\/".$WPhtc_data['custom_search_permalink']."\/(.+)\/feed|".$page_base."?/"; 67 } 68 preg_match($pattern,$_SERVER["REQUEST_URI"], $matches); 69 $wp_query=new WP_Query('s='.$matches[1].$format ); 62 $page_base=($WPhtc_data['cpp']!='')?$WPhtc_data['cpp']:'page'; 63 # in need of better regex 64 65 if(!strpos($_SERVER["REQUEST_URI"], '/feed')&&!strpos($_SERVER["REQUEST_URI"],$page_base)){ 66 $pattern="/\/".$WPhtc_data['custom_search_permalink']."\/(.+)/"; 67 } 68 else{ 69 $pattern="/\/".$WPhtc_data['custom_search_permalink']."\/(.+)\/feed|".$page_base."?/"; 70 } 71 72 $pattern="/\/".$WPhtc_data['custom_search_permalink']."\/(.+)/"; 73 preg_match($pattern,$_SERVER["REQUEST_URI"], $matches); 74 $results=split("/",$matches[1]); 75 if($results[1]==$page_base){ 76 $page="&paged=".$results[2]; 77 } 78 $wp_query=new WP_Query('s='.$results[0].$page.$format ); 70 79 } 71 80 } … … 75 84 $WPhtc_data=get_option('WPhtc_data'); 76 85 if($WPhtc_data['custom_search_permalink']!=''&&strpos($_SERVER["REQUEST_URI"], $WPhtc_data['custom_search_permalink'])){ 86 $page_base=($WPhtc_data['cpp']!='')?$WPhtc_data['cpp']:'page'; 77 87 # in need of better regex 78 if(!strpos($_SERVER["REQUEST_URI"], '/feed')&&!strpos($_SERVER["REQUEST_URI"], $page_base)){88 if(!strpos($_SERVER["REQUEST_URI"], '/feed')&&!strpos($_SERVER["REQUEST_URI"],"/".$page_base)){ 79 89 $pattern="/\/".$WPhtc_data['custom_search_permalink']."\/(.+)/"; 80 90 } … … 83 93 } 84 94 preg_match($pattern,$_SERVER["REQUEST_URI"], $matches); 85 return urldecode($matches[1]); 95 $results=split("/",$matches[1]); 96 return urldecode($results[0]); 86 97 } 87 98 return $query;
Note: See TracChangeset
for help on using the changeset viewer.