display_item 완료 및 주석 처리

This commit is contained in:
gnuboard
2013-07-25 11:13:30 +09:00
parent 81a39773d1
commit f135203631
9 changed files with 508 additions and 265 deletions

View File

@ -212,7 +212,7 @@ $pg_anchor = '<ul class="anchor">
<input type="checkbox" name="de_type1_list_use" value="1" id="de_type1_list_use" <?php echo $default['de_type1_list_use']?"checked":""; ?>>
<label for="de_type1_list_skin">스킨</label>
<select name="de_type1_list_skin" id="de_type1_list_skin">
<?php echo get_list_skin_options("^type[0-9]+.skin\.php", $shop_skin_path, $default['de_type1_list_skin']); ?>
<?php echo get_list_skin_options("^type[^\.]+\.skin\.php", $shop_skin_path, $default['de_type1_list_skin']); ?>
</select>
<label for="de_type1_list_row">출력할 줄 수</label>
<input type="text" name="de_type1_list_row" value="<?php echo $default['de_type1_list_row']; ?>" id="de_type1_list_row" class="frm_input" size="3">
@ -231,7 +231,7 @@ $pg_anchor = '<ul class="anchor">
<input type="checkbox" name="de_type2_list_use" value="1" id="de_type2_list_use" <?php echo $default['de_type2_list_use']?"checked":""; ?>>
<label for="de_type2_list_skin">스킨</label>
<select name="de_type2_list_skin" id="de_type2_list_skin">
<?php echo get_list_skin_options("^type[0-9]+.skin\.php", $shop_skin_path, $default['de_type2_list_skin']); ?>
<?php echo get_list_skin_options("^type[^\.]+\.skin\.php", $shop_skin_path, $default['de_type2_list_skin']); ?>
</select>
<label for="de_type2_list_row">출력할 줄 수</label>
<input type="text" name="de_type2_list_row" value="<?php echo $default['de_type2_list_row']; ?>" id="de_type2_list_row" class="frm_input" size="3">
@ -250,7 +250,7 @@ $pg_anchor = '<ul class="anchor">
<input type="checkbox" name="de_type3_list_use" value="1" id="de_type3_list_use" <?php echo $default['de_type3_list_use']?"checked":""; ?>>
<label for="de_type3_list_skin">스킨</label>
<select name="de_type3_list_skin" id="de_type3_list_skin">
<?php echo get_list_skin_options("^type[0-9]+.skin\.php", $shop_skin_path, $default['de_type3_list_skin']); ?>
<?php echo get_list_skin_options("^type[^\.]+\.skin\.php", $shop_skin_path, $default['de_type3_list_skin']); ?>
</select>
<label for="de_type3_list_row">출력할 줄 수</label>
<input type="text" name="de_type3_list_row" value="<?php echo $default['de_type3_list_row']; ?>" id="de_type3_list_row" class="frm_input" size="3">
@ -269,7 +269,7 @@ $pg_anchor = '<ul class="anchor">
<input type="checkbox" name="de_type4_list_use" value="1" id="de_type4_list_use" <?php echo $default['de_type4_list_use']?"checked":""; ?>>
<label for="de_type4_list_skin">스킨</label>
<select name="de_type4_list_skin" id="de_type4_list_skin">
<?php echo get_list_skin_options("^type[0-9]+.skin\.php", $shop_skin_path, $default['de_type4_list_skin']); ?>
<?php echo get_list_skin_options("^type[^\.]+\.skin\.php", $shop_skin_path, $default['de_type4_list_skin']); ?>
</select>
<label for="de_type4_list_row">출력할 줄 수</label>
<input type="text" name="de_type4_list_row" value="<?php echo $default['de_type4_list_row']; ?>" id="de_type4_list_row" class="frm_input" size="3">
@ -288,7 +288,7 @@ $pg_anchor = '<ul class="anchor">
<input type="checkbox" name="de_type5_list_use" value="1" id="de_type5_list_use" <?php echo $default['de_type5_list_use']?"checked":""; ?>>
<label for="de_type5_list_skin">스킨</label>
<select name="de_type5_list_skin" id="de_type5_list_skin">
<?php echo get_list_skin_options("^type[0-9]+.skin\.php", $shop_skin_path, $default['de_type5_list_skin']); ?>
<?php echo get_list_skin_options("^type[^\.]+\.skin\.php", $shop_skin_path, $default['de_type5_list_skin']); ?>
</select>
<label for="de_type5_list_row">출력할 줄 수</label>
<input type="text" name="de_type5_list_row" value="<?php echo $default['de_type5_list_row']; ?>" id="de_type5_list_row" class="frm_input" size="3">

