execute('me',$sql);
$tpc = '';
while($row = $dsql->getarray('me')){
$topc[$row['id']] = $row;
$topid[] = $row['id'];
blc($row['id'],null);
}
function blc($pid,$ppid)
{
global $dsql , $topc;
$rows = '';
$sql = select id,reid,typename from dede_arctype where reid=$pid order by id asc;
$dsql->execute('idme',$sql);
while($row = $dsql->getarray('idme')){
$topc[$pid]['son'][$row['id']] = $row;
$topc[$ppid]['son'][$pid]['son'][$row['id']] = &$topc[$pid]['son'][$row['id']];
$rows[] = $row;
}
if($rows == '')
{
return;
}
else
{
foreach($rows as $varid){
blc($varid['id'],$varid['reid']);
}
return;
}
}
$topkey = array_keys($topc);
$toplength = count($topkey);
foreach($topid as $now_id)
{
for($i=0;$i {
if($topkey[$i] == $now_id) $retop[$topkey[$i]] = $topc[$topkey[$i]];
}
}
unset($topc);
$str = '';
function echotra($row){
global $str;
//if(empty($row['son'])) return;
foreach($row as $id=>$value){
$str .= '
'.$value['typename'].'';
if($value['son']){
$str .='';
echotra($value['son']);
$str .= '';
}
}
}
echotra($retop);
echo $str; ad:真正免费,域名+虚机+企业邮箱=0元
