From 48489cf7440fbd3b68d4859b18ae77967ac9a37c Mon Sep 17 00:00:00 2001 From: gnuboard Date: Thu, 25 Jul 2013 15:53:12 +0900 Subject: [PATCH 01/11] =?UTF-8?q?=EC=BF=BC=EB=A6=AC=EB=AC=B8=EC=9D=84=20?= =?UTF-8?q?=ED=95=9C=EC=A4=84=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/wishlist.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/shop/wishlist.php b/shop/wishlist.php index 658e5529b..4add815f6 100644 --- a/shop/wishlist.php +++ b/shop/wishlist.php @@ -33,10 +33,8 @@ include_once('./_head.php'); Date: Thu, 25 Jul 2013 16:02:11 +0900 Subject: [PATCH 02/11] =?UTF-8?q?ct=5Fnotax=20=EC=83=9D=EC=84=B1=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=A3=BC=EC=84=9D=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/cartupdate.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shop/cartupdate.php b/shop/cartupdate.php index 78145a350..7f1746f97 100644 --- a/shop/cartupdate.php +++ b/shop/cartupdate.php @@ -1,6 +1,8 @@ Date: Thu, 25 Jul 2013 16:12:29 +0900 Subject: [PATCH 03/11] =?UTF-8?q?=EC=83=81,=ED=95=98=EB=8B=A8=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EA=B8=B0=EB=8A=A5=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/itemform.php | 46 ------------------------------- adm/shop_admin/itemformupdate.php | 7 ----- shop/item.php | 21 ++------------ 3 files changed, 3 insertions(+), 71 deletions(-) diff --git a/adm/shop_admin/itemform.php b/adm/shop_admin/itemform.php index 68859654b..9cd4bbc96 100644 --- a/adm/shop_admin/itemform.php +++ b/adm/shop_admin/itemform.php @@ -1281,52 +1281,6 @@ $(function(){ - - 상단이미지 - - - - - - - - - - - - - - 하단이미지 - - - - - - - - - - - - 상품상단내용 diff --git a/adm/shop_admin/itemformupdate.php b/adm/shop_admin/itemformupdate.php index 576b74436..459f286c8 100644 --- a/adm/shop_admin/itemformupdate.php +++ b/adm/shop_admin/itemformupdate.php @@ -13,9 +13,6 @@ else if ($w == 'd') @mkdir(G4_DATA_PATH."/item", 0707); @chmod(G4_DATA_PATH."/item", 0707); -if ($it_himg_del) @unlink(G4_DATA_PATH."/item/{$it_id}_h"); -if ($it_timg_del) @unlink(G4_DATA_PATH."/item/{$it_id}_t"); - // 파일정보 if($w == "u") { $sql = " select it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10 @@ -181,10 +178,6 @@ if ($_FILES['it_img10']['name']) { $it_img10 = it_img_upload($_FILES['it_img10']['tmp_name'], $_FILES['it_img10']['name'], $it_img_dir.'/'.$it_id); } -// 상, 하단 이미지 업로드 -if ($_FILES['it_himg']['name']) upload_file($_FILES['it_himg']['tmp_name'], $it_id . "_h", G4_DATA_PATH.'/item'); -if ($_FILES['it_timg']['name']) upload_file($_FILES['it_timg']['tmp_name'], $it_id . "_t", G4_DATA_PATH.'/item'); - if ($w == "" || $w == "u") { // 다음 입력을 위해서 옵션값을 쿠키로 한달동안 저장함 diff --git a/shop/item.php b/shop/item.php index 666ef92a9..b208aecec 100644 --- a/shop/item.php +++ b/shop/item.php @@ -8,14 +8,6 @@ if (G4_IS_MOBILE) { include_once(G4_LIB_PATH.'/iteminfo.lib.php'); -// 불법접속을 할 수 없도록 세션에 아무값이나 저장하여 hidden 으로 넘겨서 다음 페이지에서 비교함 -$token = md5(uniqid(rand(), true)); -set_session("ss_token", $token); - -$rand = rand(4, 6); -$norobot_key = substr($token, 0, $rand); -set_session('ss_norobot_key', $norobot_key); - // 분류사용, 상품사용하는 상품의 정보를 얻음 $sql = " select a.*, b.ca_name, b.ca_use from {$g4['shop_item_table']} a, {$g4['shop_category_table']} b where a.it_id = '$it_id' and a.ca_id = b.ca_id "; $it = sql_fetch($sql); @@ -23,7 +15,7 @@ if (!$it['it_id']) alert('자료가 없습니다.'); if (!($it['ca_use'] && $it['it_use'])) { if (!$is_admin) - alert('판매가능한 상품이 아닙니다.'); + alert('현재 판매가능한 상품이 아닙니다.'); } // 분류 테이블에서 분류 상단, 하단 코드를 얻음 @@ -90,16 +82,13 @@ include G4_SHOP_PATH.'/navigation1.inc.php'; // 이 분류에 속한 하위분류 출력 include G4_SHOP_PATH.'/listcategory.inc.php'; -if ($is_admin) +if ($is_admin) { echo '
상품 관리
'; +} ?> '; - // 상단 HTML echo '
'.stripslashes($it['it_head_html']).'
'; @@ -799,10 +788,6 @@ else '; ?> From 896b96d6d15859f8e62ed6042eaac54fb6638cde Mon Sep 17 00:00:00 2001 From: whitedot Date: Fri, 26 Jul 2013 10:20:42 +0900 Subject: [PATCH 04/11] =?UTF-8?q?=EC=87=BC=ED=95=91=EB=AA=B0=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=EC=9E=90:=20=EA=B4=80=EB=A0=A8=EC=83=81=ED=92=88,=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=EC=95=88=EB=82=B4=EB=A9=94=EC=84=B8=EC=A7=80=20?= =?UTF-8?q?=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/admin.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/admin.css b/css/admin.css index 01a43fcab..a935c0369 100644 --- a/css/admin.css +++ b/css/admin.css @@ -268,7 +268,7 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right} .srel li {position:relative;border-bottom:1px solid #e9e9e9} .srel .srel_list {height:auto !important;height:200px;max-height:200px;border:1px solid #ced9de;background:#f6f6f6;overflow-y:scroll} .srel .srel_sel {border:1px solid #ced9de;background:#fcfff2} -.srel .srel_sel p {text-align:center} +.srel .srel_list p, .srel .srel_sel p {text-align:center} .srel .compare_left ul {margin:0;list-style:none} .srel button {position:absolute;top:12px;right:0} .srel .srel_noneimg li {padding:7px 0} From 0e0ee508892c0eb69330d0b00f0a11788afec507 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Fri, 26 Jul 2013 10:27:51 +0900 Subject: [PATCH 05/11] =?UTF-8?q?=EB=B6=84=EB=A5=98=EC=83=9D=EC=84=B1?= =?UTF-8?q?=EC=8B=9C=20=EC=9D=B4=EB=AF=B8=EC=A7=80=ED=8F=AD,=20=EB=86=92?= =?UTF-8?q?=EC=9D=B4=EB=A5=BC=20=EC=87=BC=ED=95=91=EB=AA=B0=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20>=20=EA=B8=B0=ED=83=80=EC=84=A4=EC=A0=95=EC=9D=98?= =?UTF-8?q?=20=EC=9E=91=EC=9D=80=EC=9D=B4=EB=AF=B8=EC=A7=80=20=ED=8F=AD,?= =?UTF-8?q?=20=EB=86=92=EC=9D=B4=EB=A5=BC=20=EA=B8=B0=EB=B3=B8=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/categoryform.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/adm/shop_admin/categoryform.php b/adm/shop_admin/categoryform.php index 0dc4cfbf3..8ffc9a3b6 100644 --- a/adm/shop_admin/categoryform.php +++ b/adm/shop_admin/categoryform.php @@ -52,10 +52,10 @@ if ($w == "") $html_title = "1단계분류추가"; $ca['ca_use'] = 1; $ca['ca_explan_html'] = 1; - $ca['ca_img_width'] = $default['de_mimg_width']; - $ca['ca_img_height'] = $default['de_mimg_height']; - $ca['ca_mobile_img_width'] = $default['de_mimg_width']; - $ca['ca_mobile_img_height'] = $default['de_mimg_height']; + $ca['ca_img_width'] = $default['de_simg_width']; + $ca['ca_img_height'] = $default['de_simg_height']; + $ca['ca_mobile_img_width'] = $default['de_simg_width']; + $ca['ca_mobile_img_height'] = $default['de_simg_height']; $ca['ca_list_mod'] = 3; $ca['ca_list_row'] = 5; $ca['ca_mobile_list_row'] = 3; @@ -195,14 +195,14 @@ $pg_anchor .= ''; - + 픽셀 - + 픽셀 @@ -223,14 +223,14 @@ $pg_anchor .= ''; - + 픽셀 - + 픽셀 From ae652609e04a7fb9e73894804021762ac8de357b Mon Sep 17 00:00:00 2001 From: gnuboard Date: Fri, 26 Jul 2013 10:30:30 +0900 Subject: [PATCH 06/11] =?UTF-8?q?=EC=87=BC=ED=95=91=EB=AA=B0=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20>=20=EA=B8=B0=ED=83=80=EC=84=A4=EC=A0=95=20>=20?= =?UTF-8?q?=EC=9E=91=EC=9D=80=EC=9D=B4=EB=AF=B8=EC=A7=80=EC=9D=98=20?= =?UTF-8?q?=EC=84=A4=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/configform.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adm/shop_admin/configform.php b/adm/shop_admin/configform.php index 8affc2448..fd82eeee4 100644 --- a/adm/shop_admin/configform.php +++ b/adm/shop_admin/configform.php @@ -695,7 +695,7 @@ $pg_anchor = '
    이미지(소) - + 픽셀 / @@ -706,7 +706,7 @@ $pg_anchor = '
      이미지(중) - + 픽셀 / From ac653bae677dc63cd946a94eeec3d2664bf8aec0 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Fri, 26 Jul 2013 10:30:56 +0900 Subject: [PATCH 07/11] =?UTF-8?q?item=5Flist=20class=20=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 | 234 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 234 insertions(+) diff --git a/lib/shop.lib.php b/lib/shop.lib.php index 11c38c46b..d3dd14a87 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -35,6 +35,240 @@ echo $disp->run(); display_category 나 display_event 로 사용하기 위해서는 $type 값만 넘기지 않으면 됩니다. */ +class item_list +{ + // 상품유형 : 기본적으로 1~5 까지 사용할수 있으며 0 으로 설정하는 경우 상품유형별로 노출하지 않습니다. + // 분류나 이벤트로 노출하는 경우 상품유형을 0 으로 설정하면 됩니다. + protected $type; + + protected $list_skin; + protected $list_mod; + protected $list_row; + protected $img_width; + protected $img_height; + + // 상품상세보기 경로 + protected $href = ""; + + // select 에 사용되는 필드 + protected $fields = "*"; + + // 분류코드로만 사용하는 경우 상품유형($type)을 0 으로 설정하면 됩니다. + protected $ca_id = ""; + protected $ca_id2 = ""; + protected $ca_id3 = ""; + + // 노출순서 + protected $order_by = "it_order, it_id desc"; + + // 상품의 이벤트번호를 저장합니다. + protected $event = ""; + + // 스킨의 기본 css 를 다른것으로 사용하고자 할 경우에 사용합니다. + protected $css = ""; + + // 상품의 사용여부를 따져 노출합니다. 0 인 경우 모든 상품을 노출합니다. + protected $use = 1; + + // 모바일에서 노출하고자 할 경우에 true 로 설정합니다. + protected $is_mobile = false; + + // 기본으로 보여지는 필드들 + protected $view_it_id = false; // 상품코드 + protected $view_it_img = true; // 상품이미지 + protected $view_it_name = true; // 상품명 + protected $view_it_price = true; // 판매가격 + protected $view_it_cust_price = false; // 소비자가 + protected $view_it_icon = false; // 아이콘 + protected $view_sns = false; // SNS + + protected $count = 1; // 몇번째 class 호출인지를 저장합니다. + + // $type : 상품유형 (기본으로 1~5까지 사용) + // $list_skin : 상품리스트를 노출할 스킨을 설정합니다. 스킨위치는 skin/shop/쇼핑몰설정스킨/type??.skin.php + // $list_mod : 1줄에 몇개의 상품을 노출할지를 설정합니다. + // $list_row : 상품을 몇줄에 노출할지를 설정합니다. + // $img_width : 상품이미지의 폭을 설정합니다. + // $img_height : 상품이미지의 높이을 설정합니다. 0 으로 설정하는 경우 썸네일 이미지의 높이는 폭에 비례하여 생성합니다. + //function __construct($type=0, $list_skin='', $list_mod='', $list_row='', $img_width='', $img_height=0, $ca_id='') { + function __construct($list_skin='', $list_mod='', $list_row='', $img_width='', $img_height=0) { + $this->list_skin = $list_skin; + $this->list_mod = $list_mod; + $this->list_row = $list_row; + $this->img_width = $img_width; + $this->img_height = $img_height; + $this->set_href(G4_SHOP_URL.'/item.php?it_id='); + $this->count++; + } + + function set_type($type) { + $this->type = $type; + if ($type) { + $this->set_list_skin($list_skin); + $this->set_list_mod($list_mod); + $this->set_list_row($list_row); + $this->set_img_size($img_width); + } + } + + // 분류코드로 검색을 하고자 하는 경우 아래와 같이 인수를 넘겨줍니다. + // 1단계 분류는 (분류코드, 1) + // 2단계 분류는 (분류코드, 2) + // 3단계 분류는 (분류코드, 3) + function set_ca_id($ca_id, $level=1) { + if ($level == 2) { + $this->ca_id2 = $ca_id; + } else if ($level == 3) { + $this->ca_id3 = $ca_id; + } else { + $this->ca_id = $ca_id; + } + } + + // 이벤트코드를 인수로 넘기게 되면 해당 이벤트에 속한 상품을 노출합니다. + function set_event($ev_id) { + $this->event = $ev_id; + } + + // 리스트 스킨을 바꾸고자 하는 경우에 사용합니다. + // 리스트 스킨의 위치는 skin/shop/쇼핑몰설정스킨/type??.skin.php 입니다. + // 특별히 설정하지 않는 경우 상품유형을 사용하는 경우는 쇼핑몰설정 값을 그대로 따릅니다. + function set_list_skin($list_skin) { + global $default; + $this->list_skin = $list_skin ? $list_skin : $default['de_type'.$this->type.'_list_skin']; + } + + // 1줄에 몇개를 노출할지를 사용한다. + // 특별히 설정하지 않는 경우 상품유형을 사용하는 경우는 쇼핑몰설정 값을 그대로 따릅니다. + function set_list_mod($list_mod) { + global $default; + $this->list_mod = $list_mod ? $list_mod : $default['de_type'.$this->type.'_list_mod']; + } + + // 몇줄을 노출할지를 사용한다. + // 특별히 설정하지 않는 경우 상품유형을 사용하는 경우는 쇼핑몰설정 값을 그대로 따릅니다. + function set_list_row($list_row) { + global $default; + $this->list_row = $list_row ? $list_row : $default['de_type'.$this->type.'_list_row']; + } + + // 노출이미지(썸네일생성)의 폭, 높이를 설정합니다. 높이를 0 으로 설정하는 경우 쎰네일 비율에 따릅니다. + // 특별히 설정하지 않는 경우 상품유형을 사용하는 경우는 쇼핑몰설정 값을 그대로 따릅니다. + function set_img_size($img_width, $img_height=0) { + global $default; + $this->img_width = $img_width ? $img_width : $default['de_type'.$this->type.'_img_width']; + $this->img_height = $img_height ? $img_height : $default['de_type'.$this->type.'_img_height']; + } + + // 특정 필드만 select 하는 경우에는 필드명을 , 로 구분하여 "field1, field2, field3, ... fieldn" 으로 인수를 넘겨줍니다. + function set_fields($str) { + $this->fields = $str; + } + + // 특정 필드로 정렬을 하는 경우 필드와 정렬순서를 , 로 구분하여 "field1 desc, field2 asc, ... fieldn desc " 으로 인수를 넘겨줍니다. + function set_order_by($str) { + $this->order_by = $str; + } + + // 사용하는 상품외에 모든 상품을 노출하려면 0 을 인수로 넘겨줍니다. + function set_use($use) { + $this->use = $use; + } + + // 모바일로 사용하려는 경우 true 를 인수로 넘겨줍니다. + function set_mobile($mobile=true) { + $this->is_mobile = $mobile; + } + + // 스킨에서 특정 필드를 노출하거나 하지 않게 할수 있습니다. + // 가령 소비자가는 처음에 노출되지 않도록 설정되어 있짐나 노출을 하려면 + // ("it_cust_price", true) 와 같이 인수를 넘겨줍니다. + // 이때 인수로 넘겨주는 값은 스킨에 정의된 필드만 가능하다는 것입니다. + function set_view($field, $view=true) { + $this->{"view_".$field} = $view; + } + + // anchor 태그에 하이퍼링크를 다른 주소로 걸거나 아예 링크를 걸지 않을 수 있습니다. + // 인수를 "" 공백으로 넘기면 링크를 걸지 않습니다. + function set_href($href) { + $this->href = $href; + } + + // ul 태그의 css 를 교체할수 있다. "sct sct_abc" 를 인수로 넘기게 되면 + // 기존의 ul 태그에 걸린 css 는 무시되며 인수로 넘긴 css 가 사용됩니다. + function set_css($css) { + $this->css = $css; + } + + // class 에 설정된 값으로 최종 실행합니다. + function run() { + + global $g4, $config, $member, $default, $shop_skin_path, $shop_skin_url; + + $where = array(); + if ($this->use) { + $where[] = " it_use = '1' "; + } + + if ($this->type) { + $where[] = " it_type{$this->type} = '1' "; + } + + if ($this->ca_id || $this->ca_id2 || $this->ca_id3) { + $where_ca_id = array(); + if ($this->ca_id) { + $where_ca_id[] = " ca_id like '{$this->ca_id}%' "; + } + if ($this->ca_id2) { + $where_ca_id[] = " ca_id2 like '{$this->ca_id2}%' "; + } + if ($this->ca_id3) { + $where_ca_id[] = " ca_id3 like '{$this->ca_id3}%' "; + } + $where[] = implode(" or ", $where_ca_id); + } + + if ($this->order_by) { + $sql_order = " order by {$this->order_by} "; + } + + if ($this->event) { + //$sql_common = " select {$this->fields} from `{$g4['shop_event_item_table']}` a left join `{$g4['shop_item_table']}` b on (a.it_id = b.it_id and a.ev_id = '{$this->event}') "; + $sql_common = " select {$this->fields} from `{$g4['shop_event_item_table']}` a left join `{$g4['shop_item_table']}` b on (a.it_id = b.it_id) "; + $where[] = " a.ev_id = '{$this->event}' "; + } else { + $sql_common = " select {$this->fields} from `{$g4['shop_item_table']}` "; + } + $sql_where = " where " . implode(" and ", $where); + + $sql = $sql_common . $sql_where . " limit " . ($this->list_mod * $this->list_row); + $result = sql_query($sql); + //echo (int)mysql_num_rows($result); + + $sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id']; + $sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']); + + if ($this->is_mobile) { + $file = G4_MSHOP_PATH."/{$this->list_skin}"; + } else { + $file = "{$shop_skin_path}/{$this->list_skin}"; + } + if ($this->list_skin == "") { + return $this->count."번 item_list() 의 스킨파일이 지정되지 않았습니다."; + } else if (!file_exists($file)) { + return "{$shop_skin_url}/{$this->list_skin} 파일을 찾을 수 없습니다."; + } else { + ob_start(); + $list_mod = $this->list_mod; + include($file); + $content = ob_get_contents(); + ob_end_clean(); + return $content; + } + } +} + + class display_item { // 상품유형 : 기본적으로 1~5 까지 사용할수 있으며 0 으로 설정하는 경우 상품유형별로 노출하지 않습니다. From 0e95f53371e438a52e1684e58ea60991f9ba456f Mon Sep 17 00:00:00 2001 From: gnuboard Date: Fri, 26 Jul 2013 10:32:25 +0900 Subject: [PATCH 08/11] =?UTF-8?q?=EC=83=81=ED=92=88=EC=84=A4=EB=AA=85?= =?UTF-8?q?=EC=9D=98=20=EC=9D=B4=EB=AF=B8=EC=A7=80=EB=8A=94=20320=20?= =?UTF-8?q?=EC=82=AC=EC=9D=B4=EC=A6=88=EC=97=90=EC=84=9C=20=EA=B8=B0?= =?UTF-8?q?=ED=83=80=EC=84=A4=EC=A0=95=EC=9D=98=20=EC=A4=91=EA=B0=84?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EA=B0=92=EC=9C=BC=EB=A1=9C=20=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shop/item.php b/shop/item.php index b208aecec..e1ff0ef42 100644 --- a/shop/item.php +++ b/shop/item.php @@ -179,7 +179,7 @@ else if(!$it['it_img'.$i]) continue; - $img = get_it_thumbnail($it['it_img'.$i], 320, 320); + $img = get_it_thumbnail($it['it_img'.$i], $default['de_mimg_width'], $default['de_mimg_height']); if($img) { // 썸네일 From a52322e3173056528b2ffacf6bbeba5de9ad4383 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Fri, 26 Jul 2013 10:33:06 +0900 Subject: [PATCH 09/11] =?UTF-8?q?=EC=BF=BC=EB=A6=AC=EB=AC=B8=20=ED=95=9C?= =?UTF-8?q?=EC=A4=84=EB=A1=9C=20=EB=82=98=EC=98=A4=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=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 --- shop/list.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/shop/list.php b/shop/list.php index 424073478..9c1b0aa87 100644 --- a/shop/list.php +++ b/shop/list.php @@ -75,11 +75,7 @@ if ($is_admin) // 하위분류 포함 // 판매가능한 상품만 - $sql_common = " from {$g4['shop_item_table']} - where (ca_id like '{$ca_id}%' - or ca_id2 like '{$ca_id}%' - or ca_id3 like '{$ca_id}%') - and it_use = '1' "; + $sql_common = " from {$g4['shop_item_table']} where (ca_id like '{$ca_id}%' or ca_id2 like '{$ca_id}%' or ca_id3 like '{$ca_id}%') and it_use = '1' "; $error = '

      등록된 상품이 없습니다.

      '; @@ -88,6 +84,7 @@ if ($is_admin) if (file_exists($list_file)) { //display_type(2, "maintype10.inc.php", 4, 2, 100, 100, $ca[ca_id]); + /* $list_mod = $ca['ca_list_mod']; $list_row = $ca['ca_list_row']; $img_width = $ca['ca_img_width']; @@ -99,9 +96,13 @@ if ($is_admin) $sql = $sql_list1 . $sql_common . $sql_list2 . " limit $from_record, $items "; $result = sql_query($sql); - echo '
      '; - include $list_file; - echo '
      '; + echo '
      '; + include $list_file; + echo '
      '; + */ + + $list = new item_list(0, "type10.skin.php", $ca['ca_list_mod'], $ca['ca_list_row'], $ca['ca_img_width'], $ca['ca_img_height'], $ca_id); + echo $list->run(); } else From 10a6777302ecc666fec14baed778e146c826a110 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Fri, 26 Jul 2013 10:36:31 +0900 Subject: [PATCH 10/11] =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EA=B3=A0?= =?UTF-8?q?=EC=A0=95=EA=B0=92=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/default_shop.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/css/default_shop.css b/css/default_shop.css index b0f17802e..735650cbe 100644 --- a/css/default_shop.css +++ b/css/default_shop.css @@ -375,16 +375,16 @@ td.empty_table {padding:85px 0;text-align:center} #sit_ov_wrap:after {display:block;visibility:hidden;clear:both;content:""} /* 상품 상세보기 - 이미지 미리보기 */ -#sit_pvi {float:left;padding:15px;width:320px} +#sit_pvi {float:left;padding:15px;} #sit_pvi_big {margin:0 0 10px} #sit_pvi_big a {display:none} #sit_pvi_big a.visible {display:block} -#sit_pvi_big img {width:320px;height:320px} +#sit_pvi_big img {} #sit_pvi_thumb {margin:0;padding:0;list-style:none;zoom:1} #sit_pvi_thumb:after {display:block;visibility:hidden;clear:both;content:""} #sit_pvi_thumb li {float:left;margin:0 5px 5px 0} #sit_pvi_thumb .li_last {margin:0 !important} -#sit_pvi_thumb img {width:60px;height:60px} +#sit_pvi_thumb img {} #sit_pvi_nw h1 {position:absolute;font-size:0;line-height:0;overflow:hidden} #sit_pvi_nwbig {padding:10px 0;text-align:center} From 1d2c04146f2fd5f8d3f0feea60b436fcd8498e87 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Fri, 26 Jul 2013 16:48:09 +0900 Subject: [PATCH 11/11] =?UTF-8?q?class=20item=5Flist=20=EB=AA=A8=EB=B0=94?= =?UTF-8?q?=EC=9D=BC=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/categoryform.php | 2 +- adm/shop_admin/configform.php | 82 ++-- extend/shop.extend.php | 19 +- lib/shop.lib.php | 399 +++++------------- mobile/shop/index.php | 60 ++- mobile/shop/item.php | 20 +- .../skin/shop/basic/list.10.skin.php | 2 +- shop/index.php | 25 +- shop/item.php | 12 +- shop/list.php | 18 +- skin/shop/basic/list.10.skin.php | 75 ++++ .../{type11.skin.php => list.11.skin.php} | 2 +- .../{type12.skin.php => list.12.skin.php} | 3 +- .../{type13.skin.php => list.13.skin.php} | 4 +- 14 files changed, 328 insertions(+), 395 deletions(-) rename skin/shop/basic/type10.skin.php => mobile/skin/shop/basic/list.10.skin.php (93%) create mode 100644 skin/shop/basic/list.10.skin.php rename skin/shop/basic/{type11.skin.php => list.11.skin.php} (93%) rename skin/shop/basic/{type12.skin.php => list.12.skin.php} (92%) rename skin/shop/basic/{type13.skin.php => list.13.skin.php} (93%) diff --git a/adm/shop_admin/categoryform.php b/adm/shop_admin/categoryform.php index 8ffc9a3b6..ca9663cee 100644 --- a/adm/shop_admin/categoryform.php +++ b/adm/shop_admin/categoryform.php @@ -179,7 +179,7 @@ $pg_anchor .= '
    '; diff --git a/adm/shop_admin/configform.php b/adm/shop_admin/configform.php index fd82eeee4..9180c44ab 100644 --- a/adm/shop_admin/configform.php +++ b/adm/shop_admin/configform.php @@ -155,9 +155,7 @@ $pg_anchor = '
      - - - + @@ -212,7 +210,7 @@ $pg_anchor = '
        > @@ -231,7 +229,7 @@ $pg_anchor = '
          > @@ -250,7 +248,7 @@ $pg_anchor = '
            > @@ -269,7 +267,7 @@ $pg_anchor = '
              > @@ -288,7 +286,7 @@ $pg_anchor = '
                > @@ -317,33 +315,17 @@ $pg_anchor = '
      - - - - + + + +
      최신상품출력 - - > - - - - - - - - -
      히트상품출력 - > - + + > + - - + + @@ -353,20 +335,36 @@ $pg_anchor = '
      추천상품출력 - - > - + > + - - + +
      최신상품출력 + + > + + + + + + + + +
      인기상품출력 @@ -374,10 +372,10 @@ $pg_anchor = '
        > - - + + @@ -391,10 +389,10 @@ $pg_anchor = '
          > - - + + diff --git a/extend/shop.extend.php b/extend/shop.extend.php index 55f90f461..ead55b255 100644 --- a/extend/shop.extend.php +++ b/extend/shop.extend.php @@ -3,9 +3,6 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined('G4_USE_SHOP') || !G4_USE_SHOP) return; -include_once(G4_LIB_PATH.'/shop.lib.php'); -include_once(G4_LIB_PATH.'/thumbnail.lib.php'); - //------------------------------------------------------------------------------ // 쇼핑몰 상수 모음 시작 //------------------------------------------------------------------------------ @@ -53,18 +50,20 @@ define(_MISU_QUERY_, " //============================================================================== // 쇼핑몰 필수 실행코드 모음 시작 //============================================================================== + // 쇼핑몰 설정값 배열변수 $default = sql_fetch(" select * from {$g4['shop_default_table']} "); -if (G4_IS_MOBILE) { - $shop_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/shop/'.$default['de_shop_mobile_skin']; - $shop_skin_url = G4_MOBILE_URL .'/'.G4_SKIN_DIR.'/shop/'.$default['de_shop_mobile_skin']; -} else { - $shop_skin_path = G4_PATH.'/'.G4_SKIN_DIR.'/shop/'.$default['de_shop_mobile_skin']; - $shop_skin_url = G4_URL .'/'.G4_SKIN_DIR.'/shop/'.$default['de_shop_mobile_skin']; -} +define('G4_SHOP_SKIN_PATH', G4_PATH.'/'.G4_SKIN_DIR.'/shop/'.$default['de_shop_skin']); +define('G4_SHOP_SKIN_URL', G4_URL .'/'.G4_SKIN_DIR.'/shop/'.$default['de_shop_skin']); +define('G4_MSHOP_SKIN_PATH', G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/shop/'.$default['de_shop_mobile_skin']); +define('G4_MSHOP_SKIN_URL', G4_MOBILE_URL .'/'.G4_SKIN_DIR.'/shop/'.$default['de_shop_mobile_skin']); //============================================================================== // 쇼핑몰 필수 실행코드 모음 끝 //============================================================================== + + +include_once(G4_LIB_PATH.'/shop.lib.php'); +include_once(G4_LIB_PATH.'/thumbnail.lib.php'); ?> \ No newline at end of file diff --git a/lib/shop.lib.php b/lib/shop.lib.php index d3dd14a87..a415058ed 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -14,7 +14,7 @@ $disp = new display_item(1); // 사용할 스킨을 바꿉니다. $disp->set_list_skin("type_user.skin.php"); // 1단계분류를 20으로 시작되는 분류로 지정합니다. -$disp->set_ca_id("20", 1); +$disp->set_category("20", 1); echo $disp->run(); @@ -82,7 +82,21 @@ class item_list protected $view_it_icon = false; // 아이콘 protected $view_sns = false; // SNS - protected $count = 1; // 몇번째 class 호출인지를 저장합니다. + // 몇번째 class 호출인지를 저장합니다. + protected $count = 0; + + // true 인 경우 페이지를 구한다. + protected $is_page = false; + + // 페이지 표시를 위하여 총 상품 갯수를 구합니다. + public $total_count = 0; + + // sql limit 의 시작 레코드 + protected $from_record = 0; + + // 외부에서 쿼리문을 넘겨줄 경우에 담아두는 변수 + protected $query = ""; + // $type : 상품유형 (기본으로 1~5까지 사용) // $list_skin : 상품리스트를 노출할 스킨을 설정합니다. 스킨위치는 skin/shop/쇼핑몰설정스킨/type??.skin.php @@ -115,7 +129,7 @@ class item_list // 1단계 분류는 (분류코드, 1) // 2단계 분류는 (분류코드, 2) // 3단계 분류는 (분류코드, 3) - function set_ca_id($ca_id, $level=1) { + function set_category($ca_id, $level=1) { if ($level == 2) { $this->ca_id2 = $ca_id; } else if ($level == 3) { @@ -135,29 +149,48 @@ class item_list // 특별히 설정하지 않는 경우 상품유형을 사용하는 경우는 쇼핑몰설정 값을 그대로 따릅니다. function set_list_skin($list_skin) { global $default; - $this->list_skin = $list_skin ? $list_skin : $default['de_type'.$this->type.'_list_skin']; + if ($this->is_mobile) { + $this->list_skin = $list_skin ? $list_skin : $default['de_mobile_type'.$this->type.'_list_skin']; + } else { + $this->list_skin = $list_skin ? $list_skin : $default['de_type'.$this->type.'_list_skin']; + } } // 1줄에 몇개를 노출할지를 사용한다. // 특별히 설정하지 않는 경우 상품유형을 사용하는 경우는 쇼핑몰설정 값을 그대로 따릅니다. function set_list_mod($list_mod) { global $default; - $this->list_mod = $list_mod ? $list_mod : $default['de_type'.$this->type.'_list_mod']; + if ($this->is_mobile) { + $this->list_mod = $list_mod ? $list_mod : $default['de_mobile_type'.$this->type.'_list_mod']; + } else { + $this->list_mod = $list_mod ? $list_mod : $default['de_type'.$this->type.'_list_mod']; + } } // 몇줄을 노출할지를 사용한다. // 특별히 설정하지 않는 경우 상품유형을 사용하는 경우는 쇼핑몰설정 값을 그대로 따릅니다. function set_list_row($list_row) { global $default; - $this->list_row = $list_row ? $list_row : $default['de_type'.$this->type.'_list_row']; + if ($this->is_mobile) { + $this->list_row = $list_row ? $list_row : $default['de_mobile_type'.$this->type.'_list_row']; + } else { + $this->list_row = $list_row ? $list_row : $default['de_type'.$this->type.'_list_row']; + } + if (!$this->list_row) + $this->list_row = 1; } // 노출이미지(썸네일생성)의 폭, 높이를 설정합니다. 높이를 0 으로 설정하는 경우 쎰네일 비율에 따릅니다. // 특별히 설정하지 않는 경우 상품유형을 사용하는 경우는 쇼핑몰설정 값을 그대로 따릅니다. function set_img_size($img_width, $img_height=0) { global $default; - $this->img_width = $img_width ? $img_width : $default['de_type'.$this->type.'_img_width']; - $this->img_height = $img_height ? $img_height : $default['de_type'.$this->type.'_img_height']; + if ($this->is_mobile) { + $this->img_width = $img_width ? $img_width : $default['de_mobile_type'.$this->type.'_img_width']; + $this->img_height = $img_height ? $img_height : $default['de_mobile_type'.$this->type.'_img_height']; + } else { + $this->img_width = $img_width ? $img_width : $default['de_type'.$this->type.'_img_width']; + $this->img_height = $img_height ? $img_height : $default['de_type'.$this->type.'_img_height']; + } } // 특정 필드만 select 하는 경우에는 필드명을 , 로 구분하여 "field1, field2, field3, ... fieldn" 으로 인수를 넘겨줍니다. @@ -200,294 +233,96 @@ class item_list $this->css = $css; } + // 페이지를 노출하기 위해 true 로 설정할때 사용합니다. + function set_is_page($is_page) { + $this->is_page = $is_page; + } + + // select ... limit 의 시작값 + function set_from_record($from_record) { + $this->from_record = $from_record; + } + + // 외부에서 쿼리문을 넘겨줄 경우에 담아둡니다. + function set_query($query) { + $this->query = $query; + } + // class 에 설정된 값으로 최종 실행합니다. function run() { - global $g4, $config, $member, $default, $shop_skin_path, $shop_skin_url; + global $g4, $config, $member, $default; - $where = array(); - if ($this->use) { - $where[] = " it_use = '1' "; - } - - if ($this->type) { - $where[] = " it_type{$this->type} = '1' "; - } + if ($this->query) { + + $sql = $this->query; + $result = sql_query($sql); + $this->total_count = @mysql_num_rows($result); - if ($this->ca_id || $this->ca_id2 || $this->ca_id3) { - $where_ca_id = array(); - if ($this->ca_id) { - $where_ca_id[] = " ca_id like '{$this->ca_id}%' "; - } - if ($this->ca_id2) { - $where_ca_id[] = " ca_id2 like '{$this->ca_id2}%' "; - } - if ($this->ca_id3) { - $where_ca_id[] = " ca_id3 like '{$this->ca_id3}%' "; - } - $where[] = implode(" or ", $where_ca_id); - } - - if ($this->order_by) { - $sql_order = " order by {$this->order_by} "; - } - - if ($this->event) { - //$sql_common = " select {$this->fields} from `{$g4['shop_event_item_table']}` a left join `{$g4['shop_item_table']}` b on (a.it_id = b.it_id and a.ev_id = '{$this->event}') "; - $sql_common = " select {$this->fields} from `{$g4['shop_event_item_table']}` a left join `{$g4['shop_item_table']}` b on (a.it_id = b.it_id) "; - $where[] = " a.ev_id = '{$this->event}' "; } else { - $sql_common = " select {$this->fields} from `{$g4['shop_item_table']}` "; - } - $sql_where = " where " . implode(" and ", $where); - $sql = $sql_common . $sql_where . " limit " . ($this->list_mod * $this->list_row); - $result = sql_query($sql); - //echo (int)mysql_num_rows($result); + $where = array(); + if ($this->use) { + $where[] = " it_use = '1' "; + } + + if ($this->type) { + $where[] = " it_type{$this->type} = '1' "; + } + + if ($this->ca_id || $this->ca_id2 || $this->ca_id3) { + $where_ca_id = array(); + if ($this->ca_id) { + $where_ca_id[] = " ca_id like '{$this->ca_id}%' "; + } + if ($this->ca_id2) { + $where_ca_id[] = " ca_id2 like '{$this->ca_id2}%' "; + } + if ($this->ca_id3) { + $where_ca_id[] = " ca_id3 like '{$this->ca_id3}%' "; + } + $where[] = implode(" or ", $where_ca_id); + } + + if ($this->order_by) { + $sql_order = " order by {$this->order_by} "; + } + + if ($this->event) { + $sql_select = " select {$this->fields} "; + $sql_common = " from `{$g4['shop_event_item_table']}` a left join `{$g4['shop_item_table']}` b on (a.it_id = b.it_id) "; + $where[] = " a.ev_id = '{$this->event}' "; + } else { + $sql_select = " select {$this->fields} "; + $sql_common = " from `{$g4['shop_item_table']}` "; + } + $sql_where = " where " . implode(" and ", $where); + $sql_limit = " limit " . $this->from_record . " , " . ($this->list_mod * $this->list_row); + + $sql = $sql_select . $sql_common . $sql_where . $sql_limit; + $result = sql_query($sql); + + if ($this->is_page) { + $sql2 = " select count(*) as cnt " . $sql_common . $sql_where; + $row2 = sql_fetch($sql2); + $this->total_count = $row2['cnt']; + } + + } $sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id']; $sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']); if ($this->is_mobile) { - $file = G4_MSHOP_PATH."/{$this->list_skin}"; + $file = G4_MSHOP_SKIN_PATH."/{$this->list_skin}"; } else { - $file = "{$shop_skin_path}/{$this->list_skin}"; + $file = G4_SHOP_SKIN_PATH."/{$this->list_skin}"; } + if ($this->list_skin == "") { return $this->count."번 item_list() 의 스킨파일이 지정되지 않았습니다."; } else if (!file_exists($file)) { - return "{$shop_skin_url}/{$this->list_skin} 파일을 찾을 수 없습니다."; - } else { - ob_start(); - $list_mod = $this->list_mod; - include($file); - $content = ob_get_contents(); - ob_end_clean(); - return $content; - } - } -} - - -class display_item -{ - // 상품유형 : 기본적으로 1~5 까지 사용할수 있으며 0 으로 설정하는 경우 상품유형별로 노출하지 않습니다. - // 분류나 이벤트로 노출하는 경우 상품유형을 0 으로 설정하면 됩니다. - protected $type; - - protected $list_skin; - protected $list_mod; - protected $list_row; - protected $img_width; - protected $img_height; - - // 상품상세보기 경로 - protected $href = ""; - - // select 에 사용되는 필드 - protected $fields = "*"; - - // 분류코드로만 사용하는 경우 상품유형($type)을 0 으로 설정하면 됩니다. - protected $ca_id = ""; - protected $ca_id2 = ""; - protected $ca_id3 = ""; - - // 노출순서 - protected $order_by = "it_order, it_id desc"; - - // 상품의 이벤트번호를 저장합니다. - protected $event = ""; - - // 스킨의 기본 css 를 다른것으로 사용하고자 할 경우에 사용합니다. - protected $css = ""; - - // 상품의 사용여부를 따져 노출합니다. 0 인 경우 모든 상품을 노출합니다. - protected $use = 1; - - // 모바일에서 노출하고자 할 경우에 true 로 설정합니다. - protected $is_mobile = false; - - // 기본으로 보여지는 필드들 - protected $view_it_id = false; // 상품코드 - protected $view_it_img = true; // 상품이미지 - protected $view_it_name = true; // 상품명 - protected $view_it_price = true; // 판매가격 - protected $view_it_cust_price = false; // 소비자가 - protected $view_it_icon = false; // 아이콘 - protected $view_sns = false; // SNS - - protected $count = 1; // 몇번째 class 호출인지를 저장합니다. - - // $type : 상품유형 (기본으로 1~5까지 사용) - // $list_skin : 상품리스트를 노출할 스킨을 설정합니다. 스킨위치는 skin/shop/쇼핑몰설정스킨/type??.skin.php - // $list_mod : 1줄에 몇개의 상품을 노출할지를 설정합니다. - // $list_row : 상품을 몇줄에 노출할지를 설정합니다. - // $img_width : 상품이미지의 폭을 설정합니다. - // $img_height : 상품이미지의 높이을 설정합니다. 0 으로 설정하는 경우 썸네일 이미지의 높이는 폭에 비례하여 생성합니다. - function __construct($type=0, $list_skin='', $list_mod='', $list_row='', $img_width='', $img_height=0) { - - global $default; - - $this->type = $type; - if ($type) { - $this->set_list_skin($list_skin); - $this->set_list_mod($list_mod); - $this->set_list_row($list_row); - $this->set_img_size($img_width); - } - $this->ca_id = $ca_id; - - $this->set_href(G4_SHOP_URL.'/item.php?it_id='); - - $this->count++; - } - - // 리스트 스킨을 바꾸고자 하는 경우에 사용합니다. - // 리스트 스킨의 위치는 skin/shop/쇼핑몰설정스킨/type??.skin.php 입니다. - // 특별히 설정하지 않는 경우 상품유형을 사용하는 경우는 쇼핑몰설정 값을 그대로 따릅니다. - function set_list_skin($list_skin) { - global $default; - $this->list_skin = $list_skin ? $list_skin : $default['de_type'.$this->type.'_list_skin']; - } - - // 1줄에 몇개를 노출할지를 사용한다. - // 특별히 설정하지 않는 경우 상품유형을 사용하는 경우는 쇼핑몰설정 값을 그대로 따릅니다. - function set_list_mod($list_mod) { - global $default; - $this->list_mod = $list_mod ? $list_mod : $default['de_type'.$this->type.'_list_mod']; - } - - // 몇줄을 노출할지를 사용한다. - // 특별히 설정하지 않는 경우 상품유형을 사용하는 경우는 쇼핑몰설정 값을 그대로 따릅니다. - function set_list_row($list_row) { - global $default; - $this->list_row = $list_row ? $list_row : $default['de_type'.$this->type.'_list_row']; - } - - // 노출이미지(썸네일생성)의 폭, 높이를 설정합니다. 높이를 0 으로 설정하는 경우 쎰네일 비율에 따릅니다. - // 특별히 설정하지 않는 경우 상품유형을 사용하는 경우는 쇼핑몰설정 값을 그대로 따릅니다. - function set_img_size($img_width, $img_height=0) { - global $default; - $this->img_width = $img_width ? $img_width : $default['de_type'.$this->type.'_img_width']; - $this->img_height = $img_height ? $img_height : $default['de_type'.$this->type.'_img_height']; - } - - // 특정 필드만 select 하는 경우에는 필드명을 , 로 구분하여 "field1, field2, field3, ... fieldn" 으로 인수를 넘겨줍니다. - function set_fields($str) { - $this->fields = $str; - } - - // 특정 필드로 정렬을 하는 경우 필드와 정렬순서를 , 로 구분하여 "field1 desc, field2 asc, ... fieldn desc " 으로 인수를 넘겨줍니다. - function set_order_by($str) { - $this->order_by = $str; - } - - // 사용하는 상품외에 모든 상품을 노출하려면 0 을 인수로 넘겨줍니다. - function set_use($use) { - $this->use = $use; - } - - // 모바일로 사용하려는 경우 true 를 인수로 넘겨줍니다. - function set_mobile($mobile=true) { - $this->is_mobile = $mobile; - } - - // 분류코드로 검색을 하고자 하는 경우 아래와 같이 인수를 넘겨줍니다. - // 1단계 분류는 (분류코드, 1) - // 2단계 분류는 (분류코드, 2) - // 3단계 분류는 (분류코드, 3) - function set_ca_id($ca_id, $level=1) { - if ($level == 2) { - $this->ca_id2 = $ca_id; - } else if ($level == 3) { - $this->ca_id3 = $ca_id; - } else { - $this->ca_id = $ca_id; - } - } - - // 스킨에서 특정 필드를 노출하거나 하지 않게 할수 있습니다. - // 가령 소비자가는 처음에 노출되지 않도록 설정되어 있짐나 노출을 하려면 - // ("it_cust_price", true) 와 같이 인수를 넘겨줍니다. - // 이때 인수로 넘겨주는 값은 스킨에 정의된 필드만 가능하다는 것입니다. - function set_view($field, $view=true) { - $this->{"view_".$field} = $view; - } - - // anchor 태그에 하이퍼링크를 다른 주소로 걸거나 아예 링크를 걸지 않을 수 있습니다. - // 인수를 "" 공백으로 넘기면 링크를 걸지 않습니다. - function set_href($href) { - $this->href = $href; - } - - // 이벤트코드를 인수로 넘기게 되면 해당 이벤트에 속한 상품을 노출합니다. - function set_event($ev_id) { - $this->event = $ev_id; - } - - // ul 태그의 css 를 교체할수 있다. "sct sct_abc" 를 인수로 넘기게 되면 - // 기존의 ul 태그에 걸린 css 는 무시되며 인수로 넘긴 css 가 사용됩니다. - function set_css($css) { - $this->css = $css; - } - - // class 에 설정된 값으로 최종 실행합니다. - function run() { - - global $g4, $config, $member, $default, $shop_skin_path, $shop_skin_url; - - $where = array(); - if ($this->use) { - $where[] = " it_use = '1' "; - } - - if ($this->type) { - $where[] = " it_type{$this->type} = '1' "; - } - - if ($this->ca_id || $this->ca_id2 || $this->ca_id3) { - $where_ca_id = array(); - if ($this->ca_id) { - $where_ca_id[] = " ca_id like '{$this->ca_id}%' "; - } - if ($this->ca_id2) { - $where_ca_id[] = " ca_id2 like '{$this->ca_id2}%' "; - } - if ($this->ca_id3) { - $where_ca_id[] = " ca_id3 like '{$this->ca_id3}%' "; - } - $where[] = implode(" or ", $where_ca_id); - } - - if ($this->order_by) { - $sql_order = " order by {$this->order_by} "; - } - - if ($this->event) { - //$sql_common = " select {$this->fields} from `{$g4['shop_event_item_table']}` a left join `{$g4['shop_item_table']}` b on (a.it_id = b.it_id and a.ev_id = '{$this->event}') "; - $sql_common = " select {$this->fields} from `{$g4['shop_event_item_table']}` a left join `{$g4['shop_item_table']}` b on (a.it_id = b.it_id) "; - $where[] = " a.ev_id = '{$this->event}' "; - } else { - $sql_common = " select {$this->fields} from `{$g4['shop_item_table']}` "; - } - $sql_where = " where " . implode(" and ", $where); - - $sql = $sql_common . $sql_where . " limit " . ($this->list_mod * $this->list_row); - $result = sql_query($sql); - //echo (int)mysql_num_rows($result); - - $sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id']; - $sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']); - - if ($this->is_mobile) { - $file = G4_MSHOP_PATH."/{$this->list_skin}"; - } else { - $file = "{$shop_skin_path}/{$this->list_skin}"; - } - if ($this->list_skin == "") { - return $this->count."번 display_item() 의 스킨파일이 지정되지 않았습니다."; - } else if (!file_exists($file)) { - return "{$shop_skin_url}/{$this->list_skin} 파일을 찾을 수 없습니다."; + return $file." 파일을 찾을 수 없습니다."; } else { ob_start(); $list_mod = $this->list_mod; @@ -855,7 +690,7 @@ function is_null_time($datetime) //function display_type($type, $skin_file, $list_mod, $list_row, $img_width, $img_height, $ca_id="") function display_type($type, $list_skin='', $list_mod='', $list_row='', $img_width='', $img_height='', $ca_id='') { - global $member, $g4, $config, $default, $shop_skin_path, $shop_skin_url; + global $member, $g4, $config, $default; if (!$default["de_type{$type}_list_use"]) return ""; @@ -881,9 +716,9 @@ function display_type($type, $list_skin='', $list_mod='', $list_row='', $img_wid */ //$file = G4_SHOP_PATH.'/'.$skin_file; - $file = $shop_skin_path.'/'.$list_skin; + $file = G4_SHOP_SKIN_PATH.'/'.$list_skin; if (!file_exists($file)) { - return $shop_skin_url.'/'.$list_skin.' 파일을 찾을 수 없습니다.'; + return G4_SHOP_SKIN_URL.'/'.$list_skin.' 파일을 찾을 수 없습니다.'; } else { $td_width = (int)(100 / $list_mod); ob_start(); diff --git a/mobile/shop/index.php b/mobile/shop/index.php index 68571b695..275b2dd7d 100644 --- a/mobile/shop/index.php +++ b/mobile/shop/index.php @@ -13,13 +13,11 @@ include_once(G4_MSHOP_PATH.'/shop.head.php');

          최신상품

          최신상품 모음

          - set_mobile(true); + $list->set_type(1); + echo $list->run(); ?> @@ -28,13 +26,11 @@ include_once(G4_MSHOP_PATH.'/shop.head.php');

          히트상품

          히트상품 모음

          - set_mobile(true); + $list->set_type(2); + echo $list->run(); ?> @@ -43,13 +39,11 @@ include_once(G4_MSHOP_PATH.'/shop.head.php');

          추천상품

          추천상품 모음

          - set_mobile(true); + $list->set_type(3); + echo $list->run(); ?> @@ -58,13 +52,11 @@ include_once(G4_MSHOP_PATH.'/shop.head.php');

          인기상품

          인기상품 모음

          - set_mobile(true); + $list->set_type(4); + echo $list->run(); ?> @@ -73,13 +65,11 @@ include_once(G4_MSHOP_PATH.'/shop.head.php');

          할인상품

          할인상품 모음

          - set_mobile(true); + $list->set_type(5); + echo $list->run(); ?> diff --git a/mobile/shop/item.php b/mobile/shop/item.php index 606d4030a..0769602a5 100644 --- a/mobile/shop/item.php +++ b/mobile/shop/item.php @@ -252,10 +252,10 @@ else $sns_url = G4_SHOP_URL.'/item.php?it_id='.$it['it_id']; ?> 고객선호도 별개 - - - - + + + + @@ -609,6 +609,7 @@ else
          set_mobile(true); + $list->set_query($sql); + echo $list->run(); + + /* if ($num) include G4_MSHOP_PATH.'/maintype10.inc.php'; else echo '

          이 상품과 관련된 상품이 없습니다.

          '; + */ ?>
          diff --git a/skin/shop/basic/type10.skin.php b/mobile/skin/shop/basic/list.10.skin.php similarity index 93% rename from skin/shop/basic/type10.skin.php rename to mobile/skin/shop/basic/list.10.skin.php index 85816c55c..99a102f55 100644 --- a/skin/shop/basic/type10.skin.php +++ b/mobile/skin/shop/basic/list.10.skin.php @@ -2,7 +2,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 ?> - + 히트상품 모음

          run(); + $list = new item_list(); + $list->set_type(1); + echo $list->run(); ?> @@ -65,8 +66,9 @@ exit;

          추천상품 모음

          run(); + $list = new item_list(); + $list->set_type(2); + echo $list->run(); ?> @@ -78,8 +80,9 @@ exit;

          최신상품 모음

          run(); + $list = new item_list(); + $list->set_type(3); + echo $list->run(); ?> @@ -91,8 +94,9 @@ exit;

          인기상품 모음

          run(); + $list = new item_list(); + $list->set_type(4); + echo $list->run(); ?> @@ -104,8 +108,9 @@ exit;

          할인상품 모음

          run(); + $list = new item_list(); + $list->set_type(5); + echo $list->run(); ?> diff --git a/shop/item.php b/shop/item.php index e1ff0ef42..30c1e796a 100644 --- a/shop/item.php +++ b/shop/item.php @@ -620,17 +620,25 @@ else
          set_mobile(true); + $list->set_query($sql); + echo $list->run(); + + /* if ($num) include G4_SHOP_PATH.'/maintype10.inc.php'; else echo '

          이 상품과 관련된 상품이 없습니다.

          '; + */ ?>
          diff --git a/shop/list.php b/shop/list.php index 9c1b0aa87..4dd864f1f 100644 --- a/shop/list.php +++ b/shop/list.php @@ -80,7 +80,7 @@ if ($is_admin) $error = '

          등록된 상품이 없습니다.

          '; // 리스트 유형별로 출력 - $list_file = G4_SHOP_PATH.'/'.$ca['ca_skin']; + $list_file = G4_SHOP_SKIN_PATH.'/'.$ca['ca_skin']; if (file_exists($list_file)) { //display_type(2, "maintype10.inc.php", 4, 2, 100, 100, $ca[ca_id]); @@ -101,9 +101,23 @@ if ($is_admin) echo ''; */ - $list = new item_list(0, "type10.skin.php", $ca['ca_list_mod'], $ca['ca_list_row'], $ca['ca_img_width'], $ca['ca_img_height'], $ca_id); + // 총몇개 = 한줄에 몇개 * 몇줄 + $items = $ca['ca_list_mod'] * $ca['ca_list_row']; + // 페이지가 없으면 첫 페이지 (1 페이지) + if ($page == "") $page = 1; + // 시작 레코드 구함 + $from_record = ($page - 1) * $items; + + $list = new item_list($ca['ca_skin'], $ca['ca_list_mod'], $ca['ca_list_row'], $ca['ca_img_width'], $ca['ca_img_height']); + $list->set_category($ca['ca_id']); + $list->set_is_page(true); + $list->set_from_record($from_record); echo $list->run(); + // where 된 전체 상품수 + $total_count = $list->total_count; + // 전체 페이지 계산 + $total_page = ceil($total_count / $items); } else { diff --git a/skin/shop/basic/list.10.skin.php b/skin/shop/basic/list.10.skin.php new file mode 100644 index 000000000..99a102f55 --- /dev/null +++ b/skin/shop/basic/list.10.skin.php @@ -0,0 +1,75 @@ + + + + + +list_mod >= 2) { // 1줄 이미지 : 2개 이상 + if ($i%$this->list_mod == 0) $sct_last = 'sct_last'; // 줄 마지막 + else if ($i%$this->list_mod == 1) $sct_last = 'sct_clear'; // 줄 첫번째 + else $sct_last = ''; + } else { // 1줄 이미지 : 1개 + $sct_last = 'sct_clear'; + } + + if ($i == 1) { + if ($this->css) { + echo "