
本期EMLOG教程是为你的EMlog博客显示今天文章更新多少资源,和计算共更新多少资源计算,超过三天没发布文章会显示,三天没更新,十天也会提示哦,能够随时提醒你今天是否有更新文章
你想放在什么位置都可以,我反正是放在log_list.php这个文件里面,代码如下
<style>
.minic{
overflow:hidden;
margin-bottom:10px;
border:1px solid #eaeaea;
background-color:#fff;
height:40px;
line-height:40px
}
</style>
<div class="queyikeji-org the-best-plugins minic">
<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>'.$today_num.'</b>个资源 ☆</b> '
;}
?>
<b>本站共分享了<b><?php echo $sta_cache['lognum'];?></b>个资源</b>
</p>
</div>
以上是《EMLOG主页显示今日更新文章统计》文章的全部内容,感谢你的支持!
以上就是《EMLOG主页显示今日更新文章统计》文章的全部内容了!
本文最后更新于2020-5-6,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后发表评论
注册
社交帐号登录