hook 기능을 이용한 글 이동시 안내 쪽지 발송 > 자료실

자료실

자료실

hook 기능을 이용한 글 이동시 안내 쪽지 발송

페이지 정보

profile_image
작성자 최고관리자
댓글 0 조회 326회 작성일 23-03-29 14:05
작성일 23-03-29 14:05

본문

extend/user.config.php 파일에 아래 내용 전체 추가

add_event('bbs_move_copy', 'move_memo_insert', 10, 3);


function move_memo_insert($row2, $move_bo_table, $insert_id, $next_wr_num, $sw)

{

    global $g5, $config, $board, $sw;


    $sql = "select * from {$g5['board_table']} where bo_table = '".sql_real_escape_string($move_bo_table)."' ";

    $move_board = sql_fetch($sql);


    // 코멘트가 아니라면

    if (!$row2['wr_is_comment'] && $sw == 'move')

    {

        $tmp_row = sql_fetch(" select max(me_id) as max_me_id from {$g5['memo_table']} ");

        $me_id = $tmp_row['max_me_id'] + 1;


        $memo_content = '['.$row2['wr_subject'].']\n이 게시물은 관리자님에 의해 '.G5_TIME_YMDHIS.' '.$board['bo_subject'].'에서 '.$move_board['bo_subject'].' 게시판으로 이동됨';


        $sql = " insert into {$g5['memo_table']} set me_id='$me_id', me_recv_mb_id = '{$row2['mb_id']}', me_send_mb_id = '{$config['cf_admin']}', me_send_datetime='".G5_TIME_YMDHIS."', me_memo='{$memo_content}'  ";

        sql_query($sql);


        $sql = " update {$g5['member_table']} set mb_memo_call = '{$config['cf_admin']}', mb_memo_cnt = '".get_memo_not_read($row2['mb_id'])."' where mb_id = '{$row2['mb_id']}' ";

        sql_query($sql);

    }

}



추천 0 비추천 0

  • 회사 :
  • 대표 :
  • 주소 :
  • 메일 : admin@mysample.com
  • 사업자 등록번호 :
Copyright © cginjs.com All rights reserved.
notice