diff --git a/lib/thumbnail.lib.php b/lib/thumbnail.lib.php index 755058a60..baf036d69 100644 --- a/lib/thumbnail.lib.php +++ b/lib/thumbnail.lib.php @@ -9,9 +9,62 @@ function it_img_thumb($filename, $filepath, $thumb_width, $thumb_height, $is_cre } // 게시글리스트 썸네일 생성 -function get_list_thumbnail($filename, $filepath, $thumb_width, $thumb_height, $is_create=false, $is_crop=true) +function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true) { - return thumbnail($filename, $filepath, $filepath, $thumb_width, $thumb_height, $is_create, $is_crop); + global $g4, $config; + $filename = $alt = ""; + $edt = false; + + $sql = " select bf_file, bf_content from {$g4['board_file_table']} + where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_type between '1' and '3' order by bf_no limit 0, 1 "; + $row = sql_fetch($sql); + + if($row['bf_file']) { + $filename = $row['bf_file']; + $filepath = G4_DATA_PATH.'/file/'.$bo_table; + $src_url = G4_DATA_URL.'/file/'.$bo_table; + $alt = get_text($row['bf_content']); + } else { + $write_table = $g4['write_prefix'].$bo_table; + $sql = " select wr_content from $write_table where wr_id = '$wr_id' "; + $write = sql_fetch($sql); + $matchs = get_editor_image($write['wr_content']); + $edt = true; + + for($i=0; $i$src, "alt"=>$alt); + + return $thumb; } // 게시글보기 썸네일 생성 diff --git a/mobile/skin/board/gallery/list.skin.php b/mobile/skin/board/gallery/list.skin.php index 8dc2e80b3..3f2e04926 100644 --- a/mobile/skin/board/gallery/list.skin.php +++ b/mobile/skin/board/gallery/list.skin.php @@ -87,15 +87,12 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php'); 공지 '; + if($thumb['src']) { + $img_content = ''.$thumb['alt'].''; } else { - $img_content = 'no image'; + $img_content = 'no image'; } echo $img_content; diff --git a/skin/board/gallery/list.skin.php b/skin/board/gallery/list.skin.php index f15321fc9..e5f382fd6 100644 --- a/skin/board/gallery/list.skin.php +++ b/skin/board/gallery/list.skin.php @@ -72,13 +72,10 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php'); 공지 '; + if($thumb['src']) { + $img_content = ''.$thumb['alt'].''; } else { $img_content = 'no image'; }