첨부파일질문좀 드리겠습니다

첨부파일질문좀 드리겠습니다

QA

첨부파일질문좀 드리겠습니다

답변 2

본문

안녕하세요 질문좀드리겠습니다

갤러리 리스트부분인데요

첨부파일 2번 이미지가 나오게 하고싶은데 어떻게 해야할까요 ㅠㅠ?

 


   <?php
                if ($list[$i]['is_notice']) { // 공지사항 ?>
                    <strong style="width:<?php echo $board['bo_mobile_gallery_width'] ?>px;height:<?php echo $board['bo_mobile_gallery_height'] ?>px">공지</strong>
                <?php
                } else {
                    $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_mobile_gallery_width'], $board['bo_mobile_gallery_height']);
                    if($thumb['src']) {
                        $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'"  >';
                    } else {
                        $img_content = '<span class="no-img">no image</span>';
                    }
                    echo $img_content;
                }
                ?>

이 질문에 댓글 쓰기 :

답변 2

이렇게 넣어주시면 나올거에요.


<?php
$sql_bf = " select bf_file, bf_content from {$g5['board_file_table']}
   where bo_table = '{$board[bo_table]}' and wr_id = '{$list[$i][wr_id]}' and bf_type between '1' and '3' order by bf_no limit 1, 1 ";
$row_bf = sql_fetch($sql_bf);
if($row_bf['bf_file']) {
 $filename = $row_bf['bf_file'];
 $filepath = G5_DATA_PATH.'/file/'.$board['bo_table'];
 $alt = get_text($row_bf['bf_content']);
 $tname = thumbnail($filename, $filepath, $filepath, $board['bo_mobile_gallery_width'], $board['bo_mobile_gallery_height']);
 $src = G5_DATA_URL.'/file/'.$board['bo_table'].'/'.$tname;
 echo '<img src="'.$src.'" alt="'.$alt.'"  >';
}
?>

$tname = thumbnail($filename, $filepath, $filepath, $board['bo_mobile_gallery_width'], $board['bo_mobile_gallery_height']);

위 코드를 밑에 처럼 false를 추가해주세요.
$tname = thumbnail($filename, $filepath, $filepath, $board['bo_mobile_gallery_width'], $board['bo_mobile_gallery_height'], false);

2번 이미지가 있다고 전제하면

lib / thumbnail.lib.php 파일 13라인쯤 

between '1' and '3' order by bf_no limit 0, 1 ";  이런 부분을 찾아

limit 1, 1 즉, 0을 1로 바꾸시면 되는데 ... 이렇게 되면 이 함수를 사용하는 모든 스킨들에서

그렇게 될테니 따로 함수를 하나 더 만들어 그걸 적용하시던지, 아니면 extend폴더에 넣어 그걸 사용하셔야 겠네요. 

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