Emlog显示今日更新数量和总文章数量

作者: 小易

全网最全的网络资源分享网站

手机扫码查看

特别声明:本站多为原创或网络转载、资源使用一般不提供帮助、本站资源不可商用原创或部分除外、如有侵权请联系!

摘要:Emlog首页添加今日文章更新数量代码,之前都有Emlog网站统计,但是有点鸡肋,这个能在视觉上能有很好的体验感觉,也是针对博主的一种叮嘱吧小易在fee主题搜集的,仅提供测试,小易...

Emlog首页添加今日文章更新数量代码,之前都有Emlog网站统计,但是有点鸡肋,这个能在视觉上能有很好的体验感觉,也是针对博主的一种叮嘱吧

小易在fee主题搜集的,仅提供测试,小易测试过

图片演示

Emlog显示今日更新数量和总文章数量

Emlog今日更新代码

<article class="excerpt-minic excerpt-minic-index" data-aos="fade-up">
<center><p><?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></p>
</center>
</article>
分享到:
打赏
  •  阅读时间:

    字数统计:本文共有 1063 个字

    本文标题:《Emlog显示今日更新数量和总文章数量》发布于2022-5-30

    原创文章:http://www.eruu.cn/post-4.html

    版权声明:文章由《 小易》发布、原创转载请保留出处!

    评论

    
    切换注册

    登录

    忘记密码?

    您也可以使用第三方帐号快捷登录

    切换登录

    注册

    觉得文章有用就打赏一下文章作者

    支付宝扫一扫打赏

    微信扫一扫打赏