emlog博客站点今日更新,全站资源数量统计美化过的代码,代码有些缺陷,可以自行删掉些。话不多说直接上代码。
原文地址:https://iooqp.cn/?post=708
一般的话都是放在首页统计,比如说fee,可以把它放在log_list.php文件里头
最新发布
$Log_Model = new Log_Model();
$today = strtotime(date('Y-m-d'));//今天凌晨时间戳
$threeday = strtotime(date('Y-m-d',strtotime('-3 day')));//3天前凌晨时间戳
$tenday = strtotime(date('Y-m-d',strtotime('-10 day')));//10天前凌晨时间戳
$today_sql = "and date>$today";
$today_num = $Log_Model->getLogNum('n', $today_sql);
$threeday_sql = "and date>$threeday";
$threeday_num = $Log_Model->getLogNum('n', $threeday_sql);
$tenday_sql = "and date>$tenday";
$tenday_num = $Log_Model->getLogNum('n', $tenday_sql);
if($tenday_num=='0'){echo '10几天没有更新 | ';}
elseif($threeday_num=='0'){echo '3天没有更新了 | ';}
elseif($today_num=='0'){echo '今日未更新,';}
else{echo ' 今日更新'.$today_num.'个资源 丨 ';}
?> 全站个资源