[관리] 그누보드 함수 간단하게 보기 > 정보공유

본문 바로가기

정보공유

일반글
그누보드팁

[관리] 그누보드 함수 간단하게 보기

페이지 정보

게시물QR코드

본문

그누보드의 기본 함수들은 www/lib/ 경로에 .lib.php 파일로 저장 되어있습니다.

www/lib/ 경로에있는 .lib.php 파일들을 읽어서 간단하게 함수들을

정리해서 볼 수 있는 페이지를 만들어 보겠습니다.

저는 예제에서는 www/경로에 lib_func.php 파일을 생성하여 만들어 보겠습니다.

 

1. www/lib_func.php 파일을 생성 후 아래의 소스코드를 붙혀 넣고 저장합니다.

<?php

/* www/lib_func.php */

 

include_once('./common.php');

include_once(G5_PATH.'/head.php');

?>

<link type="text/css" rel="stylesheet" href="./css/lib_func.css" />

 

<div style='width:250px; float:left'> 

<table class="__se_tbl">

<tbody>

<tr>

<th class="th_tbl"><p id="p_tbl"><b>파일이름</b></p></td>

</tr>

 

<?

// lib폴더의 파일들을 스캔

$scan = scandir(G5_PATH."/lib");

foreach ($scan as $val) {

    if (!strstr($val, ".lib.php")) continue; //파일명이 .lib.php로 끝나지않으면 무시

echo "<tr><td class='td_tbl'><p id='p_tbl'><b><a href='?file=$val'>".$val."</a></b></p></td></tr>";

}

?>

 

</tbody>

</table>

</div>

<div style='width:75%; float:left'> 

<? if ($_GET[file]) { ?>

<table class="contant_table">

 

<th class="th_tbl" width="10%" nowrap>라인</td>

<th class="th_tbl" width="40%" align="left">함수명</th>

<th class="th_tbl" width="40%">코멘트</td>

 

    <?

    $file = file_get_contents(G5_PATH."/lib/$_GET[file]");

    $scan = explode("\n", $file);

    for ($n = count($scan), $i = 0; $i < $n; $i++) {

        $line = $scan[$i];

        if (substr($line, 0, 8) != "function") continue;

        $name = trim(substr($line, 8));

        $comm = $scan[$i - 1];

        if (substr($comm, 0, 2) == "//")

            $comm = trim($comm);

        $name = trim(str_replace("{", "", $name));

    ?>

 

    <tr>

        <td width="10%" nowrap><?=$i + 1?></td>

        <th width="40%" align="left"><?=$name?></th>

        <td width="40%"><?=$comm?></td>

    </tr>

    <? } ?>

</table>

<? } ?>

</div>

 

<?

include_once(G5_PATH.'/tail.php');

?>

 

2. www/css/lib_func.css 스타일시트를 생성합니다.

스타일시트의 내용은 아래의 내용을 넣어주겠습니다.

/* www/css/lib_func.css */

 

.__se_tbl {

width:200px;

background-color:rgb(199,199,199);

border:0;

}

 

.th_tbl{

height:28px;

padding:3px 4px 2px;

background-color:rgb(51,51,51);

color:rgb(255,255,255);

text-align:center;

font-weight:normal;

}

 

.td_tbl{

height:28px;

padding:3px 4px 2px;

color:rgb(102,102,102);

text-align:center;

font-weight:normal;

background-color:rgb(248,248,248);

}

 

.contant_table {

width:100%;

border-collapse:collapse;

border:1px solid #dde4e9;

}

 

.contant_table th {

border:1px solid #dde4e9;

height:30px;

padding:3px 4px 2px;

font-weight:bold;

}

 

.contant_table td{

border:1px solid #dde4e9;

height:30px;

padding:3px 4px 2px;

font-weight:normal;

}

 

www/lib_func.php 파일과

www/css/lib_func.css 파일을 정상적으로 생성 하셨다면

도메인/lib_func.php 경로로 접속시 아래와 같이 새로운 페이지가 생성된것을 확인할 수 있겠습니다.

953ab8fb6f863dbf027111de8eb32c19_1497933065_0599.png 

 

데모는 링크1 또는 다음에서 확인이 가능합니다.

 

http://gnuwiz.com/interface/lib_func.php

댓글목록

마이웨이님의 댓글

no_profile 마이웨이쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 작성일

편리한 기능이네요 감사합니다.

  • Addr.부산광역시 동구 중앙대로 319, 9층 L4호(초량동, 부산YMCA빌딩) Email. gnuwiz@naver.com
  • BR. 625-68-00172 TRC. 2019-부산해운대-1186 TEL. 0507-1382-2790
All rights reserved.