탑메뉴 응용
본문
<?php
if(!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style type="text/css">
.nav {
height:50px;
background: url('<?php echo $g4[path]?>/img/top_menu_bg.png') repeat-x;
position:relative;
width:100%;
z-index:100;
margin:0;
padding:2px 0 0 0;
}
.nav .table {
display:table;
padding:0 0 0 20px;
}
.nav .select,
.nav .current {
margin:0;
padding:0;
list-style:none;
display:table-cell;
white-space:nowrap;
}
.nav li {
margin:0;
padding:0;
height:auto;
float:left;
}
.nav .select a {
display:block;
float:left;
font-weight:bold;
padding:0 10px;
text-decoration:none;
line-height:20px;
vertical-align: middle;
white-space:nowrap;
color:#2b3238;
margin:5px 0 0 0;
font-family:Gulim, Sans-Serif;
}
.nav .select a:hover,
.nav .select li:hover a {
padding:0;
cursor:pointer;
color:#2b3238;
padding:0 10px;
}
.nav .select a b{
font-weight:bold;
}
.nav .select a:hover b,
.nav .select li:hover a b {
display:block;
float:left;
padding:0 0px;
cursor:pointer;
}
.nav .select_sub {
display:none;
}
/* IE6 only */
.nav table {
border-collapse:collapse;
margin:-1px;
width:0;
height:0;
}
.nav .sub {
display:table;
padding:0 0 0 0px;
list-style:none;
}
.nav .sub_active .current_sub a,
.nav .sub_active a:hover {
background:transparent;
color:#2b3238;
}
.nav .select .select_sub,
.nav .current .show {
display:block;
position:absolute;
width:948px;
top:36px;
line-height:30px;
padding:3px 0 0 5px;
z-index:100;
left:0;
text-align:left;
font-family:Gulim, Sans-Serif;
}
.nav .current .show {
z-index:10;
}
.nav .current .sub li.sub_show a {
color:#000;
cursor:default;
}
.nav .select .sub li a {
font-weight:normal;
}
.nav .select :hover .sub li a:hover,
.nav .current .sub li a:hover {
visibility:visible;
color:#000;
}
</style>
<!--[if IE]>
<style type="text/css">
.nav ul {display:inline-block;}
.nav ul {display:inline;}
.nav ul li {float:left;}
.nav {text-align:left;}
.nav .select a:hover b,
.nav .select li:hover a b {float:none;}
</style>
<![endif]-->
<div class="nav">
<div class="table">
<?php
$sql = " select * from ".$g5['menu_table']."
where me_use = '1'
and length(me_code) = '2'
order by me_order, me_id ";
$result = sql_query($sql, false);
$gnb_zindex = 999; // gnb_1dli z-index 값 설정용
for ($i=0; $row=sql_fetch_array($result); $i++) {
?>
<a href='<?php echo $glink;?>'><?php echo $gsubject;?></a>
<?
$sql2 = " select count(bo_table) as cnt from $g4[board_table] where (gr_id = '$row[gr_id]') order by bo_order_search, bo_table ";
$row2 = sql_fetch($sql3);
if($row2[cnt] > 0) {
//board
$sqlb = " select * from $g4[board_table] where (gr_id = '$gr_id') order by bo_order_search, bo_table";
$resultb = sql_query($sqlb);
echo "<div class='select_sub'>";
echo "<ul class='sub'>";
for ($j=0; $rowb=sql_fetch_array($resultb); $j++) {
$icl = "<img src='{$g4[path]}/img/top_icon.gif' border='0' style='vertical-align:middle;' alt='' />";
$icl2 = "<img src='{$g4[path]}/img/top_icon.gif' border='0' style='vertical-align:middle;' alt='' />";
$bsubject = ($rowb['bo_table'] == $bo_table)?"<span class='bold'>".$rowb['bo_subject']."</span>":"<span>".$rowb['bo_subject']."</span>";
//board link
$blink = $g4['bbs_path'].'/'.'board.php?bo_table=' .$rowb['bo_table'];
?>
<li><a href='<?php echo $blink;?>'><?php echo $bsubject;?><?//php echo $new;?></a></li>
<?
}
echo "</ul>";
echo "</div>";
}
?>
<? echo"</li></ul>";
} ?>
</ul>
</div>
</div>
이소스는 그누보드4로 정상 적동 되었습니다.
============================
이를
탑메뉴 형식으로 위 소스를 그누보드5를 적용 시키는 방법 부탁 드립니다.
답변 1
그누보드4와 5의 html구성형태도, PHP 소스코드의 형태도 많이 다르기때문에 눈으로 직접확인하고 그 기능을 그대로 따라 구현하는 수밖에 없습니다.
그대로 복사하시면 안될거에요..