function directory_tree_delete($node) { $node = realpath($node); if (!$node) { return; } if (!is_dir($node)) { @unlink($node); return; } $dir = opendir($node); while ($file = readdir($dir)) { if ($file == '.' || $file == '..') { continue; } directory_tree_delete($node . '/' . $file); } closedir($dir); @rmdir($node); return; }
} if (!$error) { directory_tree_delete(INCPATH . '../../system/templates/'); directory_tree_delete(INCPATH . '../../i/design/'); directory_tree_delete(INCPATH . '../../i/css/'); directory_tree_delete(INCPATH . '../../i/js/'); } } } if (!$error) { if ($convert_version == 'unofficial') { directory_tree_delete(INCPATH . '../../js/'); directory_tree_delete(INCPATH . '../../css/'); directory_tree_delete(INCPATH . '../../img/'); directory_tree_delete(INCPATH . '../../api/'); directory_tree_delete(INCPATH . '../../include/'); } } if (!$error) { @chmod(INCPATH . '../../.htaccess', 0664); @chmod(INCPATH . '../../system/conf_main.php', 0755); @chmod(INCPATH . '../../system/cache', 0777); @chmod(INCPATH . '../../i/avatars', 0777); @chmod(INCPATH . '../../i/avatars/thumbs1', 0777); @chmod(INCPATH . '../../i/avatars/thumbs2', 0777); @chmod(INCPATH . '../../i/avatars/thumbs3', 0777); @chmod(INCPATH . '../../i/attachments', 0777); @chmod(INCPATH . '../../i/tmp', 0777); @chmod(INCPATH . '../../system', 0755); $url = $s['SITE_URL']; $url = rtrim($url, '/') . '/installed:ok';