g5_board_new 등록 삭제
본문
g5_board_new 테이블의 mb_id 그리고 as_video 아이디와 비디오태그가 저장되는데
혹시 a 게시판 글작성시 위 테이블에서 mb_id와 as_video 란에 공백으로 등록하려면 어떻게 해야할까요?
매번 직접 해당 테이블 비워주고있는데 애초에 글쓸대 자동으로 빈테이블로 작성되면 좋을꺼같은데....
어떻게해야할지 모르겟네요
답변 2
bbs/write_update.php에
// 새글 INSERT
sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '{$bo_table}', '{$wr_id}', '{$wr_id}', '".G5_TIME_YMDHIS."', '{$member['mb_id']}' ) ");
여기를
if( $bo_table=='a게시판')
sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '{$bo_table}', '{$wr_id}', '{$wr_id}', '".G5_TIME_YMDHIS."', '' ) ");
else
sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '{$bo_table}', '{$wr_id}', '{$wr_id}', '".G5_TIME_YMDHIS."', '{$member['mb_id']}' ) ");
extend/user.config.php
function hook_write_update_after($board, $wr_id, $w, $qstr, $redirect_url) {
global $g5;
if ($board['bo_table'] == 'a 게시판') {
return;
}
sql_query(" update {$g5['board_new_table']} set mb_id = '', as_video = '' where bo_table = '{$board['bo_table']}' and wr_id = '{$wr_id}' and wr_parent = '{$wr_id}' ");
}
add_event('write_update_after', 'hook_write_update_after', G5_HOOK_DEFAULT_PRIORITY, 5);