//获取指定栏目的所有子栏目
//@param:$id(栏目ID)
function get_child_id($id){
$arr='';
$sql="select id from ".DB_PRE."category where cate_hide!=1 and cate_parent=".intval($id);
$child=$GLOBALS['mysql']->fetch_asc($sql);
if(empty($child)){
return '';
}else{
foreach($child as $k=>$v){
$arr.=",".$v['id'];
$arr.=get_child_id($v['id']);
}
unset($child);
return $arr;
}
}