[이윰] 출석체크 점수 경험치로 부여하기

페이지 정보

루루아빠 2,501 3 2 2019.08.11 19:01

평점

  • 평점 : 5점 (2명 참여)

본문

출석체크 점수 경험치로 부여하기
그누보드5/eyoom/user_program/page/attendance.php를 열어 // 기본 포인트를 검색하여 다음과 같이 수정한다.

수정 전

                // 기본 포인트
                $point = array();
                $point['default'] = attendance_point($attendance['point_default']);
                insert_point($member['mb_id'], $point['default'], "{$date_day} 출석체크", '@attendance', '@default', "{$date_day}");

                // 부지런상 포인트
                if($attendance['hard_use'] == 'y') {
                    if($atd_count%$attendance['hard_cond']==0) {
                        $point['hard'] = attendance_point($attendance['hard_point']);
                        insert_point($member['mb_id'], $point['hard'], "{$date_day} 출석체크 부지런상", '@attendance', '@hard', "{$date_day}");
                    }
                }

                // 선착순상 포인트
                if($attendance['group_use'] == 'y' && $ranking == $attendance['group_cond'] && $attendance['group_cond'] > 1) {
                    $point['group'] = attendance_point($attendance['group_point']);

                    // 출석부에 포인트 등록
                    sql_query("update {$g5['eyoom_attendance']} set group_point='{$point['group']}' where ranking<'{$ranking}' and group_point=0 and atd_datetime like '".$date_day."%' ",false);
                    $res = sql_query("select atd_mb_id from {$g5['eyoom_attendance']} where ranking<'{$ranking}' and atd_datetime like '".$date_day."%'",false);
                    for($i=0;$row=sql_fetch_array($res);$i++) {
                        insert_point($row['atd_mb_id'], $point['group'], "{$date_day} 출석체크 선착순상", '@attendance', '@group', "{$date_day}");
                    }
                    insert_point($member['mb_id'], $point['group'], "{$date_day} 출석체크 선착순상", '@attendance', '@group', "{$date_day}");
                }

                // 어머나상 포인트
                if($attendance['lucky_use'] == 'y') {
                    $random = $eb->random_num(9);
                    if($random%10 == 0) {
                        $point['lucky'] = attendance_point($attendance['lucky_point']);
                        insert_point($member['mb_id'], $point['lucky'], "{$date_day} 출석체크 어머나상", '@attendance', '@lucky', "{$date_day}");
                    }
                }

                // 어느날상 포인트
                if($attendance['someday_use'] == 'y' && $attendance['someday_date'] == $today) {
                    $point['someday'] = attendance_point($attendance['someday_point']);
                    insert_point($member['mb_id'], $point['someday'], "{$date_day} 출석체크 어느날상", '@attendance', '@someday', "{$date_day}");
                }

                // 랭킹상 포인트
                if($attendance['ranking_use'] && $ranking <= $attendance['ranking_use'] && $ranking<=10) {
                    $rkey = 'ranking'.$ranking.'_point';
                    $point['ranking'] = $attendance[$rkey];
                    insert_point($member['mb_id'], $point['ranking'], "{$date_day} 출석체크 {$ranking}위 랭킹상", '@attendance', '@ranking', "{$date_day}");
                }
수정 후

                // 기본 포인트
                $point = array();
                $point['default'] = attendance_point($attendance['point_default']);
                //insert_point($member['mb_id'], $point['default'], "{$date_day} 출석체크", '@attendance', '@default', "{$date_day}");
                $eb->level_point($point['default']);    //추가, 경험치 적립

                // 부지런상 포인트
                if($attendance['hard_use'] == 'y') {
                    if($atd_count%$attendance['hard_cond']==0) {
                        $point['hard'] = attendance_point($attendance['hard_point']);
                        //insert_point($member['mb_id'], $point['hard'], "{$date_day} 출석체크 부지런상", '@attendance', '@hard', "{$date_day}");
                        $eb->level_point($point['default']+$point['hard']);    //추가, 경험치 적립
                    }
                }

                // 선착순상 포인트
                if($attendance['group_use'] == 'y' && $ranking == $attendance['group_cond'] && $attendance['group_cond'] > 1) {
                    $point['group'] = attendance_point($attendance['group_point']);

                    // 출석부에 포인트 등록
                    sql_query("update {$g5['eyoom_attendance']} set group_point='{$point['group']}' where ranking<'{$ranking}' and group_point=0 and atd_datetime like '".$date_day."%' ",false);
                    $res = sql_query("select atd_mb_id from {$g5['eyoom_attendance']} where ranking<'{$ranking}' and atd_datetime like '".$date_day."%'",false);
                    for($i=0;$row=sql_fetch_array($res);$i++) {
                        //insert_point($row['atd_mb_id'], $point['group'], "{$date_day} 출석체크 선착순상", '@attendance', '@group', "{$date_day}");
                        $eb->level_point($point['default']+$point['hard'],$row['atd_mb_id'],$point['group']);    //추가, 경험치 적립
                    }
                    //insert_point($member['mb_id'], $point['group'], "{$date_day} 출석체크 선착순상", '@attendance', '@group', "{$date_day}");
                    $eb->level_point($point['default']+$point['group']+$point['hard']);    //추가, 경험치 적립
                }

                // 어머나상 포인트
                if($attendance['lucky_use'] == 'y') {
                    $random = $eb->random_num(9);
                    if($random%10 == 0) {
                        $point['lucky'] = attendance_point($attendance['lucky_point']);
                        //insert_point($member['mb_id'], $point['lucky'], "{$date_day} 출석체크 어머나상", '@attendance', '@lucky', "{$date_day}");
                        $eb->level_point($point['default']+$point['lucky']+$point['hard']+$point['group']);    //추가, 경험치 적립
                    }
                }

                // 랭킹상 포인트
                if($attendance['ranking_use'] && $ranking <= $attendance['ranking_use'] && $ranking<=10) {
                    $rkey = 'ranking'.$ranking.'_point';
                    $point['ranking'] = $attendance[$rkey];
                    //insert_point($member['mb_id'], $point['ranking'], "{$date_day} 출석체크 {$ranking}위 랭킹상", '@attendance', '@ranking', "{$date_day}");
                    $eb->level_point($point['default']+$point['ranking']+$point['hard']+$point['group']+$point['lucky']);    //추가, 경험치 적립
                }

                // 어느날상 포인트
                if($attendance['someday_use'] == 'y' && $attendance['someday_date'] == $today) {
                    $point['someday'] = attendance_point($attendance['someday_point']);
                    //insert_point($member['mb_id'], $point['someday'], "{$date_day} 출석체크 어느날상", '@attendance', '@someday', "{$date_day}");
                    $eb->level_point($point['default']+$point['someday']+$point['hard']+$point['group']+$point['lucky']+$point['ranking']);    //추가, 경험치 적립
                }
