10) $file = WP_CONTENT_URL.'/plugins'.AWP_MODULES.'/core_cache/core.cache.js.php'; return $file; } function switchcss($file){ $home = get_settings('siteurl'); $tfile = ABSPATH . PLUGINDIR . AWP_MODULES.'/core_cache/core.cache.css'; if(@file_exists($tfile) && is_readable($tfile) && filesize($tfile) > 10) $file = WP_CONTENT_URL.'/plugins'.AWP_MODULES.'/core_cache/core.cache.css.php'; return $file; } function recache(){ $this->recacheJS(); $this->recacheCSS(); } function my_file_get_contents($file){ if (!$handle = fopen($file,'r')) { return ''; } $contents = fread($handle, filesize($file)); fclose($handle); return $contents; } function recacheJS(){ global $awpall,$aWP; $file = ABSPATH . PLUGINDIR . AWP_MODULES.'/core_cache/core.cache.js'; if (!$handle = fopen($file,'w')) { return false; } $contents = $this->my_file_get_contents(ABSPATH.PLUGINDIR.'/'.AWP_BASE.'/js/core.js.php'); if (fwrite($handle, $contents) === FALSE) { return false; } fclose($handle); return true; } function recacheCSS(){ global $awpall,$aWP; $file = ABSPATH . PLUGINDIR . AWP_MODULES.'/core_cache/core.cache.css'; if (!$handle = fopen($file,'w')) { return false; } $contents = file_get_contents(WP_CONTENT_URL.'/plugins/'. AWP_BASE. '/js/core.css.php'); if (fwrite($handle, $contents) === FALSE) { return false; } fclose($handle); return true; } function admin(){ global $aWP, $awpall; ob_start(); ?> <?php _e('Core Cache Options.','awp');?> recache(); update_option('awp',$awpall); } } ?>