Typecho 获取网站标签总数目
/**
* 获取标签数目
*
* 语法: <?php echo tagsNum(); ?>
*
* @access protected
* @return integer
*/
function tagsNum($display = true)
{
$db = Typecho_Db::get();
$total_tags = $db->fetchObject($db->select(array('COUNT(mid)' => 'num'))
->from('table.metas')
->where('table.metas.type = ?', 'tag'))->num;
if($display) {
echo $total_tags;
} else {
return $total_tags;
}
}
广告声明:文内含有的对外跳转链接(包括不限于超链接、二维码、口令等形式),用于传递更多信息,节省甄选时间,结果仅供参考,Typecho.Wiki所有文章均包含本声明。