영카트 [YC4] 왼쪽메뉴 분류(카테고리) 이미지로
페이지 정보
본문
<!-- 영카트 카테고리 이미지로 사용하기 -->
<table width="100%" cellpadding="0" cellspacing="0">
<?php
// 2단계 분류 레이어 표시
$menu = ""; // 메뉴 레이어 임시저장 변수 (처음엔 아무값도 없어야 합니다.)
$sub_menu_left = 100; // 2단계 메뉴 왼쪽 좌표 (1단계 좌표에서 부터)
// 1단계 분류 판매가능한것만
$hp_ca_sql = " select ca_id, ca_name from $g4[yc4_category_table]
where length(ca_id) = '2'
and ca_use = '1'
order by ca_id ";
$hp_ca_result = sql_query($hp_ca_sql);
$hp_ca_num = @mysql_num_rows($hp_ca_result);
for ($i=0; $row=sql_fetch_array($hp_ca_result); $i++)
{
// 2단계 분류
$menubody = "";
$onmouseover = "";
$onmouseout = "";
$hp_ca_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 ";
$hp_ca_result2 = sql_query($hp_ca_sql2);
$hp_ca_num2 = @mysql_num_rows($hp_ca_result);
for ($j=0; $row2=sql_fetch_array($hp_ca_result2); $j++)
{
// 2차메뉴 보여지는거
$menubody .= "<tr height='22'><td> · <a href='$g4[shop_path]/list.php?ca_id=$row2[ca_id]'>$row2[ca_name]</a></td></tr>";
// 맨밑줄은 출력하지 않음
// if ($j < $hp_ca_num2)
// $menubody .= "<tr><td align=center><img src='$g4[shop_img_path]/dot_line.gif'></td></tr>";
}
if ($menubody)
{
$onmouseover = " layer_view('lmenu{$i}', 'lmenu_layer{$i}', 'view', $sub_menu_left, -22); ";
$onmouseout = " layer_view('lmenu{$i}', 'lmenu_layer{$i}', 'hide'); ";
}
$hp_ca_link = "<a href='$g4[shop_path]/list.php?ca_id=$row[ca_id]'>";
echo "<tr id='lmenu{$i}' onmouseover=\"$onmouseover\" onmouseout=\"$onmouseout\">";
$ca_happy = $row[ca_name];
if ($ca_happy == "마레스") {
$ca_happyimg = "<img src='/2008/images/left_shop_01_ov.jpg' border='0'>";
} elseif ($ca_happy == "그외 브랜드") {
$ca_happyimg = "<img src='/2008/images/left_shop_02.jpg' border='0' />";
} elseif ($ca_happy == "기획상품") {
$ca_happyimg = "<img src='/2008/images/left_shop_03.jpg' border='0' />";
}
echo "<td>$hp_ca_link$ca_happyimg</a>";
// echo "<td height='22'> · $hp_ca_link$row[ca_name]</a>";
if ($menubody)
{
echo "<div id='lmenu_layer{$i}' style='width:180px; display:none; position:absolute; FILTER: alpha(opacity=95); z-index:999;'>";
//echo "<div id='lmenu_layer{$i}' style='width:180px; display:none; position:absolute; z-index:999;'>";
echo "<table cellpadding='1' cellspacing='0' bgcolor='#CCCCCC' width='100%'><tr>";
echo "<td><table border='0' width='100%' bgcolor='#FFFFFF' cellpadding='0' cellspacing='0'>$menubody</table></td>";
echo "</tr></table>";
echo "</div>";
echo "</td></tr>\n";
}
// if ($i<$hp_ca_num-1) // 맨밑줄은 출력하지 않음
// echo "<tr><td align='center'><img src='$g4[shop_img_path]/dot_line.gif'></td></tr>\n";
}
if ($i==0)
echo "<tr><td height='50' align='center'>등록된 자료가 없습니다.</td></tr>\n";
?>
<?php echo $menu; ?>
<script language="JavaScript">
<!--
var save_layer = null;
function layer_view(link_id, menu_id, opt, x, y) {
var link = document.getElementById(link_id);
var menu = document.getElementById(menu_id);
//for (i in link) { document.write(i + '<br/>'); } return;
if (save_layer != null)
save_layer.style.display = "none";
if (opt == 'hide') {
menu.style.display = 'none';
}
else {
x = parseInt(x);
y = parseInt(y);
menu.style.left = get_left_pos(link) + x;
menu.style.top = get_top_pos(link) + link.offsetHeight + y;
menu.style.display = 'block';
}
save_layer = menu;
}
//-->
</script>
</table>
<!-- 영카트 카테고리 이미지로 사용하기 -->
<!-- 영카트 카테고리 이미지로 사용하기 -->
<table width=100% cellpadding=0 cellspacing=0>
<?php
// 1단계 분류 판매가능한것만
$hp_ca_sql = " select ca_id, ca_name from $g4[yc4_category_table]
where length(ca_id) = '2'
and ca_use = '1'
order by ca_id ";
$hp_ca_result = sql_query($hp_ca_sql);
$hp_ca_num = @mysql_num_rows($hp_ca_result);
for ($i=0; $row=sql_fetch_array($hp_ca_result); $i++) {
// 2단계 분류
$menubody = "";
$hp_ca_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 ";
$hp_ca_result2 = sql_query($hp_ca_sql2);
$hp_ca_num2 = @mysql_num_rows($hp_ca_result);
for ($j=0; $row2=sql_fetch_array($hp_ca_result2); $j++) {
// 2단계 목록보이기
$menubody .= "<tr height='22'><td> · <a href='$g4[shop_path]/list.php?ca_id=$row2[ca_id]'>$row2[ca_name]</a></td></tr>";
}
$hp_ca_link = "<a href='$g4[shop_path]/list.php?ca_id=$row[ca_id]'>";
echo "<tr>";
$ca_happy = $row[ca_name];
if ($ca_happy == "마레스") {
$ca_happyimg = "<img src='/2008/images/left_shop_01_ov.jpg' border='0'>";
} elseif ($ca_happy == "그외 브랜드") {
$ca_happyimg = "<img src='/2008/images/left_shop_02.jpg' border='0' />";
} elseif ($ca_happy == "기획상품") {
$ca_happyimg = "<img src='/2008/images/left_shop_03.jpg' border='0' />";
} else {
}
echo "<td>$hp_ca_link$ca_happyimg</a>";
// echo "<td height='22'>$hp_ca_link$row[ca_name]</a>";
if ($menubody) {
echo "<table cellpadding='1' cellspacing='0' width='90%' align='right'><tr><td>";
echo "<table border='0' width='100%' 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>
<?php echo $menu; ?>
<!-- 영카트 카테고리 이미지로 사용하기 -->
<!-- 영카트 카테고리 이미지로 사용하기 -->
<table width=100% cellpadding=0 cellspacing=0>
<?php
// 1단계 분류 판매가능한것만
$hp_ca_sql = " select ca_id, ca_name from $g4[yc4_category_table]
where length(ca_id) = '2'
and ca_use = '1'
order by ca_id ";
$hp_ca_result = sql_query($hp_ca_sql);
$hp_ca_num = @mysql_num_rows($hp_ca_result);
for ($i=0; $row=sql_fetch_array($hp_ca_result); $i++) {
// 2단계 분류
$menubody = "";
$hp_ca_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 ";
$hp_ca_result2 = sql_query($hp_ca_sql2);
$hp_ca_num2 = @mysql_num_rows($hp_ca_result);
for ($j=0; $row2=sql_fetch_array($hp_ca_result2); $j++) {
// 2단계 목록보이기
$menubody .= "<tr height='22'><td> · <a href='$g4[shop_path]/list.php?ca_id=$row2[ca_id]'>$row2[ca_name]</a></td></tr>";
}
$hp_ca_link = "<a href='$g4[shop_path]/list.php?ca_id=$row[ca_id]'>";
echo "<tr>";
$ca_happy = $row[ca_name];
if ($ca_happy == "마레스") {
$ca_happyimg = "<img src='/2008/images/left_shop_01_ov.jpg' border='0'>";
} elseif ($ca_happy == "그외 브랜드") {
$ca_happyimg = "<img src='/2008/images/left_shop_02.jpg' border='0' />";
} elseif ($ca_happy == "기획상품") {
$ca_happyimg = "<img src='/2008/images/left_shop_03.jpg' border='0' />";
} else {
}
echo "<td>$hp_ca_link$ca_happyimg</a>";
// echo "<td height='22'>$hp_ca_link$row[ca_name]</a>";
if ($ca_happy == "마레스") { // 특정 대분류만 보이고 싶을때
if ($menubody) {
echo "<table cellpadding='1' cellspacing='0' width='90%' align='right'><tr><td>";
echo "<table border='0' width='100%' 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>
<?php echo $menu; ?>
<!-- 영카트 카테고리 이미지로 사용하기 -->
참고자료
http://sir.co.kr/bbs/board.php?bo_table=yc4_tiptech&wr_id=287
댓글목록
등록된 댓글이 없습니다.