제로보드-그누보드 컨버터

제로보드에서 그누보드로 컨버터할려고 자료실에서 다운받아서 했는데..오류가 나는군요..,
열심히 왜그런지 봐도 도저히 모르겠네요...
오류1)Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/firstasi/public_html/zb2gnu3.php on line 108

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/firstasi/public_html/zb2gnu3.php on line 178

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/firstasi/public_html/zb2gnu3.php on line 108

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/firstasi/public_html/zb2gnu3.php on line 178
컨버트를 시작했을경우 이런오류가 납니다..

컨버터 소스입니다------------------

<?
/*
제로보드 4.1 pl4 -> 그누보드 3.0x 게시판 자료 변환 프로그램
2003.4.18 일 작성
2003.9.4 일 수정
* 분류는 모두 일반 (1) 로 변경
*/
set_time_limit(0);

if (!$src) die ("src 값이 넘어오지 않았습니다.");
if (!$dst) die ("dst 값이 넘어오지 않았습니다.");

$zb4[host] = "localhost";
$zb4[user] = "firs";
$zb4[pass] = "tony";
$zb4[db] = "firstasi_d1";
$zb4[dir] = "bbs";

$gnu[host] = "localhost";
$gnu[user] = "firs";
$gnu[pass] = "ton";
$gnu[db] = "firstasi_1";
$gnu[dir] = "gnu3";

$zb4[link] = @mysql_connect($zb4[host], $zb4[user], $zb4[pass]) or die("host, user, pass 오류.");
@mysql_select_db($zb4[db], $zb4[link]) or die("$zb4[db] 접속불가.");

$sql = " select * from zetyx_board_{$src} order by headnum desc,arrangenum ";
$zb4[result] = mysql_query($sql);

$gnu[link] = @mysql_connect($gnu[host], $gnu[user], $gnu[pass]) or die("host, user, pass 오류.");
@mysql_select_db($gnu[db], $gnu[link]) or die("$gnu[db] 접속불가.");

// 폴더생성
@exec("mkdir $gnu[dir]/data/file/$dst");
@exec("chmod 707 $gnu[dir]/data/file/$dst");

$sql = " delete from gb_write_{$dst} ";
mysql_query($sql);

$sql = " update gb_board
set bo_total_count = 0
where bo_table = '$dst' ";
mysql_query($sql);

$save_num = null;
for ($i = 0; $row = mysql_fetch_array($zb4[result]); $i++) {
//$wr_num = get_next_num($write_table, $wr_notice);

//echo $i;

$reg_date = date("Y-m-d H:i:s", $row[reg_date]);

$file1 = "";
$file1_source = "";
if ($row[file_name1] && file_exists("$zb4[dir]/$row[file_name1]")) {
$file1 = substr(md5($i),0,8) . "_" . $row[s_file_name1];
$file1_source = $row[s_file_name1];
@copy("$zb4[dir]/$row[file_name1]", "$gnu[dir]/data/file/$dst/$file1");
@chmod("$gnu[dir]/data/file/$dst/$file1", 0606);
}

$file2 = "";
$file2_source = "";
if ($row[file_name2] && file_exists("$zb4[dir]/$row[file_name2]")) {
$file2 = substr(md5($i),0,8) . "_" . $row[s_file_name2];
$file2_source = $row[s_file_name2];
@copy("$zb4[dir]/$row[file_name2]", "$gnu[dir]/data/file/$dst/$file2");
@chmod("$gnu[dir]/data/file/$dst/$file2", 0606);
}

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";
}

//echo $reply;
}

$num = $row[headnum];

if ($row[headnum] <= -2000000000) {
$notice = -1;
$num = 1;
} else {
$notice = 0;
}

if ($row[ismember]) {
$sql1 = " select user_id from zetyx_member_table where no = '$row[ismember]' ";
$res1 = mysql_query($sql1, $zb4[link]);
$row1 = mysql_fetch_array($res1); <<<<<<<<<<<<<,--이부분이 108번째소스입니다____>>>>>>>>>>
$mb_id = $row1[user_id];
} else {
$mb_id = "";
}

// 제로보드는 HTML에 BR 태그 붙이는게 다르군요
$html = 0;
if ($row[use_html]) {
if ($row[use_html] == 1) {
$html = 2;
} else {
$html = 1;
}
}

