From 05a5fa7d09a742fb8430f0ee14b69d29930dea61 Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 29 Jan 2013 13:22:24 +0900 Subject: [PATCH 01/14] =?UTF-8?q?admin.js=20=EA=B2=BD=EB=A1=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/admin.tail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adm/admin.tail.php b/adm/admin.tail.php index 8c410218a..7aaee42dd 100644 --- a/adm/admin.tail.php +++ b/adm/admin.tail.php @@ -16,7 +16,7 @@ if (!defined('_GNUBOARD_')) exit; - + Date: Tue, 29 Jan 2013 14:37:09 +0900 Subject: [PATCH 02/14] =?UTF-8?q?it=5Fimg=5Fupload=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/shop.lib.php | 73 ------------------------------------------------ 1 file changed, 73 deletions(-) diff --git a/lib/shop.lib.php b/lib/shop.lib.php index ccc125521..e06d6785c 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -311,79 +311,6 @@ function upload_file($srcfile, $destfile, $dir) return true; } -// 유일키를 생성 -function get_unique_id($len=32) -{ - global $g4; - - $result = @mysql_query(" LOCK TABLES $g4[yc4_on_uid_table] WRITE, $g4[yc4_cart_table] READ, $g4[yc4_order_table] READ "); - if (!$result) { - $sql = " CREATE TABLE `$g4[yc4_on_uid_table]` ( - `on_id` int(11) NOT NULL auto_increment, - `on_uid` varchar(32) NOT NULL default '', - `on_datetime` datetime NOT NULL default '0000-00-00 00:00:00', - `session_id` varchar(32) NOT NULL default '', - PRIMARY KEY (`on_id`), - UNIQUE KEY `on_uid` (`on_uid`) ) "; - sql_query($sql, false); - } - - // 이틀전 자료는 모두 삭제함 - $ytime = date("Y-m-d", $g4['server_time'] - 86400 * 1); - $sql = " delete from $g4[yc4_on_uid_table] where on_datetime < '$ytime' "; - sql_query($sql); - - $unique = false; - - do { - sql_query(" INSERT INTO $g4[yc4_on_uid_table] set on_uid = NOW(), on_datetime = NOW(), session_id = '".session_id()."' ", false); - $id = @mysql_insert_id(); - $uid = md5($id); - sql_query(" UPDATE $g4[yc4_on_uid_table] set on_uid = '$uid' where on_id = '$id' "); - - // 장바구니에도 겹치는게 있을 수 있으므로 ... - $sql = "select COUNT(*) as cnt from $g4[yc4_cart_table] where on_uid = '$uid' "; - $row = sql_fetch($sql); - if (!$row[cnt]) { - // 주문서에도 겹치는게 있을 수 있으므로 ... - $sql = "select COUNT(*) as cnt from $g4[yc4_order_table] where on_uid = '$uid' "; - $row = sql_fetch($sql); - if (!$row[cnt]) - $unique = true; - } - } while (!$unique); // $unique 가 거짓인동안 실행 - - @mysql_query(" UNLOCK TABLES "); - - return $uid; -} - -// 주문서 번호를 얻는다. -function get_new_od_id() -{ - global $g4; - - // 주문서 테이블 Lock 걸고 - sql_query(" LOCK TABLES $g4[yc4_order_table] READ, $g4[yc4_order_table] WRITE ", FALSE); - // 주문서 번호를 만든다. - $date = date("ymd", time()); // 2002년 3월 7일 일경우 020307 - $sql = " select max(od_id) as max_od_id from $g4[yc4_order_table] where SUBSTRING(od_id, 1, 6) = '$date' "; - $row = sql_fetch($sql); - $od_id = $row[max_od_id]; - if ($od_id == 0) - $od_id = 1; - else - { - $od_id = (int)substr($od_id, -4); - $od_id++; - } - $od_id = $date . substr("0000" . $od_id, -4); - // 주문서 테이블 Lock 풀고 - sql_query(" UNLOCK TABLES ", FALSE); - - return $od_id; -} - function message($subject, $content, $align="left", $width="450") { $str = " From e85f46695e3e4edcab71eec82718b9af11c3c6d1 Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 29 Jan 2013 14:38:11 +0900 Subject: [PATCH 03/14] =?UTF-8?q?thumbnail=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/thumbnail.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/thumbnail.lib.php b/lib/thumbnail.lib.php index 4da500bac..fe59bc0f2 100644 --- a/lib/thumbnail.lib.php +++ b/lib/thumbnail.lib.php @@ -26,7 +26,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h $source_time = @filemtime($source_file); if (file_exists($thumb_file)) { if ($is_create == false && $source_time < $thumb_time) { - return str_replace($target_path.'/', '', $thumb_file); + return basename($thumb_file); } } @@ -42,7 +42,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h imagepng($target, $thumb_file, 0); @chmod($thumb_file, 0606); // 추후 삭제를 위하여 파일모드 변경 } - return str_replace($target_path.'/', '', $thumb_file); + return basename($thumb_file); } $is_imagecopyresampled = false; @@ -65,7 +65,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h $dst = imagecreatetruecolor($thumb_width, $thumb_height); $bgcolor = imagecolorallocate($dst, 250, 250, 250); // 배경색 여기야!!! imagefill($dst, 0, 0, $bgcolor); - imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $tmp_height, $size[0], $size[1]); + imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $thumb_height, $size[0], $size[1]); } else { $dst = imagecreatetruecolor($thumb_width, $thumb_height); imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $thumb_height, $size[0], $size[1]); From eeebc48bfd61ba99b22e94680fb595c7134f29f0 Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 29 Jan 2013 14:39:02 +0900 Subject: [PATCH 04/14] =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=8D=B8?= =?UTF-8?q?=EB=84=A4=EC=9D=BC=20=EC=83=9D=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/itemlist.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/adm/shop_admin/itemlist.php b/adm/shop_admin/itemlist.php index ef8cb33c0..62f8f15c6 100644 --- a/adm/shop_admin/itemlist.php +++ b/adm/shop_admin/itemlist.php @@ -1,6 +1,7 @@ document.getElementById('ca_id_$i').value='$row[ca_id]';"; $list = $i%2; + $it_img = it_img_thumb($row['it_img1'], G4_DATA_PATH.'/item/'.$row['it_id'], 50, 50); echo " $row[it_id] - ".get_it_image("{$row[it_id]}_s", 50, 50)." + ".get_it_image("{$row['it_id']}/{$it_img}", 50, 50)." $tmp_ca_list
From 19738368f5c149c1179693d2d659f403d390f0d9 Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 29 Jan 2013 14:40:06 +0900 Subject: [PATCH 05/14] =?UTF-8?q?=EC=83=81=ED=92=88=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=ED=95=84=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/itemform.php | 53 ++++--------------------------------- 1 file changed, 5 insertions(+), 48 deletions(-) diff --git a/adm/shop_admin/itemform.php b/adm/shop_admin/itemform.php index 07b873890..1b3957c66 100644 --- a/adm/shop_admin/itemform.php +++ b/adm/shop_admin/itemform.php @@ -383,62 +383,19 @@ ul { margin: 0; padding: 0; list-style: none; } - - - - - - - - - - - - - - + From 376ac5d78d26021e0542d3c2841103b7bb69cc33 Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 29 Jan 2013 14:40:39 +0900 Subject: [PATCH 06/14] =?UTF-8?q?=EC=83=81=ED=92=88=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EC=82=AD=EC=A0=9C=20=EC=BD=94=EB=93=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/itemformupdate.php | 84 ++++++++++++++++++++++--------- 1 file changed, 60 insertions(+), 24 deletions(-) diff --git a/adm/shop_admin/itemformupdate.php b/adm/shop_admin/itemformupdate.php index 7cb3b94ce..cd96a0935 100644 --- a/adm/shop_admin/itemformupdate.php +++ b/adm/shop_admin/itemformupdate.php @@ -44,17 +44,11 @@ function itemdelete($it_id) // 상품 이미지 삭제 - @unlink("$g4[path]/data/item/$it_id"."_s"); - @unlink("$g4[path]/data/item/$it_id"."_m"); - @unlink("$g4[path]/data/item/$it_id"."_l1"); - @unlink("$g4[path]/data/item/$it_id"."_l2"); - @unlink("$g4[path]/data/item/$it_id"."_l3"); - @unlink("$g4[path]/data/item/$it_id"."_l4"); - @unlink("$g4[path]/data/item/$it_id"."_l5"); - - // 상, 하단 이미지 삭제 - @unlink("$g4[path]/data/item/$it_id"."_h"); - @unlink("$g4[path]/data/item/$it_id"."_t"); + $files = scan_dir(G4_DATA_PATH.'/item/'.$it_id); + for($i=0; $i Date: Tue, 29 Jan 2013 14:49:52 +0900 Subject: [PATCH 07/14] =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=8D=B8?= =?UTF-8?q?=EB=84=A4=EC=9D=BC=EC=9D=84=20it=5Fimg1=EC=97=90=20=EA=B0=92?= =?UTF-8?q?=EC=9D=B4=20=EC=97=86=EC=9D=84=20=EB=95=8C=EB=8F=84=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=EB=90=98=EB=8F=84=EB=A1=9D=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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/adm/shop_admin/itemlist.php b/adm/shop_admin/itemlist.php index 62f8f15c6..dbe723c76 100644 --- a/adm/shop_admin/itemlist.php +++ b/adm/shop_admin/itemlist.php @@ -161,7 +161,18 @@ for ($i=0; $row=mysql_fetch_array($result); $i++) $tmp_ca_list .= ""; $list = $i%2; - $it_img = it_img_thumb($row['it_img1'], G4_DATA_PATH.'/item/'.$row['it_id'], 50, 50); + + // 리스트 썸네일 이미지 + $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; + } + } + $it_img = it_img_thumb($filename, G4_DATA_PATH.'/item/'.$row['it_id'], 50, 50); + echo " From 4edcf09c15e022016bc659a8335cee74ff539ad5 Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 29 Jan 2013 14:59:22 +0900 Subject: [PATCH 08/14] =?UTF-8?q?=EC=A3=BC=EC=84=9D=EC=B2=98=EB=A6=AC=20?= =?UTF-8?q?=EB=9D=BC=EC=9D=B8=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/itemform.php | 1 - 1 file changed, 1 deletion(-) diff --git a/adm/shop_admin/itemform.php b/adm/shop_admin/itemform.php index 1b3957c66..c9fe164c4 100644 --- a/adm/shop_admin/itemform.php +++ b/adm/shop_admin/itemform.php @@ -1,6 +1,5 @@ Date: Tue, 29 Jan 2013 15:17:38 +0900 Subject: [PATCH 09/14] =?UTF-8?q?=EC=BD=94=EB=93=9C=EC=A4=91=EB=B3=B5?= =?UTF-8?q?=EA=B2=80=EC=82=AC=20=EC=BD=94=EB=93=9C=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/itemform.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adm/shop_admin/itemform.php b/adm/shop_admin/itemform.php index c9fe164c4..ca4356cdb 100644 --- a/adm/shop_admin/itemform.php +++ b/adm/shop_admin/itemform.php @@ -800,7 +800,7 @@ function codedupcheck(id) $.post( "./codedupcheck.php", - { id: id }, + { it_id: id }, function(data) { if(data) { From e5dfd9a878ea1afc0c92794c5ad2988550204c0f Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 29 Jan 2013 15:19:31 +0900 Subject: [PATCH 10/14] =?UTF-8?q?G4=EA=B2=BD=EB=A1=9C,=20=EC=B6=9C?= =?UTF-8?q?=EB=A0=A5=EC=8A=A4=ED=82=A8,=20=EC=97=90=EB=94=94=ED=84=B0=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EC=BD=94=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/categoryform.php | 39 +++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/adm/shop_admin/categoryform.php b/adm/shop_admin/categoryform.php index c7bccc4c8..0764b75b9 100644 --- a/adm/shop_admin/categoryform.php +++ b/adm/shop_admin/categoryform.php @@ -1,6 +1,7 @@ - -
@@ -107,8 +106,8 @@ include_once(G4_ADMIN_PATH."/admin.head.php"); - - "; ?> + + "; ?> 상품리스트 @@ -133,7 +132,7 @@ include_once(G4_ADMIN_PATH."/admin.head.php");
- + - +
이미지(대) - - 삭제"; - echo ""; - } - ?> -
이미지(중) - - 삭제"; - echo ""; - } - ?> -   -
이미지(소) - - 삭제"; - echo ""; - } - ?> -   -
이미지(대) size=40> 삭제"; - echo "
출력스킨 @@ -278,11 +277,11 @@ include_once(G4_ADMIN_PATH."/admin.head.php");
상단 내용

