사이트 내 전체검색
그누보드
검색목록
[팁] 게시판 일정기간 이상 자동 글 삭제 extend
로빈아빠
https://cmd.kr/gnu/494 URL이 복사되었습니다.

본문

/extend/ar.extend.board.php 

 

<?

 

if (strstr($PHP_SELF,"board.php") && $bo_table) {

if ($board[bo_10_subj]=='기간삭제' && $board[bo_10]) {

$sql="select * from $write_table where wr_datetime<'".date("Y-m-d H:i:s",time()-$board[bo_10]*24*3600)."'";

$rst=sql_query($sql);

$found=false;

        $tmp_array = explode(",", $board['bo_notice']);

while($row=sql_fetch_array($rst)) {

if (in_array($row[wr_id],$tmp_array)) continue;

$found=true;

$sql2 = " delete from $write_table where wr_parent = '$row[wr_id]'";

sql_query($sql2);

//echo "$row[wr_datetime] $sql2<BR>";

}

if ($found) {

// 게시판의 글 수

$sql = " select count(*) as cnt from $write_table where wr_is_comment = 0 ";

$row = sql_fetch($sql);

$bo_count_write = $row['cnt'];

 

// 게시판의 코멘트 수

$sql = " select count(*) as cnt from $write_table where wr_is_comment = 1 ";

$row = sql_fetch($sql);

$bo_count_comment = $row['cnt'];

 

$sql3 = " update {$g5['board_table']} set bo_count_write = '{$bo_count_write}',bo_count_comment = '{$bo_count_comment}' where bo_table = '{$bo_table}' ";

sql_query($sql3);

//echo "$sql3<BR>";

 

}

 

 

}

 

}

?> 

댓글목록

등록된 댓글이 없습니다.

그누보드
65 (1/2P)

Search

Copyright © Cmd 명령어 18.217.135.23