스킨파일은 <?php @include(NA_PATH.'/bbs/btn_write.php'); //글쓰기 버튼 모음 ?> 인듯한데
코어는..잘모르겠네요 ㅎㅎ
<?php
include_once('./_common.php');
// 모바일 에디터 설정 ------------------------------------
$editor_nariya = (is_mobile() && isset($boset['editor_mo']) && $boset['editor_mo']) ? $boset['editor_mo'] : '';
if($editor_nariya) {
if(is_file(G5_EDITOR_PATH.'/'.$editor_nariya.'/editor.lib.php')) {
$config['cf_editor'] = $editor_nariya;
include_once(G5_EDITOR_PATH.'/'.$config['cf_editor'].'/editor.lib.php');
} else {
$editor_nariya = '';
}
}
if(!$editor_nariya)
include_once(G5_EDITOR_LIB);
//--------------------------------------------------
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');
if (!$board['bo_table']) {
alert('존재하지 않는 게시판입니다.', G5_URL);
}
if (!$bo_table) {
alert("bo_table 값이 넘어오지 않았습니다.\\nwrite.php?bo_table=code 와 같은 방식으로 넘겨 주세요.", G5_URL);
}
check_device($board['bo_device']);
$notice_array = explode(',', trim($board['bo_notice']));
if (!($w == '' || $w == 'u' || $w == 'r')) {
alert('w 값이 제대로 넘어오지 않았습니다.');
}
if ($w == 'u' || $w == 'r') {
if ($write['wr_id']) {
// 가변 변수로 $wr_1 .. $wr_10 까지 만든다.
for ($i=1; $i<=10; $i++) {
$vvar = "wr_".$i;
$$vvar = $write['wr_'.$i];
}
} else {
alert("글이 존재하지 않습니다.\\n삭제되었거나 이동된 경우입니다.", G5_URL);
}
}
run_event('bbs_write', $board, $wr_id, $w);
if ($w == '') {
if ($wr_id) {
alert('글쓰기에는 \$wr_id 값을 사용하지 않습니다.', G5_BBS_URL.'/board.php?bo_table='.$bo_table);
}
if ($member['mb_level'] < $board['bo_write_level']) {
if ($member['mb_id']) {
alert('글을 쓸 권한이 없습니다.');
} else {
alert("글을 쓸 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.", G5_BBS_URL.'/login.php?'.$qstr.'&url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
}
}
// 음수도 true 인것을 왜 이제야 알았을까?
if ($is_member) {
$tmp_point = ($member['mb_point'] > 0) ? $member['mb_point'] : 0;
if ($tmp_point + $board['bo_write_point'] < 0 && !$is_admin) {
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글쓰기('.number_format($board['bo_write_point']).')가 불가합니다.\\n\\n포인트를 적립하신 후 다시 글쓰기 해 주십시오.');
}
}
$title_msg = '글쓰기';
} else if ($w == 'u') {
// 김선용 1.00 : 글쓰기 권한과 수정은 별도로 처리되어야 함
//if ($member['mb_level'] < $board['bo_write_level']) {
if($member['mb_id'] && $write['mb_id'] === $member['mb_id']) {
;
} else if ($member['mb_level'] < $board['bo_write_level']) {
if ($member['mb_id']) {
alert('글을 수정할 권한이 없습니다.');
} else {
alert('글을 수정할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?'.$qstr.'&url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
}
}
$len = strlen($write['wr_reply']);
if ($len < 0) $len = 0;
$reply = substr($write['wr_reply'], 0, $len);
// 원글만 구한다.
$sql = " select count(*) as cnt from {$write_table}
where wr_reply like '{$reply}%'
and wr_id <> '{$write['wr_id']}'
and wr_num = '{$write['wr_num']}'
and wr_is_comment = 0 ";
$row = sql_fetch($sql);
if ($row['cnt'] && !$is_admin)
alert('이 글과 관련된 답변글이 존재하므로 수정 할 수 없습니다.\\n\\n답변글이 있는 원글은 수정할 수 없습니다.');
// 코멘트 달린 원글의 수정 여부
$sql = " select count(*) as cnt from {$write_table}
where wr_parent = '{$wr_id}'
and mb_id <> '{$member['mb_id']}'
and wr_is_comment = 1 ";
$row = sql_fetch($sql);
if ($board['bo_count_modify'] && $row['cnt'] >= $board['bo_count_modify'] && !$is_admin)
alert('이 글과 관련된 댓글이 존재하므로 수정 할 수 없습니다.\\n\\n댓글이 '.$board['bo_count_modify'].'건 이상 달린 원글은 수정할 수 없습니다.');
$title_msg = '글수정';
} else if ($w == 'r') {
if ($member['mb_level'] < $board['bo_reply_level']) {
if ($member['mb_id'])
alert('글을 답변할 권한이 없습니다.');
else
alert('답변글을 작성할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?'.$qstr.'&url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
}
$tmp_point = isset($member['mb_point']) ? $member['mb_point'] : 0;
if ($tmp_point + $board['bo_write_point'] < 0 && !$is_admin)
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글답변('.number_format($board['bo_comment_point']).')가 불가합니다.\\n\\n포인트를 적립하신 후 다시 글답변 해 주십시오.');
//if (preg_match("/[^0-9]{0,1}{$wr_id}[\r]{0,1}/",$board['bo_notice']))
if (in_array((int)$wr_id, $notice_array))
alert('공지에는 답변 할 수 없습니다.');
//----------
// 4.06.13 : 비밀글을 타인이 열람할 수 있는 오류 수정 (헐랭이, 플록님께서 알려주셨습니다.)
// 코멘트에는 원글의 답변이 불가하므로
if ($write['wr_is_comment'])
alert('정상적인 접근이 아닙니다.');
// 비밀글인지를 검사
if (strstr($write['wr_option'], 'secret')) {
if ($write['mb_id']) {
// 회원의 경우는 해당 글쓴 회원 및 관리자
if (!($write['mb_id'] === $member['mb_id'] || $is_admin))
alert('비밀