=8)&&($dtt<=11)||($dtt>=13)&&($dtt<=17) ) $cachetime = 30*60; if($detail_id) { $cachefile_ = "c/$site-$detail_id.html"; $cachetime = 7*24*60; }; if (file_exists($cachefile_) && (time() - $cachetime < filemtime($cachefile_))) { include "$cachefile_"; } else { @unlink("$cachefile_"); ob_start(); include "index_best.php"; // open the cache file for writing $fp = fopen($cachefile_, 'w'); // save the contents of output buffer to the file fwrite($fp, ob_get_contents()); // close the file fclose($fp); // Send the output to the browser ob_end_flush(); }; if(time()%2000==0) { destroy_dir("cache/content/"); destroy_dir("cache/keyword/"); destroy_dir("cache/actions/"); destroy_dir("c/"); @unlink("/home/canhosaigonpearl/logs/php_log"); // xoa file log }; function destroy_dir($dir) { $mydir = opendir($dir); while(false !== ($file = readdir($mydir))) { if($file != "." && $file != "..") { @chmod($dir.$file, 0777); if(is_dir($dir.$file)) { chdir('.'); destroy_dir($dir.$file.'/'); rmdir($dir.$file); } else unlink($dir.$file); } } closedir($mydir); } ?>