리스트 카테고리 하위메뉴.. 고수님들 도와주세요 ㅠㅠ
안녕하세용
listcategory.skin.php 파일입니다..
Copy
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$str = '';
$exists = false;
$ca_id_len = strlen($ca_id);
$len2 = $ca_id_len + 2;
$len4 = $ca_id_len + 4;
if($ca_id_len == 2) {
$ca_id = substr($ca_id,0,2);
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$ca_id%' and length(ca_id) = 4 and ca_use = '1' order by ca_order, ca_id ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result)) {
$row2 = sql_fetch(" select count(*) as cnt from {$g5['g5_shop_item_table']} where (ca_id like '{$row['ca_id']}%' or ca_id2 like '{$row['ca_id']}%' or ca_id3 like '{$row['ca_id']}%') and it_use = '1' ");
$str .= '<li><a href="'.shop_category_url($row['ca_id']).'">'.$row['ca_name'].' ('.$row2['cnt'].')</a></li>';
$exists = true;
}
} elseif($ca_id_len == 4){
$ca_id = substr($ca_id,0,2);
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$ca_id%' and length(ca_id) = 4 and ca_use = '1' order by ca_order, ca_id ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result)) {
$row2 = sql_fetch(" select count(*) as cnt from {$g5['g5_shop_item_table']} where (ca_id like '{$row['ca_id']}%' or ca_id2 like '{$row['ca_id']}%' or ca_id3 like '{$row['ca_id']}%') and it_use = '1' ");
$str .= '<li><a href="'.shop_category_url($row['ca_id']).'">'.$row['ca_name'].' ('.$row2['cnt'].')</a></li>';
$exists = true;
}
} elseif($ca_id_len == 6){
$ca_id = substr($ca_id,0,6);
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$len4%' and length(ca_id) = 4 and ca_use = '1' order by ca_order, ca_id ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result)) {
$row2 = sql_fetch(" select count(*) as cnt from {$g5['g5_shop_item_table']} where (ca_id like '{$row['ca_id']}%' or ca_id2 like '{$row['ca_id']}%' or ca_id3 like '{$row['ca_id']}%') and it_use = '1' ");
$str .= '<li><a href="'.shop_category_url($row['ca_id']).'">'.$row['ca_name'].' ('.$row2['cnt'].')</a></li>';
$exists = true;
}
}
if ($exists) {
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">', 0);
?>
<!-- 상품분류 1 시작 { -->
<aside id="sct_ct_1" class="sct_ct">
<h2>현재 상품 분류와 관련된 분류</h2>
<ul>
<li><a href="<?php echo shop_category_url(substr($ca_id,0,2)); ?>">전체</a></li>
<?php echo $str; ?>
</ul>
</aside>
<!-- } 상품분류 1 끝 -->
<?php }
전체 = 10
고양이 1 = 1010
고양이 2 = 1020
고양이 3 = 1030
이상태에서 아무대나 들어가도 저 메뉴가 고정돼어있는 상태입니다..
여기서 고양이 1,2,3을 눌렀을때 하위메뉴로 고양이 1을 누르면 고양이 4 = 101010 또는 고양이2를 누르면 102010 이런식으로 하위메뉴가 생기게 할수 있을까요..? 도와주세요고수님들 ㅠㅠ 냥냥..
|
답변 1개
답변을 작성하려면 로그인이 필요합니다.