Changeset 898037
- Timestamp:
- 04/19/2014 12:18:43 PM (12 years ago)
- Location:
- anylink/trunk
- Files:
-
- 1 added
- 1 deleted
- 5 edited
-
anyLink.php (modified) (1 diff)
-
classes/al_filter.php (modified) (1 diff)
-
classes/al_option.php (modified) (1 diff)
-
functions.php (modified) (1 diff)
-
re.php (added)
-
readme.txt (modified) (2 diffs)
-
redirect.php (deleted)
Legend:
- Unmodified
- Added
- Removed
-
anylink/trunk/anyLink.php
r847629 r898037 4 4 Plugin URI: http://dudo.org/anylink 5 5 Description: anyLink is an external links management tool. It help you to covert all the external links in your posts into internal links automatically. It can prevent the website weight flow outside to others. It's absolutely SEO friendly. 6 Version: 0.1. 86 Version: 0.1.9 7 7 Author: dudo 8 8 Author URI: http://dudo.org/about -
anylink/trunk/classes/al_filter.php
r847629 r898037 94 94 $gotoURL = $_GET[$this -> redirectCat]; 95 95 if( ! empty( $gotoURL ) ) { 96 wp_redirect( htmlspecialchars_decode( $this -> getUrlBySlug( $gotoURL ) ), ( int )$this -> redirectType ); 97 exit; 98 } 96 //since 0.1.9 97 // changed redirect method by javascript 98 $gotoLink = htmlspecialchars_decode( $this -> getUrlBySlug( $gotoURL ) ); 99 $redirectType = ( int )$this -> redirectType; 100 if( $redirectType == 200 ) { 101 require_once( ANYLNK_PATH . '/re.php'); 102 exit; 103 } else { //end 104 wp_redirect( $gotoLink, $redirectType ); 105 exit; 106 } 107 } 99 108 } 100 109 public function getUrlBySlug( $slug ) { -
anylink/trunk/classes/al_option.php
r846920 r898037 151 151 $cat = $alOptions['redirectCat']; 152 152 $type = $alOptions['redirectType']; 153 global $wp_rewrite; 154 if( $type == '200' ) { 155 /* get the relative path of redirect file */ 156 $redirectFile = substr( plugins_url(), strlen( home_url() ) + 1 ) . '/' . ANYLNK_PLUGIN . '/redirect.php'; 157 /* add an external rewrite rule which will be written into .htaccess file */ 158 $wp_rewrite -> add_external_rule( "$cat/([0-9a-z]{4,})/?$", $redirectFile . '?slug=$1' ); 159 flush_rewrite_rules(); 160 } else { 161 $wp_rewrite -> flush_rules( true ); 162 add_rewrite_rule( "$cat/([0-9a-z]{4,})/?$", 'index.php?' . $cat . '=$matches[1]', 'top' ); 163 flush_rewrite_rules(); 164 } 153 global $wp_rewrite; //since 0.1.9 154 $wp_rewrite -> flush_rules( true ); 155 add_rewrite_rule( "$cat/([0-9a-z]{4,})/?$", 'index.php?' . $cat . '=$matches[1]', 'top' ); 156 flush_rewrite_rules(); 165 157 $alOptions['oldCat'] = $alOptions['redirectCat']; 166 158 $alOptions['oldRedirectType'] = $alOptions['redirectType']; -
anylink/trunk/functions.php
r846905 r898037 137 137 update_option( 'anylink_options', $al_option ); 138 138 } 139 if( (float )$al_option['version'] < 19 ) { 140 global $wp_rewrite; 141 $wp_rewrite -> flush_rules( true ); 142 add_rewrite_rule( "$cat/([0-9a-z]{4,})/?$", 'index.php?' . $al_option['redirectCat'] . '=$matches[1]', 'top' ); 143 flush_rewrite_rules(); 144 $al_option['version'] = 19; 145 update_option( 'anylink_options', $al_option ); 146 } 139 147 } 140 148 } -
anylink/trunk/readme.txt
r847629 r898037 4 4 Tags: seo, link sanitize, covert external links to internal links 5 5 Requires at least: 3.4 6 Tested up to: 3. 8.17 Stable tag: 0.1. 86 Tested up to: 3.9 7 Stable tag: 0.1.9 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 41 41 42 42 == Changelog == 43 44 = 0.1.9 = 45 * 修改了Javascript跳转方式,不再依赖于.htaccess配置文件 46 * 优化了部分代码,性能得到一定提升 43 47 44 48 = 0.1.8 =
Note: See TracChangeset
for help on using the changeset viewer.