g4를 g5로 변경

This commit is contained in:
chicpro
2013-09-13 14:32:06 +09:00
parent 9a18a049d5
commit 0f78b67eb7
563 changed files with 4097 additions and 4097 deletions

View File

@ -11,13 +11,13 @@ if (!preg_match('/[A-Za-z0-9_]{1,20}/', $target_table)) {
alert('게시판 TABLE명은 공백없이 영문자, 숫자, _ 만 사용 가능합니다. (20자 이내)');
}
$row = sql_fetch(" select count(*) as cnt from {$g4['board_table']} where bo_table = '$target_table' ");
$row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where bo_table = '$target_table' ");
if ($row['cnt'])
alert($target_table.'은(는) 이미 존재하는 게시판 테이블명 입니다.\\n복사할 테이블명으로 사용할 수 없습니다.');
// 게시판 테이블 생성
$sql = get_table_define($g4['write_prefix'] . $bo_table);
$sql = str_replace($g4['write_prefix'] . $bo_table, $g4['write_prefix'] . $target_table, $sql);
$sql = get_table_define($g5['write_prefix'] . $bo_table);
$sql = str_replace($g5['write_prefix'] . $bo_table, $g5['write_prefix'] . $target_table, $sql);
sql_query($sql, false);
$file_copy = array();
@ -28,7 +28,7 @@ if ($copy_case == 'schema_only') {
}
// 게시판 정보
$sql = " insert into {$g4['board_table']}
$sql = " insert into {$g5['board_table']}
set bo_table = '$target_table',
gr_id = '{$board['gr_id']}',
bo_subject = '$target_subject',
@ -121,57 +121,57 @@ $sql = " insert into {$g4['board_table']}
sql_query($sql, false);
// 게시판 폴더 생성
@mkdir(G4_DATA_PATH.'/file/'.$target_table, G4_DIR_PERMISSION);
@chmod(G4_DATA_PATH.'/file/'.$target_table, G4_DIR_PERMISSION);
@mkdir(G5_DATA_PATH.'/file/'.$target_table, G5_DIR_PERMISSION);
@chmod(G5_DATA_PATH.'/file/'.$target_table, G5_DIR_PERMISSION);
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$board_path = G4_DATA_PATH.'/file/'.$target_table;
$board_path = G5_DATA_PATH.'/file/'.$target_table;
$file = $board_path . '/index.php';
$f = @fopen($file, 'w');
@fwrite($f, '');
@fclose($f);
@chmod($file, G4_FILE_PERMISSION);
@chmod($file, G5_FILE_PERMISSION);
$copy_file = 0;
if ($copy_case == 'schema_data_both') {
$d = dir(G4_DATA_PATH.'/file/'.$bo_table);
$d = dir(G5_DATA_PATH.'/file/'.$bo_table);
while ($entry = $d->read()) {
if ($entry == '.' || $entry == '..') continue;
// 김선용 201007 :
if(is_dir(G4_DATA_PATH.'/file/'.$bo_table.'/'.$entry)){
$dd = dir(G4_DATA_PATH.'/file/'.$bo_table.'/'.$entry);
@mkdir(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry, G4_DIR_PERMISSION);
@chmod(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry, G4_DIR_PERMISSION);
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(G4_DATA_PATH.'/file/'.$bo_table.'/'.$entry.'/'.$entry2, G4_DATA_PATH.'/file/'.$target_table.'/'.$entry.'/'.$entry2);
@chmod(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry.'/'.$entry2, G4_DIR_PERMISSION);
@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(G4_DATA_PATH.'/file/'.$bo_table.'/'.$entry, G4_DATA_PATH.'/file/'.$target_table.'/'.$entry);
@chmod(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry, G4_DIR_PERMISSION);
@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();
// 글복사
$sql = " insert into {$g4['write_prefix']}$target_table select * from {$g4['write_prefix']}$bo_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 {$g4['board_table']} where bo_table = '$bo_table' ";
$sql = " select bo_count_write, bo_count_comment from {$g5['board_table']} where bo_table = '$bo_table' ";
$row = sql_fetch($sql);
$sql = " update {$g4['board_table']} set bo_count_write = '{$row['bo_count_write']}', bo_count_comment = '{$row['bo_count_comment']}' where bo_table = '$target_table' ";
$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 {$g4['board_file_table']} where bo_table = '$bo_table' ";
$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;
@ -179,7 +179,7 @@ if ($copy_case == 'schema_data_both') {
if (count($file_copy)) {
for ($i=0; $i<count($file_copy); $i++) {
$sql = " insert into {$g4['board_file_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']}',