From 64bbdc7e3f2bce27ffe21d44a89d4fe3d6aa5a2c Mon Sep 17 00:00:00 2001 From: chicpro Date: Thu, 31 Jan 2013 11:36:13 +0900 Subject: [PATCH] =?UTF-8?q?get=5Fit=5Fimage=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/itemlist.php | 12 +--------- adm/shop_admin/orderlist2.php | 16 +++++++------ adm/shop_admin/orderstatuslist.php | 30 +++++++++--------------- lib/shop.lib.php | 37 +++++++++++++++++++++--------- shop/boxtodayview.inc.php | 2 +- shop/item.php | 6 ++--- shop/largeimage.php | 7 ++++-- shop/list.skin.10.php | 12 +--------- shop/maintype10.inc.php | 12 +--------- 9 files changed, 58 insertions(+), 76 deletions(-) diff --git a/adm/shop_admin/itemlist.php b/adm/shop_admin/itemlist.php index 3f67dd296..f75924ff1 100644 --- a/adm/shop_admin/itemlist.php +++ b/adm/shop_admin/itemlist.php @@ -162,21 +162,11 @@ for ($i=0; $row=mysql_fetch_array($result); $i++) $list = $i%2; - // 리스트 썸네일 이미지 - $filepath = G4_DATA_PATH.'/item/'.$row['it_id']; - for($k=1; $k<=10; $k++) { - $idx = 'it_img'.$k; - if(file_exists($filepath.'/'.$row[$idx]) && is_file($filepath.'/'.$row[$idx])) { - $filename = $row[$idx]; - break; - } - } - echo " $row[it_id] - ".get_it_image($row['it_id'], $filename, 50, 50)." + ".get_it_image($row['it_id'], 50, 50)." $tmp_ca_list
diff --git a/adm/shop_admin/orderlist2.php b/adm/shop_admin/orderlist2.php index b12227b87..49e10ea08 100644 --- a/adm/shop_admin/orderlist2.php +++ b/adm/shop_admin/orderlist2.php @@ -1,6 +1,7 @@ "; $list = $i%2; + echo " @@ -197,7 +199,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++) $sql2 = " select c.it_name, b.* from $g4[yc4_order_table] a - left join $g4[yc4_cart_table] b on (a.on_uid = b.on_uid) + left join $g4[yc4_cart_table] b on (a.od_id = b.uq_id) left join $g4[yc4_item_table] c on (b.it_id = c.it_id) where od_id = '$row[od_id]' "; $result2 = sql_query($sql2); @@ -216,7 +218,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++) diff --git a/adm/shop_admin/orderstatuslist.php b/adm/shop_admin/orderstatuslist.php index 5ef269b61..8a1b15576 100644 --- a/adm/shop_admin/orderstatuslist.php +++ b/adm/shop_admin/orderstatuslist.php @@ -1,6 +1,7 @@ - + - + diff --git a/lib/shop.lib.php b/lib/shop.lib.php index 2493d66d3..852f84b89 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -143,27 +143,42 @@ function get_image($img, $width=0, $height=0) } // 상품 이미지를 얻는다 -function get_it_image($dir, $img, $width, $height, $it_id="", $class="", $thumbnail=true) +function get_it_image($it_id, $width, $height, $id="", $thumbnail=true) { + global $g4; + if($thumbnail && !$width) return ""; - $src = G4_DATA_URL.'/item/'.$dir.'/'.$img; + $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 {$g4['yc4_item_table']} + where it_id = '$it_id' "; + $row = sql_fetch($sql); - if($thumbnail) { - $filepath = G4_DATA_PATH.'/item/'.$dir; + if(!$row['it_id']) + return ""; - if(file_exists($filepath.'/'.$img) && is_file($filepath.'/'.$img)) { - $src = G4_DATA_URL.'/item/'.$dir.'/'.it_img_thumb($img, $filepath, $width, $height); + $filepath = G4_DATA_PATH.'/item/'.$row['it_id']; + $filename = ""; + for($k=1; $k<=10; $k++) { + $idx = 'it_img'.$k; + if(file_exists($filepath.'/'.$row[$idx]) && is_file($filepath.'/'.$row[$idx])) { + $filename = $row[$idx]; + break; } } - $str = ""; + + if ($id) { $str = "$str"; } diff --git a/shop/boxtodayview.inc.php b/shop/boxtodayview.inc.php index 826fe9880..ffc4dfa6c 100644 --- a/shop/boxtodayview.inc.php +++ b/shop/boxtodayview.inc.php @@ -66,7 +66,7 @@ for ($i=1; $i<=$tv_idx; $i++) if(file_exists($tv_filepath.'/'.$tv_filename) && $tv_filename != "") break; } - $img = get_it_image($tv_it_id, $tv_filename, $tv_div['img_width'], $tv_div['img_height'], $tv_it_id); + $img = get_it_image($tv_it_id, $tv_div['img_width'], $tv_div['img_height'], $tv_it_id); $img = str_replace("\"", "\\\"", $img); $img = preg_replace("/\".cut_str($it_name,10,"")."\";\n"; diff --git a/shop/item.php b/shop/item.php index 41baf541a..14d99f8a6 100644 --- a/shop/item.php +++ b/shop/item.php @@ -188,7 +188,7 @@ else
$row[od_id] - +
".get_it_image("{$row2[it_id]}_s", 50, 50)."".get_it_image($row2[it_id], 50, 50)." $it_name
$row[od_id] ".cut_str($row[od_name],10,"")." $row[mb_id]".get_it_image("{$row[it_id]}_s", 50, 50)."".get_it_image($row['it_id'], 50, 50)." $it_name".number_format($row[ct_amount])." ".number_format($row[it_amount] + $row[ct_amount])."  $row[ct_qty] ".number_format($row[ct_sub_amount])."  ".number_format($row[ct_sub_point])." 
+
-
@@ -200,8 +200,8 @@ else if (file_exists($filepath.'/'.$filename) && $filename != "") { echo get_large_image($filename, $it['it_id'], false); - echo get_it_image($it['it_id'], $filename, 40, 40, "", "item_view_thumbnail"); - echo "  "; + echo ""; + echo " "; } } ?> diff --git a/shop/largeimage.php b/shop/largeimage.php index 253667d11..fd3e756a3 100644 --- a/shop/largeimage.php +++ b/shop/largeimage.php @@ -26,9 +26,12 @@ include_once(G4_PATH.'/head.sub.php'); "; + echo " "; + } } ?>   diff --git a/shop/list.skin.10.php b/shop/list.skin.10.php index 5b5ca33fc..a6825a733 100644 --- a/shop/list.skin.10.php +++ b/shop/list.skin.10.php @@ -14,21 +14,11 @@ for ($i=0; $row=sql_fetch_array($result); $i++) echo "\n"; } - // 리스트 썸네일 이미지 - $filepath = G4_DATA_PATH.'/item/'.$row['it_id']; - for($k=1; $k<=10; $k++) { - $idx = 'it_img'.$k; - if(file_exists($filepath.'/'.$row[$idx]) && is_file($filepath.'/'.$row[$idx])) { - $filename = $row[$idx]; - break; - } - } - echo "
- + "; if ($row[it_cust_amount] && !$row[it_gallery]) diff --git a/shop/maintype10.inc.php b/shop/maintype10.inc.php index ce92bc797..ef42540a6 100644 --- a/shop/maintype10.inc.php +++ b/shop/maintype10.inc.php @@ -11,21 +11,11 @@ for ($i=0; $row=sql_fetch_array($result); $i++) { } $href = ""; - - // 리스트 썸네일 이미지 - $filepath = G4_DATA_PATH.'/item/'.$row['it_id']; - for($k=1; $k<=10; $k++) { - $idx = 'it_img'.$k; - if(file_exists($filepath.'/'.$row[$idx]) && is_file($filepath.'/'.$row[$idx])) { - $filename = $row[$idx]; - break; - } - } ?>
".get_it_image($row['it_id'], $filename, $img_width , $img_height, $row['it_id'])."
".get_it_image($row['it_id'], $img_width , $img_height, $row['it_id'])."
".it_name_icon($row)."
- +