채택완료

게시판 목록에서 공지글에도 썸네일 나타나게 하려면...

2015-07-02 (목) 17:05:36 3,805
|

답변 1개 / 댓글 1개

채택된 답변
+20 포인트
2015-07-03 (금) 12:01:39
            <ul class="gall_con"> <!-- 이미지 출력 -->
                <li class="gall_href" style="padding:4px; border:1px solid #ddd;">
                    <a href="<?php echo $list[$i]['href'] ?>">
                    <?php
                        // $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);
                        $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $thumb_width, $thumb_height); // 썸네일 크기를 위에서 선언한 크기사용

                        if($thumb['src']) {
                            // $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
                            $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$thumb_width.'" height="'.$thumb_height.'">';
                        } else {
                            // $img_content = '<span style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px">no image</span>';
       $img_content = '<span style="width:'.$thumb_width.'px;height:'.$thumb_height.'px">no image</span>';
                        }

                        echo $img_content;
                     ?>
                    </a>
                </li>
   </ul>

답변에 대한 댓글 1개

모바일님 진심 감사합니다 덕분에 드디어 해결되었어요 건강조시하시고 좋은 주말 되세요~

답변을 작성하려면 로그인이 필요합니다.