광고배너

짧은주소 사용시 3차메뉴 나오지 않는 문제입니다.

짧은주소 사용시 3차메뉴 나오지 않는 문제입니다.

QA

짧은주소 사용시 3차메뉴 나오지 않는 문제입니다.

본문

짧은 주소를 사용하려고 메뉴설정 링크에서 /bbs/board.php?bo_table=m01_02 이렇게 되어 있는부분을 /m01_02 이렇게 고치고 해당페이지를 들어가면 잘 출력되던 3차메뉴가 출력되지 않습니다.

 

$tmp_code = substr($me_code,0,2); 부분에서 $me_code 를 짧은 주소를 사용하면 못불러와서 3차 메뉴가 출력이 되지 않는것 같은데 해결 방법이 있는지 문의드립니다.

(head.php 에서 수정하면 될것 같은데 해결방법이 있는지 문의드립니다.)

 

head.php 에 3차메뉴관련 소스입니다.


if($bo_table) { 
    $cate = "me_link LIKE '%bo_table=".$bo_table ."%'"; 
    $present_row = sql_query("select me_code  from ".$g5['menu_table']." where  $cate order by me_order,me_code,me_id limit 0,1 ");
    $present_row2=sql_fetch_array($present_row); 
    $me_code = $present_row2[me_code]; 
}else if($co_id){ 
    $cate = "me_link LIKE '%co_id=".$co_id ."' "; 
    $present_row = sql_query("select me_code  from ".$g5['menu_table']." where  $cate order by me_order,me_code,me_id limit 0,1 ");
    $present_row2=sql_fetch_array($present_row); 
    $me_code = $present_row2[me_code]; 
} 

 

메뉴관련 소스입니다.


<div class="mysub">
<?php
    $tmp_code = substr($me_code,0,2);
    $tmp_menu_name=sql_fetch(" select * from {$g5['menu_table']} where me_use = '1' and length(me_code) = '2' and me_code = '$tmp_code' ");
    ?>
        <h2>
            <?=$tmp_menu_name['me_name']?>
            <span style="width:60px; height:4px; margin:30px auto 0 auto; background:#004193; display:block;"></span>
        </h2>
    <?
    $sql2 = " select *
                from {$g5['menu_table']}
                where me_use = '1'
                  and length(me_code) = '4'
                  and substring(me_code, 1, 2) = '$tmp_code'
                order by me_order,me_code, me_id ";
    $result2 = sql_query($sql2);
    for ($k=0; $row2=sql_fetch_array($result2); $k++) {
        if($k == 0)
            echo '<ul class="snb_2dul">'.PHP_EOL;
    ?>
        <li class="snb_2dli">
            <a href="<?php echo $row2['me_link']; ?>" target="_<?php echo $row2['me_target']; ?>" class="snb_2da_<?php if($row2['me_code']==substr($me_code,0,4) && strlen($bo_table) > 5) { echo "on"; }?>"><?php echo $row2['me_name'] ?></a></li>
            <?php
                //3차메뉴 불러 오기.
                $sql3 = " select *
                            from {$g5['menu_table']}
                            where me_use = '1'
                              and length(me_code) = '6'
                              and substring(me_code, 1, 4) = '{$row2['me_code']}'
                            order by me_order,me_code, me_id ";
                $result3 = sql_query($sql3);
                $num3 = sql_num_rows($result3);
                if($num3>0){
                    echo '<ul class="snb_3dul">'.PHP_EOL;
                    while($row3=sql_fetch_array($result3)){
            ?>
                        <li class="snb_3dli">
                            <a href="<?php echo $row3['me_link']; ?>" target="_<?php echo $row3['me_target']; ?>" class="snb_3da_<?php if($row3['me_code']==$me_code && strlen($bo_table) > 8) { echo "on2"; }?>"><?php echo $row3['me_name'] ?></a></li>
                        <?php
                    }
                    echo '</ul>'.PHP_EOL;
                }            
    }
    if($k > 0)
        echo '</ul>'.PHP_EOL;
    ?>
</div>

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
전체 470
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT