글
그간 몇차례 그누보드4를 설치하고 사용자 모듈을 만들어보려고 시도를 했었습니다. 그런데 그누보드4가 short open 태그여서 수정하기 귀찮음으로 그만두고는 하다가, 이번에 간단한 스크립트를 돌려서 short open 태그를 모두 고친 후에 설치를 하고 사용자 모듈을 만들어 봤습니다.
사용자 모듈은 다음과 같은 형태입니다.
<?php class User_g4 extends WikiUser { function g4_init() { global $g4, $member, $g4_root_dir; $g4_root_dir = !empty($DBInfo->g4_root_dir) ? $DBInfo->g4_root_dir : __DIR__.'/../../../gb4'; require_once('g4.common.php'); $member = g4_get_member(); } function User_g4($id = '') {
여기서 g4.common.php는 그누보드의 루트 디렉토리에 있는 common.php를 간소화시킨 버전으로 다음과 같은 형태입니다.
<?php /** * simplified common.php by wkpark @ gmail.com * 2015/04/29 */ function g4_get_member() { global $g4, $g4_root_dir; ... include_once("$g4_root_dir/lib/constant.php"); // 상수 정의 include_once("$g4_root_dir/config.php"); // 설정 파일 include_once("$g4_root_dir/lib/common.lib.php"); // 공통 라이브러리 include_once("$g4_root_dir/dbconfig.php"); $connect_db = sql_connect($mysql_host, $mysql_user, $mysql_password); $select_db = sql_select_db($mysql_db, $connect_db); ...
이런 식으로 연결을 한 후에 그누보드 함수 get_menber()로 사용자를 가져오게 됩니다. 자세한 내용은 소스를 참고하시기 바라며, 소스 다운로드 및 사용 설명은 http://moniwiki.kldp.net/wiki.php/G4UserPlugin.를 참조하시기 바랍니다~
'오픈소스 > 모니위키' 카테고리의 다른 글
모니위키는 왜 텍스트기반을 고집하는가? (2) | 2015.06.12 |
---|---|
리그베다위키와 모니위키 뒷얘기 외 (4) | 2015.04.28 |
리그베다위키발 보안버그 분석 및 대처방법 (0) | 2015.04.27 |
모니위키에 Varnish 지원 추가 (0) | 2013.11.23 |
XE 1.7 모니위키 회원 연동 (0) | 2013.07.05 |
RECENT COMMENT