테스트 사이트 - 개발 중인 베타 버전입니다

포인트 레벨 관련... 채택완료

개미왕자 9년 전 조회 4,674

아래 코드를 변형해서 포인트별 레벨을 출력하도록 사용하려고 하는데요.

아래 코드를 적용시키면 포인트가 올라가면 자동으로 권한(레벨) 이 올라가는거잖아요..

저는 포인트가 올라가면 권한레벨이 올라가는거 말고 레벨이 오르는데

그 레벨은 권한이랑 관련이 없는 그냥 일정포인트마다 레벨이 올라가는

그냥 아무 의미 없는 숫자에 불과한 그런 레벨을 만들어서

닉네임 옆에 출력되게 하고 싶어서 그러는데 어떤부분을 없애면

홈페이지권한레벨이랑 별개의 레벨이 될수 있을까요??

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개

채택된 답변
+20 포인트
p
9년 전

여분필드를 사용하시면 되지 않을까 싶네요.

</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개

개미왕자
9년 전
답변 감사합니다 ㅠㅠ 제가 초짜라 여분필드가 뭔지 그 용도를 잘 몰라서요...
그리고 레벨을 99까지 하려고 하는데... 저 코드를 99까지로 늘리면 되나요?
p
port
9년 전
여분필드는 10까지만 기본 제공되기 때문에 DB에서 별도로 원하는 필드만큼 추가해줘야 합니다.
개미왕자
9년 전
추가하는방법좀 알려주실수 있나요??

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인