하단 내용

@@ -315,11 +314,8 @@ include_once(G4_ADMIN_PATH."/admin.head.php"); - - \ No newline at end of file From 1ce229537fadf9ab6fdb97eea8e953f14a59d88f Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 29 Jan 2013 15:34:38 +0900 Subject: [PATCH 11/14] =?UTF-8?q?it=5Fname=5Ficon=20=ED=95=A8=EC=88=98=20G?= =?UTF-8?q?4=20=EA=B2=BD=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/shop.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/shop.lib.php b/lib/shop.lib.php index e06d6785c..e0dad79a5 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -737,16 +737,16 @@ function it_name_icon($it, $it_name="", $url=1) if ($url) $str = "$str"; - if ($it[it_type1]) $str .= " "; - if ($it[it_type2]) $str .= " "; - if ($it[it_type3]) $str .= " "; - if ($it[it_type4]) $str .= " "; - if ($it[it_type5]) $str .= " "; + if ($it[it_type1]) $str .= " "; + if ($it[it_type2]) $str .= " "; + if ($it[it_type3]) $str .= " "; + if ($it[it_type4]) $str .= " "; + if ($it[it_type5]) $str .= " "; // 품절 $stock = get_it_stock_qty($it[it_id]); if ($stock <= 0) - $str .= " "; + $str .= " "; return $str; } From 97a1789d39abc7ddd2bdf455f885d0e4f24791ba Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 29 Jan 2013 15:35:03 +0900 Subject: [PATCH 12/14] =?UTF-8?q?thumbnail=20=EB=9D=BC=EC=9D=B4=EB=B8=8C?= =?UTF-8?q?=EB=9F=AC=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/shop/list.php b/shop/list.php index 4caf2b407..a6125264b 100644 --- a/shop/list.php +++ b/shop/list.php @@ -1,5 +1,6 @@ Date: Tue, 29 Jan 2013 15:39:07 +0900 Subject: [PATCH 13/14] =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=8D=B8?= =?UTF-8?q?=EB=84=A4=EC=9D=BC=20=EC=83=9D=EC=84=B1=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/list.skin.10.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/shop/list.skin.10.php b/shop/list.skin.10.php index c71cff164..7f6f2dbb3 100644 --- a/shop/list.skin.10.php +++ b/shop/list.skin.10.php @@ -14,11 +14,22 @@ 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; + } + } + $it_img = it_img_thumb($filename, G4_DATA_PATH.'/item/'.$row['it_id'], $img_width, $img_height); + echo "
- + "; if ($row[it_cust_amount] && !$row[it_gallery]) From 3d3359eafc1e1f7989638f7abf78a9bde31684a4 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Tue, 29 Jan 2013 16:41:45 +0900 Subject: [PATCH 14/14] =?UTF-8?q?showSideView,=20g4=5Fadmin=5Furl=20?= =?UTF-8?q?=EC=9D=B4=20=EC=A0=95=EC=9D=98=EB=90=98=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EC=95=98=EB=8B=A4=EB=8A=94=20=EC=98=A4=EB=A5=98=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/board.php | 2 +- head.sub.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bbs/board.php b/bbs/board.php index aca7542b9..e4b883ba6 100644 --- a/bbs/board.php +++ b/bbs/board.php @@ -180,7 +180,7 @@ if ($member['mb_id'] && ($is_admin == 'super' || $group['gr_admin'] == $member[' include_once('./board_head.php'); -echo ""; +echo ''; // 게시물 아이디가 있다면 게시물 보기를 INCLUDE if (isset($wr_id) && $wr_id) { diff --git a/head.sub.php b/head.sub.php index e60aa5779..975ed12bc 100644 --- a/head.sub.php +++ b/head.sub.php @@ -56,7 +56,11 @@ var g4_charset = ""; var g4_cookie_domain = ""; var g4_is_gecko = navigator.userAgent.toLowerCase().indexOf("gecko") != -1; var g4_is_ie = navigator.userAgent.toLowerCase().indexOf("msie") != -1; - +
".get_it_image($row[it_id]."_s", $img_width , $img_height, $row[it_id])."
".get_it_image($row['it_id'].'/'.$it_img, $img_width , $img_height, $row[it_id])."
".it_name_icon($row)."