변환프로그램 문의드립니다.

알지보드기반에 버닝빌더라는 게시판인데요
자료실의 알지보드용변환프로그램을 수정해서 변환을 했습니다

코맨트가 없는게시판은 변환이 이상없이 잘되는데
코맨트가 달린 게시판경우는

이런식으로 게시물 번호도 마이너스 형태로 번호가 바뀌고
게시물도 어떤건 보이고 어떤건 않보이고 그러네요
디비상에는 160개가 있는데
게시판에서는 게시물이 0 ~ -14까지만 보이네요
코맨트 부분에 문제인거 같은데 소스보시고 원인좀 찾아주세요

---------------------------------------------------------------------
<?
include_once("./_common.php");

if ($is_admin != "super")
    alert("최고관리자만 변환 가능합니다", "$g4[bbs_path]/login.php?url=".urlencode($_SERVER[PHP_SELF]));

if (!$src) alert("보드의 값이 넘어오지 않았습니다.");
if (!$dst) alert("그누보드 포에버의 값이 넘어오지 않았습니다.");


$sql = " select * from bn_{$src}_body order by bn_doc_num asc";
$zb4_result = sql_query($sql);
$zb4_count = mysql_num_rows($zb4_result);
if (!$zb4_count)
    alert("게시물이 한건도 없으므로 변환하지 않습니다.");
?>
<link rel="stylesheet" href="<?=$g4[path]?>/style.css" type="text/css">
<?
$tmp_target = $g4[write_prefix] . $dst;

sql_query(" delete from $tmp_target ");
sql_query(" delete from $g4[board_file_table] where bo_table = '$dst' ");

