Changeset 212172
- Timestamp:
- 03/02/2010 03:29:06 PM (16 years ago)
- Location:
- file-proxy/trunk/com/twothirdsdesign
- Files:
-
- 4 edited
-
core/gcp_options.php (modified) (2 diffs)
-
core/ttd_plugin_class.php (modified) (2 diffs)
-
file-proxy/admin/admin.php (modified) (7 diffs)
-
file-proxy/ttd_file_proxy.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
file-proxy/trunk/com/twothirdsdesign/core/gcp_options.php
r211980 r212172 4 4 * 5 5 * @author Geraint Palmer 6 * @version 1.0. 26 * @version 1.0.3 7 7 */ 8 8 class GcpOptions 9 9 { 10 const VERSION = '1.0. 2';10 const VERSION = '1.0.3'; 11 11 protected $options_key = 'ttd_plugin_options'; 12 12 protected $_options = array( … … 27 27 // tries to create a cache from wordpress DB options table.// uses plugin preset options not in db 28 28 $this->_optioncache = unserialize( get_option( $this->options_key , false )); 29 if (!$this->_optioncache) $this->_optioncache = $this->_options; 29 if (!$this->_optioncache) 30 $this->_optioncache = $this->_options; 30 31 } 31 32 } 32 33 34 /** 35 * Clears the option cache 36 */ 37 public function flush_options() 38 { 39 unset($this->_optioncache); 40 } 33 41 34 42 /** -
file-proxy/trunk/com/twothirdsdesign/core/ttd_plugin_class.php
r210557 r212172 4 4 * 5 5 * @author Geraint Palmer 6 * @version 1.0. 06 * @version 1.0.1 7 7 */ 8 8 class TtdPluginClass 9 9 { 10 const VERSION = '1.0. 0';10 const VERSION = '1.0.1'; 11 11 // variable 12 12 protected $options; … … 91 91 92 92 /** 93 * Clears the option cache 94 */ 95 public function flush_options() 96 { 97 $this->options->flush_options(); 98 } 99 100 /** 93 101 * Executes a MySQL query with exception handling. 94 102 */ -
file-proxy/trunk/com/twothirdsdesign/file-proxy/admin/admin.php
r212141 r212172 162 162 if( "Y" == esc_attr( $_POST['ttd_file_proxy_submit_hidden'] )){ 163 163 //echo "<pre>"; print_r( $_POST ); echo "</pre>"; 164 $this->m->update_option( "permalinks", isset( $_POST[ 'permalinks' ] ) ? 'on' : 'off' ); 165 $this->m->update_option( "cache", isset( $_POST[ 'cache' ] ) ? 'on' : 'off' ); 164 165 if( $this->m->get_option( "permalinks" != "disabled" ) ) 166 $this->m->update_option( "permalinks", isset( $_POST[ 'permalinks' ] ) ? 'on' : 'off' ); 167 168 if( $this->m->get_option( "cache" != "disabled" ) ) 169 $this->m->update_option( "cache", isset( $_POST[ 'cache' ] ) ? 'on' : 'off' ); 170 166 171 $this->m->update_option( "uninstall", isset( $_POST[ 'uninstall' ] ) ? true : false ); 167 172 $this->m->update_option( "url-key", esc_attr( $_POST['url-key']) ); … … 171 176 else if( $_GET['opt'] == "reset" ){ 172 177 delete_option( $this->m->get_options_key() ); 178 $this->m->flush_options(); 179 $this->m->update_option("version", TTDPF_VERSION); 173 180 wp_redirect( $this->get_settings_link() ); 174 181 } … … 237 244 <tr> 238 245 <th><?php _e( 'Version:', $this->domain ); ?></th> 239 <td><?php echo TTDPF_VERSION;?></td>246 <td><?php echo $this->m->get_option("version", 0 );?></td> 240 247 </tr> 241 248 </table><!-- .form-table --><?php … … 259 266 260 267 <table class="form-table"> 261 268 <?php if($this->m->get_option('permalinks') != "disabled"): ?> 262 269 <tr> 263 270 <th><label for="permalinks"><?php _e( 'Use Permalinks:', $this->domain ); ?></label></th> … … 275 282 </td> 276 283 </tr> 284 <?php endif; ?> 277 285 <tr> 278 286 <th><label for="url-key"><?php _e( 'Url Key:', $this->domain ); ?></label></th> … … 285 293 </td> 286 294 </tr> 287 295 <?php if($this->m->get_option('cache') != "disabled"): ?> 288 296 <tr> 289 297 <th><label for="cache"><?php _e( 'Caching:', $this->domain ); ?></label></th> … … 299 307 </td> 300 308 </tr> 309 <?php endif; ?> 301 310 <tr> 302 311 <th><label for="uninstall"><?php _e( 'Uninstall:', $this->domain ); ?></label></th> -
file-proxy/trunk/com/twothirdsdesign/file-proxy/ttd_file_proxy.php
r212141 r212172 19 19 'uninstall' => true, 20 20 'url-key' => 'file', 21 'cache' => ' off',22 'permalinks' => ' off',21 'cache' => 'disabled', 22 'permalinks' => 'disabled', 23 23 ); 24 24 … … 137 137 { 138 138 $this->flush_rules(); 139 140 $this->update_option("version", TTDPF_VERSION ); 141 139 $this->install(); 140 } 141 142 public function install(){ 143 switch ( $this->get_option("version", "0") ) 144 { 145 case '0.1': 146 case '0.2': 147 case '0.3': 148 case '0.4': 149 // Clears options for previous version 150 delete_option( $this->options_key ); 151 break; 152 default: 153 break; 154 } 155 if( $this->get_option("cache") != "disabled" ) 156 $this->build_cache_dir(); 157 158 $this->update_option("version", TTDFP_VERSION ); 159 } 160 161 public function build_cache_dir() 162 { 142 163 if( defined('WP_CONTENT_DIR') ){ 143 164 if(!is_dir( WP_CONTENT_DIR.DS.'cache' ) && is_writable( WP_CONTENT_DIR )){
Note: See TracChangeset
for help on using the changeset viewer.