g5사용중인데 g4소스를 쓰고있습니다. 변황해야하는함수좀 알려주세요~
본문
맨 위의 상위폴더가 html입니다.
나름 함수를 바꾼다고 바꾼것같은데 적용이 안되네요
고수님들의 가르침 부탁드립니다.
<?
$html = ".."; // 상대 경로
include_once ("html/common.php");
include_once("../mypage_head.php");
// 관리자와 본인만 본다.
if ($mb_id != $member[mb_id]) {
if($is_admin != "djlee"){
alert("추천현황은 본인만 보실 수 있습니다!");
}
}
$re = get_tmp_re($mb_id);
?>
<img src="<?=html?>/img/bar/top_bar_member00.gif" width="780" height="100">
<link rel="stylesheet" href="<?=$html']?>/style.css" type="text/css">
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
<tr>
<td height="20" valign=top align="center">
<font size=2>아래 회원이름 옆에 있는 (+)를 클릭하시면 추천회원이 나옵니다.</font>
</td>
</tr>
<tr><td height="1" bgcolor="999999"></td></tr>
<tr><td valign=top height=10></td></tr>
</table>
<? if($re){?>
<table width=100% cellpadding=0 cellspacing=0>
<tr height=30>
<td width=90% style='border-top-width:1px; border-left-width:1px; border-top-color:black; border-left-color:black; border-top-style:solid; border-left-style:solid;' align=center bgcolor=#F8F8F8><b><font color=CD7444>직접 추천회원 명단</font></b></td>
<td width=10% style='border-top-width:1px; border-right-width:1px; border-left-width:1px; border-top-color:black; border-right-color:black; border-left-color:#999999; border-top-style:solid; border-right-style:solid; border-left-style:solid;' align=center bgcolor=#F8F8F8><b><font color=CD7444>추천수</font></b></td>
</tr>
<tr height=30>
<td width=90% style='border-top-width:1px; border-left-width:1px; border-top-color:black; border-left-color:black; border-top-style:solid; border-left-style:solid;'> <?=$re[re_member]?></td>
<td width=10% style='border-top-width:1px; border-right-width:1px; border-left-width:1px; border-top-color:black; border-right-color:black; border-left-color:#999999; border-top-style:solid; border-right-style:solid; border-left-style:solid;' align=center><?=$re[re_num]?></td>
</tr>
<tr><td height="1" bgcolor="999999" colspan='2'></td></tr>
</table>
<?}else{?>
<table width=100% cellpadding=0 cellspacing=0 border = 1>
<tr height=50>
<td width=100% align=center bgcolor=#F8F8F8><b><font color=CD7444>추천인이 없습니다</font></b></td>
</tr>
</table>
<?}?>
<br><br>
<?
//-------------------------------------------------------------------------------------------------------------------------
if($mb_id == "admin"){$mcnt = 1;$mb_id="admin";}
$re = get_tmp_re($mb_id);
$mc = get_mb_reclass(); // 가장 낮은 후원인의 레벨을 찾는다.
$mcnt = $mc[mb_recommend_class];
$mb = get_member($mb_id);
$mb_class = $mb[mb_recommend_class];
$mb_c = $mb[mb_recommend_class];
$mb_id = $mb[mb_id];
$mb_name = $mb[mb_name];
$mb_level = $mb[mb_level];
if($mb_level == 2){$img = "<img src='$html/img/2.png' align='absmiddle' alt='레벨2등급'>";}
else if($mb_level == 3){$img = "<img src='$html/img/3.png' align='absmiddle' alt='레벨3등급'>";}
else if($mb_level == 4){$img = "<img src='$html/img/4.png' align='absmiddle' alt='레벨4등급'>";}
else if($mb_level == 5){$img = "<img src='$html/img/5.png' align='absmiddle' alt='레벨5등급'>";}
else if($mb_level == 6){$img = "<img src='$html/img/6.png' align='absmiddle' alt='레벨6등급'>";}
else if($mb_level == 7){$img = "<img src='$html/img/7.png' align='absmiddle' alt='레벨7등급'>";}
else if($mb_level == 8){$img = "<img src='$html/img/8.png' align='absmiddle' alt='레벨8등급'>";}
else if($mb_level == 9){$img = "<img src='$html/img/9.png' align='absmiddle' alt='레벨9등급'>";}
else if($mb_level == 10){$img = "<img src='$html/img/10.png' align='absmiddle' alt='레벨10등급'>"; }
$f_no = 1;
$before_id = $mb_id ."|"; // 배열에 부모이름
$before_no = $f_no ."|"; // 배열에 부모번호
$list[0] = "1|0|<b>" .$mb_name ."</b> (" .$mb_id .") " .$img ." |#";
// 검색회원 하위를 배열에 넣는다.
for($k=$mb_class; $k<$mcnt; $k++){
$b_class = $k + 1; // 부모밑
$sql="select mb_id, mb_name, mb_recommend_class, mb_recommend from $html[member_table] where mb_recommend_class = $b_class";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$mb_name = $row[mb_name];
$mb_id = $row[mb_id];
$mb_recommend = $row[mb_recommend];
$flgs_id = explode("|",$before_id);
for($j=0; $j<count($flgs_id); $j++){
if($mb_recommend == $flgs_id[$j]){ // 상위회원이 같으면
$f_no +=1;
$before_id .= $mb_id ."|"; // 배열에 부모이름
$before_no .= $f_no ."|"; // 배열에 부모번호
}
} // 포문끝
} // 포문끝
} // 포문끝
$no = 1;
for($k=$mb_class; $k<$mcnt; $k++){
$mb_c = $k + 1; // 부모밑
$sql="select mb_id, mb_name, mb_recommend_class, mb_level, mb_recommend from $html[member_table] where mb_recommend_class = $mb_c";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {$mb_level = "";
$mb_name = $row[mb_name];
$mb_id = $row[mb_id];
$mb_recommend = $row[mb_recommend];
$mb_level = $row[mb_level];
if($mb_level == 2){$img = "<img src='$html/img/2.png' align='absmiddle' alt='레벨2등급'>";}
else if($mb_level == 3){$img = "<img src='$html/img/3.png' align='absmiddle' alt='레벨3등급'>";}
else if($mb_level == 4){$img = "<img src='$html/img/4.png' align='absmiddle' alt='레벨4등급'>";}
else if($mb_level == 5){$img = "<img src='$html/img/5.png' align='absmiddle' alt='레벨5등급'>";}
else if($mb_level == 6){$img = "<img src='$html/img/6.png' align='absmiddle' alt='레벨6등급'>";}
else if($mb_level == 7){$img = "<img src='$html/img/7.png' align='absmiddle' alt='레벨7등급'>";}
else if($mb_level == 8){$img = "<img src='$html/img/8.png' align='absmiddle' alt='레벨8등급'>";}
else if($mb_level == 9){$img = "<img src='$html/img/9.png' align='absmiddle' alt='레벨9등급'>";}
else if($mb_level == 10){$img = "<img src='$html/img/10.png' align='absmiddle' alt='레벨10등급'>"; }
$ck_id = explode("|",$before_id);
$ck_no = explode("|",$before_no);
for($j=-1; $j<count($ck_id); $j++){
if($mb_recommend == $ck_id[$j]){ // 추천인이 같으면
$no +=1;
$num=$no - 1;
$m_class = $ck_no[$j];
$list[$num] = $no ."|" .$m_class ."|<b> " .$mb_name ."</b> (" .$mb_id .") " .$img ." |#";
//echo"$j // $no | $m_class -> $mb_recommend == $ck_id[$j] / $mb_name <br>";
}
}
} // 포문끝
} // 포문끝
//for($m=0; $m<$no; $m++){$txt = $list[$m]; echo"$txt <Br>";}
?>
<link rel="StyleSheet" href="tree.css" type="text/css">
<script type="text/javascript" src="tree.js"></script>
<?$total = $no -1;?>
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
<tr>
<td width="100%" valign=top>
<img src="../img/imgfolder.gif" border=0 align="absmiddle"> <u><font size=2>총 하위 추천회원수 : <?=$total?>명</font></u>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
var Tree = new Array;
<?for($i=0;$i<$no; $i++){?>
Tree[<?=$i?>] = "<?=$list[$i]?>";
<?}?>
//-->
</script>
<div class="tree">
<script type="text/javascript">
<!--
createTree(Tree);
//-->
</script>
</div>
<?
include_once("../tail.php");
?>