모바일 관련상품 설정 추가

This commit is contained in:
chicpro
2014-02-24 13:56:04 +09:00
parent 73b2917195
commit c90a3f69e6
9 changed files with 80 additions and 35 deletions

View File

@ -55,6 +55,15 @@ if(!isset($default['de_shop_layout_use'])) {
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
ADD `de_shop_layout_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_root_index_use` ", true);
}
// 모바일 관련상품 설정 필드추가
if(!isset($default['de_mobile_rel_list_use'])) {
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
ADD `de_mobile_rel_list_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_rel_img_height`,
ADD `de_mobile_rel_list_skin` varchar(255) NOT NULL DEFAULT '' AFTER `de_mobile_rel_list_use`,
ADD `de_mobile_rel_img_width` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_rel_list_skin`,
ADD `de_mobile_rel_img_height` int(11) NOT NULL DEFAULT ' 0' AFTER `de_mobile_rel_img_width`", true);
}
?>
<form name="fconfig" action="./configformupdate.php" onsubmit="return fconfig_check(this)" method="post" enctype="MULTIPART/FORM-DATA">
@ -764,6 +773,22 @@ if(!isset($default['de_shop_layout_use'])) {
<input type="checkbox" name="de_rel_list_use" value="1" id="de_rel_list_use" <?php echo $default['de_rel_list_use']?"checked":""; ?>>
</td>
</tr>
<tr>
<th scope="row">모바일 관련상품출력</th>
<td>
<?php echo help("관련상품의 경우 등록된 상품은 모두 출력하므로 '출력할 줄 수'는 설정하지 않습니다. 이미지높이를 0으로 설정하면 상품이미지를 이미지폭에 비례하여 생성합니다."); ?>
<label for="de_mobile_rel_list_skin">스킨</label>
<select name="de_mobile_rel_list_skin" id="de_mobile_rel_list_skin">
<?php echo get_list_skin_options("^relation.[0-9]+\.skin\.php", G5_MSHOP_SKIN_PATH, $default['de_mobile_rel_list_skin']); ?>
</select>
<label for="de_mobile_rel_img_width">이미지폭</label>
<input type="text" name="de_mobile_rel_img_width" value="<?php echo $default['de_mobile_rel_img_width']; ?>" id="de_mobile_rel_img_width" class="frm_input" size="3">
<label for="de_mobile_rel_img_height">이미지높이</label>
<input type="text" name="de_mobile_rel_img_height" value="<?php echo $default['de_mobile_rel_img_height']; ?>" id="de_mobile_rel_img_height" class="frm_input" size="3">
<label for="de_mobile_rel_list_use">출력</label>
<input type="checkbox" name="de_mobile_rel_list_use" value="1" id="de_mobile_rel_list_use" <?php echo $default['de_mobile_rel_list_use']?"checked":""; ?>>
</td>
</tr>
<tr>
<th scope="row">검색상품출력</th>
<td>

View File

@ -97,6 +97,10 @@ $sql = " update {$g5['g5_shop_default_table']}
de_rel_list_mod = '$de_rel_list_mod',
de_rel_img_width = '$de_rel_img_width',
de_rel_img_height = '$de_rel_img_height',
de_mobile_rel_list_use = '$de_mobile_rel_list_use',
de_mobile_rel_list_skin = '$de_mobile_rel_list_skin',
de_mobile_rel_img_width = '$de_mobile_rel_img_width',
de_mobile_rel_img_height = '$de_mobile_rel_img_height',
de_search_list_skin = '$de_search_list_skin',
de_search_list_mod = '$de_search_list_mod',
de_search_list_row = '$de_search_list_row',

View File

@ -239,6 +239,10 @@ CREATE TABLE IF NOT EXISTS `g5_shop_default` (
`de_rel_list_mod` int(11) NOT NULL DEFAULT '0',
`de_rel_img_width` int(11) NOT NULL DEFAULT '0',
`de_rel_img_height` int(11) NOT NULL DEFAULT '0',
`de_mobile_rel_list_use` tinyint(4) NOT NULL DEFAULT '0',
`de_mobile_rel_list_skin` varchar(255) NOT NULL DEFAULT '',
`de_mobile_rel_img_width` int(11) NOT NULL DEFAULT '0',
`de_mobile_rel_img_height` int(11) NOT NULL DEFAULT '0',
`de_search_list_skin` varchar(255) NOT NULL DEFAULT '',
`de_search_list_mod` int(11) NOT NULL DEFAULT '0',
`de_search_list_row` int(11) NOT NULL DEFAULT '0',

View File

@ -302,9 +302,15 @@ if($g5_shop_install) {
de_hope_date_after = '3',
de_baesong_content = '<b>배송 안내 입력전입니다.</b>',
de_change_content = '<b>교환/반품 안내 입력전입니다.</b>',
de_rel_list_use = '1',
de_rel_list_skin = 'relation.10.skin.php',
de_rel_list_mod = '3',
de_rel_img_width = '$simg_width',
de_rel_img_height = '$simg_height',
de_mobile_rel_list_use = '1',
de_mobile_rel_list_skin = 'relation.10.skin.php',
de_mobile_rel_img_width = '$simg_width',
de_mobile_rel_img_height = '$simg_height',
de_search_list_skin = 'list.10.skin.php',
de_search_img_width = '$simg_width',
de_search_img_height = '$simg_height',

View File

@ -105,13 +105,15 @@ $sql = " select count(*) as cnt from `{$g5['g5_shop_item_qa_table']}` where it_i
$row = sql_fetch($sql);
$item_qa_count = $row['cnt'];
// 관련상품의 개수를 얻음
$sql = " select count(*) as cnt
from {$g5['g5_shop_item_relation_table']} a
left join {$g5['g5_shop_item_table']} b on (a.it_id2=b.it_id and b.it_use='1')
where a.it_id = '{$it['it_id']}' ";
$row = sql_fetch($sql);
$item_relation_count = $row['cnt'];
if ($default['de_rel_list_use']) {
// 관련상품의 개수를 얻음
$sql = " select count(*) as cnt
from {$g5['g5_shop_item_relation_table']} a
left join {$g5['g5_shop_item_table']} b on (a.it_id2=b.it_id and b.it_use='1')
where a.it_id = '{$it['it_id']}' ";
$row = sql_fetch($sql);
$item_relation_count = $row['cnt'];
}
// 상품품절체크
$is_soldout = is_soldout($it['it_id']);

View File

@ -40,13 +40,15 @@ $sql = " select count(*) as cnt from `{$g5['g5_shop_item_qa_table']}` where it_i
$row = sql_fetch($sql);
$item_qa_count = $row['cnt'];
// 관련상품의 개수를 얻음
$sql = " select count(*) as cnt
from {$g5['g5_shop_item_relation_table']} a
left join {$g5['g5_shop_item_table']} b on (a.it_id2=b.it_id and b.it_use='1')
where a.it_id = '{$it['it_id']}' ";
$row = sql_fetch($sql);
$item_relation_count = $row['cnt'];
if ($default['de_rel_list_use']) {
// 관련상품의 개수를 얻음
$sql = " select count(*) as cnt
from {$g5['g5_shop_item_relation_table']} a
left join {$g5['g5_shop_item_table']} b on (a.it_id2=b.it_id and b.it_use='1')
where a.it_id = '{$it['it_id']}' ";
$row = sql_fetch($sql);
$item_relation_count = $row['cnt'];
}
function pg_anchor($info) {
global $default;
@ -60,7 +62,9 @@ function pg_anchor($info) {
<li><a href="<?php echo $href; ?>&amp;info=qa" <?php if ($info == 'qa') echo 'class="sanchor_on"'; ?>>상품문의 <span class="item_qa_count"><?php echo $item_qa_count; ?></span></a></li>
<?php if ($default['de_baesong_content']) { ?><li><a href="<?php echo $href; ?>&amp;info=dvr" <?php if ($info == 'dvr') echo 'class="sanchor_on"'; ?>>배송정보</a></li><?php } ?>
<?php if ($default['de_change_content']) { ?><li><a href="<?php echo $href; ?>&amp;info=ex" <?php if ($info == 'ex') echo 'class="sanchor_on"'; ?>>교환정보</a></li><?php } ?>
<?php if ($default['de_rel_list_use']) { ?>
<li><a href="<?php echo $href; ?>&amp;info=rel" <?php if ($info == 'rel') echo 'class="sanchor_on"'; ?>>관련상품 <span class="item_relation_count"><?php echo $item_relation_count; ?></span></a></li>
<?php } ?>
<li><button type="button" id="iteminfo_close" onclick="self.close();">창닫기</button></li>
</ul>
<?php

View File

@ -296,7 +296,7 @@ $href = G5_SHOP_URL.'/iteminfo.php?it_id='.$it_id;
<li><a href="<?php echo $href; ?>&amp;info=qa" target="_blank">상품문의 <span class="item_qa_count"><?php echo $item_qa_count; ?></span></a></li>
<?php if ($default['de_baesong_content']) { ?><li><a href="<?php echo $href; ?>&amp;info=dvr" target="_blank">배송정보</a></li><?php } ?>
<?php if ($default['de_change_content']) { ?><li><a href="<?php echo $href; ?>&amp;info=ex" target="_blank">교환정보</a></li><?php } ?>
<?php if($default['de_rel_list_use']) {?>
<?php if($default['de_mobile_rel_list_use']) {?>
<li><a href="<?php echo $href; ?>&amp;info=rel" target="_blank">관련상품 <span class="item_relation_count"><?php echo $item_relation_count; ?></span></a></li>
<?php } ?>
</ul>

View File

@ -11,7 +11,7 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">',
<?php
$sql = " select b.* from {$g5['g5_shop_item_relation_table']} a left join {$g5['g5_shop_item_table']} b on (a.it_id2=b.it_id) where a.it_id = '{$it['it_id']}' and b.it_use='1' ";
$list = new item_list("relation.10.skin.php", $default['de_rel_list_mod'], 1, $default['de_rel_img_width'], $default['de_rel_img_height']);
$list = new item_list($default['de_mobile_rel_list_skin'], 1, 1, $default['de_mobile_rel_img_width'], $default['de_mobile_rel_img_height']);
$list->set_mobile(true);
$list->set_query($sql);
$list->set_view('sns', true);

View File

@ -5,22 +5,16 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">', 0);
?>
<script src="<?php echo G5_JS_URL ?>/jquery.fancylist.js"></script>
<!-- 상품진열 10 시작 { -->
<?php
for ($i=1; $row=sql_fetch_array($result); $i++) {
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';
}
if ($i == 1) {
for ($i=0; $row=sql_fetch_array($result); $i++) {
if ($i == 0) {
if ($this->css) {
echo "<ul class=\"{$this->css}\">\n";
echo "<ul id=\"sct_wrap\" class=\"{$this->css}\">\n";
} else {
echo "<ul class=\"sct sct_10\">\n";
echo "<ul id=\"sct_wrap\" class=\"sct sct_10\">\n";
}
}
@ -38,6 +32,10 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
echo "</a>\n";
}
if ($this->view_it_icon) {
echo "<div class=\"sct_icon\">".item_icon($row)."</div>\n";
}
if ($this->view_it_id) {
echo "<span class=\"sct_id\">&lt;".stripslashes($row['it_id'])."&gt;</span>\n";
}
@ -74,10 +72,6 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
}
if ($this->view_it_icon) {
echo "<div class=\"sct_icon\">".item_icon($row)."</div>\n";
}
if ($this->view_sns) {
$sns_url = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
$sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']);
@ -96,8 +90,14 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
echo "</li>\n";
}
if ($i > 1) echo "</ul>\n";
if ($i > 0) echo "</ul>\n";
if($i == 1) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
if($i == 0) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
?>
<!-- } 상품진열 10 끝 -->
<!-- } 상품진열 10 끝 -->
<script>
$(function() {
$("#sct_wrap").fancyList("li.sct_li", "sct_clear");
});
</script>