//获取当前栏目的上级顶级栏目
function getfirstclassid($classid){
global $empire,$dbtbpre;
$result = mysql_query("select * from {$dbtbpre}enewsclass where classid = '$classid' limit 1");
while($row=mysql_fetch_array($result)){
$bclassid = $row[bclassid];
}
if($bclassid>0){
$firstclassid = getfirstclassid($bclassid);
}else{
$firstclassid = $classid;
}
/*
$result = mysql_query("select * from {$dbtbpre}enewsclass where classid = '$bclassid' limit 1");
while($row=mysql_fetch_array($result)){
$bclassid = $row[bclassid];
}
*/
return $firstclassid;
}
<?php
$firstclassid = getfirstclassid($_GET[classid]);
$result = mysql_query("select classname from {$dbtbpre}enewsclass where classid = '$firstclassid' limit 1");
while($row=mysql_fetch_array($result)){
$firstclassname = $row[classname];
}
?>
<?php
$result = mysql_query("select * from {$dbtbpre}enewsclass where bclassid = '$firstclassid' order by myorder asc limit 15 ");
while($row=mysql_fetch_array($result)){
?>
<li><a href="/e/action/ListInfo/?classid=<?=$row['classid']?>" target="_blank"><?=$row['classname']?></a></li>
<?php
}
?>
·关于我们·免责声明·服务条款·RSS订阅·dede168.com技术支持
Copyright © 1998-2015 All rights reserved.