사용자단 따옴표 작업 bbs/good.php 까지 진행
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
include_once('./_common.php');
|
||||
|
||||
// 4.11
|
||||
@include_once("$board_skin_path/delete_all.head.skin.php");
|
||||
@include_once($board_skin_path.'/delete_all.head.skin.php');
|
||||
|
||||
$count_write = 0;
|
||||
$count_comment = 0;
|
||||
@ -15,17 +15,17 @@ else // 일괄삭제
|
||||
|
||||
|
||||
// 사용자 코드 실행
|
||||
@include_once("$board_skin_path/delete_all.skin.php");
|
||||
@include_once($board_skin_path.'/delete_all.skin.php');
|
||||
|
||||
|
||||
// 거꾸로 읽는 이유는 답변글부터 삭제가 되어야 하기 때문임
|
||||
for ($i=count($tmp_array)-1; $i>=0; $i--)
|
||||
{
|
||||
$write = sql_fetch(" select * from $write_table where wr_id = '{$tmp_array[$i]}' ");
|
||||
$write = sql_fetch(" select * from {$write_table} where wr_id = '{$tmp_array[$i]}' ");
|
||||
|
||||
if ($is_admin == "super") // 최고관리자 통과
|
||||
if ($is_admin == 'super') // 최고관리자 통과
|
||||
;
|
||||
else if ($is_admin == "group") // 그룹관리자
|
||||
else if ($is_admin == 'group') // 그룹관리자
|
||||
{
|
||||
$mb = get_member($write[mb_id]);
|
||||
if ($member[mb_id] == $group[gr_admin]) // 자신이 관리하는 그룹인가?
|
||||
@ -38,7 +38,7 @@ for ($i=count($tmp_array)-1; $i>=0; $i--)
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else if ($is_admin == "board") // 게시판관리자이면
|
||||
else if ($is_admin == 'board') // 게시판관리자이면
|
||||
{
|
||||
$mb = get_member($write[mb_id]);
|
||||
if ($member[mb_id] == $board[bo_admin]) // 자신이 관리하는 게시판인가?
|
||||
@ -65,18 +65,18 @@ for ($i=count($tmp_array)-1; $i>=0; $i--)
|
||||
$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]'
|
||||
$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])
|
||||
continue;
|
||||
|
||||
// 나라오름님 수정 : 원글과 코멘트수가 정상적으로 업데이트 되지 않는 오류를 잡아 주셨습니다.
|
||||
//$sql = " select wr_id, mb_id, wr_comment from $write_table where wr_parent = '$write[wr_id]' order by wr_id ";
|
||||
$sql = " select wr_id, mb_id, wr_is_comment from $write_table where wr_parent = '$write[wr_id]' order by wr_id ";
|
||||
//$sql = " select wr_id, mb_id, wr_comment from {$write_table} where wr_parent = '{$write[wr_id]}' order by wr_id ";
|
||||
$sql = " select wr_id, mb_id, wr_is_comment from {$write_table} where wr_parent = '{$write[wr_id]}' order by wr_id ";
|
||||
$result = sql_query($sql);
|
||||
while ($row = sql_fetch_array($result))
|
||||
{
|
||||
@ -85,17 +85,17 @@ for ($i=count($tmp_array)-1; $i>=0; $i--)
|
||||
{
|
||||
// 원글 포인트 삭제
|
||||
if (!delete_point($row[mb_id], $bo_table, $row[wr_id], '쓰기'))
|
||||
insert_point($row[mb_id], $board[bo_write_point] * (-1), "$board[bo_subject] $row[wr_id] 글삭제");
|
||||
insert_point($row[mb_id], $board[bo_write_point] * (-1), "{$board[bo_subject]} {$row[wr_id]} 글 삭제");
|
||||
|
||||
// 업로드된 파일이 있다면
|
||||
$sql2 = " select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$row[wr_id]' ";
|
||||
$sql2 = " select * from {$g4[board_file_table]} where bo_table = '{$bo_table}' and wr_id = '{$row[wr_id]}' ";
|
||||
$result2 = sql_query($sql2);
|
||||
while ($row2 = sql_fetch_array($result2))
|
||||
// 파일삭제
|
||||
@unlink("$g4[path]/data/file/$bo_table/$row2[bf_file]");
|
||||
@unlink($g4['path'].'/data/file/'.$bo_table.'/'.$row2[bf_file]);
|
||||
|
||||
// 파일테이블 행 삭제
|
||||
sql_query(" delete from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$row[wr_id]' ");
|
||||
sql_query(" delete from {$g4[board_file_table]} where bo_table = '{$bo_table}' and wr_id = '{$row[wr_id]}' ");
|
||||
|
||||
$count_write++;
|
||||
}
|
||||
@ -103,38 +103,38 @@ for ($i=count($tmp_array)-1; $i>=0; $i--)
|
||||
{
|
||||
// 코멘트 포인트 삭제
|
||||
if (!delete_point($row[mb_id], $bo_table, $row[wr_id], '코멘트'))
|
||||
insert_point($row[mb_id], $board[bo_comment_point] * (-1), "$board[bo_subject] {$write[wr_id]}-{$row[wr_id]} 코멘트삭제");
|
||||
insert_point($row[mb_id], $board[bo_comment_point] * (-1), "{$board[bo_subject]} {$write[wr_id]}-{$row[wr_id]} 코멘트삭제");
|
||||
|
||||
$count_comment++;
|
||||
}
|
||||
}
|
||||
|
||||
// 게시글 삭제
|
||||
sql_query(" delete from $write_table where wr_parent = '$write[wr_id]' ");
|
||||
sql_query(" delete from {$write_table} where wr_parent = '{$write[wr_id]}' ");
|
||||
|
||||
// 최근게시물 삭제
|
||||
sql_query(" delete from $g4[board_new_table] where bo_table = '$bo_table' and wr_parent = '$write[wr_id]' ");
|
||||
sql_query(" delete from {$g4[board_new_table]} where bo_table = '{$bo_table}' and wr_parent = '{$write[wr_id]}' ");
|
||||
|
||||
// 스크랩 삭제
|
||||
sql_query(" delete from $g4[scrap_table] where bo_table = '$bo_table' and wr_id = '$write[wr_id]' ");
|
||||
sql_query(" delete from {$g4[scrap_table]} where bo_table = '{$bo_table}' and wr_id = '{$write[wr_id]}' ");
|
||||
|
||||
// 공지사항 삭제
|
||||
$notice_array = explode("\n", trim($board[bo_notice]));
|
||||
$notice_array = explode(',', trim($board[bo_notice]));
|
||||
$bo_notice = "";
|
||||
for ($k=0; $k<count($notice_array); $k++)
|
||||
if ((int)$write[wr_id] != (int)$notice_array[$k])
|
||||
$bo_notice .= $notice_array[$k] . "\n";
|
||||
$bo_notice .= $notice_array[$k].',';
|
||||
$bo_notice = trim($bo_notice);
|
||||
sql_query(" update $g4[board_table] set bo_notice = '$bo_notice' where bo_table = '$bo_table' ");
|
||||
sql_query(" update {$g4[board_table]} set bo_notice = '{$bo_notice}' where bo_table = '{$bo_table}' ");
|
||||
$board[bo_notice] = $bo_notice;
|
||||
}
|
||||
|
||||
// 글숫자 감소
|
||||
if ($count_write > 0 || $count_comment > 0)
|
||||
sql_query(" update $g4[board_table] set bo_count_write = bo_count_write - '$count_write', bo_count_comment = bo_count_comment - '$count_comment' where bo_table = '$bo_table' ");
|
||||
sql_query(" update {$g4[board_table]} set bo_count_write = bo_count_write - '{$count_write}', bo_count_comment = bo_count_comment - '{$count_comment}' where bo_table = '{$bo_table}' ");
|
||||
|
||||
// 4.11
|
||||
@include_once("$board_skin_path/delete_all.tail.skin.php");
|
||||
@include_once($board_skin_path.'/delete_all.tail.skin.php');
|
||||
|
||||
goto_url("./board.php?bo_table=$bo_table&page=$page" . $qstr);
|
||||
goto_url('./board.php?bo_table='.$bo_table.'&page='.$page.$qstr);
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user