서브메뉴에서 특정게시판을 제외하려고 합니다.
본문
서브메뉴에 특장게시판(B01, B02)를 제외하려고 하는데요.
$sql.= " where me_link like 'bo_table' and me_link not like 'B01' and me_link not like 'B102'";
$no_bo_table="'B01','B02'";//출력 하지않을 게시판 아이디 나열
검색해보니 이런게 있어서 넣어보니 안되는거 같은데 어떻게 해야 특정게시판이 제외되나요?
groupmenu.skin
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<!-- 메뉴 시작 { -->
<link rel="stylesheet" href="<?php echo $groupmenu_skin_url ?>/style.css">
<div id="sir_lnb">
<aside id="lnb_cate">
<h2><?php echo $group['gr_subject'] ?></h2>
<div class="sir_ddl sir_ddl_pc" id="cate_2d">
<button class="ddl_btn" type="button"><?php echo $group['gr_subject'] ?></button>
</div>
<ul>
<?php for ($i=0; $i<count($groupmenu); $i++) { ?>
<li<?php if($bo_table==$groupmenu[$i]['bo_table']) { echo " class=\"lnb_cate_on\""; } ?>><a href="<?php echo $groupmenu[$i]['href'] ?>">
<!--제목 아이콘 -->
<span class="m">
<img src="../skin/groupmenu/mysubmenu_sub/img/Message-24-2.png" style="opacity:1.0"
onmouseover="this.style.opacity='1.0'" onmouseout="this.style.opacity='1.0'" width='20' height='19' border='0'>
</span>
<?php echo $groupmenu[$i]['subject'] ?>
<?php if($groupmenu[$i]['cnt']) { ?>
<strong><?php echo $groupmenu[$i]['cnt'] ?></strong>
<?php } ?>
<?php if($groupmenu[$i]['total_cnt']) { ?>
<span><?php echo $groupmenu[$i]['total_cnt'] ?></span>
<?php } ?>
</a>
</li>
<?php } ?>
</ul>
</aside>
</div><!-- #sir_lnb -->
<!-- } 메뉴 끝 -->
groupmenu.lib
[code]
<?php
if (!defined('_GNUBOARD_')) exit;
// 메뉴
function groupmenu($skin_dir='basic', $new_time)
{
global $config, $group, $g5, $is_admin, $bo_table;
$groupmenu = array();
if(!$group['gr_id'] || G5_IS_MOBILE)
return;
$sql = " select * from {$g5['group_table']} where gr_device <> 'mobile' and gr_id = '{$group['gr_id']}' order by gr_order ";
$result = sql_query($sql);
for ($gi=0; $row=sql_fetch_array($result); $gi++) { // gi 는 group index
$sql2 = " select * from {$g5['board_table']} where gr_id = '{$row['gr_id']}' and bo_device <> 'mobile' order by bo_order ";
$result2 = sql_query($sql2);
for ($bi=0; $row2=sql_fetch_array($result2); $bi++) { // bi 는 board index
$board_table = $g5['write_prefix'] . $row2['bo_table'];
$latest_count = sql_fetch(" select count(*) as cnt from {$board_table} where wr_datetime > '".date('Y-m-d H:i:s', time() - (3600 * $new_time))."'");
$total_count = sql_fetch(" select count(*) as cnt from {$board_table} ");
$groupmenu[$bi]['bo_table'] = $row2['bo_table'];
$groupmenu[$bi]['href'] = G5_BBS_URL.'/board.php?bo_table='.$row2['bo_table'];
$groupmenu[$bi]['subject'] = $row2['bo_subject'];
$groupmenu[$bi]['cnt'] = $latest_count['cnt'];
$groupmenu[$bi]['total_cnt'] = $total_count['cnt'];
}
}
$groupmenu_skin_path = G5_SKIN_PATH.'/groupmenu/'.$skin_dir;
$groupmenu_skin_url = G5_SKIN_URL.'/groupmenu/'.$skin_dir;
ob_start();
include_once ($groupmenu_skin_path.'/groupmenu.skin.php');
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
[code]
!-->
답변 1
$sql2 = " select * from {$g5['board_table']} where gr_id = '{$row['gr_id']}' and bo_device <> 'mobile' order by bo_order ";
=> 아래와 같이 하시면 해당 게시판이 제외될거 같습니다.
$sql2 = " select * from {$g5['board_table']} where gr_id = '{$row['gr_id']}' and bo_device <> 'mobile' and bo_table != 'B01' and bo_table != 'B02' order by bo_order ";