Exemple #1
0
    $all_fields .= " , bo_content_head = '{$bo_content_head}' ";
}
if (is_checked('chk_all_content_tail')) {
    $all_fields .= " , bo_content_tail = '{$bo_content_tail}' ";
}
if (is_checked('chk_all_mobile_content_head')) {
    $all_fields .= " , bo_mobile_content_head = '{$bo_mobile_content_head}' ";
}
if (is_checked('chk_all_mobile_content_tail')) {
    $all_fields .= " , bo_mobile_content_tail = '{$bo_mobile_content_tail}' ";
}
if (is_checked('chk_all_insert_content')) {
    $all_fields .= " , bo_insert_content = '{$bo_insert_content}' ";
}
if (is_checked('chk_all_use_search')) {
    $all_fields .= " , bo_use_search = '{$bo_use_search}' ";
}
if (is_checked('chk_all_order')) {
    $all_fields .= " , bo_order = '{$bo_order}' ";
}
for ($i = 1; $i <= 10; $i++) {
    if (is_checked('chk_all_' . $i)) {
        $all_fields .= " , bo_{$i}_subj = '" . $_POST['bo_' . $i . '_subj'] . "' ";
        $all_fields .= " , bo_{$i} = '" . $_POST['bo_' . $i] . "' ";
    }
}
if ($all_fields) {
    sql_query(" update {$g5['board_table']} set bo_table = bo_table {$all_fields} ");
}
delete_cache_latest($bo_table);
goto_url("./board_form.php?w=u&bo_table={$bo_table}&amp;{$qstr}");
            @chmod(G5_DATA_PATH . '/file/' . $target_table . '/' . $entry, G5_DIR_PERMISSION);
            $copy_file++;
        }
    }
    $d->close();
    // 글복사
    $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++) {
        $sql = " insert into {$g5['board_file_table']}\n                    set bo_table = '{$target_table}',\n                         wr_id = '{$file_copy[$i]['wr_id']}',\n                         bf_no = '{$file_copy[$i]['bf_no']}',\n                         bf_source = '" . addslashes($file_copy[$i]['bf_source']) . "',\n                         bf_file = '{$file_copy[$i]['bf_file']}',\n                         bf_download = '{$file_copy[$i]['bf_download']}',\n                         bf_content = '" . addslashes($file_copy[$i]['bf_content']) . "',\n                         bf_filesize = '{$file_copy[$i]['bf_filesize']}',\n                         bf_width = '{$file_copy[$i]['bf_width']}',\n                         bf_height = '{$file_copy[$i]['bf_height']}',\n                         bf_type = '{$file_copy[$i]['bf_type']}',\n                         bf_datetime = '{$file_copy[$i]['bf_datetime']}' ";
        sql_query($sql, false);
    }
}
delete_cache_latest($bo_table);
delete_cache_latest($target_table);
echo "<script>opener.document.location.reload();</script>";
alert("복사에 성공 했습니다.", './board_copy.php?bo_table=' . $bo_table . '&amp;' . $qstr);
Exemple #3
0
        // 코멘트 삭제시 답변 코멘트 까지 삭제되지는 않음
        //--------------------------------------------------------------------
        //print_r2($write);
        $comment_id = $wr_id;
        $len = strlen($write['wr_comment_reply']);
        if ($len < 0) {
            $len = 0;
        }
        $comment_reply = substr($write['wr_comment_reply'], 0, $len);
        // 코멘트 삭제
        if (!delete_point($write['mb_id'], $bo_table, $comment_id, '코멘트')) {
            insert_point($write['mb_id'], $board['bo_comment_point'] * -1, "{$board['bo_subject']} {$write[wr_parent]}-{$comment_id} 코멘트삭제");
        }
        // 코멘트 삭제
        sql_query(" delete from {$write_table} where wr_id = '{$comment_id}' ");
        // 코멘트가 삭제되므로 해당 게시물에 대한 최근 시간을 다시 얻는다.
        $sql = " select max(wr_datetime) as wr_last from {$write_table} where wr_parent = '{$write['wr_parent']}' ";
        $row = sql_fetch($sql);
        // 원글의 코멘트 숫자를 감소
        sql_query(" update {$write_table} set wr_comment = wr_comment - 1, wr_last = '{$row['wr_last']}' where wr_id = '{$write['wr_parent']}' ");
        // 코멘트 숫자 감소
        sql_query(" update {$g5['board_table']} set bo_count_comment = bo_count_comment - 1 where bo_table = '{$bo_table}' ");
        // 새글 삭제
        sql_query(" delete from {$g5['board_new_table']} where bo_table = '{$bo_table}' and wr_id = '{$comment_id}' ");
    }
}
$save_bo_table = array_unique($save_bo_table);
foreach ($save_bo_table as $key => $value) {
    delete_cache_latest($value);
}
goto_url("new.php?sfl={$sfl}&stx={$stx}&page={$page}");
Exemple #4
0
<?php

// board_delete.php , boardgroup_delete.php 에서 include 하는 파일
if (!defined('_GNUBOARD_')) {
    exit;
}
if (!defined('_BOARD_DELETE_')) {
    exit;
}
// 개별 페이지 접근 불가
// $tmp_bo_table 에는 $bo_table 값을 넘겨주어야 함
if (!$tmp_bo_table) {
    return;
}
// 게시판 1개는 삭제 불가 (게시판 복사를 위해서)
//$row = sql_fetch(" select count(*) as cnt from $g5['board_table'] ");
//if ($row['cnt'] <= 1) { return; }
// 게시판 설정 삭제
sql_query(" delete from {$g5['board_table']} where bo_table = '{$tmp_bo_table}' ");
// 최신글 삭제
sql_query(" delete from {$g5['board_new_table']} where bo_table = '{$tmp_bo_table}' ");
// 스크랩 삭제
sql_query(" delete from {$g5['scrap_table']} where bo_table = '{$tmp_bo_table}' ");
// 파일 삭제
sql_query(" delete from {$g5['board_file_table']} where bo_table = '{$tmp_bo_table}' ");
// 게시판 테이블 DROP
sql_query(" drop table {$g5['write_prefix']}{$tmp_bo_table} ", FALSE);
delete_cache_latest($tmp_bo_table);
// 게시판 폴더 전체 삭제
rm_rf(G5_DATA_PATH . '/file/' . $tmp_bo_table);