히트상품출력
- 출력 >
- 스킨
+ 출력
+ >
+ 스킨
-
+
- 출력할 이미지 수
-
+ 출력할 이미지 수
+
이미지 폭
이미지 높이
@@ -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 "css}\">\n";
+ } else {
+ echo "\n";
+ }
+ }
+
+ echo "\n";
+
+ if ($this->href) {
+ echo "href}{$row['it_id']}\" class=\"sct_a\">\n";
+ }
+
+ if ($this->view_it_img) {
+ echo "".get_it_image($row['it_id'], $this->img_width, $this->img_height)." \n";
+ }
+
+ if ($this->view_it_id) {
+ echo "".stripslashes($row['it_id'])." \n";
+ }
+
+ if ($this->view_it_name) {
+ echo "".stripslashes($row['it_name'])." \n";
+ }
+
+ if ($this->view_it_cust_price) {
+ echo "".display_price($row['it_cust_price'])." \n";
+ }
+
+ if ($this->view_it_price) {
+ echo "".display_price(get_price($row), $row['it_tel_inq'])." \n";
+ }
+
+ if ($this->view_it_icon) {
+ echo "".item_icon($row)." \n";
+ }
+
+ if ($this->view_sns) {
+ echo "";
+ echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_SHOP_URL.'/img/sns_fb.png');
+ echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_SHOP_URL.'/img/sns_twt.png');
+ echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_SHOP_URL.'/img/sns_goo.png');
+ echo "
\n";
+ }
+
+ if ($this->href) {
+ echo " \n";
+ }
+
+ echo " \n";
+}
+
+if ($i > 1) echo " \n";
+
+if($i == 1) echo "등록된 상품이 없습니다.
\n";
+?>
+
\ No newline at end of file
diff --git a/skin/shop/basic/type11.skin.php b/skin/shop/basic/list.11.skin.php
similarity index 93%
rename from skin/shop/basic/type11.skin.php
rename to skin/shop/basic/list.11.skin.php
index f4f93192f..426ad382a 100644
--- a/skin/shop/basic/type11.skin.php
+++ b/skin/shop/basic/list.11.skin.php
@@ -2,7 +2,7 @@
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
-
+
-
+
-
+