그누커머스 자동댓글, 게시판별로 가능할까요? 채택완료
그누그누1
9년 전
조회 5,187
안녕하세요
그누커머스에서 자동댓글을 사용하기 위해
테마-funtions.php에 아래 코드를 넣어서 사용중입니다.
현재 게시판을 하나 더 만들어서 사용중인데
기존과 다른 스킨입니다.
혹시 자동댓글 내용을 게시판마다 다르게 나오게 할 수 있을까요?
</p><pre style="line-height: normal;">add_action('write_update_metadata', 'gc_auto_comment_write', 10, 2);
function gc_auto_comment_write($wr_id, $w){
global $wpdb, $gcboard;
$gc = $gcboard->gc;
$notice = isset($_POST['notice']) ? $_POST['notice'] : '';
if($w == '' && !$notice){ //글쓰기이고 notice 아니면
$write = gc_get_write( $gc['write_table'], $wr_id );
$cm_num = gc_get_next_num( $gc['comment_table'], $wr_id, 'comment' );
$cm_data = array(
'wr_id' => $wr_id,
'bo_table' => $write['bo_table'],
'cm_parent' => 0,
'cm_num' => $cm_num,
'user_id' => 1,
'user_pass' => '',
'user_display_name' => '자동댓글',
'user_email' => '',
'cm_subject' => '',
'cm_content' => '자동댓글 내용입니다.',
'cm_datetime' => GC_TIME_YMDHIS,
'cm_ip' => $_SERVER['REMOTE_ADDR'],
'cm_option' => ''
);
$formats = array(
'%d',
'%s',
'%d',
'%s',
'%s',
'%s',
'%s',
'%s',
'%s',
'%s',
'%s',
'%s',
'%s'
);
$result = $wpdb->insert( $gc['comment_table'], $cm_data, $formats );
}
}</pre><pre style="line-height: normal;">
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인