하루 게임 횟수 제한 만들기
본문
https://sir.kr/g5_plugin/3435?sfl=wr_subject%7C%7Cwr_content&stx=%EA%B2%8C%EC%9E%84&page=2
섯셋님께서 올려주신 랜덤상자 게임인데요.
하루 횟수제한을 만들고싶어요~
답변 2
버그가 있을 수 있지만... 대략 이렇게 하시면 되요
/randombox/config.php 12번째줄 정도 하단에 추가...
$tmp_data = '';
$today_cnt = 0;
$tmp_data = date("Y-m-d 00:00:00");
$query = "SELECT count(*) as today_cnt FROM {$g5['point_table']} WHERE 1 and mb_id = '{$member['mb_id']}' and po_content like '랜덤 상자%' and po_datetime > '{$tmp_data}' ";
$today_cnt = sql_fetch($query);
$today_cnt = (int)$today_cnt['today_cnt'];
if($today_cnt > 5){
alert("하루에 5회만 게임 가능합니다.", "/"); // 횟수제한
}
unset($tmp_data);
안녕하세요.
index.php 또는 result.php 파일 안에 회원들이 오늘 게임한 내역을 DB에 기록하고 다음 게임시 DB에서 비교하여
제한을 주는 코드를 만들어야 할거 같습니다~
답변을 작성하시기 전에 로그인 해주세요.