테스트 사이트 - 개발 중인 베타 버전입니다

질문 채택완료

초초동 9년 전 조회 2,659

if ($this->view_it_img) { 

echo get_it_image($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name']))."\n"; 

} 

 

이런 코드가 있습니다.

 

제품의 이미지를 나타내는 코드인것 같은데 

 

저 이미지를 마우스오버 했을때는

 

echo get_it_image2($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name']))."\n";

 

get_it_image2이미지를 노출 시키고 싶은데 어떻게 하나요?ㅠㅠㅠ

 

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

답변 2개

채택된 답변
+20 포인트

썸네일이미지는 이부분 같습니다..

 

</p><p>    if($thumb) { 
        $file_url = str_replace(G5_PATH, G5_URL, $filepath.'/'.$thumb); 
        $img = '<img src="'.$file_url.'" width="'.$width.'" name="items" height="'.$height.'" alt="'.$img_alt.'"'; 
    } else { 
        $img = '<img src="'.G5_SHOP_URL.'/img/no_image.gif" width="'.$width.'"'; 
        if($height) 
            $img .= ' height="'.$height.'"'; 
        $img .= ' alt="'.$img_alt.'"'; 
    } </p><p>

 

img 태그 안에 onmouseover="" 넣어주시면 될듯 하네요^^;; 

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

답변에 대한 댓글 1개

초초동
9년 전
그건 저도 아는데 ㅎㅎㅎ
암튼 자체 완료 했네요 ㅎㅎ
답변감사

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

소스 전체를 부탁드려요^^ 

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

답변에 대한 댓글 1개

초초동
9년 전
echo "<li class=\"sct_li {$sct_last}\" style=\"width:{$this->img_width}px\">\n";
if ($this->href) {
echo "<div class=\"sct_img\"><a href=\"{$this->href}{$row['it_id']}\" class=\"sct_a\">\n";
}

if ($this->view_it_img) {
echo get_it_image($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name']))."\n";
}

if ($this->href) {
echo "</a></div>\n";
}



이게 main.10.skin.php 파일이구요. 이미지 쪽


// 상품 이미지를 얻는다
function get_it_image($it_id, $width, $height=0, $anchor=false, $img_id='', $img_alt='')
{
global $g5;

if(!$it_id || !$width)
return '';

$sql = " select it_id, 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($sql);

if(!$row['it_id'])
return '';

for($i=1;$i<=10; $i++) {
$file = G5_DATA_PATH.'/item/'.$row['it_img'.$i];
if(is_file($file) && $row['it_img'.$i]) {
$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;
}
}


if($img_width && !$height) {
$height = round(($width * $img_height) / $img_width);
}

if($filename) {
//thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_height, $is_create, $is_crop=false, $crop_mode='center', $is_sharpen=true, $um_value='80/0.5/3')
$thumb = thumbnail($filename, $filepath, $filepath, $width, $height, false, true, 'center', false, $um_value='80/0.5/3');
}

if($thumb) {
$file_url = str_replace(G5_PATH, G5_URL, $filepath.'/'.$thumb);
$img = '<img src="'.$file_url.'" width="'.$width.'" name="items" height="'.$height.'" alt="'.$img_alt.'"';
} else {
$img = '<img src="'.G5_SHOP_URL.'/img/no_image.gif" width="'.$width.'"';
if($height)
$img .= ' height="'.$height.'"';
$img .= ' alt="'.$img_alt.'"';
}

if($img_id)
$img .= ' id="'.$img_id.'"';
$img .= '>';

if($anchor)
$img = '<a href="'.G5_SHOP_URL.'/item.php?it_id='.$it_id.'">'.$img.'</a>';

return $img;
}

이건 이미지를 얻을때 shop.lib.php 의 소스 중 하나에요

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

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

로그인