Merge branch 'master' of github.com:gnuboard/g4s
This commit is contained in:
@ -18,11 +18,11 @@ include_once($g4['path'].'/head.sub.php');
|
||||
<caption>기존 게시판을 새 게시판으로 복사</caption>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="col">원본 테이블</th>
|
||||
<th scope="col">원본 테이블명</th>
|
||||
<td><?=$bo_table?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="col"><label for="target_table">복사할 TABLE</label></th>
|
||||
<th scope="col"><label for="target_table">복사 테이블명</label></th>
|
||||
<td><input type="text" id="target_table" name="target_table" maxlength="20" class="required alnum_" required="required" title="복사할 TABLE"> 영문자, 숫자, _ 만 가능 (공백없이)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -53,6 +53,11 @@ include_once($g4['path'].'/head.sub.php');
|
||||
<script>
|
||||
function fboardcopy_check(f)
|
||||
{
|
||||
if (f.bo_table.value == f.target_table.value) {
|
||||
alert("원본 테이블명과 복사할 테이블명이 달라야 합니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
<? echo chk_captcha_js(); ?>
|
||||
|
||||
return true;
|
||||
|
||||
@ -12,14 +12,13 @@ if (!chk_captcha()) {
|
||||
$target_table = escape_trim($_POST['target_table']);
|
||||
$target_subject = escape_trim($_POST['target_subject']);
|
||||
|
||||
if (!preg_match('/[A-Za-z0-9_]{1,20}/', $target_table))
|
||||
{
|
||||
if (!preg_match('/[A-Za-z0-9_]{1,20}/', $target_table)) {
|
||||
alert('게시판 TABLE명은 공백없이 영문자, 숫자, _ 만 사용 가능합니다. (20자 이내)');
|
||||
}
|
||||
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g4['board_table']} where bo_table = '$target_table' ");
|
||||
if ($row['cnt'])
|
||||
alert($target_table.'은(는) 이미 존재하는 게시판 TABLE 입니다.\\n\\n복사할 TABLE로 사용할 수 없습니다.');
|
||||
alert($target_table.'은(는) 이미 존재하는 게시판 테이블명 입니다.\\n복사할 테이블명으로 사용할 수 없습니다.');
|
||||
|
||||
check_token();
|
||||
|
||||
@ -119,20 +118,11 @@ $f = @fopen($file, 'w');
|
||||
@chmod($file, 0606);
|
||||
|
||||
$copy_file = 0;
|
||||
if ($copy_case == 'schema_data_both')
|
||||
{
|
||||
if ($copy_case == 'schema_data_both') {
|
||||
$d = dir($g4['path'].'/data/file/'.$bo_table);
|
||||
while ($entry = $d->read())
|
||||
{
|
||||
while ($entry = $d->read()) {
|
||||
if ($entry == '.' || $entry == '..') continue;
|
||||
|
||||
/*
|
||||
@copy('$g4['path']/data/file/$bo_table/$entry', '$g4['path']/data/file/$target_table/$entry');
|
||||
@chmod('$g4['path']/data/file/$target_table/$entry', 0707);
|
||||
|
||||
$copy_file++;
|
||||
*/
|
||||
|
||||
// 김선용 201007 :
|
||||
if(is_dir($g4['path'].'/data/file/'.$bo_table.'/'.$entry)){
|
||||
$dd = dir($g4['path'].'/data/file/'.$bo_table.'/'.$entry);
|
||||
@ -164,11 +154,6 @@ if ($copy_case == 'schema_data_both')
|
||||
$sql = " update {$g4['board_table']} set bo_count_write = '{$row['bo_count_write']}', bo_count_comment = '{$row['bo_count_comment']}' where bo_table = '$target_table' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 05.05.24
|
||||
// 파일테이블 복사
|
||||
//$sql = ' insert into $g4['board_file_table'] select "$target_table", wr_id, bf_no, bf_source, bf_file, bf_download, bf_content from $g4['board_file_table'] where bo_table = "$bo_table" ';
|
||||
//sql_query($sql);
|
||||
|
||||
// 4.00.01
|
||||
// 위의 코드는 같은 테이블명을 사용하였다는 오류가 발생함. (희한하네 ㅡㅡ;)
|
||||
$sql = " select * from {$g4['board_file_table']} where bo_table = '$bo_table' ";
|
||||
@ -177,10 +162,8 @@ if ($copy_case == 'schema_data_both')
|
||||
$file_copy[$i] = $row;
|
||||
}
|
||||
|
||||
if (count($file_copy))
|
||||
{
|
||||
for ($i=0; $i<count($file_copy); $i++)
|
||||
{
|
||||
if (count($file_copy)) {
|
||||
for ($i=0; $i<count($file_copy); $i++) {
|
||||
$sql = " insert into {$g4['board_file_table']}
|
||||
set bo_table = '$target_table',
|
||||
wr_id = '{$file_copy[$i]['wr_id']}',
|
||||
@ -197,14 +180,8 @@ if (count($file_copy))
|
||||
sql_query($sql, FALSE);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=<?=$g4['charset']?>">
|
||||
<script>
|
||||
alert('게시판 복사 : <?=$bo_table?> > <?=$target_table?> 성공 <? if ($copy_file) echo PHP_EOL.' 복사한 파일 : 총 <?=$copy_file?>개';?>');
|
||||
opener.document.location.reload();
|
||||
</script>
|
||||
echo "<script>opener.document.location.reload();</script>";
|
||||
|
||||
<?
|
||||
goto_url('./board_copy.php?bo_table='.$bo_table.'&'.$qstr);
|
||||
?>
|
||||
alert("복사에 성공 했습니다.", './board_copy.php?bo_table='.$bo_table.'&'.$qstr);
|
||||
?>
|
||||
@ -656,10 +656,9 @@ if (!preg_match("/([m|M])$/", $upload_max_filesize)) {
|
||||
<th scope="row"><label for="bo_reply_order">답변 달기</label></th>
|
||||
<td>
|
||||
<select id="bo_reply_order" name="bo_reply_order">
|
||||
<option value="1">나중에 쓴 답변 아래로 달기 (기본)
|
||||
<option value='0'>나중에 쓴 답변 위로 달기
|
||||
<option value="1" <?=get_selected($board['bo_reply_order'], 1, true);?>>나중에 쓴 답변 아래로 달기 (기본)
|
||||
<option value="0" <?=get_selected($board['bo_reply_order'], 0);?>>나중에 쓴 답변 위로 달기
|
||||
</select>
|
||||
<script> document.fboardform.bo_reply_order.value = "<?=$board['bo_reply_order']?>"; </script>
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" id="chk_reply_order" name="chk_reply_order" value="1">
|
||||
@ -671,27 +670,26 @@ if (!preg_match("/([m|M])$/", $upload_max_filesize)) {
|
||||
<td>
|
||||
<?=help('리스트에서 기본으로 정렬에 사용할 필드를 선택합니다. "기본"으로 사용하지 않으시는 경우 속도가 느려질 수 있습니다.')?>
|
||||
<select id="bo_sort_field" name="bo_sort_field">
|
||||
<option value="">wr_num, wr_reply : 기본</option>
|
||||
<option value="wr_datetime asc">wr_datetime asc : 날짜 이전것 부터</option>
|
||||
<option value="wr_datetime desc">wr_datetime desc : 날짜 최근것 부터</option>
|
||||
<option value="wr_hit asc, wr_num, wr_reply">wr_hit asc : 조회수 낮은것 부터</option>
|
||||
<option value="wr_hit desc, wr_num, wr_reply">wr_hit desc : 조회수 높은것 부터</option>
|
||||
<option value="wr_last asc">wr_last asc : 최근글 이전것 부터</option>
|
||||
<option value="wr_last desc">wr_last desc : 최근글 최근것 부터</option>
|
||||
<option value="wr_comment asc, wr_num, wr_reply">wr_comment asc : 댓글수 낮은것 부터</option>
|
||||
<option value="wr_comment desc, wr_num, wr_reply">wr_comment desc : 댓글수 높은것 부터</option>
|
||||
<option value="wr_good asc, wr_num, wr_reply">wr_good asc : 추천수 낮은것 부터</option>
|
||||
<option value="wr_good desc, wr_num, wr_reply">wr_good desc : 추천수 높은것 부터</option>
|
||||
<option value="wr_nogood asc, wr_num, wr_reply">wr_nogood asc : 비추천수 낮은것 부터</option>
|
||||
<option value="wr_nogood desc, wr_num, wr_reply">wr_nogood desc : 비추천수 높은것 부터</option>
|
||||
<option value="wr_subject asc, wr_num, wr_reply">wr_subject asc : 제목 내림차순</option>
|
||||
<option value="wr_subject desc, wr_num, wr_reply">wr_subject desc : 제목 오름차순</option>
|
||||
<option value="wr_name asc, wr_num, wr_reply">wr_name asc : 글쓴이 내림차순</option>
|
||||
<option value="wr_name desc, wr_num, wr_reply">wr_name desc : 글쓴이 오름차순</option>
|
||||
<option value="ca_name asc, wr_num, wr_reply">ca_name asc : 분류명 내림차순</option>
|
||||
<option value="ca_name desc, wr_num, wr_reply">ca_name desc : 분류명 오름차순</option>
|
||||
<option value="" <?=get_selected($board['bo_sort_field'], "" );?>>wr_num, wr_reply : 기본</option>
|
||||
<option value="wr_datetime asc" <?=get_selected($board['bo_sort_field'], "wr_datetime asc" );?>>wr_datetime asc : 날짜 이전것 부터</option>
|
||||
<option value="wr_datetime desc" <?=get_selected($board['bo_sort_field'], "wr_datetime desc" );?>>wr_datetime desc : 날짜 최근것 부터</option>
|
||||
<option value="wr_hit asc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "wr_hit asc, wr_num, wr_reply" );?>>wr_hit asc : 조회수 낮은것 부터</option>
|
||||
<option value="wr_hit desc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "wr_hit desc, wr_num, wr_reply" );?>>wr_hit desc : 조회수 높은것 부터</option>
|
||||
<option value="wr_last asc" <?=get_selected($board['bo_sort_field'], "wr_last asc" );?>>wr_last asc : 최근글 이전것 부터</option>
|
||||
<option value="wr_last desc" <?=get_selected($board['bo_sort_field'], "wr_last desc" );?>>wr_last desc : 최근글 최근것 부터</option>
|
||||
<option value="wr_comment asc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "wr_comment asc, wr_num, wr_reply" );?>>wr_comment asc : 댓글수 낮은것 부터</option>
|
||||
<option value="wr_comment desc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "wr_comment desc, wr_num, wr_reply" );?>>wr_comment desc : 댓글수 높은것 부터</option>
|
||||
<option value="wr_good asc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "wr_good asc, wr_num, wr_reply" );?>>wr_good asc : 추천수 낮은것 부터</option>
|
||||
<option value="wr_good desc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "wr_good desc, wr_num, wr_reply" );?>>wr_good desc : 추천수 높은것 부터</option>
|
||||
<option value="wr_nogood asc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "wr_nogood asc, wr_num, wr_reply" );?>>wr_nogood asc : 비추천수 낮은것 부터</option>
|
||||
<option value="wr_nogood desc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "wr_nogood desc, wr_num, wr_reply" );?>>wr_nogood desc : 비추천수 높은것 부터</option>
|
||||
<option value="wr_subject asc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "wr_subject asc, wr_num, wr_reply" );?>>wr_subject asc : 제목 내림차순</option>
|
||||
<option value="wr_subject desc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "wr_subject desc, wr_num, wr_reply" );?>>wr_subject desc : 제목 오름차순</option>
|
||||
<option value="wr_name asc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "wr_name asc, wr_num, wr_reply" );?>>wr_name asc : 글쓴이 내림차순</option>
|
||||
<option value="wr_name desc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "wr_name desc, wr_num, wr_reply" );?>>wr_name desc : 글쓴이 오름차순</option>
|
||||
<option value="ca_name asc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "ca_name asc, wr_num, wr_reply" );?>>ca_name asc : 분류명 내림차순</option>
|
||||
<option value="ca_name desc, wr_num, wr_reply" <?=get_selected($board['bo_sort_field'], "ca_name desc, wr_num, wr_reply" );?>>ca_name desc : 분류명 오름차순</option>
|
||||
</select>
|
||||
<script> document.fboardform.bo_sort_field.value = "<?=$board['bo_sort_field']?>"; </script>
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" id="chk_sort_field" name="chk_sort_field" value="1">
|
||||
|
||||
@ -19,7 +19,7 @@ if (!$bo_table) {
|
||||
if (isset($wr_id) && $wr_id) {
|
||||
// 글이 없을 경우 해당 게시판 목록으로 이동
|
||||
if (!$write['wr_id']) {
|
||||
$msg = '글이 존재하지 않습니다.'.PHP_EOL.PHP_EOL.'글이 삭제되었거나 이동된 경우입니다.';
|
||||
$msg = '글이 존재하지 않습니다.\\n\\n글이 삭제되었거나 이동된 경우입니다.';
|
||||
alert($msg, './board.php?bo_table='.$bo_table);
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ if (isset($wr_id) && $wr_id) {
|
||||
if ($is_member)
|
||||
alert('글을 읽을 권한이 없습니다.', $g4['path']);
|
||||
else
|
||||
alert('글을 읽을 권한이 없습니다.'.PHP_EOL.PHP_EOL.'회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode('./board.php?bo_table='.$bo_table.'&wr_id='.$wr_id));
|
||||
alert('글을 읽을 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode('./board.php?bo_table='.$bo_table.'&wr_id='.$wr_id));
|
||||
}
|
||||
|
||||
// 자신의 글이거나 관리자라면 통과
|
||||
@ -105,14 +105,14 @@ if (isset($wr_id) && $wr_id) {
|
||||
// 회원이상 글읽기가 가능하다면
|
||||
if ($board['bo_read_level'] > 1) {
|
||||
if ($member['mb_point'] + $board['bo_read_point'] < 0)
|
||||
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글읽기('.number_format($board['bo_read_point']).')가 불가합니다.'.PHP_EOL.PHP_EOL.'포인트를 모으신 후 다시 글읽기 해 주십시오.');
|
||||
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글읽기('.number_format($board['bo_read_point']).')가 불가합니다.\\n\\n포인트를 모으신 후 다시 글읽기 해 주십시오.');
|
||||
|
||||
insert_point($member['mb_id'], $board['bo_read_point'], '{$board['bo_subject']} {$wr_id} 글읽기', $bo_table, $wr_id, '읽기');
|
||||
}
|
||||
*/
|
||||
// 글읽기 포인트가 설정되어 있다면
|
||||
if ($board['bo_read_point'] && $member['mb_point'] + $board['bo_read_point'] < 0)
|
||||
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글읽기('.number_format($board['bo_read_point']).')가 불가합니다.'.PHP_EOL.PHP_EOL.'포인트를 모으신 후 다시 글읽기 해 주십시오.');
|
||||
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글읽기('.number_format($board['bo_read_point']).')가 불가합니다.\\n\\n포인트를 모으신 후 다시 글읽기 해 주십시오.');
|
||||
|
||||
insert_point($member['mb_id'], $board['bo_read_point'], "{$board['bo_subject']} {$wr_id} 글읽기", $bo_table, $wr_id, '읽기');
|
||||
}
|
||||
@ -126,7 +126,7 @@ if (isset($wr_id) && $wr_id) {
|
||||
if ($member['mb_id'])
|
||||
alert('목록을 볼 권한이 없습니다.', $g4['path']);
|
||||
else
|
||||
alert('목록을 볼 권한이 없습니다.'.PHP_EOL.PHP_EOL.'회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode('board.php?bo_table='.$bo_table.'&wr_id='.$wr_id));
|
||||
alert('목록을 볼 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode('board.php?bo_table='.$bo_table.'&wr_id='.$wr_id));
|
||||
}
|
||||
|
||||
if (!isset($page) || (isset($page) && $page == 0)) $page = 1;
|
||||
|
||||
@ -10,20 +10,20 @@ $no = (int)$no;
|
||||
if (!get_session('ss_view_'.$bo_table.'_'.$wr_id))
|
||||
alert('잘못된 접근입니다.');
|
||||
|
||||
$sql = " select bf_source, bf_file from {$g4[board_file_table]} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and bf_no = '{$no}' ";
|
||||
$sql = " select bf_source, bf_file from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$no' ";
|
||||
$file = sql_fetch($sql);
|
||||
if (!$file[bf_file])
|
||||
if (!$file['bf_file'])
|
||||
alert_close('파일 정보가 존재하지 않습니다.');
|
||||
|
||||
if ($member[mb_level] < $board[bo_download_level]) {
|
||||
if ($member['mb_level'] < $board['bo_download_level']) {
|
||||
$alert_msg = '다운로드 권한이 없습니다.';
|
||||
if ($member[mb_id])
|
||||
if ($member['mb_id'])
|
||||
alert($alert_msg);
|
||||
else
|
||||
alert($alert_msg.PHP_EOL.PHP_EOL.'회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id=.'$wr_id.'&'.$qstr.'&url='.urlencode($g4['bbs_path'].'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id));
|
||||
alert($alert_msg.'\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.'&'.$qstr.'&url='.urlencode($g4['bbs_path'].'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id));
|
||||
}
|
||||
|
||||
$filepath = $g4['path'].'/data/file/'.$bo_table.'/'.$file[bf_file];
|
||||
$filepath = $g4['path'].'/data/file/'.$bo_table.'/'.$file['bf_file'];
|
||||
$filepath = addslashes($filepath);
|
||||
if (!is_file($filepath) || !file_exists($filepath))
|
||||
alert('파일이 존재하지 않습니다.');
|
||||
@ -37,35 +37,35 @@ if (!get_session($ss_name))
|
||||
{
|
||||
// 자신의 글이라면 통과
|
||||
// 관리자인 경우 통과
|
||||
if (($write[mb_id] && $write[mb_id] == $member[mb_id]) || $is_admin)
|
||||
if (($write['mb_id'] && $write['mb_id'] == $member['mb_id']) || $is_admin)
|
||||
;
|
||||
else if ($board[bo_download_level] > 1) // 회원이상 다운로드가 가능하다면
|
||||
else if ($board['bo_download_level'] > 1) // 회원이상 다운로드가 가능하다면
|
||||
{
|
||||
// 다운로드 포인트가 음수이고 회원의 포인트가 0 이거나 작다면
|
||||
if ($member[mb_point] + $board[bo_download_point] < 0)
|
||||
alert('보유하신 포인트('.number_format($member[mb_point]).')가 없거나 모자라서 다운로드('.number_format($board[bo_download_point]).')가 불가합니다.'.PHP_EOL.PHP_EOL.'포인트를 적립하신 후 다시 다운로드 해 주십시오.');
|
||||
if ($member['mb_point'] + $board['bo_download_point'] < 0)
|
||||
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 다운로드('.number_format($board['bo_download_point']).')가 불가합니다.'."\n\n".'포인트를 적립하신 후 다시 다운로드 해 주십시오.');
|
||||
|
||||
// 게시물당 한번만 차감하도록 수정
|
||||
insert_point($member[mb_id], $board[bo_download_point], "{$board[bo_subject]} {$wr_id} 파일 다운로드", $bo_table, $wr_id, "다운로드");
|
||||
insert_point($member['mb_id'], $board['bo_download_point'], "{$board['bo_subject']} $wr_id 파일 다운로드", $bo_table, $wr_id, "다운로드");
|
||||
}
|
||||
|
||||
// 다운로드 카운트 증가
|
||||
$sql = " update {$g4[board_file_table]} set bf_download = bf_download + 1 where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and bf_no = '{$no}' ";
|
||||
$sql = " update {$g4['board_file_table']} set bf_download = bf_download + 1 where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$no' ";
|
||||
sql_query($sql);
|
||||
|
||||
set_session($ss_name, TRUE);
|
||||
}
|
||||
|
||||
$g4['title'] = '다운로드 > '.conv_subject($write[wr_subject], 255);
|
||||
$g4['title'] = '다운로드 > '.conv_subject($write['wr_subject'], 255);
|
||||
|
||||
if (preg_match("/^utf/i", $g4[charset]))
|
||||
$original = urlencode($file[bf_source]);
|
||||
if (preg_match("/^utf/i", $g4['charset']))
|
||||
$original = urlencode($file['bf_source']);
|
||||
else
|
||||
$original = $file[bf_source];
|
||||
$original = $file['bf_source'];
|
||||
|
||||
@include_once($board_skin_path.'/download.tail.skin.php');
|
||||
|
||||
if(preg_match("/msie/i", $_SERVER[HTTP_USER_AGENT]) && preg_match("/5\.5/", $_SERVER[HTTP_USER_AGENT])) {
|
||||
if(preg_match("/msie/i", $_SERVER['HTTP_USER_AGENT']) && preg_match("/5\.5/", $_SERVER['HTTP_USER_AGENT'])) {
|
||||
header("content-type: doesn/matter");
|
||||
header("content-length: ".filesize("$filepath"));
|
||||
header("content-disposition: attachment; filename=\"$original\"");
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
$captcha_html = "";
|
||||
if ($is_guest) {
|
||||
@ -16,14 +16,14 @@ if ($is_admin && !$token) {
|
||||
$list = array();
|
||||
|
||||
$is_comment_write = false;
|
||||
if ($member['mb_level'] >= $board['bo_comment_level'])
|
||||
if ($member['mb_level'] >= $board['bo_comment_level'])
|
||||
$is_comment_write = true;
|
||||
|
||||
// 코멘트 출력
|
||||
//$sql = " select * from {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 order by wr_comment desc, wr_comment_reply ";
|
||||
$sql = " select * from {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
|
||||
$sql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$list[$i] = $row;
|
||||
|
||||
@ -36,14 +36,14 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
$list[$i]['name'] = '<span class="'.($row['mb_id']?'member':'guest').'">'.$tmp_name.'</span>';
|
||||
|
||||
|
||||
|
||||
|
||||
// 공백없이 연속 입력한 문자 자르기 (way 보드 참고. way.co.kr)
|
||||
//$list[$i]['content'] = eregi_replace("[^ \n<>]{130}", "\\0\n", $row['wr_content']);
|
||||
|
||||
$list[$i]['content'] = $list[$i]['content1']= '비밀글 입니다.';
|
||||
if (!strstr($row['wr_option'], 'secret') ||
|
||||
$is_admin ||
|
||||
($write['mb_id']==$member['mb_id'] && $member['mb_id']) ||
|
||||
$is_admin ||
|
||||
($write['mb_id']==$member['mb_id'] && $member['mb_id']) ||
|
||||
($row['mb_id']==$member['mb_id'] && $member['mb_id'])) {
|
||||
$list[$i]['content1'] = $row['wr_content'];
|
||||
$list[$i]['content'] = conv_content($row['wr_content'], 0, 'wr_content');
|
||||
@ -60,18 +60,18 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
$list[$i]['is_reply'] = false;
|
||||
$list[$i]['is_edit'] = false;
|
||||
$list[$i]['is_del'] = false;
|
||||
if ($is_comment_write || $is_admin)
|
||||
if ($is_comment_write || $is_admin)
|
||||
{
|
||||
if ($member['mb_id'])
|
||||
if ($member['mb_id'])
|
||||
{
|
||||
if ($row['mb_id'] == $member['mb_id'] || $is_admin)
|
||||
if ($row['mb_id'] == $member['mb_id'] || $is_admin)
|
||||
{
|
||||
$list[$i]['del_link'] = './delete_comment.php?bo_table='.$bo_table.'&comment_id='.$row['wr_id'].'&token='.$token.'&page='.$page.$qstr;
|
||||
$list[$i]['is_edit'] = true;
|
||||
$list[$i]['is_del'] = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$row['mb_id']) {
|
||||
$list[$i]['del_link'] = './password.php?w=x&bo_table='.$bo_table.'&comment_id='.$row['wr_id'].'&page='.$page.$qstr;
|
||||
@ -87,7 +87,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
// 답변있는 코멘트는 수정, 삭제 불가
|
||||
if ($i > 0 && !$is_admin)
|
||||
{
|
||||
if ($row['wr_comment_reply'])
|
||||
if ($row['wr_comment_reply'])
|
||||
{
|
||||
$tmp_comment_reply = substr($row['wr_comment_reply'], 0, strlen($row['wr_comment_reply']) - 1);
|
||||
if ($tmp_comment_reply == $list[$i-1]['wr_comment_reply'])
|
||||
|
||||
@ -13,7 +13,7 @@ if (substr_count($wr_content, "&#") > 50) {
|
||||
$w = $_POST["w"];
|
||||
$wr_name = escape_trim($_POST['wr_name']);
|
||||
$wr_email = '';
|
||||
if (!empty($_POST['wr_email']))
|
||||
if (!empty($_POST['wr_email']))
|
||||
$wr_email = escape_trim($_POST['wr_email']);
|
||||
|
||||
// 비회원의 경우 이름이 누락되는 경우가 있음
|
||||
@ -23,38 +23,38 @@ if ($is_guest) {
|
||||
}
|
||||
|
||||
if ($w == "c" || $w == "cu") {
|
||||
if ($member['mb_level'] < $board['bo_comment_level'])
|
||||
if ($member['mb_level'] < $board['bo_comment_level'])
|
||||
alert('코멘트를 쓸 권한이 없습니다.');
|
||||
}
|
||||
}
|
||||
else
|
||||
alert('w 값이 제대로 넘어오지 않았습니다.');
|
||||
|
||||
// 세션의 시간 검사
|
||||
// 4.00.15 - 코멘트 수정시 연속 게시물 등록 메시지로 인한 오류 수정
|
||||
if ($w == 'c' && $_SESSION['ss_datetime'] >= ($g4['server_time'] - $config['cf_delay_sec']) && !$is_admin)
|
||||
if ($w == 'c' && $_SESSION['ss_datetime'] >= ($g4['server_time'] - $config['cf_delay_sec']) && !$is_admin)
|
||||
alert('너무 빠른 시간내에 게시물을 연속해서 올릴 수 없습니다.');
|
||||
|
||||
set_session('ss_datetime', $g4['server_time']);
|
||||
|
||||
$wr = get_write($write_table, $wr_id);
|
||||
if (empty($wr['wr_id']))
|
||||
alert("글이 존재하지 않습니다.\\n글이 삭제되었거나 이동하였을 수 있습니다.");
|
||||
if (empty($wr['wr_id']))
|
||||
alert("글이 존재하지 않습니다.\\n글이 삭제되었거나 이동하였을 수 있습니다.");
|
||||
|
||||
|
||||
// "인터넷옵션 > 보안 > 사용자정의수준 > 스크립팅 > Action 스크립팅 > 사용 안 함" 일 경우의 오류 처리
|
||||
// 이 옵션을 사용 안 함으로 설정할 경우 어떤 스크립트도 실행 되지 않습니다.
|
||||
//if (!trim($_POST["wr_content"])) die ("내용을 입력하여 주십시오.");
|
||||
|
||||
if ($member[mb_id])
|
||||
if ($is_admin)
|
||||
{
|
||||
$mb_id = $member[mb_id];
|
||||
$mb_id = $member['mb_id'];
|
||||
// 4.00.13 - 실명 사용일때 코멘트에 별명으로 입력되던 오류를 수정
|
||||
$wr_name = $board[bo_use_name] ? $member[mb_name] : $member[mb_nick];
|
||||
$wr_password = $member[mb_password];
|
||||
$wr_email = $member[mb_email];
|
||||
$wr_homepage = $member[mb_homepage];
|
||||
}
|
||||
else
|
||||
$wr_name = $board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick'];
|
||||
$wr_password = $member['mb_password'];
|
||||
$wr_email = $member['mb_email'];
|
||||
$wr_homepage = $member['mb_homepage'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$mb_id = '';
|
||||
$wr_password = sql_password($wr_password);
|
||||
@ -67,131 +67,131 @@ if ($w == 'c') // 코멘트 입력
|
||||
alert('보유하신 포인트('.number_format($member[mb_point]).')가 없거나 모자라서 코멘트쓰기('.number_format($board[bo_comment_point]).')가 불가합니다.'.PHP_EOL.PHP_EOL.'포인트를 적립하신 후 다시 코멘트를 써 주십시오.');
|
||||
*/
|
||||
// 코멘트쓰기 포인트설정시 회원의 포인트가 음수인 경우 코멘트를 쓰지 못하던 버그를 수정 (곱슬최씨님)
|
||||
$tmp_point = ($member[mb_point] > 0) ? $member[mb_point] : 0;
|
||||
if ($tmp_point + $board[bo_comment_point] < 0 && !$is_admin)
|
||||
alert('보유하신 포인트('.number_format($member[mb_point]).')가 없거나 모자라서 코멘트쓰기('.number_format($board[bo_comment_point]).')가 불가합니다.'.PHP_EOL.PHP_EOL.'포인트를 적립하신 후 다시 코멘트를 써 주십시오.');
|
||||
$tmp_point = ($member['mb_point'] > 0) ? $member['mb_point'] : 0;
|
||||
if ($tmp_point + $board['bo_comment_point'] < 0 && !$is_admin)
|
||||
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 코멘트쓰기('.number_format($board['bo_comment_point']).')가 불가합니다.'."\n\n".'포인트를 적립하신 후 다시 코멘트를 써 주십시오.');
|
||||
|
||||
// 코멘트 답변
|
||||
if ($comment_id)
|
||||
if ($comment_id)
|
||||
{
|
||||
$sql = " select wr_id, wr_comment, wr_comment_reply from {$write_table}
|
||||
where wr_id = '{$comment_id}' ";
|
||||
$sql = " select wr_id, wr_comment, wr_comment_reply from $write_table
|
||||
where wr_id = '$comment_id' ";
|
||||
$reply_array = sql_fetch($sql);
|
||||
if (!$reply_array[wr_id])
|
||||
alert('답변할 코멘트가 없습니다.'.PHP_EOL.PHP_EOL.'답변하는 동안 코멘트가 삭제되었을 수 있습니다.');
|
||||
if (!$reply_array['wr_id'])
|
||||
alert('답변할 코멘트가 없습니다.'."\n\n".'답변하는 동안 코멘트가 삭제되었을 수 있습니다.');
|
||||
|
||||
$tmp_comment = $reply_array[wr_comment];
|
||||
$tmp_comment = $reply_array['wr_comment'];
|
||||
|
||||
if (strlen($reply_array[wr_comment_reply]) == 5)
|
||||
alert('더 이상 답변하실 수 없습니다.'.PHP_EOL.PHP_EOL.'답변은 5단계 까지만 가능합니다.');
|
||||
if (strlen($reply_array['wr_comment_reply']) == 5)
|
||||
alert('더 이상 답변하실 수 없습니다.'."\n\n".'답변은 5단계 까지만 가능합니다.');
|
||||
|
||||
$reply_len = strlen($reply_array[wr_comment_reply]) + 1;
|
||||
if ($board[bo_reply_order]) {
|
||||
$reply_len = strlen($reply_array['wr_comment_reply']) + 1;
|
||||
if ($board['bo_reply_order']) {
|
||||
$begin_reply_char = 'A';
|
||||
$end_reply_char = 'Z';
|
||||
$reply_number = +1;
|
||||
$sql = " select MAX(SUBSTRING(wr_comment_reply, {$reply_len}, 1)) as reply
|
||||
from {$write_table}
|
||||
where wr_parent = '{$wr_id}'
|
||||
and wr_comment = '{$tmp_comment}'
|
||||
and SUBSTRING(wr_comment_reply, {$reply_len}, 1) <> '' ";
|
||||
}
|
||||
else
|
||||
$sql = " select MAX(SUBSTRING(wr_comment_reply, $reply_len, 1)) as reply
|
||||
from $write_table
|
||||
where wr_parent = '$wr_id'
|
||||
and wr_comment = '$tmp_comment'
|
||||
and SUBSTRING(wr_comment_reply, $reply_len, 1) <> '' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$begin_reply_char = 'Z';
|
||||
$end_reply_char = 'A';
|
||||
$reply_number = -1;
|
||||
$sql = " select MIN(SUBSTRING(wr_comment_reply, {$reply_len}, 1)) as reply
|
||||
from {$write_table}
|
||||
where wr_parent = '{$wr_id}'
|
||||
and wr_comment = '{$tmp_comment}'
|
||||
and SUBSTRING(wr_comment_reply, {$reply_len}, 1) <> '' ";
|
||||
$sql = " select MIN(SUBSTRING(wr_comment_reply, $reply_len, 1)) as reply
|
||||
from $write_table
|
||||
where wr_parent = '$wr_id'
|
||||
and wr_comment = '$tmp_comment'
|
||||
and SUBSTRING(wr_comment_reply, $reply_len, 1) <> '' ";
|
||||
}
|
||||
if ($reply_array[wr_comment_reply])
|
||||
$sql .= " and wr_comment_reply like '{$reply_array[wr_comment_reply]}%' ";
|
||||
if ($reply_array['wr_comment_reply'])
|
||||
$sql .= " and wr_comment_reply like '{$reply_array['wr_comment_reply']}%' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if (!$row[reply])
|
||||
if (!$row['reply'])
|
||||
$reply_char = $begin_reply_char;
|
||||
else if ($row[reply] == $end_reply_char) // A~Z은 26 입니다.
|
||||
alert('더 이상 답변하실 수 없습니다.'.PHP_EOL.PHP_EOL.'답변은 26개 까지만 가능합니다.');
|
||||
else if ($row['reply'] == $end_reply_char) // A~Z은 26 입니다.
|
||||
alert('더 이상 답변하실 수 없습니다.'."\n\n".'답변은 26개 까지만 가능합니다.');
|
||||
else
|
||||
$reply_char = chr(ord($row[reply]) + $reply_number);
|
||||
$reply_char = chr(ord($row['reply']) + $reply_number);
|
||||
|
||||
$tmp_comment_reply = $reply_array[wr_comment_reply] . $reply_char;
|
||||
$tmp_comment_reply = $reply_array['wr_comment_reply'] . $reply_char;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$sql = " select max(wr_comment) as max_comment from {$write_table}
|
||||
where wr_parent = '{$wr_id}' and wr_is_comment = 1 ";
|
||||
$sql = " select max(wr_comment) as max_comment from $write_table
|
||||
where wr_parent = '$wr_id' and wr_is_comment = 1 ";
|
||||
$row = sql_fetch($sql);
|
||||
//$row[max_comment] -= 1;
|
||||
$row[max_comment] += 1;
|
||||
$tmp_comment = $row[max_comment];
|
||||
$row['max_comment'] += 1;
|
||||
$tmp_comment = $row['max_comment'];
|
||||
$tmp_comment_reply = '';
|
||||
}
|
||||
|
||||
$sql = " insert into {$write_table}
|
||||
set ca_name = '{$wr[ca_name]}',
|
||||
wr_option = '{$wr_secret}',
|
||||
wr_num = '{$wr[wr_num]}',
|
||||
$sql = " insert into $write_table
|
||||
set ca_name = '{$wr['ca_name']}',
|
||||
wr_option = '$wr_secret',
|
||||
wr_num = '{$wr['wr_num']}',
|
||||
wr_reply = '',
|
||||
wr_parent = '{$wr_id}',
|
||||
wr_parent = '$wr_id',
|
||||
wr_is_comment = 1,
|
||||
wr_comment = '{$tmp_comment}',
|
||||
wr_comment_reply = '{$tmp_comment_reply}',
|
||||
wr_subject = '{$wr_subject}',
|
||||
wr_content = '{$wr_content}',
|
||||
mb_id = '{$mb_id}',
|
||||
wr_password = '{$wr_password}',
|
||||
wr_name = '{$wr_name}',
|
||||
wr_email = '{$wr_email}',
|
||||
wr_homepage = '{$wr_homepage}',
|
||||
wr_datetime = '{$g4[time_ymdhis]}',
|
||||
wr_comment = '$tmp_comment',
|
||||
wr_comment_reply = '$tmp_comment_reply',
|
||||
wr_subject = '$wr_subject',
|
||||
wr_content = '$wr_content',
|
||||
mb_id = '$mb_id',
|
||||
wr_password = '$wr_password',
|
||||
wr_name = '$wr_name',
|
||||
wr_email = '$wr_email',
|
||||
wr_homepage = '$wr_homepage',
|
||||
wr_datetime = '$g4[time_ymdhis]',
|
||||
wr_last = '',
|
||||
wr_ip = '{$_SERVER[REMOTE_ADDR]}',
|
||||
wr_1 = '{$wr_1}',
|
||||
wr_2 = '{$wr_2}',
|
||||
wr_3 = '{$wr_3}',
|
||||
wr_4 = '{$wr_4}',
|
||||
wr_5 = '{$wr_5}',
|
||||
wr_6 = '{$wr_6}',
|
||||
wr_7 = '{$wr_7}',
|
||||
wr_8 = '{$wr_8}',
|
||||
wr_9 = '{$wr_9}',
|
||||
wr_10 = '{$wr_10}' ";
|
||||
wr_ip = '{$_SERVER['REMOTE_ADDR']}',
|
||||
wr_1 = '$wr_1',
|
||||
wr_2 = '$wr_2',
|
||||
wr_3 = '$wr_3',
|
||||
wr_4 = '$wr_4',
|
||||
wr_5 = '$wr_5',
|
||||
wr_6 = '$wr_6',
|
||||
wr_7 = '$wr_7',
|
||||
wr_8 = '$wr_8',
|
||||
wr_9 = '$wr_9',
|
||||
wr_10 = '$wr_10' ";
|
||||
sql_query($sql);
|
||||
|
||||
$comment_id = mysql_insert_id();
|
||||
|
||||
// 원글에 코멘트수 증가 & 마지막 시간 반영
|
||||
sql_query(" update {$write_table} set wr_comment = wr_comment + 1, wr_last = '{$g4[time_ymdhis]}' where wr_id = '{$wr_id}' ");
|
||||
sql_query(" update $write_table set wr_comment = wr_comment + 1, wr_last = '{$g4['time_ymdhis']}' where wr_id = '$wr_id' ");
|
||||
|
||||
// 새글 INSERT
|
||||
//sql_query(" insert into {$g4[board_new_table]} ( bo_table, wr_id, wr_parent, bn_datetime ) values ( '{$bo_table}', '{$comment_id}', '{$wr_id}', '{$g4[time_ymdhis]}' ) ");
|
||||
sql_query(" insert into {$g4[board_new_table]} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '{$bo_table}', '{$comment_id}', '{$wr_id}', '{$g4[time_ymdhis]}', '{$member[mb_id]}' ) ");
|
||||
sql_query(" insert into {$g4['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$comment_id', '$wr_id', '{$g4['time_ymdhis']}', '{$member['mb_id']}' ) ");
|
||||
|
||||
// 코멘트 1 증가
|
||||
sql_query(" update {$g4[board_table]} set bo_count_comment = bo_count_comment + 1 where bo_table = '{$bo_table}' ");
|
||||
sql_query(" update {$g4['board_table']} set bo_count_comment = bo_count_comment + 1 where bo_table = '$bo_table' ");
|
||||
|
||||
// 포인트 부여
|
||||
insert_point($member[mb_id], $board[bo_comment_point], "{$board[bo_subject]} {$wr_id}-{$comment_id} 코멘트쓰기", $bo_table, $comment_id, '코멘트');
|
||||
insert_point($member['mb_id'], $board['bo_comment_point'], "{$board['bo_subject']} {$wr_id}-{$comment_id} 코멘트쓰기", $bo_table, $comment_id, '코멘트');
|
||||
|
||||
// 메일발송 사용
|
||||
if ($config[cf_email_use] && $board[bo_use_email])
|
||||
if ($config['cf_email_use'] && $board['bo_use_email'])
|
||||
{
|
||||
// 관리자의 정보를 얻고
|
||||
$super_admin = get_admin('super');
|
||||
$group_admin = get_admin('group');
|
||||
$board_admin = get_admin('board');
|
||||
|
||||
$wr_subject = get_text(stripslashes($wr[wr_subject]));
|
||||
$wr_content = nl2br(get_text(stripslashes('----- 원글 -----'.PHP_EOL.PHP_EOL.$wr[wr_subject].PHP_EOL.PHP_EOL.PHP_EOL.'----- 코멘트 -----'.PHP_EOL.PHP_EOL.$wr_content)));
|
||||
$wr_subject = get_text(stripslashes($wr['wr_subject']));
|
||||
$wr_content = nl2br(get_text(stripslashes("----- 원글 -----\n\n{$wr['wr_subject']}\n\n\n----- 코멘트 -----\n\n$wr_content")));
|
||||
|
||||
$warr = array( ''=>'입력', 'u'=>'수정', 'r'=>'답변', 'c'=>'코멘트', 'cu'=>'코멘트 수정' );
|
||||
$str = $warr[$w];
|
||||
|
||||
$subject = $board[bo_subject].' 게시판에 '.$str.'글이 올라왔습니다.';
|
||||
$subject = $board['bo_subject'].' 게시판에 '.$str.'글이 올라왔습니다.';
|
||||
// 4.00.15 - 메일로 보내는 코멘트의 바로가기 링크 수정
|
||||
$link_url = $g4['url']."/".$g4['bbs']."/board.php?bo_table=".$bo_table."&wr_id=".$wr_id."&".$qstr."#c_".$comment_id;
|
||||
|
||||
@ -204,25 +204,25 @@ if ($w == 'c') // 코멘트 입력
|
||||
|
||||
$array_email = array();
|
||||
// 게시판관리자에게 보내는 메일
|
||||
if ($config[cf_email_wr_board_admin]) $array_email[] = $board_admin[mb_email];
|
||||
if ($config['cf_email_wr_board_admin']) $array_email[] = $board_admin['mb_email'];
|
||||
// 게시판그룹관리자에게 보내는 메일
|
||||
if ($config[cf_email_wr_group_admin]) $array_email[] = $group_admin[mb_email];
|
||||
if ($config['cf_email_wr_group_admin']) $array_email[] = $group_admin['mb_email'];
|
||||
// 최고관리자에게 보내는 메일
|
||||
if ($config[cf_email_wr_super_admin]) $array_email[] = $super_admin[mb_email];
|
||||
if ($config['cf_email_wr_super_admin']) $array_email[] = $super_admin['mb_email'];
|
||||
|
||||
// 옵션에 메일받기가 체크되어 있고, 게시자의 메일이 있다면
|
||||
if (strstr($wr[wr_option], 'mail') && $wr[wr_email]) {
|
||||
if (strstr($wr['wr_option'], 'mail') && $wr['wr_email']) {
|
||||
// 원글 메일발송에 체크가 되어 있다면
|
||||
if ($config[cf_email_wr_write]) $array_email[] = $wr[wr_email];
|
||||
if ($config['cf_email_wr_write']) $array_email[] = $wr['wr_email'];
|
||||
|
||||
// 코멘트 쓴 모든이에게 메일 발송이 되어 있다면 (자신에게는 발송하지 않는다)
|
||||
if ($config[cf_email_wr_comment_all]) {
|
||||
if ($config['cf_email_wr_comment_all']) {
|
||||
$sql = " select distinct wr_email from {$write_table}
|
||||
where wr_email not in ( '{$wr[wr_email]}', '{$member[mb_email]}', '' )
|
||||
and wr_parent = '{$wr_id}' ";
|
||||
where wr_email not in ( '{$wr['wr_email']}', '{$member['mb_email']}', '' )
|
||||
and wr_parent = '$wr_id' ";
|
||||
$result = sql_query($sql);
|
||||
while ($row=sql_fetch_array($result))
|
||||
$array_email[] = $row[wr_email];
|
||||
$array_email[] = $row['wr_email'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,79 +233,79 @@ if ($w == 'c') // 코멘트 입력
|
||||
mailer($wr_name, $wr_email, $unique_email[$i], $subject, $content, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ($w == 'cu') // 코멘트 수정
|
||||
{
|
||||
$sql = " select mb_id, wr_comment, wr_comment_reply from {$write_table}
|
||||
where wr_id = '{$comment_id}' ";
|
||||
{
|
||||
$sql = " select mb_id, wr_comment, wr_comment_reply from $write_table
|
||||
where wr_id = '$comment_id' ";
|
||||
$comment = $reply_array = sql_fetch($sql);
|
||||
$tmp_comment = $reply_array[wr_comment];
|
||||
$tmp_comment = $reply_array['wr_comment'];
|
||||
|
||||
$len = strlen($reply_array[wr_comment_reply]);
|
||||
if ($len < 0) $len = 0;
|
||||
$comment_reply = substr($reply_array[wr_comment_reply], 0, $len);
|
||||
$len = strlen($reply_array['wr_comment_reply']);
|
||||
if ($len < 0) $len = 0;
|
||||
$comment_reply = substr($reply_array['wr_comment_reply'], 0, $len);
|
||||
//print_r2($GLOBALS); exit;
|
||||
|
||||
if ($is_admin == 'super') // 최고관리자 통과
|
||||
;
|
||||
else if ($is_admin == 'group') { // 그룹관리자
|
||||
$mb = get_member($comment[mb_id]);
|
||||
if ($member[mb_id] == $group[gr_admin]) { // 자신이 관리하는 그룹인가?
|
||||
if ($member[mb_level] >= $mb[mb_level]) // 자신의 레벨이 크거나 같다면 통과
|
||||
;
|
||||
else
|
||||
alert('그룹관리자의 권한보다 높은 회원의 코멘트이므로 수정할 수 없습니다.');
|
||||
} else
|
||||
alert('자신이 관리하는 그룹의 게시판이 아니므로 코멘트를 수정할 수 없습니다.');
|
||||
} else if ($is_admin == 'board') { // 게시판관리자이면
|
||||
$mb = get_member($comment[mb_id]);
|
||||
if ($member[mb_id] == $board[bo_admin]) { // 자신이 관리하는 게시판인가?
|
||||
if ($member[mb_level] >= $mb[mb_level]) // 자신의 레벨이 크거나 같다면 통과
|
||||
;
|
||||
else
|
||||
alert('게시판관리자의 권한보다 높은 회원의 코멘트이므로 수정할 수 없습니다.');
|
||||
} else
|
||||
alert('자신이 관리하는 게시판이 아니므로 코멘트를 수정할 수 없습니다.');
|
||||
} else if ($member[mb_id]) {
|
||||
if ($member[mb_id] != $comment[mb_id])
|
||||
alert('자신의 글이 아니므로 수정할 수 없습니다.');
|
||||
}
|
||||
if ($is_admin == 'super') // 최고관리자 통과
|
||||
;
|
||||
else if ($is_admin == 'group') { // 그룹관리자
|
||||
$mb = get_member($comment['mb_id']);
|
||||
if ($member['mb_id'] == $group['gr_admin']) { // 자신이 관리하는 그룹인가?
|
||||
if ($member['mb_level'] >= $mb['mb_level']) // 자신의 레벨이 크거나 같다면 통과
|
||||
;
|
||||
else
|
||||
alert('그룹관리자의 권한보다 높은 회원의 코멘트이므로 수정할 수 없습니다.');
|
||||
} else
|
||||
alert('자신이 관리하는 그룹의 게시판이 아니므로 코멘트를 수정할 수 없습니다.');
|
||||
} else if ($is_admin == 'board') { // 게시판관리자이면
|
||||
$mb = get_member($comment['mb_id']);
|
||||
if ($member['mb_id'] == $board['bo_admin']) { // 자신이 관리하는 게시판인가?
|
||||
if ($member['mb_level'] >= $mb['mb_level']) // 자신의 레벨이 크거나 같다면 통과
|
||||
;
|
||||
else
|
||||
alert('게시판관리자의 권한보다 높은 회원의 코멘트이므로 수정할 수 없습니다.');
|
||||
} else
|
||||
alert('자신이 관리하는 게시판이 아니므로 코멘트를 수정할 수 없습니다.');
|
||||
} else if ($member['mb_id']) {
|
||||
if ($member['mb_id'] != $comment['mb_id'])
|
||||
alert('자신의 글이 아니므로 수정할 수 없습니다.');
|
||||
}
|
||||
|
||||
$sql = " select count(*) as cnt from {$write_table}
|
||||
where wr_comment_reply like '{$comment_reply}%'
|
||||
and wr_id <> '{$comment_id}'
|
||||
and wr_parent = '{$wr_id}'
|
||||
and wr_comment = '{$tmp_comment}'
|
||||
$sql = " select count(*) as cnt from $write_table
|
||||
where wr_comment_reply like '$comment_reply%'
|
||||
and wr_id <> '$comment_id'
|
||||
and wr_parent = '$wr_id'
|
||||
and wr_comment = '$tmp_comment'
|
||||
and wr_is_comment = 1 ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row[cnt] && !$is_admin)
|
||||
if ($row['cnt'] && !$is_admin)
|
||||
alert('이 코멘트와 관련된 답변코멘트가 존재하므로 수정 할 수 없습니다.');
|
||||
|
||||
$sql_ip = "";
|
||||
if (!$is_admin)
|
||||
$sql_ip = " , wr_ip = '{$_SERVER[REMOTE_ADDR]}' ";
|
||||
$sql_ip = " , wr_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
||||
|
||||
$sql_secret = "";
|
||||
if ($wr_secret)
|
||||
$sql_secret = " , wr_option = '{$wr_secret}' ";
|
||||
$sql_secret = " , wr_option = '$wr_secret' ";
|
||||
|
||||
$sql = " update {$write_table}
|
||||
set wr_subject = '{$wr_subject}',
|
||||
wr_content = '{$wr_content}',
|
||||
wr_1 = '{$wr_1}',
|
||||
wr_2 = '{$wr_2}',
|
||||
wr_3 = '{$wr_3}',
|
||||
wr_4 = '{$wr_4}',
|
||||
wr_5 = '{$wr_5}',
|
||||
wr_6 = '{$wr_6}',
|
||||
wr_7 = '{$wr_7}',
|
||||
wr_8 = '{$wr_8}',
|
||||
wr_9 = '{$wr_9}',
|
||||
wr_10 = '{$wr_10}',
|
||||
wr_option = '{$wr_option}'
|
||||
{$sql_ip}
|
||||
{$sql_secret}
|
||||
where wr_id = '{$comment_id}' ";
|
||||
$sql = " update $write_table
|
||||
set wr_subject = '$wr_subject',
|
||||
wr_content = '$wr_content',
|
||||
wr_1 = '$wr_1',
|
||||
wr_2 = '$wr_2',
|
||||
wr_3 = '$wr_3',
|
||||
wr_4 = '$wr_4',
|
||||
wr_5 = '$wr_5',
|
||||
wr_6 = '$wr_6',
|
||||
wr_7 = '$wr_7',
|
||||
wr_8 = '$wr_8',
|
||||
wr_9 = '$wr_9',
|
||||
wr_10 = '$wr_10',
|
||||
wr_option = '$wr_option'
|
||||
$sql_ip
|
||||
$sql_secret
|
||||
where wr_id = '$comment_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
@ -313,5 +313,5 @@ else if ($w == 'cu') // 코멘트 수정
|
||||
@include_once($board_skin_path.'/write_comment_update.skin.php');
|
||||
@include_once($board_skin_path.'/write_comment_update.tail.skin.php');
|
||||
|
||||
goto_url('./board.php?bo_table='.$bo_table.'&wr_id='.$wr[wr_parent].'&page='.$page.$qstr.'&#c_'.$comment_id);
|
||||
goto_url('./board.php?bo_table='.$bo_table.'&wr_id='.$wr['wr_parent'].'&page='.$page.$qstr.'&#c_'.$comment_id);
|
||||
?>
|
||||
|
||||
@ -37,7 +37,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
$cnt++;
|
||||
?>
|
||||
<li>
|
||||
<a href="javascript:file_download('<?=$view['file'][$i]['href']?>', '<?=urlencode($view['file'][$i]['source'])?>');">
|
||||
<a href="javascript:file_download('<?=$view['file'][$i]['href']?>', '<?=$view['file'][$i]['source']?>');">
|
||||
<span><?=$view['file'][$i]['source']?> (<?=$view['file'][$i]['size']?>)</span>
|
||||
<span class="bo_v_file_cnt"><?=$view['file'][$i]['download']?></span>
|
||||
<span>DATE : <?=$view['file'][$i]['datetime']?></span>
|
||||
@ -149,7 +149,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
<script>
|
||||
function file_download(link, file) {
|
||||
<? if ($board['bo_download_point'] < 0) { ?>if (confirm("'"+decodeURIComponent(file)+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board['bo_download_point'])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
|
||||
<? if ($board['bo_download_point'] < 0) { ?>if (confirm("'"+file+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board['bo_download_point'])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
|
||||
document.location.href=link;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user