상품리스트와 상품상세보기에서 동일 분류는 분류리스트에 표시하지 않기
상품리스트와 상품상세보기에서 동일 분류는 분류리스트에 표시하지 않기
shop/listcategory.inc.php 을
<?
$str = "";
$exists = false;
$str = "";
$exists = false;
$ca_id_len = strlen($ca_id);
$len2 = $ca_id_len + 2;
$len4 = $ca_id_len + 4;
$len2 = $ca_id_len + 2;
$len4 = $ca_id_len + 4;
// 차차기 분류의 건수를 얻음
$sql = " select count(*) as cnt from $g4[yc4_category_table]
where ca_id like '$ca_id%'
and length(ca_id) = $len4
and ca_use = '1' ";
$row = sql_fetch($sql);
$cnt = $row['cnt'];
if (!$cnt)
$str .= "<tr><td width=11 background='$g4[shop_img_path]/ca_bg02.gif'></td><td>";
$sql = " select count(*) as cnt from $g4[yc4_category_table]
where ca_id like '$ca_id%'
and length(ca_id) = $len4
and ca_use = '1' ";
$row = sql_fetch($sql);
$cnt = $row['cnt'];
if (!$cnt)
$str .= "<tr><td width=11 background='$g4[shop_img_path]/ca_bg02.gif'></td><td>";
$sql = " select ca_id, ca_name from $g4[yc4_category_table]
where ca_id like '$ca_id%'
and length(ca_id) = $len2
and ca_use = '1'
order by ca_id ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result)) {
if ($cnt) {
$str .= "<tr><td width=11 background='$g4[shop_img_path]/ca_bg02.gif'></td>";
$str .= "<td><table width=100% border=0><tr><td width=120><b>· <a href='./list.php?ca_id=$row[ca_id]'>$row[ca_name]</a></b></td>";
$sql2 = " select ca_id, ca_name from $g4[yc4_category_table]
where ca_id like '$row[ca_id]%'
and length(ca_id) = $len4
and ca_use = '1'
order by ca_id ";
$result2 = sql_query($sql2);
$k=0;
while ($row2=sql_fetch_array($result2)) {
if (!$k)
$str .= "<td width=20 align=center>|</td><td class=lh>";
$str .= "<a href='./list.php?ca_id=$row2[ca_id]'>$row2[ca_name]</a> ";
$k++;
}
//if (!$k) $str .= "<td></td><td>";
$str .= "</td></tr></table></td><td width=11 background='$g4[shop_img_path]/ca_bg03.gif'></td>";
} else {
$str .= "<a href='./list.php?ca_id=$row[ca_id]'>$row[ca_name]</a> ";
}
$exists = true;
}
where ca_id like '$ca_id%'
and length(ca_id) = $len2
and ca_use = '1'
order by ca_id ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result)) {
if ($cnt) {
$str .= "<tr><td width=11 background='$g4[shop_img_path]/ca_bg02.gif'></td>";
$str .= "<td><table width=100% border=0><tr><td width=120><b>· <a href='./list.php?ca_id=$row[ca_id]'>$row[ca_name]</a></b></td>";
$sql2 = " select ca_id, ca_name from $g4[yc4_category_table]
where ca_id like '$row[ca_id]%'
and length(ca_id) = $len4
and ca_use = '1'
order by ca_id ";
$result2 = sql_query($sql2);
$k=0;
while ($row2=sql_fetch_array($result2)) {
if (!$k)
$str .= "<td width=20 align=center>|</td><td class=lh>";
$str .= "<a href='./list.php?ca_id=$row2[ca_id]'>$row2[ca_name]</a> ";
$k++;
}
//if (!$k) $str .= "<td></td><td>";
$str .= "</td></tr></table></td><td width=11 background='$g4[shop_img_path]/ca_bg03.gif'></td>";
} else {
$str .= "<a href='./list.php?ca_id=$row[ca_id]'>$row[ca_name]</a> ";
}
$exists = true;
}
if (!$cnt)
$str .= "</td><td width=11 background='$g4[shop_img_path]/ca_bg03.gif'></td></tr>";
$str .= "</td><td width=11 background='$g4[shop_img_path]/ca_bg03.gif'></td></tr>";
if ($exists) {
echo "
<br>
<table width=98% cellpadding=0 cellspacing=0 align=center border=0>
<colgroup width=11>
<colgroup width=''>
<colgroup width=11>
<tr>
<td width=11><img src='$g4[shop_img_path]/ca_box01.gif'></td>
<td background='$g4[shop_img_path]/ca_bg01.gif'></td>
<td width=11><img src='$g4[shop_img_path]/ca_box02.gif'></td>
</tr>
$str
<tr>
<td width=11><img src='$g4[shop_img_path]/ca_box03.gif'></td>
<td background='$g4[shop_img_path]/ca_bg04.gif'></td>
<td width=11><img src='$g4[shop_img_path]/ca_box04.gif'></td>
</tr>
</table><br>";
}
?>
echo "
<br>
<table width=98% cellpadding=0 cellspacing=0 align=center border=0>
<colgroup width=11>
<colgroup width=''>
<colgroup width=11>
<tr>
<td width=11><img src='$g4[shop_img_path]/ca_box01.gif'></td>
<td background='$g4[shop_img_path]/ca_bg01.gif'></td>
<td width=11><img src='$g4[shop_img_path]/ca_box02.gif'></td>
</tr>
$str
<tr>
<td width=11><img src='$g4[shop_img_path]/ca_box03.gif'></td>
<td background='$g4[shop_img_path]/ca_bg04.gif'></td>
<td width=11><img src='$g4[shop_img_path]/ca_box04.gif'></td>
</tr>
</table><br>";
}
?>
와 같이 수정해 주십시오.
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 1개
1차분류 1,2,3,4,5가 있고 1-1차, 1-2차,1-3차, 2-1차,2-2차 ,3-1차,3-2차등등 이렇다면
1차분류의 1을 클릭하면 우측창에
-------------------------------------------------
1차분류 | 1-1차분류 , 1-2차분류, 1-3차분류
2차분류 | 2-1차분류, 2-2차분류
3차분류 | 3-1차분류, 3-2차분류, 3-3차분류
--------------------------------------------------
이렇게 나오는데
1차분류를 클릭하면 2차분류및 2-1 / 3차분류, 3-1등은 안나오게 하고싶습니다.
즉 좌측메뉴에서 1차분류를 클릭하면
1차분류| 1-1, 1-2, 1-3 이것만나오고
2차분류는 안나오게...
이해되셨나요?
감사합니다