View File

@ -3,117 +3,269 @@
// 쇼핑몰 라이브러리 모음 시작
//==============================================================================
/*
간편 사용법 : 상품유형을 1~5 사이로 지정합니다.
$disp = new display_item(1);
echo $disp->run();
// 상품 보기
class item_view
유형+분류별로 노출하는 경우 상세 사용법 : 상품유형을 지정하는 것은 동일합니다.
$disp = new display_item(1);
// 사용할 스킨을 바꿉니다.
$disp->set_list_skin("type_user.skin.php");
// 1단계분류를 20으로 시작되는 분류로 지정합니다.
$disp->set_ca_id("20", 1);
echo $disp->run();
분류별로 노출하는 경우 상세 사용법
// type13.skin.php 스킨으로 3개씩 2줄을 폭 150 사이즈로 분류코드 30 으로 시작되는 상품을 노출합니다.
$disp = new display_item(0, "type13.skin.php", 3, 2, 150, 0, "30");
echo $disp->run();
이벤트로 노출하는 경우 상세 사용법
// type13.skin.php 스킨으로 3개씩 2줄을 폭 150 사이즈로 상품을 노출합니다.
$disp = new display_item(0, "type13.skin.php", 3, 2, 150, 0);
// 이벤토번호를 설정합니다.
$disp->set_event("12345678");
echo $disp->run();
참고) 영카트4의 display_type 함수와 사용방법이 비슷한 class 입니다.
display_category 나 display_event 로 사용하기 위해서는 $type 값만 넘기지 않으면 됩니다.
*/
class display_item
{
protected $it;
protected $idx = 1;
// 상품유형 : 기본적으로 1~5 까지 사용할수 있으며 0 으로 설정하는 경우 상품유형별로 노출하지 않습니다.
// 분류나 이벤트로 노출하는 경우 상품유형을 0 으로 설정하면 됩니다.
protected $type;
protected $list_skin;
protected $list_mod;
protected $list_row;
protected $img_width;
protected $img_height;
protected $link = "it_name";
protected $buffer = array();
protected static $index = 0;
function __construct($it="") {
// 배열이 아니면 상품코드로 인식한다.
if (!is_array($it)) {
$it = $this->get_item($it);
// 상품상세보기 경로
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->it = $it;
$this->set_link();
$this->ca_id = $ca_id;
$this->set_href(G4_SHOP_URL.'/item.php?it_id=');
$this->count++;
}
function get_item($it_id) {
global $g4;
$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 ";
$this->it = sql_fetch($sql);
return $this->it;
// 리스트 스킨을 바꾸고자 하는 경우에 사용합니다.
// 리스트 스킨의 위치는 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'];
}
function set_link($link="all", $href="")
{
$this->link = $link;
if ($href)
$this->href = $href;
else
$this->href = G4_SHOP_URL."/item.php?it_id=".$this->it['it_id'];
// 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_img_idx($idx=1) {
$this->idx = $idx;
// 몇줄을 노출할지를 사용한다.
// 특별히 설정하지 않는 경우 상품유형을 사용하는 경우는 쇼핑몰설정 값을 그대로 따릅니다.
function set_list_row($list_row) {
global $default;
$this->list_row = $list_row ? $list_row : $default['de_type'.$this->type.'_list_row'];
}
function get_href($str) {
return "<a href=\"{$this->href}\">".$str."</a>";
// 노출이미지(썸네일생성)의 폭, 높이를 설정합니다. 높이를 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'];
}
function it_img($imgw, $imgh=0) {
$img = get_it_thumbnail($this->it['it_img'.$this->idx], $imgw, $imgh);
// 상품이미지의 경우 링크값이 none 이 아닌 경우 무조건 링크를 건다.
if ($this->link != "none")
$img = $this->get_href($img);
$this->buffer[] = "<li class=\"it_img\">$img</li>";
// 특정 필드만 select 하는 경우에는 필드명을 , 로 구분하여 "field1, field2, field3, ... fieldn" 으로 인수를 넘겨줍니다.
function set_fields($str) {
$this->fields = $str;
}
function it_name($length) {
$it_name = utf8_strcut($this->it['it_name'], $length);
if ($this->link == "all" || $this->link == "it_name")
$it_name = $this->get_href($it_name);
$this->buffer[] = "<li class=\"it_name\">{$it_name}</li>";
// 특정 필드로 정렬을 하는 경우 필드와 정렬순서를 , 로 구분하여 "field1 desc, field2 asc, ... fieldn desc " 으로 인수를 넘겨줍니다.
function set_order_by($str) {
$this->order_by = $str;
}
function it_cust_price($prefix="시중가 : ", $suffix="") {
$it_cust_price = $prefix.number_format($this->it['it_cust_price']).$suffix;
if ($this->link == "all")
$it_cust_price = $this->get_href($it_cust_price);
$this->buffer[] = "<li class=\"it_cust_price\">{$it_cust_price}</li>";
// 사용하는 상품외에 모든 상품을 노출하려면 0 을 인수로 넘겨줍니다.
function set_use($use) {
$this->use = $use;
}
function it_price($prefix="판매가 : ", $suffix="") {
$it_price = $prefix.number_format($this->it['it_price']).$suffix;
if ($this->link == "all")
$it_price = $this->get_href($it_price);
$this->buffer[] = "<li class=\"it_price\">{$it_price}</li>";
// 모바일로 사용하려는 경우 true 를 인수로 넘겨줍니다.
function set_mobile($mobile=true) {
$this->is_mobile = $mobile;
}
function it_point($prefix="포인트 : ") {
$suffix = ($this->it['it_point_type'] == 1) ? "%" : "";
$it_point = $prefix.number_format($this->it['it_point']).$suffix;
if ($this->link == "all")
$it_point = $this->get_href($it_point);
$this->buffer[] = "<li class=\"it_point\">{$it_point}</li>";
// 분류코드로 검색을 하고자 하는 경우 아래와 같이 인수를 넘겨줍니다.
// 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 it_etc($etc="") {
$this->index++;
if ($this->link == "all")
$$etc = $this->get_href($etc);
$this->buffer[] = "<li class=\"it_etc{$this->index}\">{$etc}</li>";
// 스킨에서 특정 필드를 노출하거나 하지 않게 할수 있습니다.
// 가령 소비자가는 처음에 노출되지 않도록 설정되어 있짐나 노출을 하려면
// ("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() {
$id = "it".$this->it['it_id'];
return !empty($this->buffer) ? "<ul".($id?" id=\"$id\"":"")." class=\"item_view\">\n".implode("\n", $this->buffer)."\n</ul>\n" : "";
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} 파일을 찾을 수 없습니다.";
} else {
ob_start();
$list_mod = $this->list_mod;
include($file);
$content = ob_get_contents();
ob_end_clean();
return $content;
}
}
}
// 장바구니 건수 검사
function get_cart_count($uq_id)
{
global $g4, $default;
$sql = " select count(ct_id) as cnt from {$g4['shop_cart_table']} where uq_id = '$uq_id' ";
if($default['de_cart_keep_term']) {
$ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
$sql .= " and ct_time > '$ctime' ";
}
$row = sql_fetch($sql);
$cnt = (int)$row['cnt'];
return $cnt;
}
// 이미지를 얻는다
function get_image($img, $width=0, $height=0, $img_id='')
{

View File

@ -14,6 +14,31 @@ include_once(G4_LIB_PATH.'/poll.lib.php');
include_once(G4_SHOP_PATH.'/shop.head.php');
?>
<?php
/*
$disp = new display_item(1);
echo $disp->run();
$disp = new display_item(1);
$disp->set_img_size(60, 0);
$disp->set_view("it_price", false);
$disp->set_view("it_id", true);
$disp->set_view("it_icon", true);
echo $disp->run();
$disp = new display_item();
$disp->set_event("1366852726");
$disp->set_list_skin("type10.skin.php");
$disp->set_img_size(125, 0);
$disp->set_list_mod(3);
$disp->set_list_row(4);
echo $disp->run();
exit;
*/
?>
<!-- 메인이미지 시작 { -->
<div id="sidx_img">
<img src="<?php echo G4_DATA_URL; ?>/common/main_img" alt="">
@ -26,7 +51,10 @@ include_once(G4_SHOP_PATH.'/shop.head.php');
<h2><a href="<?php echo G4_SHOP_URL; ?>/listtype.php?type=1">히트상품</a></h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 히트상품 모음</p>
</header>
<?php echo display_type(1); ?>
<?php
$disp = new display_item(1);
echo $disp->run();
?>
</section>
<!-- } 히트상품 끝 -->
@ -36,7 +64,10 @@ include_once(G4_SHOP_PATH.'/shop.head.php');
<h2><a href="<?php echo G4_SHOP_URL; ?>/listtype.php?type=2">추천상품</a></h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 추천상품 모음</p>
</header>
<?php echo display_type(2); ?>
<?php
$disp = new display_item(2);
echo $disp->run();
?>
</section>
<!-- } 추천상품 끝 -->
@ -46,7 +77,10 @@ include_once(G4_SHOP_PATH.'/shop.head.php');
<h2><a href="<?php echo G4_SHOP_URL; ?>/listtype.php?type=3">최신상품</a></h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 최신상품 모음</p>
</header>
<?php echo display_type(3); ?>
<?php
$disp = new display_item(3);
echo $disp->run();
?>
</section>
<!-- } 최신상품 끝 -->
@ -56,7 +90,10 @@ include_once(G4_SHOP_PATH.'/shop.head.php');
<h2><a href="<?php echo G4_SHOP_URL; ?>/listtype.php?type=4">인기상품</a></h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 인기상품 모음</p>
</header>
<?php echo display_type(4); ?>
<?php
$disp = new display_item(4);
echo $disp->run();
?>
</section>
<!-- } 인기상품 끝 -->
@ -66,7 +103,10 @@ include_once(G4_SHOP_PATH.'/shop.head.php');
<h2><a href="<?php echo G4_SHOP_URL; ?>/listtype.php?type=5">할인상품</a></h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 할인상품 모음</p>
</header>
<?php echo display_type(5); ?>
<?php
$disp = new display_item(5);
echo $disp->run();
?>
</section>
<!-- } 할인상품 끝 -->

View File

@ -1,6 +1,5 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// $list_mod 가로 나열 수
?>
<link rel="stylesheet" href="<?php echo $shop_skin_url ?>/style.css">
@ -8,34 +7,69 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<!-- 상품진열 10 시작 { -->
<?php
for ($i=1; $row=sql_fetch_array($result); $i++) {
if ($list_mod >= 2) { // 1줄 이미지 : 2개 이상
if ($i%$list_mod == 0) $sct_last = 'sct_last'; // 줄 마지막
else if ($i%$list_mod == 1) $sct_last = 'sct_clear'; // 줄 첫번째
if ($this->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';
}
$href = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
$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 ($i == 1) {
if ($this->css) {
echo "<ul class=\"{$this->css}\">\n";
} else {
echo "<ul class=\"sct sct_10\">\n";
}
}
if ($i == 1) echo '<ul class="sct sct_10">';
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<span class="sct_cost"><?php echo display_price(get_price($row), $row['it_tel_inq']); ?></span>
<span class="sct_icon">
<?php echo item_icon($row); // 이미지 아이콘?>
</span>
</a>
</li>
<?php
echo "<li class=\"sct_li {$sct_last}\">\n";
if ($this->href) {
echo "<a href=\"{$this->href}{$row['it_id']}\" class=\"sct_a\">\n";
}
if ($this->view_it_img) {
echo "<span class=\"sct_img\">".get_it_image($row['it_id'], $this->img_width, $this->img_height)."</span>\n";
}
if ($this->view_it_id) {
echo "<b>".stripslashes($row['it_id'])."</b>\n";
}
if ($this->view_it_name) {
echo "<b>".stripslashes($row['it_name'])."</b>\n";
}
if ($this->view_it_cust_price) {
echo "<span class=\"sct_cost\">".display_price($row['it_cust_price'])."</span>\n";
}
if ($this->view_it_price) {
echo "<span class=\"sct_cost\">".display_price(get_price($row), $row['it_tel_inq'])."</span>\n";
}
if ($this->view_it_icon) {
echo "<span class=\"sct_icon\">".item_icon($row)."</span>\n";
}
if ($this->view_sns) {
echo "<div class=\"sct_sns\">";
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 "</div>\n";
}
if ($this->href) {
echo "</a>\n";
}
echo "</li>\n";
}
if ($i > 1) echo '</ul>';
if($i == 1) echo '<p class="sct_noitem">등록된 상품이 없습니다.</p>';
if ($i > 1) echo "</ul>\n";
if($i == 1) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
?>
<!-- } 상품진열 10 끝 -->

View File

@ -1,6 +1,5 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// $list_mod 가로 나열 수
?>
<link rel="stylesheet" href="<?php echo $shop_skin_url ?>/style.css">
@ -8,34 +7,69 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<!-- 상품진열 11 시작 { -->
<?php
for ($i=1; $row=sql_fetch_array($result); $i++) {
$href = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($list_mod >= 2) { // 1이미지 : 2개 이상
if ($i%$list_mod == 0) $sct_last = 'sct_last'; // 줄 마지막
else if ($i%$list_mod == 1) $sct_last = 'sct_clear'; // 줄 첫번째
if ($this->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';
}
$sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']);
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) {
if ($this->css) {
echo "<ul class=\"{$this->css}\">\n";
} else {
echo "<ul class=\"sct sct_11\">\n";
}
}
if ($i == 1) echo '<ul class="sct sct_11">';
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<span class="sct_cost"><?php echo display_price(get_price($row), $row['it_tel_inq']); ?></span>
<span class="sct_icon">
<?php// echo display_item_icon($row); // 이미지 아이콘?>
</span>
</a>
</li>
<?php
echo "<li class=\"sct_li {$sct_last}\">\n";
if ($this->href) {
echo "<a href=\"{$this->href}\" class=\"sct_a\">\n";
}
if ($this->view_it_img) {
echo "<span class=\"sct_img\">".get_it_image($row['it_id'], $this->img_width, $this->img_height)."</span>\n";
}
if ($this->view_it_id) {
echo "<b>".stripslashes($row['it_id'])."</b>\n";
}
if ($this->view_it_name) {
echo "<b>".stripslashes($row['it_name'])."</b>\n";
}
if ($this->view_it_cust_price) {
echo "<span class=\"sct_cost\">".display_price($row['it_cust_price'])."</span>\n";
}
if ($this->view_it_price) {
echo "<span class=\"sct_cost\">".display_price(get_price($row), $row['it_tel_inq'])."</span>\n";
}
if ($this->view_it_icon) {
echo "<span class=\"sct_icon\">".item_icon($row)."</span>\n";
}
if ($this->view_sns) {
echo "<div class=\"sct_sns\">";
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 "</div>\n";
}
if ($this->href) {
echo "</a>\n";
}
echo "</li>\n";
}
if ($i > 1) echo '</ul>';
if($i == 1) echo '<p class="sct_noitem">등록된 상품이 없습니다.</p>';
if ($i > 1) echo "</ul>\n";
if($i == 1) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
?>
<!-- } 상품진열 11 끝 -->

View File

@ -17,27 +17,63 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
$sct_last = 'sct_clear';
}
$sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']);
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) {
if ($this->css) {
echo "<ul class=\"{$this->css}\">\n";
} else {
echo "<ul class=\"sct sct_12\">\n";
}
}
if ($i == 1) echo '<ul class="sct sct_12">';
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_arw_toleft"></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<p><?php echo $row['it_basic']; ?></p>
<span class="sct_cost"><?php echo display_price(get_price($row), $row['it_tel_inq']); ?></span>
<span class="sct_icon">
<?php// echo display_item_icon($row); // 이미지 아이콘?>
</span>
</a>
</li>
<?php
echo "<li class=\"sct_li {$sct_last}\">\n";
if ($this->href) {
echo "<a href=\"{$this->href}{$row['it_id']}\" class=\"sct_a\">\n";
}
echo "<span class=\"sct_arw_toleft\"></span>\n";
if ($this->view_it_img) {
echo "<span class=\"sct_img\">".get_it_image($row['it_id'], $this->img_width, $this->img_height)."</span>\n";
}
if ($this->view_it_id) {
echo "<b>".stripslashes($row['it_id'])."</b>\n";
}
if ($this->view_it_name) {
echo "<b>".stripslashes($row['it_name'])."</b>\n";
}
if ($this->view_it_cust_price) {
echo "<span class=\"sct_cost\">".display_price($row['it_cust_price'])."</span>\n";
}
if ($this->view_it_price) {
echo "<span class=\"sct_cost\">".display_price(get_price($row), $row['it_tel_inq'])."</span>\n";
}
if ($this->view_it_icon) {
echo "<span class=\"sct_icon\">".item_icon($row)."</span>\n";
}
if ($this->view_sns) {
echo "<div class=\"sct_sns\">";
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 "</div>\n";
}
if ($this->href) {
echo "</a>\n";
}
echo "</li>\n";
}
if ($i > 1) echo '</ul>';
if($i == 1) echo '<p class="sct_noitem">등록된 상품이 없습니다.</p>';
if ($i > 1) echo "</ul>\n";
if($i == 1) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
?>
<!-- } 상품진열 12 끝 -->

