<?
.....
.....
//显示分类************************************************
if ($func=='showtype'):
echo "<table>";
//判断分类的状态
if ($uid!=0) {
$result=mysql_query("select * from type where id=$uid");
$type=mysql_result($result,0,"type");
//******** 新加入的代码 ***************
$rout_id=mysql_result($result,0,"rout_id");
$rout_char=mysql_result($result,0,"rout_char");
$path=explode(":",$rout_id);
$path_gb=explode(":",$rout_char);
echo "<tr><td>";
for ($i=0;;$i++) {
$a=$i+1;
echo "<a
href=$php_self?func=showtype&uid=",$path[$a],">",$path_gb[$i],"</a>:";
if (empty($path_gb[$i])) {
break;
}
}
echo "</td></tr>";
//******** end ***********************
} else {
$type='父分类';
}
echo "<tr><td><a href='$php_self?func=createtype&uid=$uid'>创建分类</a></td></tr>";
echo "<tr><td>$type</td></tr>";
$result=mysql_query("select * from type where uid=$uid");
$num=mysql_numrows($result);
if (!empty($num)) {
for ($i=0;$i<$num;$i++) {
$id=mysql_result($result,$i,"id");
$type=mysql_result($result,$i,"type");
echo "<tr><td>";
echo "<a href='$php_self?func=showtype&uid=$id'>$type</a>";
echo "</td></tr>";
}
}
echo "</table>";
endif; /* end showtype */
.....
.....
?>
完成这个功能块后,就可继续分类信息的显示实现了...