썸네일 이미지를 list.skin.php에 출력하고 싶습니다.

썸네일 이미지를 list.skin.php에 출력하고 싶습니다.

QA

썸네일 이미지를 list.skin.php에 출력하고 싶습니다.

답변 3

본문

26b61685d9e2c43c804096a1ab68d193_1415073489_6495.jpg
 

 

 

위에처럼 게시판 리스트 페이지 에서.. 제목 앞부분에 따로 

 


 <th scope="col">이미지</th> 

 

<th>태그를 추가해서 썸네일 이미지를 보여주려고 합니다. 50 X 40 사이즈..

 

sql문으로 불러온 것중에 썸네밀 경로도 있나요?

 

 

이 질문에 댓글 쓰기 :

답변 3

■ list.skin.php 상단에 썸네일 함수를 불러옵니다.

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');

 

 

■​ 체크박스 다음에 이미지 출력 소스삽입
<?php if ($is_checkbox) { ?>
<td class="td_chk">
   <label for="chk_wr_id_<?php echo $i ?>" class="sound_only"><?php echo $list[$i]['subject'] ?></label>
   <input type="checkbox" name="chk_wr_id[]" value="<?php echo $list[$i]['wr_id'] ?>" id="chk_wr_id_<?php echo $i ?>">
</td>
<?php } ?>

<td>
<?php
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], "50", "40");
if($thumb['src']) {
   $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="50" height="40">';
} else {
   $img_content = '<span>no image</span>';
}
echo $img_content;
?>   
</td>

멋지네요! 약간 수정했습니다.

<th style="width:60px"></th>


<td>
    <?php
    $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], "50", "50");
    if($thumb['src']) {
        $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="50" height="50">';
    } else {
        $img_content = '<span style="display:inline-block;width:50px;height:50px;text-align:center;color:#ccc;line-height:2.0em">no<br>image</span>';
    }
    echo $img_content;
    ?>
</td>


include_once(G5_LIB_PATH.'/thumbnail.lib.php'); 
 
 
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);
 
                        if($thumb['src']) {
                            $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
                        } else {
                            $img_content = '<span style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px">no image</span>';
                        }
 
                        echo $img_content; 

 

이게 그누 기본 gallery에서 사용하는 방식이에요

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
  • 질문이 없습니다.
전체 0
© SIRSOFT
현재 페이지 제일 처음으로