View File

@ -1,5 +1,8 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 관련상품 스킨은 사품을 한줄에 하나만 표시하며 해당 상품에 관련상품이 등록되어 있는 경우 기본으로 7개까지 노출합니다.
// $list_mod 가로 나열 수
?>
@ -17,30 +20,66 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
$sct_last = 'sct_clear';
}
$sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']);
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) {
if ($this->css) {
echo "<ul class=\"{$this->css}\">\n";
} else {
echo "<ul class=\"sct sct_13\">\n";
}
}
if ($i == 1) echo '<ul class="sct sct_13">';
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_arw_toleft"></span>
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<p><?php echo $row['it_basic']; ?></p>
<span class="sct_cost"><?php echo display_price(get_price($row), $row['it_tel_inq']); ?></span>
<span class="sct_icon">
<?php echo item_icon($row); // 이미지 아이콘?>
</span>
</a>
<div class="sct_rel">
<?php echo relation_item($row['it_id'], 70, 70, 5); // 관련 상품 ?>
</div>
</li>
<?php
echo "<li class=\"sct_li {$sct_last}\">\n";
if ($this->href) {
echo "<a href=\"{$this->href}{$row['it_id']}\" class=\"sct_a\">\n";
}
echo "<span class=\"sct_arw_toleft\"></span>\n";
if ($this->view_it_img) {
echo "<span class=\"sct_img\">".get_it_image($row['it_id'], $this->img_width, $this->img_height)."</span>\n";
}
if ($this->view_it_id) {
echo "<b>".stripslashes($row['it_id'])."</b>\n";
}
if ($this->view_it_name) {
echo "<b>".stripslashes($row['it_name'])."</b>\n";
}
if ($this->view_it_cust_price) {
echo "<span class=\"sct_cost\">".display_price($row['it_cust_price'])."</span>\n";
}
if ($this->view_it_price) {
echo "<span class=\"sct_cost\">".display_price(get_price($row), $row['it_tel_inq'])."</span>\n";
}
if ($this->view_it_icon) {
echo "<span class=\"sct_icon\">".item_icon($row)."</span>\n";
}
if ($this->view_sns) {
echo "<div class=\"sct_sns\">";
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 "</div>\n";
}
if ($this->href) {
echo "</a>\n";
}
// 관련상품
echo "<div class=\"sct_rel\">".relation_item($row['it_id'], 70, 0, 5)."</div>\n";
echo "</li>\n";
}
if ($i > 1) echo '</ul>';
if($i == 1) echo '<p class="sct_noitem">등록된 상품이 없습니다.</p>';
if ($i > 1) echo "</ul>\n";
if($i == 1) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
?>
<!-- } 상품진열13 끝 -->

