在网上能搜到Z-blog怎么统计24小时更新文章数量的教程,这里就不多说了,那么怎么统计当天更新的文章数量呢?
一、在你的主题配置文件中插入如下代码:
function hnyszy_postday(){
global $zbp
$gettime = strtotime(date("Y-m-d"));//当天时间
$db = $zbp->db->sql->get();
$sql = $db->select('zbp_post')->where(array(array('=','log_Status','0'),array('>','log_PostTime',$gettime)))->sql;
$array = $zbp->GetListType('Post', $sql);
echo count($array);
}
二、在你的主题模版文件中调用如下代码:
今天已更新<b class="red">{hnyszy_postday()}</b>个资源
详细可参考《响应式资源分享网站主题》https://app.zblogcn.com/?id=2044
本人作品,提供Z-blogPHP主题定制、仿站和修改等服务。在应用页面找到我的联系方式。