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

페이지 정보

루루아빠 2,466 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,290,689
레벨 96
경험치 1,388,800

Progress Bar 73%

- 가입일 : 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 242213 페이지
제목 글쓴이 날짜 조회 추천
이윰  댓글+2🏆 추천 베스트 최신글에서 블라인드 게시글은 제외하기 shadow2fox 2020.11.13 1,435 2
이윰  댓글+1🏆 이윰빌더 현재 접속자 최신글에서 관리자도 ip가 숨겨지는 문제 해결하기 shadow2fox 2020.04.10 2,117 1
이윰  댓글+1🏆 카카오TV 올바르게 적용하기 shadow2fox 2020.01.29 1,858 1
이윰  댓글+5🏆 출석부 랭킹 중복 방지하기 shadow2fox 2019.12.16 2,955 4
이윰  댓글+3🏆 페이스북(facebook) 동영상 올바르게 적용하기 shadow2fox 2019.10.14 2,267 2
이윰  댓글+5🏆 네이버TV 올바르게 적용하기 shadow2fox 2019.10.12 2,263 2
이윰  댓글+3🏆 🚩 출석체크 점수 경험치로 부여하기 루루아빠 2019.08.11 2,467 2
이윰  댓글+4🏆 태그 앞과 뒤 공백 제거하기 shadow2fox 2019.06.25 2,153 2
이윰  댓글+1🏆 마이홈과 마이페이지에서 사이드바 사용하지 않기 shadow2fox 2019.05.26 1,984 1
이윰  댓글+2🏆 본문 내 첨부된 이미지와 에디터로 업로드한 이미지 갯수 구하기 shadow2fox 2019.05.12 1,868 1
이윰  🏆 내글반응 페이지 내 전체 선택 체크박스 올바르게 적용하기 shadow2fox 2019.05.06 1,981 0
이윰  🏆 게시글 보기시 본문에 포함된 주석 감추기 shadow2fox 2019.05.01 1,855 0
이윰  댓글+1🏆 현재 게시글 스크랩 갯수 본문에 보여주기 shadow2fox 2019.04.28 2,234 2
이윰  🏆 Eyoom Builder 3.0.9 패치 shadow2fox 2019.03.25 2,413 0
이윰  댓글+2🏆 출석부 선착순 포인트 올바르게 적용하기 shadow2fox 2019.03.16 2,227 2
이윰  댓글+1🏆 게시글 추천시 글 작성자에게 포인트 부여하기 shadow2fox 2019.03.15 1,885 1
이윰  댓글+1🏆 Eyoom Builder 3.0.8 패치 shadow2fox 2019.03.12 2,248 1
이윰  댓글+1🏆 카카오TV 플레이어 최신 버전 재생 오류 해결하기 shadow2fox 2019.03.11 2,538 1
이윰  댓글+1🏆 팝업창 페이지에서도 띄우기 shadow2fox 2019.02.05 2,003 1
이윰  댓글+1🏆 관리자는 쪽지 보낼 때 캡챠코드 적용하지 않기 shadow2fox 2019.01.10 2,253 1