해

[야간에 고생들 많으십니다.^^]파업없이 업로드

· 2009-03-26 (목) 02:17:47 · 992
현재 그누보드는 파일업드시 파일이 없을경우 내용이 DB에 저장되지 않습니다.
(당연한것 같지만 파일 설명만 넣고 싶을 수도 있다고봅니다.)

제가 원하는것은 파일 설명쓰기란에 글을 쓰고
파일 미첨부시에도 저장되도록 하고싶은것입니다...

bbs/write_update.php 을 수정하면 될것은데...
잘안되는군요. 어떻게 하면 될까요?

팁란과 질문답변란에서 찾지못해 질문합니다.

bbs/write_update.php 408라인 이후

// 가변 파일 업로드
// 나중에 테이블에 저장하는 이유는 $wr_id 값을 저장해야 하기 때문입니다.
for ($i=0; $i<count($upload); $i++)
{
$row = sql_fetch(" select count(*) as cnt from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$i' ");
if ($row[cnt])
{
// 삭제에 체크가 있거나 파일이 있다면 업데이트를 합니다.
// 그렇지 않다면 내용만 업데이트 합니다.
if ($upload[$i][del_check] || $upload[$i][file])
{
$sql = " update $g4[board_file_table]
set bf_source = '{$upload[$i][source]}',
bf_file = '{$upload[$i][file]}',
bf_content = '{$bf_content[$i]}',
bf_filesize = '{$upload[$i][filesize]}',
bf_width = '{$upload[$i][image][0]}',
bf_height = '{$upload[$i][image][1]}',
bf_type = '{$upload[$i][image][2]}',
bf_datetime = '$g4[time_ymdhis]'
where bo_table = '$bo_table'
and wr_id = '$wr_id'
and bf_no = '$i' ";
sql_query($sql);
}
else
{
$sql = " update $g4[board_file_table]
set bf_content = '{$bf_content[$i]}'
where bo_table = '$bo_table'
and wr_id = '$wr_id'
and bf_no = '$i' ";
sql_query($sql);
}
}
else
{
$sql = " insert into $g4[board_file_table]
set bo_table = '$bo_table',
wr_id = '$wr_id',
bf_no = '$i',
bf_source = '{$upload[$i][source]}',
bf_file = '{$upload[$i][file]}',
bf_content = '{$bf_content[$i]}',
bf_download = 0,
bf_filesize = '{$upload[$i][filesize]}',
bf_width = '{$upload[$i][image][0]}',
bf_height = '{$upload[$i][image][1]}',
bf_type = '{$upload[$i][image][2]}',
bf_datetime = '$g4[time_ymdhis]' ";
sql_query($sql);
}
}
댓글을 작성하시려면 로그인이 필요합니다.

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

+
제목 글쓴이 날짜 조회
09-03-26 조회 872
09-03-26 조회 931
09-03-26 조회 892
09-03-26 조회 1,070
09-03-26 조회 1,581
09-03-26 조회 1,051
09-03-26 조회 1,684
09-03-26 조회 1,661
09-03-26 조회 1,091
09-03-26 조회 1,616
09-03-26 조회 993
09-03-26 조회 963
09-03-25 조회 1,052
09-03-25 조회 870
09-03-25 조회 1,046
09-03-25 조회 931
09-03-25 조회 900
09-03-25 조회 1,377
09-03-25 조회 1,043
09-03-25 조회 1,015