답변 3개
답변에 대한 댓글 2개
select * from $g5['board_file_table'] where bo_table = '게시판명' and wr_id = '게시판wr_id값'
으로 쿼리를 변경해보세요
$aa['wr_file'] 도 첨부파일이 아닙니다.
bf_file 필드가 첨부파일명이 저장되는 필드입니다.
댓글을 작성하려면 로그인이 필요합니다.
$files = get_file($bo_table, $wr_id);
print_r2($files);
echo $files['count'];
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
get_file 함수가 있으니 함수 내용을 참고해서 작성하세요
// 게시글에 첨부된 파일을 얻는다. (배열로 반환) function get_file($bo_table, $wr_id) { global $g5, $qstr; $file['count'] = 0; $sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no "; $result = sql_query($sql); while ($row = sql_fetch_array($result)) { $no = $row['bf_no']; $file[$no]['href'] = G5_BBS_URL."/download.php?bo_table=$bo_table&wr_id=$wr_id&no=$no" . $qstr; $file[$no]['download'] = $row['bf_download']; // 4.00.11 - 파일 path 추가 $file[$no]['path'] = G5_DATA_URL.'/file/'.$bo_table; $file[$no]['size'] = get_filesize($row['bf_filesize']); $file[$no]['datetime'] = $row['bf_datetime']; $file[$no]['source'] = addslashes($row['bf_source']); $file[$no]['bf_content'] = $row['bf_content']; $file[$no]['content'] = get_text($row['bf_content']); //$file[$no]['view'] = view_file_link($row['bf_file'], $file[$no]['content']); $file[$no]['view'] = view_file_link($row['bf_file'], $row['bf_width'], $row['bf_height'], $file[$no]['content']); $file[$no]['file'] = $row['bf_file']; $file[$no]['image_width'] = $row['bf_width'] ? $row['bf_width'] : 640; $file[$no]['image_height'] = $row['bf_height'] ? $row['bf_height'] : 480; $file[$no]['image_type'] = $row['bf_type']; $file['count']++; } return $file; }
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인