shop 폴더에 붙어 넣기하면되요
참고로 원본은 백업하시고요
이 소스에 최고 단점은 디자인이 없다는 점입니다. 디자인 잘하시는분 디자인 입혀서 배포좀 해주세요
--------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<script type="text/javascript">
var WM_BOTTOM = "bottom";var WM_RIGHT = "right";var MARGIN_BOTTOM = 1;var MARGIN_RIGHT = 1;var currentItem = null;var menuTrail = new Array();var currentStyleOff = null;
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<script type="text/javascript">
var WM_BOTTOM = "bottom";var WM_RIGHT = "right";var MARGIN_BOTTOM = 1;var MARGIN_RIGHT = 1;var currentItem = null;var menuTrail = new Array();var currentStyleOff = null;
function wmItemOn(item, level, styleOn, styleOff, submenuId, submenuPosition) {
debug("level:" + level + ", styleOn:" + styleOn + ", styleOff:" + styleOff + ", submenu:" + submenuId + "/" + submenuPosition);
stopOffTimer();
if (currentItem != null) {
if (styleOff != currentStyleOff && currentStyleOff != null) {
currentItem.className = currentStyleOff;
} else {
currentItem.className = styleOff;
}
}
if (styleOff != currentStyleOff && currentStyleOff != null) {
currentItem.className = currentStyleOff;
} else {
currentItem.className = styleOff;
}
}
currentItem = item; item.className = styleOn; currentStyleOff = styleOff;
if (submenuId != null) {
if (submenuId != null) {
hide(level);
var menu = document.getElementById(submenuId);
if (submenuPosition == WM_BOTTOM) {
menu.style.top = findOffsetTop(item) + item.offsetHeight + MARGIN_BOTTOM;
menu.style.left = findOffsetLeft(item);
}
menu.style.top = findOffsetTop(item) + item.offsetHeight + MARGIN_BOTTOM;
menu.style.left = findOffsetLeft(item);
}
if (submenuPosition == WM_RIGHT) {
menu.style.top = findOffsetTop(item);
menu.style.left = findOffsetLeft(item) + item.offsetWidth + MARGIN_RIGHT;
}
menu.style.top = findOffsetTop(item);
menu.style.left = findOffsetLeft(item) + item.offsetWidth + MARGIN_RIGHT;
}
menu.style.visibility = "visible";
menuTrail[level] = menu;
} else {
hide(level);
}
} else {
hide(level);
}
}
function hide(level) {
for (var i = level; i < menuTrail.length; i++) {
menuTrail[i].style.visibility = "hidden";
}
}
for (var i = level; i < menuTrail.length; i++) {
menuTrail[i].style.visibility = "hidden";
}
}
var timerID = null;var timerOn = false;var timecount = 250;
function wmStartOffTimer() {
if (timerOn == false) {
timerID = setTimeout("offAll()", timecount); timerOn = true;
}
}
if (timerOn == false) {
timerID = setTimeout("offAll()", timecount); timerOn = true;
}
}
function stopOffTimer() {
if (timerOn) {
clearTimeout(timerID); timerID = null; timerOn = false;
}
}
if (timerOn) {
clearTimeout(timerID); timerID = null; timerOn = false;
}
}
function offAll() {
hide(0);
if (currentStyleOff != null) {
currentItem.className = currentStyleOff;
}
debug("All off by timer.");
}
hide(0);
if (currentStyleOff != null) {
currentItem.className = currentStyleOff;
}
debug("All off by timer.");
}
var debugId = "wmDebug";
function debug(text) {
var debug = document.getElementById(debugId);
if (debug != null) { debug.innerHTML = "» " + text + "<br>" + debug.innerHTML; }
}
var debug = document.getElementById(debugId);
if (debug != null) { debug.innerHTML = "» " + text + "<br>" + debug.innerHTML; }
}
function findOffsetLeft(obj){ var curleft = 0;
if (obj.offsetParent){
while (obj.offsetParent){ curleft += obj.offsetLeft obj = obj.offsetParent; }
}else if (obj.x){ curleft += obj.x; }
if (obj.offsetParent){
while (obj.offsetParent){ curleft += obj.offsetLeft obj = obj.offsetParent; }
}else if (obj.x){ curleft += obj.x; }
return curleft;
}
}
function findOffsetTop(obj){
var curtop = 0;
if (obj.offsetParent) {
while (obj.offsetParent){ curtop += obj.offsetTop obj = obj.offsetParent; }
}else if (obj.y){ curtop += obj.y; }
var curtop = 0;
if (obj.offsetParent) {
while (obj.offsetParent){ curtop += obj.offsetTop obj = obj.offsetParent; }
}else if (obj.y){ curtop += obj.y; }
return curtop;
}
</script>
<style>
.wmSubMenuHidden {position:absolute;visibility:hidden;border:1px solid #336699;}
.vItemOn {width:150px;padding:4px;background:#FFFFFF;cursor:pointer;}
.vItemOff {width:150px;padding:4px;background:#FFFFFF;cursor:pointer;}
</style>
<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>
<tr><td valign=top><?
$list1 = "";$list2 = "";$list3 = "";
// 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 = ""; $onmouseover = ""; $onmouseout = "";
$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($result2);
for ($j=0; $row2=sql_fetch_array($result2); $j++)
{
// 3단계 분류
$sql3 = " select ca_id, ca_name from $g4[yc4_category_table]
where LENGTH(ca_id) = '6' and SUBSTRING(ca_id,1,4) = '$row2[ca_id]' and ca_use = '1' order by ca_id ";
$result3 = sql_query($sql3);
$hnum3 = @mysql_num_rows($result3);
for ($k=0; $row3=sql_fetch_array($result3); $k++)
{
//카테고리 3단계 리스트
if($k == 0) $list3 .="<div id=\"vSubmenu".($row2[ca_id])."\" class=\"wmSubMenuHidden\">\n";
$list3 .= "<div class=\"vItemOff\" onClick=\"javascript:window.location='$g4[shop_path]/list.php?ca_id=$row3[ca_id]'\" onmouseover=\"javascript:wmItemOn(this,2,'vItemOn','vItemOff',null,null);\" onMouseOut=\"wmStartOffTimer();\">";
$list3 .= " ·$row3[ca_name]<BR><img src='$g4[shop_img_path]/dot_line.gif'>";
$list3 .= "</div>\n";
}
if($k > 0) { $list3 .= "</div>\n"; $j_plue = ",'vSubmenu".($row2[ca_id])."',WM_RIGHT"; } else $j_plue = ",null,null";
//카테고리 2단계 리스트
if($j == 0) $list2 .= "<div id=\"vSubmenu".($row[ca_id])."\" class=\"wmSubMenuHidden\">\n";
$list2 .= "<div class=\"vItemOff\" onClick=\"javascript:window.location='$g4[shop_path]/list.php?ca_id=$row2[ca_id]'\" onmouseover=\"javascript:wmItemOn(this,1,'vItemOn','vItemOff'".($j_plue).");\" onMouseOut=\"wmStartOffTimer();\"> · $row2[ca_name]<BR><img src='$g4[shop_img_path]/dot_line.gif'></div>";
}
if($j > 0) { $list2 .= "</div>\n"; $j_top = "'vSubmenu".($row[ca_id])."',WM_RIGHT"; } else $j_top = "null,null";
//카테고리 1단계 리스트
$list1 .= "<div class=\"vItemOff\" onClick=\"javascript:window.location='$g4[shop_path]/list.php?ca_id=$row[ca_id]'\" onmouseover=\"javascript:wmItemOn(this,0,'vItemOn','vItemOff',".$j_top.");\" onMouseOut=\"wmStartOffTimer();\"> · {$row[ca_name]}<BR><img src='$g4[shop_img_path]/dot_line.gif'></div>\n";
} echo $list1; echo $list2;echo $list3;?><BR>
</td></tr></table>
}
</script>
<style>
.wmSubMenuHidden {position:absolute;visibility:hidden;border:1px solid #336699;}
.vItemOn {width:150px;padding:4px;background:#FFFFFF;cursor:pointer;}
.vItemOff {width:150px;padding:4px;background:#FFFFFF;cursor:pointer;}
</style>
<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>
<tr><td valign=top><?
$list1 = "";$list2 = "";$list3 = "";
// 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 = ""; $onmouseover = ""; $onmouseout = "";
$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($result2);
for ($j=0; $row2=sql_fetch_array($result2); $j++)
{
// 3단계 분류
$sql3 = " select ca_id, ca_name from $g4[yc4_category_table]
where LENGTH(ca_id) = '6' and SUBSTRING(ca_id,1,4) = '$row2[ca_id]' and ca_use = '1' order by ca_id ";
$result3 = sql_query($sql3);
$hnum3 = @mysql_num_rows($result3);
for ($k=0; $row3=sql_fetch_array($result3); $k++)
{
//카테고리 3단계 리스트
if($k == 0) $list3 .="<div id=\"vSubmenu".($row2[ca_id])."\" class=\"wmSubMenuHidden\">\n";
$list3 .= "<div class=\"vItemOff\" onClick=\"javascript:window.location='$g4[shop_path]/list.php?ca_id=$row3[ca_id]'\" onmouseover=\"javascript:wmItemOn(this,2,'vItemOn','vItemOff',null,null);\" onMouseOut=\"wmStartOffTimer();\">";
$list3 .= " ·$row3[ca_name]<BR><img src='$g4[shop_img_path]/dot_line.gif'>";
$list3 .= "</div>\n";
}
if($k > 0) { $list3 .= "</div>\n"; $j_plue = ",'vSubmenu".($row2[ca_id])."',WM_RIGHT"; } else $j_plue = ",null,null";
//카테고리 2단계 리스트
if($j == 0) $list2 .= "<div id=\"vSubmenu".($row[ca_id])."\" class=\"wmSubMenuHidden\">\n";
$list2 .= "<div class=\"vItemOff\" onClick=\"javascript:window.location='$g4[shop_path]/list.php?ca_id=$row2[ca_id]'\" onmouseover=\"javascript:wmItemOn(this,1,'vItemOn','vItemOff'".($j_plue).");\" onMouseOut=\"wmStartOffTimer();\"> · $row2[ca_name]<BR><img src='$g4[shop_img_path]/dot_line.gif'></div>";
}
if($j > 0) { $list2 .= "</div>\n"; $j_top = "'vSubmenu".($row[ca_id])."',WM_RIGHT"; } else $j_top = "null,null";
//카테고리 1단계 리스트
$list1 .= "<div class=\"vItemOff\" onClick=\"javascript:window.location='$g4[shop_path]/list.php?ca_id=$row[ca_id]'\" onmouseover=\"javascript:wmItemOn(this,0,'vItemOn','vItemOff',".$j_top.");\" onMouseOut=\"wmStartOffTimer();\"> · {$row[ca_name]}<BR><img src='$g4[shop_img_path]/dot_line.gif'></div>\n";
} echo $list1; echo $list2;echo $list3;?><BR>
</td></tr></table>
--------------------------------------------------
버그나 문제점은 질문 답변으로 리자님이 깔끔하게 답변해드릴꺼라고 예상합니다..
게시글 목록
| 번호 | 제목 |
|---|---|
| 1440 | |
| 1434 | |
| 1433 | |
| 1428 | |
| 1421 | |
| 1397 | |
| 1396 | |
| 1388 | |
| 1379 | |
| 1378 | |
| 1377 | |
| 1367 | |
| 1365 | |
| 1362 | |
| 1348 | |
| 1343 | |
| 1335 | |
| 1318 | |
| 1311 | |
| 1310 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기