영카트 네비게이션 부분( '홈 > aaa' )에 셀렉트 메뉴를 적용해 보았습니다.
1. shop/navigation1.inc.php 파일을 아래와 같이 수정
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if ($ca_id)
{
$category = array();
$str = $bar = "";
$len = strlen($ca_id) / 2;
for ($i=1; $i<=$len; $i++)
{
$code = substr($ca_id,0,$i*2);
$code2 = substr($ca_id,0,(($i*2)-2));
{
$category = array();
$str = $bar = "";
$len = strlen($ca_id) / 2;
for ($i=1; $i<=$len; $i++)
{
$code = substr($ca_id,0,$i*2);
$code2 = substr($ca_id,0,(($i*2)-2));
$sql = " select ca_id, ca_name from $g4[yc4_category_table] where ca_id = '$code' ";
$row = sql_fetch($sql);
$row = sql_fetch($sql);
$cate_len = strlen($code);
if ($cate_len == '2')
$sql2 = " select ca_id, ca_name from $g4[yc4_category_table] where length(ca_id) = '$cate_len' ";
else
$sql2 = " select ca_id, ca_name from $g4[yc4_category_table] where ca_id like '$code2%' and length(ca_id) = '$cate_len' ";
$result2 = sql_query($sql2);
if ($cate_len == '2')
$sql2 = " select ca_id, ca_name from $g4[yc4_category_table] where length(ca_id) = '$cate_len' ";
else
$sql2 = " select ca_id, ca_name from $g4[yc4_category_table] where ca_id like '$code2%' and length(ca_id) = '$cate_len' ";
$result2 = sql_query($sql2);
$str .= $bar."<select id='it_category_{$i}' name='category[$i]' onchange=\"if (this.value=='') return; document.location = 'list.php?ca_id='+this.value;\" class='small'>";
for ($j=0; $row2=sql_fetch_array($result2); $j++) {
if ($row[ca_id] == $row2[ca_id]) {
$category[$i] = $row2[ca_id];
}
$str .= "<option value='$row2[ca_id]'>$row2[ca_name]</option>";
}
$str .= "<option value='$category[$i]' style='color:red'>현재 분류</option>";
$str .= "</select>";
$bar = " > ";
}
}
else
$str = $g4[title];
for ($j=0; $row2=sql_fetch_array($result2); $j++) {
if ($row[ca_id] == $row2[ca_id]) {
$category[$i] = $row2[ca_id];
}
$str .= "<option value='$row2[ca_id]'>$row2[ca_name]</option>";
}
$str .= "<option value='$category[$i]' style='color:red'>현재 분류</option>";
$str .= "</select>";
$bar = " > ";
}
}
else
$str = $g4[title];
include("./navigation2.inc.php");
?>
?>
2. shop/navigation2.inc.php 아래에 추가
<?
if ($ca_id)
{
$len = strlen($ca_id) / 2;
for ($i=1; $i<=$len; $i++)
{
echo "<script language='JavaScript'> document.getElementById('it_category_{$i}').value='".$category[$i]."'; </script>";
}
}
?>
if ($ca_id)
{
$len = strlen($ca_id) / 2;
for ($i=1; $i<=$len; $i++)
{
echo "<script language='JavaScript'> document.getElementById('it_category_{$i}').value='".$category[$i]."'; </script>";
}
}
?>
게시글 목록
| 번호 | 제목 |
|---|---|
| 1790 | |
| 1788 | |
| 1786 | |
| 1782 | |
| 1780 | |
| 1778 | |
| 1767 | |
| 1762 | |
| 1754 | |
| 1748 | |
| 1739 | |
| 1736 | |
| 1735 | |
| 1731 | |
| 1717 | |
| 1712 | |
| 1704 | |
| 1700 | |
| 1696 | |
| 1682 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기