read()) { if ($entry == '.' || $entry == '..') { continue; } // 김선용 201007 : if (is_dir(G5_DATA_PATH . '/file/' . $bo_table . '/' . $entry)) { $dd = dir(G5_DATA_PATH . '/file/' . $bo_table . '/' . $entry); @mkdir(G5_DATA_PATH . '/file/' . $target_table . '/' . $entry, G5_DIR_PERMISSION); @chmod(G5_DATA_PATH . '/file/' . $target_table . '/' . $entry, G5_DIR_PERMISSION); while ($entry2 = $dd->read()) { if ($entry2 == '.' || $entry2 == '..') { continue; } @copy(G5_DATA_PATH . '/file/' . $bo_table . '/' . $entry . '/' . $entry2, G5_DATA_PATH . '/file/' . $target_table . '/' . $entry . '/' . $entry2); @chmod(G5_DATA_PATH . '/file/' . $target_table . '/' . $entry . '/' . $entry2, G5_DIR_PERMISSION); $copy_file++; } $dd->close(); } else { @copy(G5_DATA_PATH . '/file/' . $bo_table . '/' . $entry, G5_DATA_PATH . '/file/' . $target_table . '/' . $entry); @chmod(G5_DATA_PATH . '/file/' . $target_table . '/' . $entry, G5_DIR_PERMISSION); $copy_file++; } } $d->close(); run_event('admin_board_copy_file', $bo_table, $target_table); // 글복사 $sql = " insert into {$g5['write_prefix']}$target_table select * from {$g5['write_prefix']}$bo_table "; sql_query($sql, false); // 게시글수 저장 $sql = " select bo_count_write, bo_count_comment from {$g5['board_table']} where bo_table = '$bo_table' "; $row = sql_fetch($sql); $sql = " update {$g5['board_table']} set bo_count_write = '{$row['bo_count_write']}', bo_count_comment = '{$row['bo_count_comment']}' where bo_table = '$target_table' "; sql_query($sql, false); // 4.00.01 $sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' "; $result = sql_query($sql, false); for ($i = 0; $row = sql_fetch_array($result); $i++) { $file_copy[$i] = $row; } } if (count($file_copy)) { for ($i = 0; $i < count($file_copy); $i++) { $file_copy[$i] = run_replace('admin_copy_update_file', $file_copy[$i], $file_copy[$i]['bf_file'], $bo_table, $target_table); $sql = " insert into {$g5['board_file_table']} set bo_table = '$target_table', wr_id = '{$file_copy[$i]['wr_id']}', bf_no = '{$file_copy[$i]['bf_no']}', bf_source = '" . addslashes($file_copy[$i]['bf_source']) . "', bf_file = '{$file_copy[$i]['bf_file']}', bf_download = '{$file_copy[$i]['bf_download']}', bf_content = '" . addslashes($file_copy[$i]['bf_content']) . "', bf_fileurl = '" . addslashes($file_copy[$i]['bf_fileurl']) . "', bf_thumburl = '" . addslashes($file_copy[$i]['bf_thumburl']) . "', bf_storage = '" . addslashes($file_copy[$i]['bf_storage']) . "', bf_filesize = '{$file_copy[$i]['bf_filesize']}', bf_width = '{$file_copy[$i]['bf_width']}', bf_height = '{$file_copy[$i]['bf_height']}', bf_type = '{$file_copy[$i]['bf_type']}', bf_datetime = '{$file_copy[$i]['bf_datetime']}' "; sql_query($sql, false); } } delete_cache_latest($bo_table); delete_cache_latest($target_table); echo ""; alert("복사에 성공 했습니다.", './board_copy.php?bo_table=' . $bo_table . '&' . $qstr);