function sublmstr2($lmid){ global $conn,$lmidarraystr; $exitslmsql=$conn->selectone(DB_EXT."lanmu","lm_id","where lm_fid='".$lmid."' and lm_islast='1'"); if($conn->rows($exitslmsql)){ $lmidarray=get_data_limit(DB_EXT."lanmu","where lm_fid='".$lmid."'"); if($lmidarray){ foreach($lmidarray as $lmidarray_v){ if(sublmstr($lmidarray_v['lm_id'])){ sublmstr2($lmidarray_v['lm_id']); }else{ if($lmidarray_v['lm_islast']){ $lmidarraystr.=$lmidarray_v['lm_id'].","; } } }} return $lmid=substr($lmidarraystr,0,-1); } };
$newshtml = ".html"; } else { $listurl = "http://" . $_SERVER['HTTP_HOST'] . "/" . $pagemulu . "/index.php?lmid=" . $lmid . "&page="; $classurl = "http://" . $_SERVER['HTTP_HOST'] . "/" . $pagemulu . "/index.php?lmid="; $danyehtml = ".php"; } $lmidarraystr = ""; $isfid = ""; $isleft = ""; $islast = ""; //$exitslmsql 检查栏目是否有子栏目,如果有就输出他包含子栏目的ID $exitslmsql = $conn->selectone(DB_EXT . "lanmu", "lm_id", "where lm_fid='" . $lmid . "' "); if (@$conn->rows($exitslmsql)) { $isfid = 1; $isexitclass = 1; $lmid = sublmstr2($lmid); //假如存在子栏目,这个时候$lmid=就为子栏目的ID集合 } //是否没有子分类的终极栏目,如果是$classid_one=$classid;$classid是本身的传过来的ID $exitslmsql_one = $conn->selectone(DB_EXT . "lanmu", "lm_id", "where lm_id='" . $lmid . "' and lm_islast='1' and lm_fid ='0'"); if (@$conn->rows($exitslmsql_one)) { $classid_one = $classid; //没有分类,就是大分类终极分类 $islast = 1; $isleft = 1; } $tkmsql = get_data_one(DB_EXT . "lanmu", "where lm_id='" . $classid . "'"); //本栏目的信息 $classbid = $classid; //本栏目ID //查询FID