View File

@ -1,46 +0,0 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// $list_mod 가로 나열 수
?>
<link rel="stylesheet" href="<?php echo $shop_skin_url ?>/style.css">
<!-- 상품진열 10 시작 { -->
<?php
for ($i=1; $row=sql_fetch_array($result); $i++) {
$href = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($list_mod >= 2) { // 1줄 이미지 : 2개 이상
if ($i%$list_mod == 0) $sct_last = 'sct_last'; // 줄 마지막
else if ($i%$list_mod == 1) $sct_last = 'sct_clear'; // 줄 첫번째
else $sct_last = '';
} else { // 1줄 이미지 : 1개
$sct_last = 'sct_clear';
}
$sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']);
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) echo '<ul class="sct sct_10">';
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<span class="sct_cost"><?php echo display_price(get_price($row), $row['it_tel_inq']); ?></span>
<span class="sct_icon">
<?php //echo display_item_icon($row); // 이미지 아이콘?>
</span>
</a>
<div class="sct_sns">
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_SHOP_URL.'/img/sns_fb.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_SHOP_URL.'/img/sns_twt.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_SHOP_URL.'/img/sns_goo.png'); ?>
</div>
</li>
<?php
}
if ($i > 1) echo '</ul>';
if($i == 1) echo '<p class="sct_noitem">등록된 상품이 없습니다.</p>';
?>
<!-- } 상품진열 10 끝 -->