수정 전 소스에서 어느날 상의 소스 위치가 변경되었는데 이건 빈도에 따른 수정이니 참고해서 수정하거나 그대로 덮어 써도 상관없다.
그누보드 포인트도 부여하고 싶다면 insert_point 주석을 해제하면 된다.
수정된 소스를 살펴보면 아래로 갈수록 경험치 점수 부여용 변수가 하나씩 더 추가되 더해짐을 알 수 있다.
추천인 2
  • 내사랑
  • 하늘구장
6
루루아빠 - 회원등급 : 최고관리자 - 포인트 : 1,294,164
레벨 97
경험치 1,397,066

Progress Bar 1%

- 가입일 : 2015-03-04 03:24:54
- 서명 : KNOW YOUR LIMITS BUT NEVER STOP TRYING TO EXCEED THEM !!
- 자기소개 : 루루의 자랑 루루아빠랍니다~~

댓글3

내사랑님의 댓글

내사랑 2019.08.12 22:32
잘 되네요 다시 한번 감사의 인사 그리고 추천

내사랑님의 댓글

내사랑 2019.08.12 00:10
약속도 잘 지켜 주시는 영자님 땡큐에요

하늘구장님의 댓글

하늘구장 2019.08.11 22:08
앗 감사합니다 잘 사용하겠습니다

축하합니다. 첫 댓글로 9경험치를 획득하였습니다.

Total 7481038 페이지
제목 글쓴이 날짜 조회 추천
제로  🏆 💾 특정 회원에게 쪽지 스킨을 적용해봅시다 루루아빠 2005.07.19 2,609 0
이윰  🏆 Q&A 게시판 최신글추출시 '비밀글입니다.' 를 원글 제목으로 변경하기 루루아빠 2015.10.20 2,640 0
이윰  🏆 공지글에는 댓글 기능 끄기 shadow2fox 2018.08.19 2,016 0
제로  🏆 💾 업로드된 이미지가 있을때에 게시판 목록에 그림 아이콘 표현하기 루루아빠 2005.07.19 2,835 0
이윰  🏆 Eyoom Builder 1.1.13 패치 루루아빠 2015.10.26 2,692 0
이윰  🏆 Eyoom Builder 3.0.3 - 패치에 문제가 있는 버전입니다. shadow2fox 2018.08.20 2,197 0
그누•영카트  🏆 영카트 5.4.4.9.1 shadow2fox 2021.02.06 1,361 0
제로  🏆 최근 갤러리 & 갤러리 목록 이미지 흑백 설정 루루아빠 2005.07.20 2,854 0
그누•영카트  🏆 구글 웹폰트를 적용해보자 루루아빠 2015.10.27 2,475 0
이윰  🏆 Eyoom Builder 3.0.4 패치 shadow2fox 2018.08.20 2,709 0
그누•영카트  🏆 영카트 5.4.5.1 shadow2fox 2021.02.06 1,294 0
제로  🏆 글쓴 후 하단 리스트에 특정 카테고리 글만 보여주지 않고 전체 목록을 보여주기 루루아빠 2005.07.23 3,141 0
이윰  🏆 Eyoom Builder 1.1.14 패치 루루아빠 2015.10.30 3,226 0
JavaScript  🏆 사용자의 브라우저를 검출하는 방법 shadow2fox 2018.08.22 1,836 0
제로  댓글+1🏆 전체에게 메일링 체크하고 싶을때에 루루아빠 2005.07.24 3,152 0
JavaScript  🏆 마우스 오른쪽 버튼 사용시 경고 메세지 띄우기 루루아빠 2015.10.31 2,578 0
이윰  🏆 jQuery-1.8.3를 jQuery-1.9.x 이상으로 업그레이드시 masonry 오류 해결하기 shadow2fox 2018.08.22 2,010 0
HTML5  🏆 HTML5 동영상 혹은 오디오 마우스 우측 버튼 다운로드 금지시키기 루루아빠 2015.10.31 3,015 0
그누•영카트  🏆 그누보드 5.3.1.6 패치 shadow2fox 2018.08.25 2,117 0
제로  🏆 공지사항글에는 코멘트 못달게 하기 루루아빠 2005.08.06 3,219 0