글 폭파 관하여^^ 부탁드립니다. > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

글 폭파 관하여^^ 부탁드립니다. 정보

글 폭파 관하여^^ 부탁드립니다.

본문

안녕하세요~ 좋은 하루 입니다.^^

다름이 아니라 아래와 같은 소스로 글을 정렬했습니다.

$blabla = $list[$i-1][subject] ;
if( $blabla == $list[$i][subject] ){
 echo "겹친문자";
}
else {
 echo "<b><font color='#7EA700'>{$list[$i][subject]}</font></b></font>";
}
 

위 소스의 3번째 줄인  "echo "겹친문자"; "를 해당 게시물 삭제 코드로 바꾸고 싶은데..
글 폭파 소스 등과 del.php를 이용하여 해보려 하였으나, 실력이 일천하여 도움을 구합니다.

 echo "겹친문자";  를 해당 글 삭제로 바꿀 수 없을까요?

본 파일은 list.skin.php 입니다.

답변해 주신 모든 분들께 감사드립니다.

댓글 전체

글만 그냥 삭제 하게 되면 그 글에 포함된 첨부파일이라던가 덧글들 같은건 삭제가 안되고
글 카운터도 맞지 안게되기 때문에 문제가 있습니다

어떤 조건일때 글 폭파하려고 하는지 알려주시면 대충 코딩해드리겠습니다

글폭파 소스 올린게 저니까요;;;; 삐질;
아래와 같은 방법으로 해결하였습니다^^;;

답변해 주신 분께 진심으로 감사드려요~



$blabla = $list[$i-1][subject] ;
if( $blabla == $list[$i][subject] ){

$bombc = $list[$i-1][wr_id];
// 게시글 삭제
$sql = " select wr_id, mb_id, wr_is_comment from $write_table where wr_parent = '$bombc' order by wr_id ";
  $result = sql_query($sql);
  while ($row = sql_fetch_array($result))
  {
  // 원글이라면
  if (!$row[wr_is_comment])
  {
    // 원글 포인트 삭제
    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] 글삭제");
    // 업로드된 파일이 있다면 파일삭제
    $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/thumb/$write[wr_id]"); //썸네일 삭제
    @unlink("$g4[path]/data/file/$bo_table/latest_thumb/$write[wr_id]"); //최근게시물 썸네일 삭제
    }

    //추천기록 삭제
    sql_query(" delete from g4_board_good where wr_id = '$row[wr_id]' AND bo_table = '$bo_table' "); //수정
   
    // 파일테이블 행 삭제
    sql_query(" delete from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$row[wr_id]' ");
    $count_write++;
  }
  else
  {
    // 코멘트 포인트 삭제
    if (!delete_point($row[mb_id], $bo_table, $row[wr_id], '코멘트'))
    insert_point($row[mb_id], $board[bo_comment_point] * (-1), "$board[bo_subject] {$view[wr_id]}-{$row[wr_id]} 코멘트삭제");
    $count_comment++;
  }
  }
  // 게시글 삭제
  sql_query(" delete from $write_table where wr_parent = '$bombc' ");
  // 최근게시물 삭제
  sql_query(" delete from $g4[board_new_table] where bo_table = '$bo_table' and wr_parent = '$bombc' ");
  // 스크랩 삭제
  sql_query(" delete from $g4[scrap_table] where bo_table = '$bo_table' and wr_id = '$bombc' ");

  // 공지사항 삭제
  $notice_array = explode("\n", trim($board[bo_notice]));
  $bo_notice = "";
  for ($k=0; $k<count($notice_array); $k++)
  if ((int)$bombc != (int)$notice_array[$k])
    $bo_notice .= $notice_array[$k] . "\n";
  $bo_notice = trim($bo_notice);
  sql_query(" update $g4[board_table] set bo_notice = '$bo_notice' where bo_table = '$bo_table' ");

  // 글숫자 감소
  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' ");
  $bend = 1;
 
 if(count($list) == $i+1 && $bend == 1){
  goto_url("./board.php?bo_table=$bo_table&page=$page");}

//자폭 끝


} else {
 echo "<b><font color='#7EA700'>{$list[$i][subject]}</font></b></font>";
}
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT