섬네일을 가로 2개로 세로로 나열하는 법 좀 부탁드립니다. > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

섬네일을 가로 2개로 세로로 나열하는 법 좀 부탁드립니다. 정보

섬네일을 가로 2개로 세로로 나열하는 법 좀 부탁드립니다.

본문

//파일 뽑기
$sql = " select bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no limit 0, 10 ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {

//썸네일 코드 시작
$data_path = $g4['path'] . "/data/file/{$bo_table}";//라이브러리 파일 참조
$thumb_path = $data_path . '/thumbOpen';

$view_w = 110; //썸네일 가로사이즈
$view_h = 83; //썸네일 세로사이즈
$sch_q = 100; //썸네일 퀼리티

if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
    $filename = $row[bf_file]; //파일명
    $thumb = $thumb_path.'/'.$filename; //썸네일
    if (!file_exists($thumb))
    {
$file = $data_path.'/'.$filename; //원본
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
        {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                continue;

            $rate = $view_w / $size[0];
            $height = (int)($size[1] * $rate);

            if ($height < $view_h)
                $dst = imagecreatetruecolor($view_w, $height);
            else
                $dst = imagecreatetruecolor($view_w, $view_h);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$filename, $sch_q);
            chmod($thumb_path.'/'.$filename, 0707);
        }
    }

if (file_exists($thumb) && $filename) {
?>
<a href="javascript:void(0);" onClick="View_Open('<?=$data_path?>/<?=$filename?>')" onMouseOver="bgChange('view_img<?=$i?>');" onMouseOut="bgChange('view_img<?=$i?>');"><img src='<?=$thumb?>' border=1 width=88 height=66 style="border-color:#d5d5d5;"></a>&nbsp;&nbsp;<?
//onMouseOut="bgChange('clear');"
}
}


어느분 스킨을 짜집기 중인데...큰 사진 오른쪽으로 섬네일 이미지가 가로 2개씩 세로로 보여줬으면 합니다.
제일 밑 부분을 바꿔야 할 것 같은데, 초짜다 보니 .... ㅠㅜ
도움 좀 부탁드립니다.

댓글 전체

현재 올리신 부분 소스 윗부분 테그가 어떻게 되어 있는지 알수가 없네요.

아래 부분(<= 해당테그에 맟추서 넣어주세요) 부분을 응용해 보세요.

if (file_exists($thumb) && $filename) {
if($i%2 == "0") echo "</td></tr><tr><td>"; <= 해당테그에 맞춰서 넣어주세요.
?>
<a href="javascript:void(0);" onClick="View_Open('<?=$data_path?>/<?=$filename?>')" onMouseOver="bgChange('view_img<?=$i?>');" onMouseOut="bgChange('view_img<?=$i?>');"><img src='<?=$thumb?>' border=1 width=88 height=66 style="border-color:#d5d5d5;"></a>&nbsp;&nbsp;<?
//onMouseOut="bgChange('clear');"
전체 66,558 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT