EMLOG统计今日更新文章和文章总数的代码

对于很多使用EMLOG程序做资源站的朋友们来说,每天更新的资源数量和总更新量是展示给访客的必备数据,那么现在就来为大家分享一下EMLOG统计今日更新文章和文章总数的代码。

1、将下面的代码添加到您需要展示数据的位置即可

?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 ' <b>今日已更新<b style="color:red">'.$today_num.'</b>个资源   |   </b> ';}
?><b>本站共分享了<b style="color:red"><?php echo $sta_cache['lognum'];?></b>个资源</b>
版权归属: 博客志
相关推荐

评论区

博主头像
博客志
知道不知道
  • 892

    文章

  • 0

    评论

  • 813356

    浏览