메인에만 다른 썸네일 적용 채택완료
상품등록시 상품 이미지 첨부하는 부분이 기본10군데가 있는듯 합니다.
리스트나 장바구니, 상세페이지 등에는 첫번째 첨부 이미지가 썸네일로 보이고,
메인에만 세번째나 네번째 첨부한 이미지가 썸네일로 보이게 하려면..
어떻게 해야 하는지 아시는분 답변 부탁드립니다..
현재 메인 부분 제품이미지 불러오는 소스는 아래 처럼 되어 있습니다. (main.10.skin.php)
list_mod >= 2) { // 1줄 이미지 : 2개 이상 if ($i%$this->list_mod == 0) $sct_last = 'sct_last'; // 줄 마지막 else if ($i%$this->list_mod == 1) $sct_last = 'sct_clear'; // 줄 첫번째 else $sct_last = ''; } else { // 1줄 이미지 : 1개 $sct_last = 'sct_clear'; }
if ($i == 1) { if ($this->css) { echo "
- css}\">\n";
} else {
echo "
- img_width}px\">\n";
echo "
\n"; if ($this->view_it_img) { echo "href}{$row['it_id']}\">\n"; echo get_it_image($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name']))."\n"; echo "\n"; }echo "\n"; }
if ($i > 1) echo "\n";
if($i == 1) echo "
등록된 상품이 없습니다.
\n"; ?>아무리 찾아 봐도..비슷한 문의가 없는 듯합니다;
두번째 줄 $i=1 부분 숫자를 바꾸거나..이것저것 해봐도 안되네요;
댓글을 작성하려면 로그인이 필요합니다.
- \n";
}
}
echo "
답변 3개
echo get_it_image($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name']),'',3);
위와 같이 함수에 값이 하나더 넘겨서,
/lib/shop.lib.php 파일에서 get_it_image 부분을 아래와 같이 수정하면 됩니다.
function get_it_image($it_id, $width, $height=0, $anchor=false, $img_id='', $img_alt='', $is_crop=false, $img_num=0)
......
for($i=1;$i<=10; $i++) {
$file = G5_DATA_PATH.'/item/'.$row['it_img'.$i];
if(is_file($file) && $row['it_img'.$i] && $i>=$img_num) {
$size = @getimagesize($file);
if($size[2] < 1 || $size[2] > 3)
continue;
$filename = basename($file);
$filepath = dirname($file);
$img_width = $size[0];
$img_height = $size[1];
break;
}
}
답변에 대한 댓글 2개
댓글을 작성하려면 로그인이 필요합니다.
</p>
<p>shop.lib.php</p>
<p>function get_it_image($it_id, $width, $height=0, $anchor=false, $img_id='', $img_alt='', $is_crop=false<span style="color:#d35400;">,$it_img=''</span>)</p>
<p> </p>
<p>for($i=1;$i<=10; $i++) {
<span style="color:#e74c3c;">if($it_img&&$i==1)$i=$it_img;</span>
$file = G5_DATA_PATH.'/item/'.$row['it_img'.$i];</p>
<p> </p>
<p>main.10.skin.php</p>
<p> </p>
<p> echo get_it_image($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name'])<span style="color:#e74c3c;">,3</span>)."\n";</p>
<p> </p>
<p> </p>
<p>
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인