안녕하세요. 정말 초보입니다.
관련링크
본문
상위 카테고리 표기는 잘 되어지는데요,
하위 카테고리가 표시되지 않고 있습니다.
<?php
include_once('./_common.php');
// 상품 리스트에서 다른 필드로 정렬을 하려면 아래의 배열 코드에서 해당 필드를 추가하세요.
if( isset($sort) && ! in_array($sort, array('it_sum_qty', 'it_price', 'it_use_avg', 'it_use_cnt', 'it_update_time')) ){
$sort='';
}
if (G5_IS_MOBILE) {
include_once(G5_MSHOP_PATH.'/list.php');
return;
}
$sql = " select * from {$g5['g5_shop_category_table']} where ca_id = '$ca_id' and ca_use = '1' ";
$ca = sql_fetch($sql);
if (!$ca['ca_id'])
alert('등록된 분류가 없습니다.');
// 테마미리보기 스킨 등의 변수 재설정
if(defined('_THEME_PREVIEW_') && _THEME_PREVIEW_ === true) {
$ca['ca_skin'] = (isset($tconfig['ca_skin']) && $tconfig['ca_skin']) ? $tconfig['ca_skin'] : $ca['ca_skin'];
$ca['ca_img_width'] = (isset($tconfig['ca_img_width']) && $tconfig['ca_img_width']) ? $tconfig['ca_img_width'] : $ca['ca_img_width'];
$ca['ca_img_height'] = (isset($tconfig['ca_img_height']) && $tconfig['ca_img_height']) ? $tconfig['ca_img_height'] : $ca['ca_img_height'];
$ca['ca_list_mod'] = (isset($tconfig['ca_list_mod']) && $tconfig['ca_list_mod']) ? $tconfig['ca_list_mod'] : $ca['ca_list_mod'];
$ca['ca_list_row'] = (isset($tconfig['ca_list_row']) && $tconfig['ca_list_row']) ? $tconfig['ca_list_row'] : $ca['ca_list_row'];
}
// 본인인증, 성인인증체크
if(!$is_admin) {
$msg = shop_member_cert_check($ca_id, 'list');
if($msg)
alert($msg, G5_SHOP_URL);
}
$g5['title'] = $ca['ca_name'].' 상품리스트';
if ($ca['ca_include_head'] && is_include_path_check($ca['ca_include_head']))
@include_once($ca['ca_include_head']);
else
include_once(G5_SHOP_PATH.'/_head.php');
// 스킨경로
$skin_dir = G5_SHOP_SKIN_PATH;
if($ca['ca_skin_dir']) {
if(preg_match('#^theme/(.+)$#', $ca['ca_skin_dir'], $match))
$skin_dir = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
else
$skin_dir = G5_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_skin_dir'];
if(is_dir($skin_dir)) {
$skin_file = $skin_dir.'/'.$ca['ca_skin'];
if(!is_file($skin_file))
$skin_dir = G5_SHOP_SKIN_PATH;
} else {
$skin_dir = G5_SHOP_SKIN_PATH;
}
}
$ca_name_2 = '';
if(strlen($ca_id) ==2){
$ca_name_2 = '선유당';
}else if(strlen($ca_id) ==2){
$ca_name_2 = $ca['ca_name'];
$ca_name_3 = '선포에버';
$ca_name_4 = '프리미엄';
$ca_name_5 = '웰빙';
}else if(strlen($ca_id) == 2){
$ca_id_2 = substr($ca_id,0,50);
$sql2 = " select * from {$g5['g5_shop_category_table']} where ca_id = '$ca_id_2' and ca_use = '50' ";
$ca2 = sql_fetch($sql2);
$ca_name_2 = $ca2['ca_name'];
$ca_name_3 = $ca3['ca_name'];
$ca_name_4 = $ca4['ca_name'];
$ca_name_5 = $ca5['ca_name'];
}
define('G5_SHOP_CSS_URL', str_replace(G5_PATH, G5_URL, $skin_dir));
echo '<!-- navi -->
<div class="navi">
<ul class="clfx">
<li><a href="/index.php" style = "background-image:none;display:contents"><img src="/img/icon_home.gif" alt="home"/></a></li>';
if (($ca_id >= 1010 && $ca_id <= 1040) || ($ca_id == 102010 || $ca_id ==102020 || $ca_id ==103010 || $ca_id ==103020 || $ca_id ==104010 || $ca_id ==104020) || $ca_id == 30 || $ca_id == 10 ){
echo '<li class="top_menu_down">
<a href="/shop/list.php?ca_id=10" id="locateBar" class="arrow">전체상품보기</a>
<ul id="list_toggle" class="top_menu_list" style="display: none;">
<li><a href="/shop/list.php?ca_id=1010">선유당</a></li>
<li><a href="/shop/list.php?ca_id=1020">선포에버</a></li>
<li><a href="/shop/list.php?ca_id=1030">프리미엄</a></li>
<li><a href="/shop/list.php?ca_id=1040">웰빙</a></li>
</ul>
</li>
<li class="top_menu_down">';
echo '<a href="#" id="locateBar2" class="arrow">선유당</a>';
// if($ca_id == 1010){
// echo '<a href="#" id="locateBar2" class="arrow">선유당</a>';
// } elseif($ca_id == 1020){
// echo '<a href="#" id="locateBar2" class="arrow">선포에버</a>';
// } elseif($ca_id == 1030){
// echo '<a href="#" id="locateBar2" class="arrow">프리미엄</a>';
// } elseif($ca_id == 1040){
// echo '<a href="#" id="locateBar2" class="arrow">웰빙</a>';
// }
$isActive = '';
if($ca_id == 10){
$isActive = 'hide';
}
echo '<ul id="list_toggle2" class="top_menu_list" style="display: none;">
<li><a class="'.(substr($ca_id,0,6) == 1010 ? "active": "").'" href="/shop/list.php?ca_id=1010">선유당 전체보기</a></li>
<li><a class="'.(substr($ca_id,0,6) == 101010 ? "active": "").'" href="/shop/list.php?ca_id=101010">고춧가루</a></li>
<li><a class="'.(substr($ca_id,0,6) == 101020 ? "active": "").'" href="/shop/list.php?ca_id=101020">건고추</a></li>
<li><a class="'.(substr($ca_id,0,6) == 101030 ? "active": "").'" href="/shop/list.php?ca_id=101030">깨</a></li>
<li><a class="'.(substr($ca_id,0,6) == 101040 ? "active": "").'" href="/shop/list.php?ca_id=101040">곡물 . 후추</a></li>
<li><a class="'.(substr($ca_id,0,6) == 101050 ? "active": "").'" href="/shop/list.php?ca_id=101050">기름</a></li>
</ul>
<li class="top_menu_down">';
echo '<a href="#" id="locateBar3" class="arrow">선포에버</a>';
// if($ca_id == 1020 || $ca_id == 102010){
// echo '<a href="#" id="locateBar3" class="arrow">선포에버웰빙</a>';
// } elseif($ca_id == 1020 || $ca_id == 102020){
// echo '<a href="#" id="locateBar3" class="arrow">고춧가루</a>';
// } elseif($ca_id == 1020 || $ca_id == 102030){
// echo '<a href="#" id="locateBar3" class="arrow">건고추</a>';
// } elseif($ca_id == 1020 || $ca_id == 102040){
// echo '<a href="#" id="locateBar3" class="arrow">고추씨</a>';
// } elseif($ca_id == 1020 || $ca_id == 102050){
// echo '<a href="#" id="locateBar3" class="arrow">깨</a>';
// } elseif($ca_id == 1020 || $ca_id == 102060){
// echo '<a href="#" id="locateBar3" class="arrow">기름</a>';
// }
$isActive = '';
if($ca_id == 10){
$isActive = 'hide';
}
echo '<ul id="list_toggle3" class="top_menu_list" style="display: none;">
<li><a class="'.(substr($ca_id,0,6) == 1020 ? "active": "").'" href="/shop/list.php?ca_id=1020">선포에버 전체보기</a></li>
<li><a class="'.(substr($ca_id,0,6) == 102010 ? "active": "").'" href="/shop/list.php?ca_id=102010">선포에버웰빙</a></li>
<li><a class="'.(substr($ca_id,0,6) == 102020 ? "active": "").'" href="/shop/list.php?ca_id=102020">고춧가루</a></li>
<li><a class="'.(substr($ca_id,0,6) == 102030 ? "active": "").'" href="/shop/list.php?ca_id=102030">건고추</a></li>
<li><a class="'.(substr($ca_id,0,6) == 102040 ? "active": "").'" href="/shop/list.php?ca_id=102040">고추씨</a></li>
<li><a class="'.(substr($ca_id,0,6) == 102050 ? "active": "").'" href="/shop/list.php?ca_id=102050">깨</a></li>
<li><a class="'.(substr($ca_id,0,6) == 102060 ? "active": "").'" href="/shop/list.php?ca_id=102060">기름</a></li>
</ul>
<li class="top_menu_down">';
echo '<a href="#" id="locateBar4" class="arrow">프리미엄</a>';
// if($ca_id == 1030 || $ca_id == 103010){
// echo '<a href="#" id="locateBar4" class="arrow">고춧가루</a>';
// } elseif($ca_id == 1030 || $ca_id == 103020){
// echo '<a href="#" id="locateBar4" class="arrow">건고추</a>';
// } elseif($ca_id == 1030 || $ca_id == 103030){
// echo '<a href="#" id="locateBar4" class="arrow">고추씨</a>';
// } elseif($ca_id == 1030 || $ca_id == 103040){
// echo '<a href="#" id="locateBar4" class="arrow">깨</a>';
// } elseif($ca_id == 1030 || $ca_id == 103050){
// echo '<a href="#" id="locateBar4" class="arrow">기름</a>';
// }
$isActive = '';
if($ca_id == 10){
$isActive = 'hide';
}
echo '<ul id="list_toggle4" class="top_menu_list" style="display: none;">
<li><a class="'.(substr($ca_id,0,6) == 1030 ? "active": "").'" href="/shop/list.php?ca_id=1030">프리미엄 전체보기</a></li>
<li><a class="'.(substr($ca_id,0,6) == 103010 ? "active": "").'" href="/shop/list.php?ca_id=103010">고춧가루</a></li>
<li><a class="'.(substr($ca_id,0,6) == 103020 ? "active": "").'" href="/shop/list.php?ca_id=103020">건고추</a></li>
<li><a class="'.(substr($ca_id,0,6) == 103030 ? "active": "").'" href="/shop/list.php?ca_id=103030">고추씨</a></li>
<li><a class="'.(substr($ca_id,0,6) == 103040 ? "active": "").'" href="/shop/list.php?ca_id=103040">깨</a></li>
<li><a class="'.(substr($ca_id,0,6) == 103050 ? "active": "").'" href="/shop/list.php?ca_id=103050">기름</a></li>
</ul>
<li class="top_menu_down">';
echo '<a href="#" id="locateBar5" class="arrow">웰빙</a>';
// if($ca_id == 1040 || $ca_id == 104010){
// echo '<a href="#" id="locateBar5" class="arrow">맛나요</a>';
// }
$isActive = '';
if($ca_id == 10){
$isActive = 'hide';
}
echo '<ul id="list_toggle5" class="top_menu_list" style="display: none;">
<li><a class="'.(substr($ca_id,0,6) == 1040 ? "active": "").'" href="/shop/list.php?ca_id=1040">웰빙 전체보기</a></li>
<li><a class="'.(substr($ca_id,0,6) == 104010 ? "active": "").'" href="/shop/list.php?ca_id=104010">웰빙</a></li>
</ul>
</li>
</ul>
</div>
<!-- //navi -->';
}
if (($ca_id >= 2010 && $ca_id <= 2050) || ($ca_id == 202010 ||$ca_id == 202020 || $ca_id ==203010 || $ca_id ==203020 || $ca_id ==204010 || $ca_id ==204040) || $ca_id == 20 ){
echo '<li class="top_menu_down">
<a href="#" id="locateBar" class="arrow">식자재용 제품</a>
<ul id="list_toggle" class="top_menu_list" style="display: none;">
<li><a href="/page/company.php">회사소개</a></li>
<li><a href="/page/brand.php">선유당 이야기</a></li>
<li><a href="/shop/list.php?ca_id=10">가정용 제품</a></li>
<li><a class = "active" href="/shop/list.php?ca_id=20">식자재용 제품</a></li>
<li><a href="/bbs/board.php?bo_table=notice">고객센터</a></li>
</ul>
</li>
<li class="top_menu_down">';
echo '<a href="#" id="locateBar2" class="arrow">'.$ca_name_2.'</a>';
// if($ca_id == 2040 || $ca_id == 204010 || 204040){
// echo '<a href="#" id="locateBar2" class="arrow">'.$ca['ca_name'].'</a>';
// } elseif($ca_id == 2020 || $ca_id == 202010 || $ca_id == 202020){
// echo '<a href="#" id="locateBar2" class="arrow">기름</a>';
// } elseif($ca_id == 2030 || $ca_id == 203010 || 203020){
// echo '<a href="#" id="locateBar2" class="arrow">깨</a>';
// }
// elseif($ca_id == 20){
// echo '<a href="#" id="locateBar2" class="arrow">식자재용제품</a>';
// }
echo '<ul id="list_toggle2" class="top_menu_list" style="display: none;">
<li><a class="'.(substr($ca_id,0,4) == 20 ? "active": "").'" href="/shop/list.php?ca_id=20">전체</a></li>
<li><a class="'.(substr($ca_id,0,4) == 2040 ? "active": "").'" href="/shop/list.php?ca_id=2040">고춧가루</a></li>
<li><a class="'.(substr($ca_id,0,4) == 2020 ? "active": "").'" href="/shop/list.php?ca_id=2020">기름</a></li>
<li><a class="'.(substr($ca_id,0,4) == 2030 ? "active": "").'" href="/shop/list.php?ca_id=2030">깨</a></li>
</ul>
</li>';
$isActive = '';
if($ca_id == 20){
$isActive = 'hide';
}
echo '
<li class="top_menu_down '.$isActive.'">'
.'<a href="#" id="locateBar3" class="arrow">'.$ca_name_3.'</a>'.
'<ul id="list_toggle3" class="top_menu_list" style="display: none;">';
if($ca_id ==2020 || $ca_id == 202010 || $ca_id == 202020){
echo '<li><a class="'.($ca_id == 2020 ? "active": "").'" href="/shop/list.php?ca_id=2020">전체</a></li>';
echo '<li><a class="'.($ca_id == 202010 ? "active": "").'" href="/shop/list.php?ca_id=202010">국내산</a></li>';
echo '<li><a class="'.($ca_id == 202020 ? "active": "").'" href="/shop/list.php?ca_id=202020">수입산</a></li>';
} elseif($ca_id==2030 || $ca_id == 203010 || $ca_id == 203020){
echo '<li><a class="'.($ca_id == 2030 ? "active": "").'" href="/shop/list.php?ca_id=2030">전체</a></li>';
echo '<li><a class="'.($ca_id == 203010 ? "active": "").'" href="/shop/list.php?ca_id=203010">국내산</a></li>';
echo '<li><a class="'.($ca_id == 203020 ? "active": "").'" href="/shop/list.php?ca_id=203020">수입산</a></li>';
} elseif($ca_id==2040 || $ca_id == 204010 || $ca_id == 204040){
echo '<li><a class="'.($ca_id == 2040 ? "active": "").'" href="/shop/list.php?ca_id=2040">전체</a></li>';
echo '<li><a class="'.($ca_id == 204010 ? "active": "").'" href="/shop/list.php?ca_id=204010">국내산</a></li>';
echo '<li><a class="'.($ca_id == 204040 ? "active": "").'" href="/shop/list.php?ca_id=204040">수입산</a></li>';
}
echo ' </ul>
</li>
</ul>
</div>
<!-- //navi -->';
}
// if ($is_admin)
// echo '<div class="sct_admin"><a href="'.G5_ADMIN_URL.'/shop_admin/categoryform.php?w=u&ca_id='.$ca_id.'" class="btn_admin">분류 관리</a></div>';
//
?>
<script>
var itemlist_ca_id = "<?php echo $ca_id; ?>";
</script>
<script src="<?php echo G5_JS_URL; ?>/shop.list.js"></script>
<!-- 상품 목록 시작 { -->
<div id="sct">
<?php
$nav_skin = $skin_dir.'/navigation.skin.php';
if(!is_file($nav_skin))
$nav_skin = G5_SHOP_SKIN_PATH.'/navigation.skin.php';
include $nav_skin;
// 상단 HTML
// echo '<div id="sct_hhtml">'.conv_content($ca['ca_head_html'], 1).'</div>';
$cate_skin = $skin_dir.'/listcategory.skin.php';
if(!is_file($cate_skin))
$cate_skin = G5_SHOP_SKIN_PATH.'/listcategory.skin.php';
include $cate_skin;
// 상품 출력순서가 있다면
if ($sort != "")
$order_by = $sort.' '.$sortodr.' , it_order, it_id desc';
else
$order_by = 'it_order, it_id desc';
$error = '<p class="sct_noitem">등록된 상품이 없습니다.</p>';
// 리스트 스킨
$skin_file = is_include_path_check($skin_dir.'/'.$ca['ca_skin']) ? $skin_dir.'/'.$ca['ca_skin'] : $skin_dir.'/list.10.skin.php';
if (file_exists($skin_file)) {
// echo '<div id="sct_sortlst">';
$sort_skin = $skin_dir.'/list.sort.skin.php';
if(!is_file($sort_skin))
$sort_skin = G5_SHOP_SKIN_PATH.'/list.sort.skin.php';
include $sort_skin;
// 상품 보기 타입 변경 버튼
$sub_skin = $skin_dir.'/list.sub.skin.php';
if(!is_file($sub_skin))
$sub_skin = G5_SHOP_SKIN_PATH.'/list.sub.skin.php';
include $sub_skin;
echo '</div>';
// 총몇개 = 한줄에 몇개 * 몇줄
$items = $ca['ca_list_mod'] * $ca['ca_list_row'];
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page < 1) $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $items;
$list = new item_list($skin_file, $ca['ca_list_mod'], $ca['ca_list_row'], $ca['ca_img_width'], $ca['ca_img_height']);
$list->set_category($ca['ca_id'], 1);
$list->set_category($ca['ca_id'], 2);
$list->set_category($ca['ca_id'], 3);
$list->set_is_page(true);
$list->set_order_by($order_by);
$list->set_from_record($from_record);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_basic', true);
$list->set_view('it_cust_price', true);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
$list->set_view('sns', true);
echo $list->run();
// where 된 전체 상품수
$total_count = $list->total_count;
// 전체 페이지 계산
$total_page = ceil($total_count / $items);
}
else
{
echo '<div class="sct_nofile">'.str_replace(G5_PATH.'/', '', $skin_file).' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</div>';
}
?>
<?php
$qstr1 .= 'ca_id='.$ca_id;
$qstr1 .='&sort='.$sort.'&sortodr='.$sortodr;
echo get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$qstr1.'&page=');
?>
<?php
// 하단 HTML
echo '<div id="sct_thtml">'.conv_content($ca['ca_tail_html'], 1).'</div>';
?>
</div>
<!-- } 상품 목록 끝 -->
</div>
<?php
if ($ca['ca_include_tail'] && is_include_path_check($ca['ca_include_tail']))
@include_once($ca['ca_include_tail']);
else
include_once(G5_SHOP_PATH.'/_tail.php');
echo "\n<!-- {$ca['ca_skin']} -->\n";
?>
이 소스 수정하다가 이런 상황이 온 것 같습니다.
초보라 설명 드리기도 부실하기 이를데 없고.
절박한 심정으로 여쭤봅니다.
답변 1
카테 메뉴 아이디를 확인해보니 1010 외 카테고리를 호출을 못하고있고,
그리고 20 202020 까지만 호출이 되고 202030 부터 호출을 못하고 있는것 같습니다.
여기보시면 중복된 선유당 과 선포에버것이 있습니다.
하지만 현재보시면 css 가 문제인듯합니다. 숨기고 있는듯해요