티스토리 뷰

switch문으로 게시판 info 정리

switch ($code){
    case "notice" :
    $_left = "member";
    break;

    case "cancer" :
    $_left = "data";
    break;

    default :
    bbsError("등록된 게시판이 아닙니다.");
    break;
}


sub_navi.php를 include 해 if 문으로 적용

<?php
    if($_left == 'member'): 
?>
    <ul>
        <li class="<?php echo isset($on5_1)?$on5_1:""?>"><a href="#n">공지사항</a></li>
        <li class="<?php echo isset($on5_2)?$on5_2:""?>"><a href="#n">회원게시판</a></li>
        <li class="<?php echo isset($on5_3)?$on5_3:""?>"><a href="#n">질문과 답변</a></li>
    </ul>
<?php 
    endif ; 
?>

<?php
    if($_left == 'data'): 
?>
    <ul>
        <li class="<?php echo isset($on6_1)?$on6_1:""?>"><a href="#ns">교육자료실</a></li>
        <li class="<?php echo isset($on6_2)?$on6_2:""?>"><a href="#n">홍보자료실</a></li>
    </ul>
<?php 
    endif ; 
?>
공지사항