文章总数、分类总数、页面总数、标签总数、评论总数、浏览总数,可分别调用,详情看本站侧边博客统计信息!
代码:
第一步:打开主题模板include.php文件,找到合适的位置输出一下代码,将主题ID改成直接注册的ID;
PHP
//信息统计 function 主题ID_all_views() { global $zbp;$all_views = GetValueInArrayByCurrent($zbp->db->Query('SELECT SUM(log_ViewNums) AS num FROM ' . $GLOBALS['table']['Post']), 'num');return $all_views;}function 主题ID_all_artiles() { global $zbp;$all_artiles = GetValueInArrayByCurrent($zbp->db->Query('SELECT COUNT(*) AS num FROM ' . $GLOBALS['table']['Post'] . ' WHERE log_Type=\'0\''), 'num');return $all_artiles;}function 主题ID_all_pages() { global $zbp;$all_pages = GetValueInArrayByCurrent($zbp->db->Query('SELECT COUNT(*) AS num FROM ' . $GLOBALS['table']['Post'] . ' WHERE log_Type=\'1\''), 'num');return $all_pages;}function 主题ID_all_categorys() { global $zbp;$all_categorys = GetValueInArrayByCurrent($zbp->db->Query('SELECT COUNT(*) AS num FROM ' . $GLOBALS['table']['Category']), 'num');return $all_categorys;}function 主题ID_all_tags() { global $zbp;$all_tags = GetValueInArrayByCurrent($zbp->db->Query('SELECT COUNT(*) as num FROM ' . $GLOBALS['table']['Tag']), 'num');return $all_tags;}function 主题ID_all_comments() { global $zbp;$all_comments = $zbp->cache->all_comment_nums;return $all_comments;}
第二步:将下面的统计代码放到想要展示统计的地方,可单独调用,放哪个显示哪个!
Markup
<p>文章总数:{主题ID_all_artiles()}</p><p>分类总数:{主题ID_all_categorys()}</p><p>页面总数:{主题ID_all_pages()}</p><p>标签总数:{主题ID_all_tags()}</p><p>评论总数:{主题ID_all_comments()}</p><p>总访问量:{主题ID_all_views()}</p>
温馨提示:本功能是zblog作者:爱分享做的插件,插件ID:site_info,有搞不懂的小伙伴可以直接搜索ID下载插件使用,若使用过程中出现bug或者任何问题可以联系爱站云付费解决哟!