#111 에 따른 쇼핑몰 인덱스 이미지 ID 유효성 오류 수정

This commit is contained in:
chicpro
2013-05-02 09:38:46 +09:00
parent 379b0b9337
commit aa381c5aa9
2 changed files with 9 additions and 6 deletions

View File

@ -14,11 +14,14 @@ function get_cart_count($uq_id)
}
// 이미지를 얻는다
function get_image($img, $width=0, $height=0)
function get_image($img, $width=0, $height=0, $type='')
{
global $g4, $default;
$full_img = G4_DATA_PATH.'/item/'.$img;
if($type != '') {
$img_id = 'type'.$type.'_'.$img;
}
if (file_exists($full_img) && $img)
{
@ -28,7 +31,7 @@ function get_image($img, $width=0, $height=0)
$width = $size[0];
$height = $size[1];
}
$str = '<img src="'.G4_DATA_URL.'/item/'.$img.'" alt="" width="'.$width.'" height="'.$height.'" id="'.$img.'">';
$str = '<img src="'.G4_DATA_URL.'/item/'.$img.'" alt="" width="'.$width.'" height="'.$height.'" id="'.$img_id.'">';
}
else
{
@ -37,7 +40,7 @@ function get_image($img, $width=0, $height=0)
$str .= 'width="'.$width.'" height="'.$height.'"';
else
$str .= 'width="'.$default['de_mimg_width'].'" height="'.$default['de_mimg_height'].'"';
$str .= ' id="'.$img.'">';
$str .= ' id="'.$img_id.'">';
}
@ -45,9 +48,9 @@ function get_image($img, $width=0, $height=0)
}
// 상품 이미지를 얻는다
function get_it_image($img, $width=0, $height=0, $id="")
function get_it_image($img, $width=0, $height=0, $id="", $type='')
{
$str = get_image($img, $width, $height);
$str = get_image($img, $width, $height, $type);
if ($id) {
$str = '<a href="'.G4_SHOP_URL.'/item.php?it_id='.$id.'" alt="">'.$str.'</a>';
}

View File

@ -12,7 +12,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
?>
<li class="sidx_it_li <?php echo $sidx_it_last; ?>">
<a href="<?php echo $href; ?>" class="sidx_it_a">
<span><?php echo get_it_image($row['it_id']."_s", $img_width, $img_height); ?></span>
<span><?php echo get_it_image($row['it_id']."_s", $img_width, $img_height, $row['it_id'], $type); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<?php echo display_amount(get_amount($row), $row['it_tel_inq']); ?>
</a>