$subject = preg_replace("/\'/", "&#039;", $row[subject]);
$memo = preg_replace("/\'/", "&#039;", $row[memo]);

$sql = " insert into gb_write_{$dst}
set ca_id = '$row[category]',
wr_notice = '$notice',
wr_html = '$html',
wr_secret = '$row[is_secret]',
wr_recv_email = '$row[reply_mail]',
wr_num = '$num',
wr_reply = '$reply',
wr_comment = '0',
wr_commentcnt = '0',
wr_subject = '$subject',
wr_content = '$memo',
wr_link1 = '$row[sitelink1]',
wr_link2 = '$row[sitelink2]',
wr_file1 = '$file1',
wr_file2 = '$file2',
wr_file1_source = '$file1_source',
wr_file2_source = '$file2_source',
wr_file1_download = '$row[download1]',
wr_file2_download = '$row[download2]',
wr_hit = '$row[hit]',
mb_id = '$mb_id',
wr_name = '$row[name]',
wr_passwd = '$row[password]',
wr_email = '$row[email]',
wr_homepage = '$row[homepage]',
wr_datetime = '$reg_date',
wr_ip = '$row[ip]',
wr_good = '$row[vote]',
wr_user_agent = '' ";
mysql_query($sql) or die (mysql_error());

$id = mysql_insert_id();

if ($save_num == $num) {
$parent_id = $save_id;
} else {
$parent_id = $id;
$save_id = $id;
}

mysql_query(" update gb_write_{$dst} set wr_parent_id = '$save_id' where wr_id = '$id' ");

// 게시글 1 증가
mysql_query("update gb_board set bo_total_count = bo_total_count + 1 where bo_table = '$dst'");

/*
** 코멘트
*/
$sql2 = " select * from zetyx_board_comment_{$src} where parent = '$row[no]' order by reg_date ";
$res2 = mysql_query($sql2, $zb4[link]);
for ($k = 0; $row2 = mysql_fetch_array($res2); $k++) { <<<<<<<--178번째줄입니다->>>>>>>>>>>>>>>>>>>>>>>>>
$sql3 = " select user_id from zetyx_member_table where no = '$row2[ismember]' ";
$res3 = mysql_query($sql3, $zb4[link]);
$row3 = mysql_fetch_array($res3);
$mb_id = $row3[user_id];

$memo = trim(preg_replace("/\'/", "&#039;", $row2[memo]));

$comment = $k + 1;
$sql = " insert into gb_write_{$dst}
set wr_notice = '$notice',
wr_num = '$num',
wr_reply = '',
wr_parent_id = '$id',
wr_comment = '$comment',
wr_content = '$memo',
mb_id = '$mb_id',
wr_passwd = '$row2[password]',
wr_name = '$row2[name]',
wr_datetime = '".date("Y-m-d H:i:s", $row2[reg_date])."',
wr_ip = '$row2[ip]' ";
mysql_query($sql);
}

mysql_query(" update gb_write_{$dst} set wr_commentcnt = '$k' where wr_id = '$id' ");

$save_reply = $reply;
$save_depth = $row[depth];
$save_num = $num;

//echo "<br>";
}

echo "{$i}건 변환 완료";
?>
---------------------------소스끝-----------------------------------
오류가 나면서도 컨버트는 되는듯합니다.....

오류2) 그런데..... 링크참조..
http://firstasiatown.com/gnu3/?doc=bbs/gnuboard.php&bo_table=webtip&page=1&wr_id=63
보시면 깨진 부분들이 보이죠? 소스를 적어 &#45479;는데...이렇게 깨지네요...


어떻게 해야 할지좀 알려주세요.....
감사합니다
|
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누3질답

+
제목 글쓴이 날짜 조회
21년 전 조회 558
zzoony
21년 전 조회 375
21년 전 조회 553
21년 전 조회 385
21년 전 조회 454
21년 전 조회 461
21년 전 조회 403
21년 전 조회 436
21년 전 조회 567
21년 전 조회 631
21년 전 조회 390
21년 전 조회 382
21년 전 조회 668
21년 전 조회 533
21년 전 조회 865
21년 전 조회 913
21년 전 조회 528
21년 전 조회 437
21년 전 조회 418
21년 전 조회 507
🐛 버그신고