diff --git a/lib/shop.lib.php b/lib/shop.lib.php index 7d0c780fc..74e8e65e7 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -148,6 +148,35 @@ function get_it_thumbnail($img, $width, $height=0, $id='') return $str; } +// +function get_it_imageurl($img, $width, $height=0) +{ + $str = ''; + + $file = G4_DATA_PATH.'/item/'.$img; + if(is_file($file)) + $size = @getimagesize($file); + + if($size[2] < 1 || $size[2] > 3) + return ''; + + $img_width = $size[0]; + $img_height = $size[1]; + $filename = basename($file); + $filepath = dirname($file); + + if($img_width && !$height) { + $height = round(($width * $img_height) / $img_width); + } + + $thumb = thumbnail($filename, $filepath, $filepath, $width, $height, false, false, 'center', true, $um_value='80/0.5/3'); + + if($thumb) + $str = str_replace(G4_PATH, G4_URL, $filepath.'/'.$thumb); + + return $str; +} + // 상품의 재고 (창고재고수량 - 주문대기수량) function get_it_stock_qty($it_id) { diff --git a/shop/price/about.php b/shop/price/about.php index 42e683fb6..7dc7fe27b 100644 --- a/shop/price/about.php +++ b/shop/price/about.php @@ -9,7 +9,7 @@ $gt = ""; // 배송비 if ($default['de_send_cost_case'] == '없음') $delivery = 0; -else +else if($default['de_send_cost_case'] == '상한') { // 배송비 상한일 경우 제일 앞에 배송비 얼마 금액 이하 $tmp = explode(';', $default['de_send_cost_limit']); @@ -58,12 +58,25 @@ for ($i=0; $row=sql_fetch_array($result); $i++) $PRDATE = substr($row['it_time'], 0, 10); + // 개별배송비계산 + if($default['de_send_cost_case'] == '개별') { + $delivery = get_item_sendcost($row['it_id'], $row['it_price'], 1); + } + + // 상품이미지 + $img_url = ''; + for($k=1; $k<=10; $k++) { + $img_url = get_it_imageurl($row['it_img'.$k], $default['de_mimg_width'], $default['de_mimg_height']); + if($img_url) + break; + } + echo "{$lt}{$row['it_id']}{$gt}"; // 쇼핑몰 상품ID echo "{$lt}C{$gt}"; // 상품구분 C/U/D 전체EP는 일괄적으로 C echo "{$lt}{$row['it_name']}{$gt}"; // 상품명 echo "{$lt}{$row['it_price']}{$gt}"; // 판매가격 echo "{$lt}".G4_SHOP_URL."/item.php?it_id={$row['it_id']}{$gt}"; // 상품의 상세페이지 주소 -echo "{$lt}".G4_DATA_URL."/item/{$row['it_id']}_l1{$gt}"; // 이미지 URL +echo "{$lt}".$img_url."{$gt}"; // 이미지 URL echo "{$lt}$ca_id1{$gt}"; // 대분류 카테고리 코드 echo "{$lt}$ca_id2{$gt}"; // 중분류 카테고리 코드 echo "{$lt}$ca_id3{$gt}"; // 소분류 카테고리 코드 diff --git a/shop/price/about_new.php b/shop/price/about_new.php index 1b8c92b2b..353d428df 100644 --- a/shop/price/about_new.php +++ b/shop/price/about_new.php @@ -9,7 +9,7 @@ $gt = ""; // 배송비 if ($default['de_send_cost_case'] == '없음') $delivery = 0; -else +else if($default['de_send_cost_case'] == '상한') { // 배송비 상한일 경우 제일 앞에 배송비 얼마 금액 이하 $tmp = explode(';', $default['de_send_cost_limit']); @@ -59,12 +59,25 @@ for ($i=0; $row=sql_fetch_array($result); $i++) $PRDATE = substr($row['it_time'], 0, 10); + // 개별배송비계산 + if($default['de_send_cost_case'] == '개별') { + $delivery = get_item_sendcost($row['it_id'], $row['it_price'], 1); + } + + // 상품이미지 + $img_url = ''; + for($k=1; $k<=10; $k++) { + $img_url = get_it_imageurl($row['it_img'.$k], $default['de_mimg_width'], $default['de_mimg_height']); + if($img_url) + break; + } + echo "{$lt}{$row['it_id']}{$gt}"; // 쇼핑몰 상품ID echo "{$lt}C{$gt}"; // 상품구분 C/U/D 전체EP는 일괄적으로 C echo "{$lt}{$row['it_name']}{$gt}"; // 상품명 echo "{$lt}{$row['it_price']}{$gt}"; // 판매가격 echo "{$lt}".G4_SHOP_URL."/item.php?it_id={$row['it_id']}{$gt}"; // 상품의 상세페이지 주소 -echo "{$lt}".G4_DATA_URL."/item/{$row['it_id']}_l1{$gt}"; // 이미지 URL +echo "{$lt}".$img_url."{$gt}"; // 이미지 URL echo "{$lt}$ca_id1{$gt}"; // 대분류 카테고리 코드 echo "{$lt}$ca_id2{$gt}"; // 중분류 카테고리 코드 echo "{$lt}$ca_id3{$gt}"; // 소분류 카테고리 코드 diff --git a/shop/price/auction.php b/shop/price/auction.php index 36935650b..31461fe0b 100644 --- a/shop/price/auction.php +++ b/shop/price/auction.php @@ -51,7 +51,7 @@ $data_url = G4_DATA_URL; // 배송비 if ($default['de_send_cost_case'] == '없음') $delivery = 0; -else +else if($default['de_send_cost_case'] == '상한') { // 배송비 상한일 경우 제일 앞에 배송비 얼마 금액 이하 $tmp = explode(';', $default['de_send_cost_limit']); @@ -87,13 +87,26 @@ for ($i=0; $row=sql_fetch_array($result); $i++) $PRDATE = substr($row['it_time'], 0, 10); + // 개별배송비계산 + if($default['de_send_cost_case'] == '개별') { + $delivery = get_item_sendcost($row['it_id'], $row['it_price'], 1); + } + + // 상품이미지 + $img_url = ''; + for($k=1; $k<=10; $k++) { + $img_url = get_it_imageurl($row['it_img'.$k], $default['de_mimg_width'], $default['de_mimg_height']); + if($img_url) + break; + } + echo <<< HEREDOC {$lt}_BEGIN{$gt} {$lt}PRODID{$gt}{$row['it_id']} {$lt}PRNAME{$gt}{$row['it_name']} {$lt}_PRICE{$gt}{$row['it_price']} {$lt}PRDURL{$gt}$shop_url/item.php?it_id={$row['it_id']} -{$lt}IMGURL{$gt}$data_url/item/{$row['it_id']}_l1 +{$lt}IMGURL{$gt}$img_url {$lt}CATE_1{$gt}$ca_name1 {$lt}CATE_2{$gt}$ca_name2 {$lt}CATE_3{$gt}$ca_name3 diff --git a/shop/price/auction_new.php b/shop/price/auction_new.php index f2783a253..dc8d65c7e 100644 --- a/shop/price/auction_new.php +++ b/shop/price/auction_new.php @@ -53,7 +53,7 @@ $data_url = G4_DATA_URL; // 배송비 if ($default['de_send_cost_case'] == '없음') $delivery = 0; -else +else if($default['de_send_cost_case'] == '상한') { // 배송비 상한일 경우 제일 앞에 배송비 얼마 금액 이하 $tmp = explode(';', $default['de_send_cost_limit']); @@ -90,13 +90,26 @@ for ($i=0; $row=sql_fetch_array($result); $i++) $PRDATE = substr($row['it_time'], 0, 10); + // 개별배송비계산 + if($default['de_send_cost_case'] == '개별') { + $delivery = get_item_sendcost($row['it_id'], $row['it_price'], 1); + } + + // 상품이미지 + $img_url = ''; + for($k=1; $k<=10; $k++) { + $img_url = get_it_imageurl($row['it_img'.$k], $default['de_mimg_width'], $default['de_mimg_height']); + if($img_url) + break; + } + echo <<< HEREDOC {$lt}_BEGIN{$gt} {$lt}PRODID{$gt}{$row['it_id']} {$lt}PRNAME{$gt}{$row['it_name']} {$lt}_PRICE{$gt}{$row['it_price']} {$lt}PRDURL{$gt}$shop_url/item.php?it_id={$row['it_id']} -{$lt}IMGURL{$gt}$data_url/item/{$row['it_id']}_l1 +{$lt}IMGURL{$gt}$img_url {$lt}CATE_1{$gt}$ca_name1 {$lt}CATE_2{$gt}$ca_name2 {$lt}CATE_3{$gt}$ca_name3 diff --git a/shop/price/bb.php b/shop/price/bb.php index 5279a37d7..0dbcce6fb 100644 --- a/shop/price/bb.php +++ b/shop/price/bb.php @@ -34,7 +34,11 @@ $sql = " select * from {$g4['shop_item_table']} $result = sql_query($sql); for ($i=0; $row=mysql_fetch_array($result); $i++) { - $image = it_image($row['it_id'].'_m'); + for($k=1; $k<=10; $k++) { + $imgage = get_it_imageurl($row['it_img'.$k], $default['de_mimg_width'], $default['de_mimg_height']); + if($image) + break; + } $row2 = sql_fetch(" select ca_name from {$g4['shop_category_table']} where ca_id = '".substr($row['ca_id'],0,2)."' "); diff --git a/shop/price/danawa.php b/shop/price/danawa.php index 98ad6781a..967a8aa49 100644 --- a/shop/price/danawa.php +++ b/shop/price/danawa.php @@ -9,7 +9,7 @@ $nl = ""; // new line \n // 배송비 if ($default['de_send_cost_case'] == '없음') $delivery = 0; -else +else if($default['de_send_cost_case'] == '상한') { // 배송비 상한일 경우 제일 앞에 배송비 $tmp = explode(';', $default['de_send_cost_list']); @@ -32,12 +32,25 @@ for ($i=0; $row=mysql_fetch_array($result); $i++) { $ca_name .= "|" . $row3['ca_name']; } + // 개별배송비계산 + if($default['de_send_cost_case'] == '개별') { + $delivery = get_item_sendcost($row['it_id'], $row['it_price'], 1); + } + + // 상품이미지 + $img_url = ''; + for($k=1; $k<=10; $k++) { + $img_url = get_it_imageurl($row['it_img'.$k], $default['de_mimg_width'], $default['de_mimg_height']); + if($img_url) + break; + } + $str .= $nl; $str .= $row['it_id']; // 상품ID $str .= "^$ca_name"; // 카테고리 $str .= "^{$row['it_name']}"; // 상품명 $str .= "^{$row['it_maker']}"; // 제조사 - $str .= "^".G4_DATA_URL."/item/{$row['it_id']}_m"; // 이미지URL + $str .= "^".$img_url; // 이미지URL $str .= "^".G4_SHOP_URL."/item.php?it_id={$row['it_id']}"; // 상품URL $str .= "^{$row['it_price']}"; // 가격 $str .= "^{$row['it_point']}"; // 적립금 diff --git a/shop/price/daum.php b/shop/price/daum.php index 59aa14c84..8cd1a322f 100644 --- a/shop/price/daum.php +++ b/shop/price/daum.php @@ -72,7 +72,7 @@ if ($default['de_send_cost_case'] == '없음') { $deliv = 0; $deliv2 = ""; } -else { +else if($default['de_send_cost_case'] == '상한') { $deliv = 1; // 배송비 상한일 경우 제일 앞에 배송비 $send_cost_limit = explode(";", $default['de_send_cost_limit']); @@ -122,13 +122,33 @@ for ($i=0; $row=sql_fetch_array($result); $i++) $pdate = date("Ymd", strtotime($row['it_time'])); $point = ($row['it_point'] <= 0) ? "" : (int)$row['it_point']; + // 개별배송비계산 + if($default['de_send_cost_case'] == '개별') { + $delivery = get_item_sendcost($row['it_id'], $row['it_price'], 1); + if($delivery) { + $deliv = $delivery; + $deliv2 = $delivery.'원'; + } else { + $deliv = 0; + $deliv2 = ""; + } + } + + // 상품이미지 + $img_url = ''; + for($k=1; $k<=10; $k++) { + $img_url = get_it_imageurl($row['it_img'.$k], $default['de_mimg_width'], $default['de_mimg_height']); + if($img_url) + break; + } + echo <<< HEREDOC {$lt}begin{$gt} {$lt}pid{$gt}{$row['it_id']} {$lt}price{$gt}{$row['it_price']} {$lt}pname{$gt}{$row['it_name']} {$lt}pgurl{$gt}$shop_url/item.php?it_id={$row['it_id']} -{$lt}igurl{$gt}$data_url/item/{$row['it_id']}_m +{$lt}igurl{$gt}$img_url {$lt}cate1{$gt}$cate1 {$lt}cate2{$gt}$cate2 {$lt}cate3{$gt}$cate3 diff --git a/shop/price/enuri.php b/shop/price/enuri.php index 6479bf518..60f7037f1 100644 --- a/shop/price/enuri.php +++ b/shop/price/enuri.php @@ -116,9 +116,27 @@ for ($i=0; $row=mysql_fetch_array($result); $i++) if ($default['de_send_cost_case'] == '없음') $send_cost = '무료'; - else + else if($default['de_send_cost_case'] == '상한') $send_cost = '유료'; + // 개별배송비계산 + if($default['de_send_cost_case'] == '개별') { + $delivery = get_item_sendcost($row['it_id'], $row['it_price'], 1); + + if($delivery) + $send_cost = '유료'; + else + $send_cost = '무료'; + } + + // 상품이미지 + $img_url = ''; + for($k=1; $k<=10; $k++) { + $img_url = get_it_imageurl($row['it_img'.$k], $default['de_mimg_width'], $default['de_mimg_height']); + if($img_url) + break; + } + echo ' '.$num.' @@ -126,7 +144,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++) '.number_format($row['it_price']).' '.$stock.' '.$send_cost.' - '.G4_DATA_URL.'/item/'.$row['it_id'].'_m + '.$img_url.' 1 N '.get_text($row['it_maker']).' diff --git a/shop/price/mymargin.php b/shop/price/mymargin.php index 9ea26ea7c..d373168c5 100644 --- a/shop/price/mymargin.php +++ b/shop/price/mymargin.php @@ -93,8 +93,6 @@ $sql = " select * from {$g4['shop_item_table']} $result = sql_query($sql); for ($i=0; $row=mysql_fetch_array($result); $i++) { - $image = it_image($row['it_id'].'_m'); - $num = (($page - 1) * $page_rows) + $i; $category = $bar = ""; @@ -110,6 +108,19 @@ for ($i=0; $row=mysql_fetch_array($result); $i++) $bar = "/"; } + // 개별배송비계산 + if($default['de_send_cost_case'] == '개별') { + $delivery = get_item_sendcost($row['it_id'], $row['it_price'], 1); + } + + // 상품이미지 + $image = ''; + for($k=1; $k<=10; $k++) { + $image = get_it_imageurl($row['it_img'.$k], $default['de_mimg_width'], $default['de_mimg_height']); + if($image) + break; + } + echo " $num diff --git a/shop/price/naver.php b/shop/price/naver.php index 4bee92522..e8b679091 100644 --- a/shop/price/naver.php +++ b/shop/price/naver.php @@ -46,7 +46,7 @@ $data_url = G4_DATA_URL; if ($default['de_send_cost_case'] == '없음') { $send_cost = 0; } -else { +else if($default['de_send_cost_case'] == '상한') { // 배송비 상한일 경우 제일 앞에 배송비 $send_cost_limit = explode(";", $default['de_send_cost_limit']); $send_cost_list = explode(";", $default['de_send_cost_list']); @@ -89,17 +89,30 @@ for ($i=0; $row=sql_fetch_array($result); $i++) // 배송비 상한가 미만이면 배송비 적용 $delivery = 0; - if ($row['it_price'] < $cost_limit) { + if ($default['de_send_cost_case'] == '상한' && $row['it_price'] < $cost_limit) { $delivery = $send_cost; } + // 개별배송비계산 + if($default['de_send_cost_case'] == '개별') { + $delivery = get_item_sendcost($row['it_id'], $row['it_price'], 1); + } + + // 상품이미지 + $img_url = ''; + for($k=1; $k<=10; $k++) { + $img_url = get_it_imageurl($row['it_img'.$k], $default['de_mimg_width'], $default['de_mimg_height']); + if($img_url) + break; + } + echo <<< HEREDOC {$lt}begin{$gt} {$lt}mapid{$gt}{$row['it_id']} {$lt}pname{$gt}{$row['it_name']} {$lt}price{$gt}{$row['it_price']} {$lt}pgurl{$gt}$shop_url/item.php?it_id={$row['it_id']} -{$lt}igurl{$gt}$data_url/item/{$row['it_id']}_m +{$lt}igurl{$gt}$img_url {$lt}cate1{$gt}$cate1 {$lt}cate2{$gt}$cate2 {$lt}cate3{$gt}$cate3 diff --git a/shop/price/naver_new.php b/shop/price/naver_new.php index a7ea4b34b..58e64f226 100644 --- a/shop/price/naver_new.php +++ b/shop/price/naver_new.php @@ -48,7 +48,7 @@ $data_url = G4_DATA_URL; if ($default['de_send_cost_case'] == '없음') { $send_cost = 0; } -else { +else if($default['de_send_cost_case'] == '상한') { // 배송비 상한일 경우 제일 앞에 배송비 $send_cost_limit = explode(";", $default['de_send_cost_limit']); $send_cost_list = explode(";", $default['de_send_cost_list']); @@ -94,13 +94,26 @@ for ($i=0; $row=sql_fetch_array($result); $i++) $delivery = $send_cost; } + // 개별배송비계산 + if($default['de_send_cost_case'] == '개별') { + $delivery = get_item_sendcost($row['it_id'], $row['it_price'], 1); + } + + // 상품이미지 + $img_url = ''; + for($k=1; $k<=10; $k++) { + $img_url = get_it_imageurl($row['it_img'.$k], $default['de_mimg_width'], $default['de_mimg_height']); + if($img_url) + break; + } + echo <<< HEREDOC {$lt}begin{$gt} {$lt}mapid{$gt}{$row['it_id']} {$lt}pname{$gt}{$row['it_name']} {$lt}price{$gt}{$row['it_price']} {$lt}pgurl{$gt}$shop_url/item.php?it_id={$row['it_id']} -{$lt}igurl{$gt}$data_url/item/{$row['it_id']}_m +{$lt}igurl{$gt}$img_url {$lt}cate1{$gt}$cate1 {$lt}cate2{$gt}$cate2 {$lt}cate3{$gt}$cate3 diff --git a/shop/price/shopbinder.php b/shop/price/shopbinder.php index 212d2060d..7faf83f33 100644 --- a/shop/price/shopbinder.php +++ b/shop/price/shopbinder.php @@ -103,6 +103,14 @@ for ($i=0; $row=mysql_fetch_array($result); $i++) $qty = (int)get_it_stock_qty($row['it_id']); if ($qty <= 0) $row['it_price'] = 0; + // 상품이미지 + $img_url = ''; + for($k=1; $k<=10; $k++) { + $img_url = get_it_imageurl($row['it_img'.$k], $default['de_mimg_width'], $default['de_mimg_height']); + if($img_url) + break; + } + echo " $num  {$row2['ca_name']} @@ -114,7 +122,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++) {$row['it_id']}  ".number_format($row['it_price'])."    - ".G4_DATA_URL."/item/{$row['it_id']}_l1  + ".$img_url."  $delivery     diff --git a/shop/price/yavis.php b/shop/price/yavis.php index 577c4d5b9..01ecf88d7 100644 --- a/shop/price/yavis.php +++ b/shop/price/yavis.php @@ -95,8 +95,6 @@ $sql = " select * from {$g4['shop_item_table']} $result = sql_query($sql); for ($i=0; $row=mysql_fetch_array($result); $i++) { - $image = it_image($row['it_id'].'_m'); - $category = $bar = ""; $len = strlen($row['ca_id']) / 2; for ($i=1; $i<=$len; $i++) @@ -110,6 +108,14 @@ for ($i=0; $row=mysql_fetch_array($result); $i++) $bar = " > "; } + // 상품이미지 + $image = ''; + for($k=1; $k<=10; $k++) { + $image = get_it_imageurl($row['it_img'.$k], $default['de_mimg_width'], $default['de_mimg_height']); + if($image) + break; + } + echo " {$row['it_name']}