상품상세 기본 이미지 세로 크기요.. 채택완료

세로로 긴 상품 이미지가 있습니다. 100px * 700px 정도요

 

02b060fcdce9bc367f242206a3ef55ec_1459862000_3586.jpg
 

이렇게 보이네요.. 

 

리스트에선 가로 세로 사이즈 정해주니 아래처럼 정상으로 보입니다.

 

02b060fcdce9bc367f242206a3ef55ec_1459862638_5709.jpg
 

 

 

가로로 긴 상품은 오른쪽 같이 정상 비율로 잘 보이구요..  02b060fcdce9bc367f242206a3ef55ec_1459862063_4795.jpg 

 

상세페이지 기본 이미지 불러오는 코드인데 

 

Copy
$img = get_it_thumbnail($it['it_img'.$i], $default['de_mimg_width'], $default['de_mimg_height']);
  

 

이 코드를 아래와 같이 변경하니 

 

Copy
$img = get_it_thumbnail($it['it_img'.$i], $default['de_mimg_width']);
  

 

02b060fcdce9bc367f242206a3ef55ec_1459862136_8338.jpg  이렇게 보이네요 ㅠㅠ

 

이미지 비율은 정상인데

 

세로가 2000px 이 넘어갑니다. 가로에 맞춘듯 합니다.

 

세로로 긴 사이즈 정상적으로 보이게 할 수 없는건가요?

 

상품 이미지에 여백주고 사각으로 만들어 올리면 되지만.. 리스트에서 보기 싫어서 그럽니다. 도와주세요.

 

 

영카트 4에선 shop.lib.php 를 아래와 같이 수정해서 사용했는데... 5로 이전 하는게 멀고도 험난하네요 .

 

Copy
// 이미지를 얻는다function get_image($img, $width=0, $height=0){	global $g4, $default;     $full_img = "$g4[path]/data/item/$img";     if (file_exists($full_img) && $img)     {         if (!$width)         {             $size = getimagesize($full_img);             $width = $size[0];             $height = $size[1];         }         //$str = "<img id='$img' src='$g4[url]/data/item/$img' width='$width' height='$height' border='0'>"; -->영카트4 기본코드        $str = "<img id='$img' src='$g4[url]/data/item/$img' width='$width' border='0'>";     }     else     {         $str = "<img id='$img' src='$g4[shop_img_url]/no_image.gif' border='0' ";         if ($width)             //$str .= "width='$width' height='$height'"; -->영카트4 기본코드            $str .= "width='$width'";         else             //$str .= "width='$default[de_mimg_width]' height='$default[de_mimg_height]'"; -->영카트4 기본코드            $str .= "width='$default[de_mimg_width]'";         $str .= ">";     }       return $str; }
  

답변 1개

자문자답.. 해결했습니다. 

 

상세페이지 상품 기본 이미지 클릭시 새창으로 뜨는 largeimage.skin.php 소스 코드 가져다 사용 했더니 잘되네요. 

 

 

item.form.skin.php 상품 이미지 출력 부분 

 

Copy
<!-- 상품이미지 미리보기 시작 { -->    <div id="sit_pvi">        <div id="sit_pvi_big">          <?php          $thumbnails = array();          for($i=1; $i<=10; $i++) {            if(!$row['it_img'.$i])                continue;             $file = G5_DATA_PATH.'/item/'.$row['it_img'.$i];            if(is_file($file)) {                // 썸네일                $thumb = get_it_thumbnail($row['it_img'.$i], 60, 60);                $thumbnails[$i] = $thumb;                $imageurl = G5_DATA_URL.'/item/'.$row['it_img'.$i];          ?>          <span>           <img src="<?php echo $imageurl; ?>" width="<?php echo $size[0]; ?>" height="<?php echo $size[1]; ?>" alt="<?php echo $row['it_name']; ?>" id="largeimage_<?php echo $i; ?>">          </span>          <?php            }           }          ?>        </div>           <?php          //썸네일          //$total_count = count($thumbnails);          //$thumb_count = 0;          // if($total_count > 0) {          // echo '<ul>';           //foreach($thumbnails as $key=>$val) {           //echo '<li><a href="'.G5_SHOP_URL.'/largeimage.php?it_id='.$it_id.'&amp;no='.$key.'" class="img_thumb">'.$val.'</a></li>';           //}           //echo '</ul>';           //}           ?>    </div>    <!-- } 상품이미지 미리보기 끝 -->

 

 

썸네일은 사용 안하기에 주석으로 처리했습니다.


 

item.form.skin.php 상단에 아래 코드 추가 

 

Copy
// largeimage.skin.php 코드 복사$sql = " select it_id, it_name, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10            from {$g5['g5_shop_item_table']} where it_id='$it_id' ";$row = sql_fetch_array(sql_query($sql));

 

 

skin/shop/basic/style.css 의 해당 레이어는 아래와 같이 수정하였습니다.

Copy
#sit_pvi_big {width:460px; height:460px; padding:5px; display:table-cell; text-align:center; vertical-align:middle; background-color:#FFF; border:1px solid #e9e9e9; }

 

 

결과는 아래와 같이 원하는대로 구현되었습니다. 

 

1548df12dbd71d1b165a5d6eefe5e88b_1459905617_4394.jpg  1548df12dbd71d1b165a5d6eefe5e88b_1459905617_4633.jpg
 

로그인 후 평가할 수 있습니다

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

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

로그인
🐛 버그신고