포인트 레벨 관련... 채택완료
아래 코드를 변형해서 포인트별 레벨을 출력하도록 사용하려고 하는데요.
아래 코드를 적용시키면 포인트가 올라가면 자동으로 권한(레벨) 이 올라가는거잖아요..
저는 포인트가 올라가면 권한레벨이 올라가는거 말고 레벨이 오르는데
그 레벨은 권한이랑 관련이 없는 그냥 일정포인트마다 레벨이 올라가는
그냥 아무 의미 없는 숫자에 불과한 그런 레벨을 만들어서
닉네임 옆에 출력되게 하고 싶어서 그러는데 어떤부분을 없애면
홈페이지권한레벨이랑 별개의 레벨이 될수 있을까요??
mb_level 을 point_level 이나 뭐... 이런식으로 해야 하나요?
</span></p><p><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> $mb_level = sql_fetch(" select mb_level from {$g5['member_table']} where mb_id = '$mb_id' "); </span></p><p><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> if($mb_level['mb_level'] < 10){ </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> if($po_mb_point <= 2000){ //2000 포인트 이하면 권한 2 </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> $level_up = 2; </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> }elseif($po_mb_point <= 3000){ </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> $level_up = 3; </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> }elseif($po_mb_point <= 4000){ </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> $level_up = 4; </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> }elseif($po_mb_point <= 5000){ </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> $level_up = 5; </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> }elseif($po_mb_point <= 6000){ </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> $level_up = 6; </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> }elseif($po_mb_point <= 7000){ </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> $level_up = 7; </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> }elseif($po_mb_point <= 8000){ </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> $level_up = 8; </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> }elseif($po_mb_point <= 9000){ </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> $level_up = 9; </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> } </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> sql_query(" update {$g5['member_table']} set mb_level = '$level_up' where mb_id = '$mb_id' "); </span><br style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;"> } </span> </p><p><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; line-height: 25.2072px;">
답변 1개
여분필드를 사용하시면 되지 않을까 싶네요.
</p><p><?php
$mb_level = sql_fetch(" select mb_level from {$g5['member_table']} where mb_id = '$mb_id' ");
if($mb_level['mb_level'] < 10){
if($po_mb_point <= 2000){ //2000 포인트 이하면 권한 2
$member['mb_1'] = 2;
}elseif($po_mb_point <= 3000){
$member['mb_1'] = 3;
}elseif($po_mb_point <= 4000){
$member['mb_1'] = 4;
}elseif($po_mb_point <= 5000){
$member['mb_1'] = 5;
}elseif($po_mb_point <= 6000){
$member['mb_1'] = 6;
}elseif($po_mb_point <= 7000){
$member['mb_1'] = 7;
}elseif($po_mb_point <= 8000){
$member['mb_1'] = 8;
}elseif($po_mb_point <= 9000){
$member['mb_1'] = 9;
}
sql_query(" update {$g5['member_table']} set mb_level = ' $member['mb_1']' where mb_id = '$mb_id' ");
}
?></p><p>
와 같이 지정하시고 mb_1의 여분 필드 초기값은 1을 지정해 주시고요.
답변에 대한 댓글 3개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
그리고 레벨을 99까지 하려고 하는데... 저 코드를 99까지로 늘리면 되나요?