$cnt = 0;
$count_write = 0;
$count_comment = 0;
for ($i=0; $row=sql_fetch_array($zb4_result); $i++)
{
    $reg_date = date("Y-m-d H:i:s", $row[bn_reg_date]);

    if ($row[arrangenum] == 0) {
        $reply = "";
        $save_depth = 0;
        $save_reply = "";
    } else {
        if ($save_depth) {
            $reply = $save_reply;
            if ($row[depth] > $save_depth) {
                $reply .= "A";
            } else if ($row[depth] == $save_depth) {
                $ch = substr($reply, -1);
                $reply = substr($reply,0,strlen($reply)-1) . chr(ord($ch) + 1);
            } else {
                $reply = substr($reply,0,strlen($reply)-1);
                $ch = substr($reply, -1);
                $reply = substr($reply,0,strlen($reply)-1) . chr(ord($ch) + 1);
            }
        } else {
            $reply = "A";
        }
    }

    $num = -$row[bn_doc_num];

           if ($row[bn_depth] == '1') {
            $reply = "A";
            $num = -$row[bn_parent_num];
            } else {
            $reply = "";
               }

    if ($row[bn_mb_num]) {
        $sql1 = " select mb_id, mb_name from bn_member where mb_num = '$row[bn_mb_num]' ";
        $res1 = sql_query($sql1, $rg3[link]);
        $row1 = sql_fetch_array($res1);
        $mb_id = $row1[mb_id];
        $mb_name = $row[bn_name];
  
    } else {
        $mb_id = "";
        $mb_name = "$row[bn_name]";
    }

    $subject = preg_replace("/\'/", "'", addslashes($row[bn_title]));
    $memo = preg_replace("/\'/", "'", addslashes($row[bn_content]));
    $name = preg_replace("/\'/", "'", addslashes($mb_name));
    $subject = addslashes($row[bn_title]);
    $memo = addslashes($row[bn_content]);
    $name = addslashes($mb_name);

    $html = "";
    if ($row[bn_html_use])
        $html = ",html{$row[bn_html_use]}";
    $secret = "";
    if ($row[bn_secret])
        $secret = ",secret";
    $recv_email = "";
    if ($row[bn_email])
        $mail = ",mail";
    $sql2 = " insert into $tmp_target
                 set ca_name = '{$category[$row[ca_id]]}',
                     wr_option = 'html1,$secret,$mail',
      wr_num = '$num',
                     wr_reply = '$reply',
      wr_subject = '$subject',
                     wr_content = '$memo',
                     wr_link1 = '$row[bn_link1_url]',
                     wr_link2 = '$row[bn_link2_url]',
                     wr_hit = '$row[bn_doc_hit]',
                     wr_good = '$row[vote]',
                     mb_id = '$mb_id',
                     wr_password = '$row[bn_password]',
                     wr_name = '$name',
                     wr_email = '$row[bn_email]',
                     wr_homepage = '$row[bn_homepage]',
                     wr_datetime = '$reg_date',
                     wr_ip = '$row[bn_reg_ip]',
                     wr_is_comment = 0,
                     wr_comment = '$row[bn_cmt_count]',
                     wr_1 = '$row[bn_ext1]',
                     wr_2 = '$row[bn_ext2]',
                     wr_3 = '$row[bn_ext3]',
                     wr_4 = '$row[bn_ext4]',
                     wr_5 = '$row[bn_ext5]',
                     wr_6 = '$row[bn_ext6]',
                     wr_7 = '$row[bn_ext7]',
                     wr_8 = '$row[bn_ext8]',
                     wr_9 = '$row[bn_ext9]',
                     wr_10 = '$row[bn_ext10]' ";
    sql_query($sql2);

    $id = mysql_insert_id();

    sql_query(" update $tmp_target set wr_parent = '$id' where wr_id = '$id' ");

    // 코멘트
    //$comment = -1;
    $comment = 1;
    $sql4 = " select * from bn_{$src}_comment where cmt_doc_num = '$row[bn_doc_num]' ";
    $res4 = sql_query($sql4);
    for ($k=0; $row4=sql_fetch_array($res4); $k++)
    {
        $sql7 = " select mb_id, mb_nick from g4_member where mb_nick = '$row4[cmt_name]'  ";
        $row7 = sql_fetch_array(sql_query($sql7));

        $memo = trim(preg_replace("/\'/", "'", addslashes($row4[cmt_comment])));
        $name = trim(preg_replace("/\'/", "'", addslashes($row7[mb_nick])));
        $reg_date = date("Y-m-d H:i:s", $row4[cmt_reg_date]);

        $sql = " insert into $tmp_target
                    set wr_num = '$num',
                        wr_parent = '$id',
                        wr_is_comment = 1,
                        wr_comment = '$comment',
                        wr_content = '$memo',
                        mb_id = '$row7[mb_id]',
                        wr_password = '$row4[cmt_password]',
                        wr_name = '$name',
                        wr_datetime = '$reg_date',
                        wr_ip = '$row4[cmt_reg_ip]' ";
        sql_query($sql);
        //$comment--;
        $comment++;

        echo "c"; $cnt++; if ($cnt%50==0) { echo "<br/>";  flush(); }

        $count_comment++;
    }
 
}

$sql = " update $g4[board_table]
            set bo_count_write = '$count_write',
                bo_count_comment = '$count_comment'
          where bo_table = '$dst' ";
sql_query($sql);


echo "<p>".($count_write+$count_comment)."건 변환 완료<p><a href='./bn_board.php'>뒤로</a>";
?>

 

|

댓글 3개

게시판 관리에 들어가 "카운트를 조정합니다."를 체크해보세요.
감사합니다. 이렇게 간단한것을 ^^
저도 제로XE에서 변환을 해놓고는 이걸 몰라서 정말 고생 많았어요 ㅎㅎ
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
16년 전 조회 987
16년 전 조회 1,066
16년 전 조회 1,550
16년 전 조회 1,434
16년 전 조회 1,045
16년 전 조회 1,602
16년 전 조회 1,624
16년 전 조회 1,399
16년 전 조회 1,029
16년 전 조회 1,346
16년 전 조회 2,324
16년 전 조회 1,389
16년 전 조회 1,091
16년 전 조회 1,547
16년 전 조회 2,131
16년 전 조회 1,082
16년 전 조회 1,672
16년 전 조회 1,520
16년 전 조회 1,559
16년 전 조회 1,350