/**
* 获取标签数目
*
* 语法: <?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;
}
}