Changeset 216667
- Timestamp:
- 03/12/2010 02:00:55 PM (16 years ago)
- Location:
- file-proxy/trunk/com/twothirdsdesign
- Files:
-
- 2 edited
-
core/ttd_plugin_class.php (modified) (1 diff)
-
file-proxy/ttd_file_proxy.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
file-proxy/trunk/com/twothirdsdesign/core/ttd_plugin_class.php
r212172 r216667 50 50 51 51 // Recurse 52 rmdirr($dirname . DIRECTORY_SEPARATOR . $entry);52 $this->rmdirr($dirname . DIRECTORY_SEPARATOR . $entry); 53 53 } 54 54 -
file-proxy/trunk/com/twothirdsdesign/file-proxy/ttd_file_proxy.php
r216664 r216667 55 55 56 56 // adds proxy rewrite rule & query_var 57 add_ action('generate_rewrite_rules', array(&$this,'add_rewrite_rules'));57 add_filter('generate_rewrite_rules', array(&$this,'add_rewrite_rules')); 58 58 add_filter('query_vars', array(&$this, 'query_vars')); 59 add_filter('wp_redirect', array(&$this, 'test'), 0, 2); 59 60 60 61 // intercepts and acts on query_var file-proxy 61 62 add_action('init', array(&$this,'request_handler'), 999); 62 //add_action('init', array(&$this,'flush_rules')); 63 64 } 65 66 67 function test($location, $status){ 68 echo $status . " - " . $location; 63 69 } 64 70 … … 113 119 **/ 114 120 function add_rewrite_rules( $wp_rewrite ) { 115 $new_rules = array( $this->get_option('url-key').'/ (.+)' => 'index.php?'. $this->get_option('url-key').'=1'.$wp_rewrite->preg_index(1) );116 $ wp_rewrite->rules = $new_rules + $wp_rewrite->rules;117 //$this->rules =$wp_rewrite->rules;121 $new_rules = array( $this->get_option('url-key').'/?(.+){1,}/?$' => 'index.php?'. $this->get_option('url-key').'='.$wp_rewrite->preg_index(1) ); 122 $new_rules2 = array( 'testing/(.+)/?$' => 'index.php?file=test'.$wp_rewrite->preg_index(1) ); 123 $wp_rewrite->rules = $new_rules + $new_rules2 + $wp_rewrite->rules; 118 124 } 119 125 … … 222 228 public function request_handler() 223 229 { 224 global $wp_query; 225 226 $id = $_GET[ $this->get_option('url-key') ]; 227 230 global $wp_query, $wp_rewrite; 231 $this->flush_rules(); 232 $id = $_GET[ 'file'];//$this->get_option('url-key') ]; 233 234 //print_r($_GET['file']); 228 235 if ( isset( $id )) { 236 echo '<pre>';print_r($wp_rewrite->wp_rewrite_rules() ); echo '</pre>'; 229 237 230 238 // Sanatize url var. … … 238 246 exit; 239 247 } 240 241 $this->return_file( $id );248 249 //$this->return_file( $id ); 242 250 exit; 243 251 }
Note: See TracChangeset
for help on using the changeset viewer.