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

페이지 정보

yadolee 루루아빠 2,918 3 2 2019.08.11 19:01:02

평점

  • 평점 : 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
  • 012i1052u
    내사랑
  • skyfield4u
    하늘구장
yadolee
6
루루아빠 - 회원등급 : 최고관리자 - 포인트 : 1,333,933
레벨 100
경험치 1,490,895

Progress Bar 19.66%

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

댓글3

내사랑님의 댓글

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

내사랑님의 댓글

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

하늘구장님의 댓글

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

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

Total 762726 페이지

제목 글쓴이 날짜 조회 추천
그누•영카트  🏆 그누보드 5.0.37 패치 루루아빠 2015.06.23 3,667 0
이윰  🏆 이윰빌더와 그누보드 패치시 수정할 파일들 루루아빠 2015.06.23 6,606 0
이윰  댓글+1🏆 masonry 사용하는 스킨 가로 갯수(box 수) 늘리기 루루아빠 2015.06.24 4,075 0
이윰  🏆 샵커뮤니티 테마 스위쳐 패치 루루아빠 2015.06.25 3,259 0
이윰  🏆 스크린 사이즈에 따른 미디어 쿼리(container 크기 변화) 루루아빠 2015.06.25 3,591 0
jQuery  댓글+2🏆 jQuery를 이용한 링크 자동 클릭(auto click) 루루아빠 2015.06.26 8,744 0
이윰  🏆 사운드클라우드와 게시글 정보와의 간격 조정 루루아빠 2015.06.28 3,914 0
이윰  댓글+1🏆 최신글 랜덤으로 뽑기 루루아빠 2015.06.29 3,659 0
그누•영카트  🏆 그누보드 5.0.38 패치 루루아빠 2015.06.30 3,806 0
그누•영카트  🏆 영카트 5.0.39 패치 루루아빠 2015.06.30 4,018 0
이윰  🏆 Eyoom Builder 1.1.7 패치 루루아빠 2015.07.06 3,206 0
그누•영카트  🏆 그누보드 5.0.39 패치 루루아빠 2015.07.07 3,156 0
그누•영카트  🏆 영카트 5.0.40 패치 루루아빠 2015.07.07 3,420 0
이윰  🏆 로그인을 메인으로 - 회원제 사이트 - 폐쇄형 사이트용 루루아빠 2015.07.08 3,537 0
서버  댓글+1🏆 PHP 파일 업로드 갯수 수정하기 루루아빠 2015.07.09 3,898 0
이윰  댓글+1🏆 스타일박스 패치, ios 관련 패치 루루아빠 2015.07.09 3,522 0
그누•영카트  🏆 그누보드 5.0.40 패치 루루아빠 2015.07.13 3,227 0
그누•영카트  🏆 영카트 5.0.41 패치 루루아빠 2015.07.13 6,546 0
그누•영카트  🏆 최고관리자의 레벨이 올바르지 않을때 루루아빠 2015.07.15 3,435 0
이윰  🏆 modal 오픈시 modal-dialog 아래 background body 스크롤 안되게 하기 루루아빠 2015.07.16 6,882 0
HTML5  댓글+1🏆 HTML5 Video 볼륨 조정하기 루루아빠 2015.07.19 4,125 0
HTML5  🏆 HTML5 Video 반응형으로 만들기 루루아빠 2015.07.19 3,076 0
그누•영카트  🏆 그누보드 5.0.41 패치 루루아빠 2015.07.20 3,507 0
그누•영카트  🏆 영카트 5.0.42 패치 루루아빠 2015.07.20 3,467 0
그누•영카트  🏆 접속자 관리에서 브라우저와 OS 종류를 추가해보자 루루아빠 2015.07.20 3,520 0
이윰  댓글+1🏆 이모티콘 크기 바꾸기 루루아빠 2015.07.23 3,189 0
이윰  🏆 이모티콘을 이윰빌더에 적용하기 위한 규칙 루루아빠 2015.07.23 3,111 0
이윰  🏆 Eyoom Builder 1.1.8 패치 루루아빠 2015.07.24 3,172 0
이윰  댓글+1🏆 dropdown menu 펼쳐지는 위치 조정하기 루루아빠 2015.07.24 4,425 0
그누•영카트  🏆 그누보드 5.0.42 패치 루루아빠 2015.07.27 3,049 0