View File

@ -1,46 +0,0 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// $list_mod 가로 나열 수
?>
<link rel="stylesheet" href="<?php echo $shop_skin_url ?>/style.css">
<!-- 상품진열 11 시작 { -->
<?php
for ($i=1; $row=sql_fetch_array($result); $i++) {
$href = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($list_mod >= 2) { // 1줄 이미지 : 2개 이상
if ($i%$list_mod == 0) $sct_last = 'sct_last'; // 줄 마지막
else if ($i%$list_mod == 1) $sct_last = 'sct_clear'; // 줄 첫번째
else $sct_last = '';
} else { // 1줄 이미지 : 1개
$sct_last = 'sct_clear';
}
$sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']);
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
if ($i == 1) echo '<ul class="sct sct_11">';
?>
<li class="sct_li <?php echo $sct_last; ?>">
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_img"><?php echo get_it_image($row['it_id'], $img_width, $img_height); ?></span>
<b><?php echo stripslashes($row['it_name']); ?></b>
<span class="sct_cost"><?php echo display_price(get_price($row), $row['it_tel_inq']); ?></span>
<span class="sct_icon">
<?php echo display_item_icon($row); // 이미지 아이콘?>
</span>
</a>
<div class="sct_sns">
<?php echo get_sns_share_link('facebook', $sns_url, $sns_title, G4_URL.'/img/shop/sns_fb.png'); ?>
<?php echo get_sns_share_link('twitter', $sns_url, $sns_title, G4_URL.'/img/shop/sns_twt.png'); ?>
<?php echo get_sns_share_link('googleplus', $sns_url, $sns_title, G4_URL.'/img/shop/sns_goo.png'); ?>
</div>
</li>
<?php
}
if ($i > 1) echo '</ul>';
if($i == 1) echo '<p class="sct_noitem">등록된 상품이 없습니다.</p>';
?>
<!-- } 상품진열 11 끝 -->