if not exists, copy

This commit is contained in:
Ibnu Maksum
2023-09-20 14:27:15 +07:00
parent 6acc342b26
commit c3fd8536eb
2 changed files with 10 additions and 3 deletions

View File

@ -15,7 +15,14 @@ if(strpos($action,"-post")===false){
//echo $path;
run_hook('view_edit_pages'); #HOOK
if(!file_exists($path)){
touch($path);
$temp = "pages_template/".str_replace(".","",$action).".html";
if(file_exists($temp)){
if(!copy($temp, $path)){
touch($path);
}
}else{
touch($path);
}
}
if(file_exists($path)){
$html = file_get_contents($path);