제로보드에 관한 팁이나 강의를 소개하는 게시판입니다.
팁공유라고 해서 아주 특별하거나 기발한거 아니어도 됩니다.
자신이 제로보드를 사용하면서 생긴 자신만의 노하우나 아주 사소한 팁이어도 좋습니다.
자신에겐 아무것도 아니더라도 다른분들께는 분명 중요하고 소중한 팁이 될수 있을겁니다.
글수 4,527

/// 제로보드4용 경험치 시스템 Ver 0.6 설치 방법 ///
※ 제로보드 폴더가 bbs 라는 가정하에 적겠습니다.
1. 일단 아래 첨부파일 zb_exp.zip을 다운로드 받으신 후 압축을 해제하시면
/bbs/exp_m.php - 본문용 경험치 배열 파일
/bbs/exp_c.php - 덧글용 경험치 배열 파일
/exp/config.php - 설정용 파일
/exp/exp.php - 경험치 설정 파일
/exp/exp_add_ok.php - 경험치 추가 파일
/exp/exp_del_ok.php - 경험치 삭제 파일
/exp/exp_install.php - DB 설치용 파일
위와 같은 파일들이 있습니다.
일단 config.php 파일을 텍스트에디터를 이용해서 불러들인후 자신의 계정에 맞게 설정하신후 FTP를 이용해 자신의 계정에
bbs 폴더의 것들은 제로보드의 폴더에 exp폴더는 최상위에 업로드해주시면됩니다.
2. 그리고 업로드한 exp_install.php를 인터넷 익스플로어를 이용해서 불러드리면 자동으로 DB를 설치하게됩니다.
※ DB 생성 내용
경험치에 이용할 zetyx_member_exp 테이블을 생성합니다. 필드는 no,next,coll 3가지 이며 모두 int 입니다.
회원테이블에 경험치용 필드를 생성합니다. exp 역시 int 입니다.
위의 DB 설치가 완료되었으면 이 파일은 삭제하셔도 상관없습니다.
3. 제로보드 관리자로 로그인한 후 익스플로어를 이용 exp.php 파일을 불러오면 경험치를 설정하는 화면이 나옵니다.

