Merge branch 'master' of github.com:gnuboard/g4s

This commit is contained in:
whitedot
2013-02-21 14:22:24 +09:00
3 changed files with 21 additions and 0 deletions

View File

@ -94,6 +94,8 @@ while ($row = sql_fetch_array($result))
@unlink($dir.'/'.$file);
}
}
closedir($dh);
}
}
}

View File

@ -107,6 +107,8 @@ for ($i=count($tmp_array)-1; $i>=0; $i--)
@unlink($dir.'/'.$file);
}
}
closedir($dh);
}
}
}

View File

@ -237,6 +237,23 @@ for ($i=0; $i<count($_FILES['bf_file']['name']); $i++) {
// 존재하는 파일이 있다면 삭제합니다.
$row = sql_fetch(" select bf_file from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$i' ");
@unlink(G4_DATA_PATH.'/file/'.$bo_table.'/'.$row['bf_file']);
// 이미지파일이면 썸네일삭제
if(preg_match("/\.({$config['cf_image_extension']})$/i", $row['bf_file']) {
$dir = G4_DATA_PATH.'/file/'.$bo_table;
if($dh = opendir($dir)) {
while(($entry = readdir($dh)) !== false) {
if($entry == "." || $entry == "..")
continue;
$fname = preg_replace("/\.[^\.]+$/i", "", $row['bf_file']);
if(strstr($entry, $fname) && strpos($entry, $fname) != 0) {
@unlink($dir.'/'.$entry);
}
}
closedir($dh);
}
}
}
// 프로그램 원래 파일명