자동등업 소스을 만들었는데 등없이 안되는 것 같아 조언을 구합니다. 채택완료
크레이티브
11년 전
조회 7,751
제가 그누보드를 처음 사용하는지라 그누보드는 레벨이 자동으로 오르고 내리지 않는 것 같습니다.
그래서 질문과 답변을 참고하여 소스를 만들었구요
답변내용대로 lib/common.lib.php 소스에 대략 871줄에 아래소스를 첨가하였습니다
</p>
<p>//자동등업 추가
if ($mb_level < 10 && $mb_level > 1) { // 레벨 9~2까지만 적용</p>
<p>
if( $sum_point >= 1000){ $mb_level = 2; } //포인트가 1000 이상이면 2레벨
if( $sum_point >= 2000){ $mb_level = 3; }
if( $sum_point >= 3000){ $mb_level = 4; }
if( $sum_point >= 4000){ $mb_level = 5; }
if( $sum_point >= 5000){ $mb_level = 6; }
if( $sum_point >= 6000){ $mb_level = 7; }
if( $sum_point >= 7000){ $mb_level = 8; }
if( $sum_point >= 8000){ $mb_level = 9; } </p>
<p> $sql = " update $g4[member_table] set mb_level = '$mb_level' where mb_id = '$mb_id' ";
sql_query($sql); </p>
<p> }
//자동등업 끝 </p>
<p>
그리고 테스트아이디로 포인트를 올리고 내려도 레벨이 자동으로 오르고 내리지 않습니다.
어떻게 해야 자동등업이 가능한지요.?
제 방법이 틀렸는지 알려주시면 감사하겠습니다
댓글을 작성하려면 로그인이 필요합니다.
답변 4개
채택된 답변
+20 포인트
댓글을 작성하려면 로그인이 필요합니다.
11년 전
소스를 다시 짜 보았는데 제대로 되었나 보아주세요
그리고 이것을 어디에 넣어야 실시간으로 자동레벨등업이 될까요
</p>
<p>//자동등업 추가
if ($is_admin == 'super' and $mb_level > 1) { // 레벨 9~2까지만 적용</p>
<p> if ($sum_point < 1000) { $to_level = 2;
} elseif ($sum_point >= 1000 and $sum_point < 2000) { $mb_level = 3;
} elseif ($sum_point >= 2000 and $sum_point < 3000) { $mb_level = 4;
} elseif ($sum_point >= 3000 and $sum_point < 4000) { $mb_level = 5;
} elseif ($sum_point >= 4000 and $sum_point < 5000) { $mb_level = 6;
} elseif ($sum_point >= 5000 and $sum_point < 6000) { $mb_level = 7;
} elseif ($sum_point >= 6000 and $sum_point < 7000) { $mb_level = 8;
} elseif ($sum_point >= 70000) {$mb_level = 9;
}</p>
<p> if ($mb_level > $mb_level) { // 현재 레벨보다 적용될 레벨 높을때.(작을때)
$sql = " update $g4[member_table] set mb_level='$mb_level' where mb_id = '$mb_id' ";
} elseif ($mb_level < $mb_level) { // 현재 레벨보다 적용될 레벨 낮을때.(클때)
$sql = " update $g4[member_table] set mb_level='$mb_level' where mb_id = '$mb_id' ";
}</p>
<p> }
//자동등업 끝
</p>
<p> </p>
<p>
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
도치즈
11년 전
$sum_point = $member["mb_point"] 해주신것 맞으시죠??
댓글을 작성하려면 로그인이 필요합니다.
11년 전
범위 지정을
if(</code><code class="variable" style="background-color: rgb(248, 248, 248); line-height: 23.54400062561035px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; color: rgb(170, 119, 0) !important">$sum_point</code><span style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 23.54400062561035px; background-color: rgb(248, 248, 248)"> </span><code class="plain" style="background-color: rgb(248, 248, 248); line-height: 23.54400062561035px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important">>= 1000 and</code><code class="plain" style="font-size: 10pt; background-color: rgb(248, 248, 248); line-height: 23.54400062561035px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important"> </code><code class="variable" style="font-size: 10pt; background-color: rgb(248, 248, 248); line-height: 23.54400062561035px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; color: rgb(170, 119, 0) !important">$sum_point</code><span style="font-size: 10pt; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 23.54400062561035px; background-color: rgb(248, 248, 248)"> <</span><code class="plain" style="font-size: 10pt; background-color: rgb(248, 248, 248); line-height: 23.54400062561035px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important"> 2000)</code><code class="plain" style="font-size: 10pt; background-color: rgb(248, 248, 248); line-height: 23.54400062561035px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important">{ </code><code class="variable" style="font-size: 10pt; background-color: rgb(248, 248, 248); line-height: 23.54400062561035px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; color: rgb(170, 119, 0) !important">$mb_level</code><span style="font-size: 10pt; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 23.54400062561035px; background-color: rgb(248, 248, 248)"> </span><code class="plain" style="font-size: 10pt; background-color: rgb(248, 248, 248); line-height: 23.54400062561035px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important">= 2; }</code><span style="background-color: rgb(248, 248, 248); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 10pt; line-height: 23.54400062561035px">
이런식으로 해야 하지 않을까요?
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인