вопрос
Добрый вечер !
Как можно реализовать возможность вкл/отк кеша конкретно в модуле ?
Как можно реализовать возможность вкл/отк кеша конкретно в модуле ?
$mod = dle_cache("mod", $config['skin']);
if (!$mod) {
///////////////// КОД МОДУЛЯ /////////////////////
$time_now = time();
$time_last = $last_time;
$time_min = $time_now - $time_last;
if ($time_min>$config_mod['cashe']){
create_cache ("mod", $mod, $config['skin']);
$time_write = "<?PHP\n\n\$last_time = \"".$time_now."\"\n?>";
$write_file = ROOT_DIR.'/engine/data/mod_time.php';
$fp = fopen($write_file, "w");
$save = fwrite($fp, $time_write);
fclose($fp);
}}
echo($mod);
<?
$disableCache=false;
$mod = dle_cache("mod", $config['skin']);
if (!$mod) {
///////////////// КОД МОДУЛЯ /////////////////////
$time_now = time();
$time_last = $last_time;
$time_min = $time_now - $time_last;
if ($time_min>$config_mod['cashe']) {
if (!$disableCache) {
create_cache ("mod", $mod, $config['skin']);
}
$time_write = "<?PHP\n\n\$last_time = \"".$time_now."\"\n?>";
$write_file = ROOT_DIR.'/engine/data/mod_time.php';
$fp = fopen($write_file, "w");
$save = fwrite($fp, $time_write);
fclose($fp);
}
}
echo($mod);
?>