1단계 아래로 2단계 카테고리(분류) 메뉴 표시하기
shop/boxcategory.inc.php 를 아래의 소스코드로 교체하여 주십시오.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table bgcolor=#FFFFFF width=100% cellpadding=0 cellspacing=0>
<tr><td align=center valign=top height=50><img src='<?=$g4[shop_img_path]?>/bar_category.gif'></td></tr>
<?
// 1단계 분류 판매가능한것만
$hsql = " select ca_id, ca_name from $g4[yc4_category_table]
where length(ca_id) = '2'
and ca_use = '1'
order by ca_id ";
$hresult = sql_query($hsql);
$hnum = @mysql_num_rows($hresult);
for ($i=0; $row=sql_fetch_array($hresult); $i++) {
// 2단계 분류
$menubody = "";
$sql2 = " select ca_id, ca_name from $g4[yc4_category_table]
where LENGTH(ca_id) = '4'
and SUBSTRING(ca_id,1,2) = '$row[ca_id]'
and ca_use = '1'
order by ca_id ";
$result2 = sql_query($sql2);
$hnum2 = @mysql_num_rows($hresult);
for ($j=0; $row2=sql_fetch_array($result2); $j++) {
$menubody .= "<tr height='22'><td> · <a href='$g4[shop_path]/list.php?ca_id=$row2[ca_id]'>$row2[ca_name]</a></td></tr>";
}
<tr><td align=center valign=top height=50><img src='<?=$g4[shop_img_path]?>/bar_category.gif'></td></tr>
<?
// 1단계 분류 판매가능한것만
$hsql = " select ca_id, ca_name from $g4[yc4_category_table]
where length(ca_id) = '2'
and ca_use = '1'
order by ca_id ";
$hresult = sql_query($hsql);
$hnum = @mysql_num_rows($hresult);
for ($i=0; $row=sql_fetch_array($hresult); $i++) {
// 2단계 분류
$menubody = "";
$sql2 = " select ca_id, ca_name from $g4[yc4_category_table]
where LENGTH(ca_id) = '4'
and SUBSTRING(ca_id,1,2) = '$row[ca_id]'
and ca_use = '1'
order by ca_id ";
$result2 = sql_query($sql2);
$hnum2 = @mysql_num_rows($hresult);
for ($j=0; $row2=sql_fetch_array($result2); $j++) {
$menubody .= "<tr height='22'><td> · <a href='$g4[shop_path]/list.php?ca_id=$row2[ca_id]'>$row2[ca_name]</a></td></tr>";
}
$category_link = "<a href='$g4[shop_path]/list.php?ca_id=$row[ca_id]'>";
echo "<tr>";
echo "<td height='22'> · $category_link$row[ca_name]</a>\n";
echo "<tr>";
echo "<td height='22'> · $category_link$row[ca_name]</a>\n";
if ($menubody) {
echo "<table cellpadding=1 cellspacing=0 width=90% align=right><tr><td>";
echo "<table border=0 width=100% bgcolor=#FFFFFF cellpadding=0 cellspacing=0>$menubody</table>";
echo "</td></tr></table>";
}
echo "<table cellpadding=1 cellspacing=0 width=90% align=right><tr><td>";
echo "<table border=0 width=100% bgcolor=#FFFFFF cellpadding=0 cellspacing=0>$menubody</table>";
echo "</td></tr></table>";
}
echo "</td></tr>\n";
}
}
if ($i==0)
echo "<tr><td height=50 align=center>등록된 자료가 없습니다.</td></tr>\n";
?>
</table>
echo "<tr><td height=50 align=center>등록된 자료가 없습니다.</td></tr>\n";
?>
</table>
<?=$menu?>
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 4개