필요경험치에 다음레벨이 될때 필요한 경험치를 적어주고 추가하기를 하면 한단계 레벨씩 추가됩니다.
필요경험치는 다음 레벨이 되기위해 모아야할 경험치 이고
모인경험치는 필요경험치를 제외하고 모여있는 경험치 이고
총경험치는 이 두가지를 합산한 값입니다.
중간에 레벨을 삭제할 경우 그 상위의 레벨들도 같이 삭제 됩니다.
설명을 잘 못해서 그런데... 일단 사용해보시면 쉽게 사용하실수 있으실 겁니다.[아마도...]
5. 이제 자신이 설정한 경험치를 게시판에 불러오기 위해 파일들을 수정하도록 하겠습니다.
ⓐ 일단 제로보드 최상위에 view.php 파일을 불러들여 파일을 수정합니다.
// 현재 선택된 데이타가 있을때, 즉 $no 가 있을때 데이타 가져옴
unset($data);
$_dbTimeStart = getmicrotime();
$data=mysql_fetch_array(mysql_query("select * from $t_board"."_$id where no='$no'"));
위와 같은 부분을 찾으신 후 아래의 내용을 그 아래 부분에 넣어주시면됩니다.
//경험치를 위해 추가된 부분
$member_no_subs = $data[ismember];
$data_subs = mysql_fetch_array(mysql_query("select exp from zetyx_member_table where no = '$member_no_subs'"));
$exp = $data_subs[exp];
위의 부분을 추가하셨다면 다음으로 넘어가겠습니다.
// 내용보기 출력
$_skinTimeStart = getmicrotime();
include $dir."/view.php";
위와 같은 내용을 찾으신후 아래와 같이 바꿔 주시면 됩니다.
// 내용보기 출력
$_skinTimeStart = getmicrotime();
include "exp_m.php"; //이 부분을 추가
include $dir."/view.php";
역시 위의 부분을 추가하셨다면 다음으로 넘어가겠습니다.
// 코멘트 출력;;
if($setup[use_comment]) {
while($c_data=mysql_fetch_array($view_comment_result)) {
위 부분을 찾으신 후 아래와 같은 내용을 아래부분에 추가하시면됩니다.
$c_no = $c_data[ismember];
$c_point = mysql_fetch_array(mysql_query("select exp from $member_table where no='$c_no'"));
$c_exp = $c_point[exp];
그리고 마지막으로 아래와 같은 내용을 찾으신 후
// 이름앞에 붙는 아이콘 정의;;
$c_face_image=get_face($c_data);
그 윗 부분에 아래의 내용을추가합니다.
include "exp_c.php";
위 작업을 마치셨다면 다음 파일을 수정하도록 하겠습니다.
ⓑ 다음은 글 작성과 삭제에 의한 경험치 업,다운 설정을 하기 위한 수정입니다.
제로보드 최상위의 write_ok.php 파일을 수정합니다.
// 회원일 경우 해당 해원의 점수 주기
if($mode=="write"||$mode=="reply") @mysql_query("update $member_table set point1=point1+1 where no='$member[no]'",$connect) or error(mysql_error());
위와같은 부분을 찾아 아래와 같이 수정해줍니다.
// 회원일 경우 해당 해원의 점수 주기
if($mode=="write"||$mode=="reply") @mysql_query("update $member_table set point1=point1+1, exp=exp+1 where no='$member[no]'",$connect) or error(mysql_error());
다음으로 제로보드 최상위의 delete_ok.php 파일을 수정합니다.
// 회원일 경우 해당 해원의 점수 주기
if($member[no]==$s_data[ismember]) @mysql_query("update $member_table set point1=point1-1 where no='$member[no]'",$connect) or error(mysql_error());
위와 같은 부분을 찾아 아래와 같이 수정합니다.
// 회원일 경우 해당 해원의 점수 주기
if($member[no]==$s_data[ismember]) @mysql_query("update $member_table set point1=point1-1, exp=exp-1 where no='$member[no]'",$connect) or error(mysql_error());
다음으로 제로보드 최상위의 comment_ok.php 파일을 수정합니다.
// 회원일 경우 해당 해원의 점수 주기
@mysql_query("update $member_table set point2=point2+1 where no='$member[no]'",$connect) or error(mysql_error());
위와 같은 부분을 찾아 아래와 같이 수정합니다.
// 회원일 경우 해당 해원의 점수 주기
@mysql_query("update $member_table set point2=point2+1, exp=exp+1 where no='$member[no]'",$connect) or error(mysql_error());
다음으로 제로보드 최상위의 del_comment_ok.php 파일을 수정합니다.
// 회원일 경우 해당 해원의 점수 주기
if($member[no]==$s_data[ismember]) @mysql_query("update $member_table set point2=point2-1 where no='$member[no]'",$connect) or error(mysql_error());
위와 같은 부분을 찾아 아래와 같이 수정합니다.
// 회원일 경우 해당 해원의 점수 주기
if($member[no]==$s_data[ismember]) @mysql_query("update $member_table set point2=point2-1, exp=exp-1 where no='$member[no]'",$connect) or error(mysql_error());
위 파일들을 모두 수정했다면 다음은 게시판에 출력하는 부분을 추가해보도록 하겠습니다.
ⓒ 자신이 사용하는 게시판 스킨의 view.php 를 불러들여온 후
아래의 부분을 자신이 원하는 위치에 넣어주면 되겠습니다.
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td width="105" align="left">
<table width="100" cellpadding="0" cellspacing="0" style="border:1px solid #444444;">
<tr>
<td width="<?=round($divide*100,0)?>" height="3" bgcolor="#ffff00" title='<?=$exp?>/<?=$nextp?>'></td><td width="<?=round(100-$divide*100,0)?>" bgcolor="#ff0000" title='<?=$exp?>/<?=$nextp?>'></td>
</tr>
</table>
</td>
<td align="left"><font style="font-size:8pt;"><?=$collp?>/<?=$needp?> - <?=round($divide*100, 2)?>%</font></td>
</tr>
<tr>
<td>Lv.<?=$dlevel?></td><td>전체EXP : <?=$exp?>/<?=$nextp?></td>
</tr>
</table>
물론 위 내용은 제가 임의적으로 만든것이기 때문에 자신이 원하는데로 바꾸어 사용하셔도 상관없습니다.
다음으로 코멘트 부분에 경험치 부분을 추가하도록 하겠습니다.
역시 게시판 스킨의 comment_view.php 파일을 불러들여 오신 후
위와 마찬가지로 자신이 원하는 위치에 아래 내요을 추가하시면 됩니다.
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td width="105" align="left">
<table width="100" cellpadding="0" cellspacing="0" style="border:1px solid #444444;">
<tr>
<td width="<?=round($c_divide*100,0)?>" height="3" bgcolor="#ffff00" title='<?=$c_exp?>/<?=$c_nextp?>'></td><td width="<?=round(100-$c_divide*100,0)?>" bgcolor="#ff0000" title='<?=$c_exp?>/<?=$c_nextp?>'></td>
</tr>
</table>
</td>
<td align="left"><font style="font-size:8pt;"><?=$c_collp?>/<?=$c_needp?> - <?=round($c_divide*100, 2)?>%</font></td>
</tr>
<tr>
<td>Lv.<?=$c_level?></td><td>전체EXP : <?=$c_exp?>/<?=$c_nextp?></td>
</tr>
</table>
이 내용 역시 제가 임의적으로 만든것이니 직접 수정하셔서 사용하셔도 무관합니다.
위 수정사항을 모두 수정하셨다면 일단 설치는 완료된것입니다.
// 설치방법 끝 //
0.6Ver 업데이트 사항
1. 관리자만 접속가능하게 변경.
2. 기타 오류 및 버그 수정.
전에 공개한 플러그인에서 개인적으로 문제가 될만한 점들을 찾아 수정하였습니다.
전 버전을 문제없이 사용하시던 분들은 config.php 내용만 수정해서 exp폴더의 파일을 모두 덮어쓰기 하시면됩니다.
불편사항, 궁금하신 점, 오류 및 버그 등이 있을시 덧글 달아주세요.
