typecho获取分类下文章数量
function leinum($id){
$db = Typecho_Db::get();
$po=$db->select('table.metas.mid')->from ('table.metas')->where ('parent = ?', $id);
$pom = $db->fetchAll($po);
$num = count($pom);
$shu = $id;
if($num>0){
for ($x=0; $x<$num; $x++) {
$shu=$pom[$x]['mid'].','.$shu;
}}
echo $shu;
}
!
发表评论