DB에서 레벨 변경 후 다시 초기화 현상
본문
최고관리자 계정이 레벨 2가 계속 유지되네요 DB에서 변경을해도..
extend파일에서
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 회원 레벨 체크
if ($member['mb_id']) {
$rowMs=sql_fetch("select sum(po_point) sPoint from ".$g5['point_table']." where mb_id='".$member['mb_id']."' And po_point>0");
$sPoint=$rowMs['sPoint'];
if ($sPoint<1500) $cLevel=2;
else if ($sPoint>=1500 && $sPoint<3000) $cLevel=3;
else if ($sPoint>=3000 && $sPoint<5000) $cLevel=4;
else if ($sPoint>=5000 && $sPoint<10000) $cLevel=5;
else if ($sPoint>=10000 && $sPoint<20000) $cLevel=6;
else if ($sPoint>=20000 && $sPoint<30000) $cLevel=7;
else if ($sPoint>=30000 && $sPoint<40000) $cLevel=8;
else if ($sPoint>=40000 && $sPoint<80000) $cLevel=9;
else if ($sPoint>=80000 && $sPoint<100000) $cLevel=10;
else if ($sPoint>=100000 && $sPoint<130000) $cLevel=11;
else if ($sPoint>=130000 && $sPoint<180000) $cLevel=12;
else if ($sPoint>=180000 && $sPoint<230000) $cLevel=13;
else if ($sPoint>=230000 && $sPoint<300000) $cLevel=14;
else if ($sPoint>=300000 && $sPoint<500000) $cLevel=15;
else if ($sPoint>=500000 && $sPoint<600000) $cLevel=16;
else if ($sPoint>=600000 && $sPoint<800000) $cLevel=17;
else if ($sPoint>=800000 && $sPoint<1200000) $cLevel=18;
else if ($sPoint>=1200000 && $sPoint<1600000) $cLevel=19;
else if ($sPoint>=1600000 && $sPoint<2000000) $cLevel=20;
else if ($sPoint>=2000000 && $sPoint<2500000) $cLevel=21;
else if ($sPoint>=2500000 && $sPoint<3000000) $cLevel=22;
else if ($sPoint>=3000000 && $sPoint<3500000) $cLevel=23;
else if ($sPoint>=3500000 && $sPoint<4000000) $cLevel=24;
else if ($sPoint>=4000000 && $sPoint<4500000) $cLevel=25;
else if ($sPoint>=4500000 && $sPoint<5000000) $cLevel=26;
else if ($sPoint>=5000000 && $sPoint<5500000) $cLevel=27;
else if ($sPoint>=5500000) $cLevel=28;
sql_query("update ".$g5['member_table']." set mb_level='". $cLevel ."' where mb_id='".$member['mb_id']."' And mb_level<=25 ");
}
?>
를 추가하였는데 무슨 문제가 있을까요 ? ㅠ
답변 3
아뇨 제가 잘못 말했어여! 그게 아니라 현재 회원 레벨하고 저거 포인트 몇대 레벨 받을거랑 비교 해서 올려야되는거 아녀요?
생각해보니까 지금 회원 레벨이 하고 줘야되는 레벨 하고 비교되는 조건문 이 없는것같아요
$sPoint=$rowMs['sPoint'];
이 뒤에서
echo $sPoint; exit;를 찍어보시고
숫자로 보려지고 값이 1500보다 큰데도 안되는경우
$sPoint=(int)$rowMs['sPoint'];
로 변경후 해보세요