g5_board_new 등록 삭제 채택완료

g5_board_new 테이블의 mb_id 그리고 as_video 아이디와 비디오태그가 저장되는데

 

혹시 a 게시판 글작성시 위 테이블에서 mb_id와 as_video 란에 공백으로 등록하려면 어떻게 해야할까요?

 

매번 직접 해당 테이블 비워주고있는데 애초에 글쓸대 자동으로 빈테이블로 작성되면 좋을꺼같은데....

어떻게해야할지 모르겟네요

답변 2개

채택된 답변
+20 포인트

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']}' ) ");

 

 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

원본을 수정해야하는 단점이있긴하나 구버전이나 최신버전에서 잘되네요.
감사합니다

댓글을 작성하려면 로그인이 필요합니다.

extend/user.config.php

Copy
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);
로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

구버전에서는 작동이 안되서 아쉽긴하지만 최신버전은 잘되네요
감사합니다.

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고