레벨업시 축하메세지 문의드려요. 정보
레벨업시 축하메세지 문의드려요.
본문
아래소스를 어떻게해야 레벨업시 축하메세지를 팝업으로 올라오게 할수가 있을가요?고수님들의 지도편달 바랍니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
function get_member_level($mb_id,$mb_point) {
global $g4;
$is_admin = is_admin($mb_id);
$point = $mb_point;
$level = ceil($point / 10000); //반올림을 하여 레벨을 구함.
if($mb_id)if($level <= 1) $level = 1; // 위 반올림에서 렙1미만 회원에게 레벨1을 줌, (비회원은 0)
if($is_admin == 'super') $level = 62; //관리자는 최고레벨
if ($level > 57) $level = 62;
$no = sprintf("%04d", $level2?$level2:$level);
return "<img src='$g4[path]/img/l2/{$no}.gif' align=absmiddle hspace=1 title='등급 {$level} / ".number_format($mb_point)."점'>";
}
//포인트 상태바
function exp_bar($mb_id,$mb_point,$option) {
global $g4;
$is_admin = is_admin($mb_id);
$point = $mb_point;
$level = ceil($point / 10000); //반올림을 하여 레벨을 구함.
if($mb_id)if($level <= 1){$level = 1;} // 반올림에서 렙1미만 회원에게 레벨1을 줌, (비회원은 0)
if ($level > 57){$level = 62;} //최대 레벨 설정
if($is_admin == 'super'){$level = 62;} //관리자 레벨 설정
$no = sprintf("%04d", $level);
$max = $level * 10000;
if(!$level){$max=10000; $a_max=10000; $a_min=0;}else{$a_max = (int)($max / $level);$a_min = (int)($point - (10000 * ($level-1)));} //레벨이 없으면 최대값, 있으면 레벨에 맞는 최대값을 구함
if($is_admin == 'super'){$max=10000; $a_max=10000; $a_min=0;} //관리자는 기본세팅
$bar = (int)($a_min / $a_max * 100);
if($bar > 100) $bar = 0;
$graph = $bar."%"; //등급, 경험치바 표시
if($level == 0){$level = "0";} // 레벨값을 이용해 레벨대신 표시
if($level == 62){$level = "Top";} // 레벨값을 이용해 레벨대신 표시
if($option == 0){
echo "<table width='80' border='0' cellspacing='0' cellpadding='0'><tr><td><font style='font-size:9px;'>Level. $level</font></td><td align='right'><font style='font-size:9px;'>$graph</font></td></tr></table><table width='80' border='0' cellspacing='0' cellpadding='0' background='$g4[path]/img/exp_bar.gif'><tr height='1'><td rowspan='3' width='1'></td><td width='77'></td><td rowspan='3' width='2'></td></td></tr><tr height='6'><td><img src='$g4[path]/img/exp_in.gif' width='$graph' height='6'></td></tr><tr height='2'><td></td></tr></table>";
}
if($option == 1){
echo "<table width='100' border='0' cellspacing='0' cellpadding='0'><td width='17'><img src='$g4[path]/img/l2/{$no}.gif' title='등급 {$level} / ".number_format($mb_point)."점'></td><td width='3'></td><td width='80'><table width='80' border='0' cellspacing='0' cellpadding='0'><tr><td><font style='font-size:9px;'>Level. $level</font></td><td align='right'><font style='font-size:9px;'>$graph</font></td></tr></table><table width='80' border='0' cellspacing='0' cellpadding='0' background='$g4[path]/img/exp_bar.gif'><tr height='1'><td rowspan='3' width='1'></td><td width='77'></td><td rowspan='3' width='2'></td></td></tr><tr height='6'><td><img src='$g4[path]/img/exp_in.gif' width='$graph' height='6'></td></tr><tr height='2'><td></td></tr></table></td></tr></table>";
}
/*if($option == 0){
echo "<table width='133' border='0' cellspacing='0' cellpadding='0' align='center'><tr height='25'><td width='30'><img src='$g4[path]/img/class.gif'></td><td width='17'><img src='$g4[path]/img/l2/{$no}.gif' title='등급 {$level} / ".number_format($mb_point)."점'></td><td align='right'><!-- <font color='#FA41E6'>$point</font>/$max<br> --><font color='#FA41E6'>$a_min</font>/$a_max</td></tr><tr><td colspan='2'><img src='$g4[path]/img/exp.gif'></td><td align='right'>$graph</td></tr><tr height='11'><td colspan='3' background='$g4[path]/img/exp_bar_133.gif'><table width='133' height='11' border='0' cellspacing='0' cellpadding='0'><tr height='1'><td colspan='3'></td></tr><tr height='8'><td width='1'></td><td width='130'><img src='$g4[path]/img/exp_in.gif' width='$graph' height='8'></td><td width='2'></td></tr><tr height='2' colspan='3'></table></td></tr></table>";
}if($option == 1){
echo "<table width='103' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td width='33'><img src='$g4[path]/img/class.gif'></td><td width='35'> $level</td><td align='right' width='35'>$graph</td></tr><tr height='11'><td colspan='3' background='$g4[path]/img/exp_bar_103.gif'><table width='103' height='11' border='0' cellspacing='0' cellpadding='0'><tr height='1'><td colspan='3'></td></tr><tr height='8'><td width='1'></td><td width='100'><img src='$g4[path]/img/exp_in.gif' width='$graph' height='8'></td><td width='2'></td></tr><tr height='2'><td colspan='3'></td></tr></table></td></tr><tr><td colspan='3' height='5'></td></tr></table>";
}*/
}
function level_icon($mb_level) {
global $g4;
if($mb_level == 10)echo "<img src='$g4[path]/img/level_img/level10.gif'> ";
if($mb_level == 9)echo "<img src='$g4[path]/img/level_img/level9.gif'> ";
if($mb_level == 8)echo "<img src='$g4[path]/img/level_img/level8.gif'> ";
if($mb_level == 7)echo "<img src='$g4[path]/img/level_img/level7.gif'> ";
if($mb_level == 6)echo "<img src='$g4[path]/img/level_img/level6.gif'> ";
if($mb_level == 5)echo "<img src='$g4[path]/img/level_img/level5.gif'> ";
if($mb_level == 4)echo "<img src='$g4[path]/img/level_img/level4.gif'> ";
if($mb_level == 3)echo "<img src='$g4[path]/img/level_img/level3.gif'> ";
if($mb_level == 2)echo "<img src='$g4[path]/img/level_img/level0.gif'> ";
//if($mb_level == 1)echo "<img src='$g4[path]/img/level_img/level5.gif'> ";
//if($mb_level == 0)echo "<img src='$g4[path]/img/level_img/level0.gif'> ";
}
?>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
function get_member_level($mb_id,$mb_point) {
global $g4;
$is_admin = is_admin($mb_id);
$point = $mb_point;
$level = ceil($point / 10000); //반올림을 하여 레벨을 구함.
if($mb_id)if($level <= 1) $level = 1; // 위 반올림에서 렙1미만 회원에게 레벨1을 줌, (비회원은 0)
if($is_admin == 'super') $level = 62; //관리자는 최고레벨
if ($level > 57) $level = 62;
$no = sprintf("%04d", $level2?$level2:$level);
return "<img src='$g4[path]/img/l2/{$no}.gif' align=absmiddle hspace=1 title='등급 {$level} / ".number_format($mb_point)."점'>";
}
//포인트 상태바
function exp_bar($mb_id,$mb_point,$option) {
global $g4;
$is_admin = is_admin($mb_id);
$point = $mb_point;
$level = ceil($point / 10000); //반올림을 하여 레벨을 구함.
if($mb_id)if($level <= 1){$level = 1;} // 반올림에서 렙1미만 회원에게 레벨1을 줌, (비회원은 0)
if ($level > 57){$level = 62;} //최대 레벨 설정
if($is_admin == 'super'){$level = 62;} //관리자 레벨 설정
$no = sprintf("%04d", $level);
$max = $level * 10000;
if(!$level){$max=10000; $a_max=10000; $a_min=0;}else{$a_max = (int)($max / $level);$a_min = (int)($point - (10000 * ($level-1)));} //레벨이 없으면 최대값, 있으면 레벨에 맞는 최대값을 구함
if($is_admin == 'super'){$max=10000; $a_max=10000; $a_min=0;} //관리자는 기본세팅
$bar = (int)($a_min / $a_max * 100);
if($bar > 100) $bar = 0;
$graph = $bar."%"; //등급, 경험치바 표시
if($level == 0){$level = "0";} // 레벨값을 이용해 레벨대신 표시
if($level == 62){$level = "Top";} // 레벨값을 이용해 레벨대신 표시
if($option == 0){
echo "<table width='80' border='0' cellspacing='0' cellpadding='0'><tr><td><font style='font-size:9px;'>Level. $level</font></td><td align='right'><font style='font-size:9px;'>$graph</font></td></tr></table><table width='80' border='0' cellspacing='0' cellpadding='0' background='$g4[path]/img/exp_bar.gif'><tr height='1'><td rowspan='3' width='1'></td><td width='77'></td><td rowspan='3' width='2'></td></td></tr><tr height='6'><td><img src='$g4[path]/img/exp_in.gif' width='$graph' height='6'></td></tr><tr height='2'><td></td></tr></table>";
}
if($option == 1){
echo "<table width='100' border='0' cellspacing='0' cellpadding='0'><td width='17'><img src='$g4[path]/img/l2/{$no}.gif' title='등급 {$level} / ".number_format($mb_point)."점'></td><td width='3'></td><td width='80'><table width='80' border='0' cellspacing='0' cellpadding='0'><tr><td><font style='font-size:9px;'>Level. $level</font></td><td align='right'><font style='font-size:9px;'>$graph</font></td></tr></table><table width='80' border='0' cellspacing='0' cellpadding='0' background='$g4[path]/img/exp_bar.gif'><tr height='1'><td rowspan='3' width='1'></td><td width='77'></td><td rowspan='3' width='2'></td></td></tr><tr height='6'><td><img src='$g4[path]/img/exp_in.gif' width='$graph' height='6'></td></tr><tr height='2'><td></td></tr></table></td></tr></table>";
}
/*if($option == 0){
echo "<table width='133' border='0' cellspacing='0' cellpadding='0' align='center'><tr height='25'><td width='30'><img src='$g4[path]/img/class.gif'></td><td width='17'><img src='$g4[path]/img/l2/{$no}.gif' title='등급 {$level} / ".number_format($mb_point)."점'></td><td align='right'><!-- <font color='#FA41E6'>$point</font>/$max<br> --><font color='#FA41E6'>$a_min</font>/$a_max</td></tr><tr><td colspan='2'><img src='$g4[path]/img/exp.gif'></td><td align='right'>$graph</td></tr><tr height='11'><td colspan='3' background='$g4[path]/img/exp_bar_133.gif'><table width='133' height='11' border='0' cellspacing='0' cellpadding='0'><tr height='1'><td colspan='3'></td></tr><tr height='8'><td width='1'></td><td width='130'><img src='$g4[path]/img/exp_in.gif' width='$graph' height='8'></td><td width='2'></td></tr><tr height='2' colspan='3'></table></td></tr></table>";
}if($option == 1){
echo "<table width='103' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td width='33'><img src='$g4[path]/img/class.gif'></td><td width='35'> $level</td><td align='right' width='35'>$graph</td></tr><tr height='11'><td colspan='3' background='$g4[path]/img/exp_bar_103.gif'><table width='103' height='11' border='0' cellspacing='0' cellpadding='0'><tr height='1'><td colspan='3'></td></tr><tr height='8'><td width='1'></td><td width='100'><img src='$g4[path]/img/exp_in.gif' width='$graph' height='8'></td><td width='2'></td></tr><tr height='2'><td colspan='3'></td></tr></table></td></tr><tr><td colspan='3' height='5'></td></tr></table>";
}*/
}
function level_icon($mb_level) {
global $g4;
if($mb_level == 10)echo "<img src='$g4[path]/img/level_img/level10.gif'> ";
if($mb_level == 9)echo "<img src='$g4[path]/img/level_img/level9.gif'> ";
if($mb_level == 8)echo "<img src='$g4[path]/img/level_img/level8.gif'> ";
if($mb_level == 7)echo "<img src='$g4[path]/img/level_img/level7.gif'> ";
if($mb_level == 6)echo "<img src='$g4[path]/img/level_img/level6.gif'> ";
if($mb_level == 5)echo "<img src='$g4[path]/img/level_img/level5.gif'> ";
if($mb_level == 4)echo "<img src='$g4[path]/img/level_img/level4.gif'> ";
if($mb_level == 3)echo "<img src='$g4[path]/img/level_img/level3.gif'> ";
if($mb_level == 2)echo "<img src='$g4[path]/img/level_img/level0.gif'> ";
//if($mb_level == 1)echo "<img src='$g4[path]/img/level_img/level5.gif'> ";
//if($mb_level == 0)echo "<img src='$g4[path]/img/level_img/level0.gif'> ";
}
?>
댓글 전체
레벨업메세지를 보여주려면 이전레벨과 지금레벨의 차이가 있는지없는지 비교가 있어야 합니다
ex)
$curLevel = sql_fetch(" select level from g4_member where mb_id='$mb_id' ");
$level = ceil($point / 10000); //반올림을 하여 레벨을 구함.
if($curLevel[level] < $level ){
echo "<script> alert(' level up~ '); </script>";
}
이런식의 비교구문이 있어야합니다
ex)
$curLevel = sql_fetch(" select level from g4_member where mb_id='$mb_id' ");
$level = ceil($point / 10000); //반올림을 하여 레벨을 구함.
if($curLevel[level] < $level ){
echo "<script> alert(' level up~ '); </script>";
}
이런식의 비교구문이 있어야합니다
GOO^^