将下面一段代码放到模板的module.php
<?php //判断网站更新情况
function recentUpdate() {
$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 '懒癌!博客废成枯井了,十几天还不更新!';}
elseif($threeday_num=='0'){echo '懒猪!博客快要荒废,连续3天都没有更新文章咯~';}
elseif($today_num=='0'){echo '懒虫!今天还没更新哦~';}
else{echo '小劳模,今天又更新了'.$today_num.'篇文章哟~';}
}
?>
然后在需要输出的地方调用recentUpdate()函数
<?php recentUpdate();?>
具体情况看本站页底吧~