카테고리 문제인데요
본문
헤드 메뉴부분에 보이는 SHOP / 키즈&쥬니어 가 따로있는데
각각 메뉴로 눌러 들어가면 내용 왼쪽사이드에 보이는 메뉴에 샵이랑 키즈쥬니어가 같이나타나서요 ㅠㅠ
shop을 누르면 shop만, 키즈쥬니어를 누르면 키즈쥬니어만 떴으면 하는데
제가 작업한게 아니라 어떻게 수정을 해야할지 잘 모르겠어요 ㅠㅠ
작업자분한테 연락했더니 listcategory.skin 여기서 수정하셨다고 하는데 긁어오신거라 잘모른다고 하셔서요
어떤걸 수정해야 하나만 뜰까요?
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$str = '';
$exists = false;
$depth2_ca_id = substr($ca_id, 0, 2);
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '${depth2_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)) {
if (preg_match("/^{$row['ca_id']}/", $ca_id))
$sct_ct_here = 'sct_ct_here';
else
$sct_ct_here = '';
$str .= '<li><a href="./list.php?ca_id='.$row['ca_id'].'" class="'.$sct_ct_here.'">'.$row['ca_name'].'</a></li>';
$exists = true;
}
if ($exists) {
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_CSS_URL.'/style.css">', 0);
?>
<!-- 상품분류 3 시작 { -->
<aside id="sct_ct_2" class="sct_ct">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<?php
// 1단계 분류 판매 가능한 것만
$hsql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where length(ca_id) = '2' and ca_use = '1' order by ca_order, ca_id ";
$hresult = sql_query($hsql);
$gnb_zindex = 999; // gnb_1dli z-index 값 설정용
for ($i=0; $row=sql_fetch_array($hresult); $i++)
{
$gnb_zindex -= 1; // html 구조에서 앞선 gnb_1dli 에 더 높은 z-index 값 부여
// 2단계 분류 판매 가능한 것만
$sql2 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where LENGTH(ca_id) = '4' and SUBSTRING(ca_id,1,2) = '{$row['ca_id']}' and ca_use = '1' order by ca_order, ca_id ";
$result2 = sql_query($sql2);
$count = sql_num_rows($result2);
?>
<td>
<a class="cate_t_01" style="color:#000000;"><?php echo $row['ca_name']; ?></a>
<?php
for ($j=0; $row2=sql_fetch_array($result2); $j++)
{
if ($j==0) echo '<ul class="cate_t_01" style="z-index:'.$gnb_zindex.'">';
?>
<?php }
if ($j>0) echo '</ul>';
?>
<?php } ?>
</td>
</tr>
</table>
<!-- <table cellpadding="0" cellspacing="0">
<tr>
<td class="cate_t_01"><?php echo $ca['ca_name']; ?></td>
</tr>
</table> -->
<ul>
<?php echo $str; ?>
</ul>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="cate_t_02"><a href="<?php echo G5_SHOP_URL; ?>/personalpay.php">개인결제</td>
</tr>
</table>
</aside>
<!-- } 상품분류 3 끝 -->
<?php } ?>
답변 2
다시보니 그게 아니고 쿼리를 좀 수정하셔야 겠네요..
$sql =
" select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id =$ca_id
and length(ca_id) = 4 and ca_use = '1' order by ca_order, ca_id "
;
$str .=
'<li><a href="./list.php?ca_id='
.
$row
[
'ca_id'
].
'" class="'
.
$sct_ct_here
.
'">'
.
$row
[
'ca_name'
].
'</a></li>'
;
여기를
$str =
'<li><a href="./list.php?ca_id='
.
$row
[
'ca_id'
].
'" class="'
.
$sct_ct_here
.
'">'
.
$row
[
'ca_name'
].
'</a></li>'
;
로 바꾸면 안될까요?
답변을 작성하시기 전에 로그인 해주세요.