메인 화면에서 게시판의 카테고리(분류)를 풀다운 메뉴로 ... > 그누3 팁자료실

그누3 팁자료실

메인 화면에서 게시판의 카테고리(분류)를 풀다운 메뉴로 ... 정보

그누호환 메인 화면에서 게시판의 카테고리(분류)를 풀다운 메뉴로 ...

본문




fulldown.gif
<?php

/////////////////////////////////////////////////

// category fulldown menu

// 2003-08-01



$img_path = $gnu_path."images/";

$fulldown_skin_path = $gnu_path."bbs/skin/fulldown_menu/";

$fulldown_menu_num = 0;



function fulldown_menu($board_id){

  global $fulldown_menu_num, $fulldown_skin_path, $img_path, $gnu_path,$cfg;



  $board_table = $cfg[write_table_prefix] . $board_id; // 테이블

  $board_cfg = sql_fetch_array(" select bo_subject from $cfg[table_board] where bo_table = '$board_id' ");



  include($fulldown_skin_path ."fulldown_head.php");



  $sql = " select * from {$board_table}_cat ";

  $rs = sql_query_error($sql);



    while ($row = mysql_fetch_array($rs)) {

      $board_link = "{$gnu_path}bbs/gnuboard.php?bo_table=$board_id&sselect=ca_id&stext={$row[ca_id]}";



      echo "<tr><td nowrap><IMG SRC='{$img_path}spacer.gif' WIDTH='15' HEIGHT='15' BORDER='0' ALT=''> - <a href='$board_link' onfocus='javascript:blur()'>$row[ca_name]</a></td></tr>";

    }

    mysql_free_result($rs);

    $fulldown_menu_num++;

  include($fulldown_skin_path ."fulldown_tail.php");

}

?>



<style>

-----------

스타일시트  

-----------

.fulldownMain {

  border-top-width: 1px;

  border-right-width: 1px;

  border-bottom-width: 1px;

  border-left-width: 1px;

  border-top-style: solid;

  border-right-style: solid;

  border-bottom-style: solid;

  border-left-style: solid;

  border-top-color: #FFFFFF;

  border-right-color: #999999;

  border-bottom-color: #999999;

  border-left-color: #FFFFFF;

  table-layout:fixed;

}

.fulldownSub {

  border-top-width: 1px;

  border-right-width: 1px;

  border-bottom-width: 1px;

  border-left-width: 1px;

  border-top-style: solid;

  border-right-style: solid;

  border-bottom-style: solid;

  border-left-style: solid;

  border-top-color: #999999;

  border-right-color: #FFFFFF;

  border-bottom-color: #FFFFFF;

  border-left-color: #999999;

  table-layout:fixed;

  margin-top:1px;

}

</style>





<SCRIPT>

<!--

-------------

자바 스크립트

-------------

var img_path = "/gnu_path/images/";

function showhide3(menu,img){

  if (menu.style.display=='none'){

    menu.style.display='';

    img.src=img_path+"open.gif" ;

  }

  else{

    menu.style.display='none'

    img.src=img_path+"closed.gif";

  }

}



//-->

</SCRIPT>





------------------

fulldown_head.php

------------------

<link rel='stylesheet' href='<?=$fulldown_skin_path?>fulldown_style.css' type='text/css'>

<table id='' class='fulldownMain' width='100%' cellpadding='1' cellspacing='0' bgcolor='#EEEEEE'>

<tr>

  <td nowrap>

    <IMG id='sign<?=$fulldown_menu_num?>' SRC='<?=$img_path;?>closed.gif' WIDTH='16' HEIGHT='16' BORDER='0'>

    <A HREF='#' onfocus='javascript:blur()' onClick='javascript:showhide3(submenu<?=$fulldown_menu_num?>,sign<?=$fulldown_menu_num?>);' ><B><?=$board_cfg[bo_subject]?></B></A>



  <table id='submenu<?=$fulldown_menu_num?>' class='fulldownSub' style='display:none;' width=100% cellpadding=0 cellspacing=0>





----------------

fulldown_tail.php

----------------

      </table>

      </td>

    </tr>

    </table>









-----------------------

적용방법

-----------------------

1. 함수를 libdeb.php파일의 추가한다.

2. 자바스크립트는 javascript.js의 추가한다.

3. 스타일시트는 style.css에 추가한다.

4. 스킨( fulldown_head.php와 fulldown_tail.php) ,  이미지 (closed.gif 와 open.gif )들은 각각 원하는 폴더에 놓는다.

5. php code 중 이미지와 스킨의 경로를 수정한다.

    $img_path = $gnu_path."images/";

    $fulldown_skin_path = $gnu_path."bbs/skin/fulldown_menu/";

6. javascript 중 이미지 경로를 수정한다.

    var img_path = "/gnu_path/images/";



-----------

함수 사용법

-----------

원하는 위치에서 아래의 코드를 삽입한다.

<?php fulldown_menu("게시판 아이디"); ?>

게시판 이아디는 웹 브라우져의 주소창에서 bo_table의 값입니다.

추천
4

댓글 전체

우아~~길당...@.@~ 그래도 적용해 볼 가치는 있네요..사이트맵 같은거 제작하기 시르니까..^^ 슬라이드 스크롤과 겹치면 멋질거 같습니다. 감사히 잘 쓸게요^^*
전체 1,026
그누3 팁자료실 내용 검색

회원로그인

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