[제나플러스] 오래된 글에 코멘트 쓰기를 하는 것에 포인트 부여하지 않기 > 팁앤테크

본문 바로가기

사이트 내 전체검색

뒤로가기 팁앤테크

[제나플러스] 오래된 글에 코멘트 쓰기를 하는 것에 포인트 부여하지 않기

본문

phpMyAdmin이나 dbEditor에서 아래 sql을 수행합니다.

ALTER TABLE `g4_config` ADD `cf_no_comment_point_days` INT( 11 ) NOT NULL ;


/adm/config_form.php에 아래 코드를 추가 합니다. 코멘트 쓰기 포인트 설정하는 밑부분쯤이 좋습니다.

<tr class='ht'>
    <td>코멘트 쓰기포인트 없슴</td>
    <td><input type=text class=ed name='cf_no_comment_point_days' size='10' required itemname='코멘트 쓰기에 포인트 부여하지 않는 기간' value='<?=$config[cf_no_comment_point_days]?>'> 일 <?=help("포인트를 올리기 위해서 오래된 글에 코멘트 다는 사람들이 있는 경우를 위해서 오래된 글에 코멘트 다는 것에 포인트 부여하지 않는 기간을 정하는 것 입니다.\n\n 0으로 두시면 오래된 글에 코멘트를 달아도 포인트가 부여됩니다.\n\n 숫자가 지정되면 작성된지 n일이 글에는 코멘트를 써도 포인트가 부여되지 않습니다.")?></td>
    <td></td>
    <td></td>
</tr>

/adm/config_form_update.php에 아래 코드를 추가 합니다.

                cf_no_comment_point_days= '$cf_no_comment_point_days',

/bbs/write_comment_update.php의 포인트 부분을 수정 합니다.

(원본)
    // 포인트 부여
    insert_point($member[mb_id], $board[bo_comment_point], "$board[bo_subject] {$wr_id}-{$comment_id} 코멘트쓰기", $bo_table, $comment_id, '코멘트');

(수정본)
    // 오래된 글에 코멘트 쓰기를 하는 경우 포인트를 부여하지 않음
    $time_diff = ($g4[server_time] - (86400 * $config['cf_no_comment_point_days'])) - strtotime($wr[wr_datetime]);
    if ($config['cf_no_comment_point_days'] && $time_diff >= 0) {
        // 포인트 안주고 깍을 경우에는 별도 수정을 해주세요.
        ;
    } else {
        // 포인트 부여
        insert_point($member[mb_id], $board[bo_comment_point], "$board[bo_subject] {$wr_id}-{$comment_id} 코멘트쓰기", $bo_table, $comment_id, '코멘트');
    }
추천0

댓글목록 0

등록된 댓글이 없습니다.

전체 770건 27 페이지
게시물 검색
Copyright (c) 株式会社YHPLUS. All rights reserved.

사이트 정보

株式会社YHPLUS / 대표 : ZERO
〒171-0014 東京都豊島区池袋2-41-5 アーバン154 8F
050-5539-7787
오픈카카오톡 (YHPLUS) :
https://open.kakao.com/o/slfDj15d

PC 버전으로 보기