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>
Ps:该代码你想放在那里都可以,一般这类的代码都是放在文章头部
版权声明:若无特殊注明,本文为《星辰Admin》原创,转载请保留文章出处。
本文链接:https://xcwlgw.cn/post-17.html
正文到此结束





发表吐槽
你肿么看?
既然没有吐槽,那就赶紧抢沙发吧!