美文网首页
emlog博客站点今日更新,全站资源数量统计美化过的代码

emlog博客站点今日更新,全站资源数量统计美化过的代码

作者: ing_3dd7 | 来源:发表于2020-03-07 06:48 被阅读0次

emlog博客站点今日更新,全站资源数量统计美化过的代码,代码有些缺陷,可以自行删掉些。话不多说直接上代码。

原文地址:https://iooqp.cn/?post=708

一般的话都是放在首页统计,比如说fee,可以把它放在log_list.php文件里头

<div class="zuixin"style="background: linear-gradient(to right,#28b3f7 0,#ff00ff 100%);">

<span class="zx" style="font-size:13px;">

<i class='fa fa-line-chart'></i>最新发布 </span>

</div>

<span class="youqing_more2"style="background: linear-gradient(to right,#ff00ff 0,#28b3f7 100%);">

<span class="zx" style="font-size:13px;">

<?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>

</span>

</span>

</div>

css部分

css可以丢在当前文件或者头部文件header.php也可以丢在mian.css文件里头(强制全新即可)

.youqing_more2 {

  float: right;

  right: 0;

  text-indent: 0px;

    margin-right: 0px;

    height: 28px;

    position: absolute;

    right: 0;

    text-transform: uppercase;

    line-height: 26px;

    letter-spacing: 1px;

    background: #2196F3;

    color: #fff;

    display: inline-block;

    padding: 0 10px;

    text-align: center;

    margin-left: 6px;

    border-radius: 5px;

}

.zuixin {

height: 28px;

line-height: 28px;

color: #fff;

left: 0;

display: inline-block;

text-align: center;

padding: 0 10px;

border-radius: 5px;

}

相关文章

  • emlog博客站点今日更新,全站资源数量统计美化过的代码

    emlog博客站点今日更新,全站资源数量统计美化过的代码,代码有些缺陷,可以自行删掉些。话不多说直接上代码。 原文...

  • Hexo基础操作

    新建博客 本地运行博客 更新博客 标签/分类数量统计不准确 更多详情

  • 520源码之家资源网

    920源码之实博客是干什么的? 920源码家博客专注于AIDE源码, Fusin app源码,emlog资源,WP...

  • 流量统计

    这是我的百度统计入口。暂时还不会用博客整站渲染,只能将统计代码插入某个单独的网页。 百度统计的数据更新有延迟。大怒...

  • 博客迁移

    博客已迁移至个人站点 简书停止更新 逆行云 见谅 ?

  • cloc 统计代码数量

    cloc 是一个很有意思的应用,可以统计你项目使用几种语言,每种语言多少个文件(files),多少空行(blank...

  • hexo添加站点访问量

    引入不蒜子并添加站点访问量 在themes的_config.yml添加属性如下: 添加如下统计代码: 因七牛强制过...

  • 质量管理-sonar

    1、为什么要做质量管理; 2、如何从多个角度来查看代码质量、项目质量; 代码量统计目录结构;类数量方法数量代码数量...

  • emlog编辑器探寻之旅

    本文同步于我的个人博客 emlog编辑器探寻之旅 一直想要寻找一个好用的emlog文本编辑器,寻觅了很久,从默认的...

  • Android Studio tips3-Plugins收集

    1 工程代码统计statistic可以方便的统计工程中的代码数量,支持过滤文件类型、排除不需要统计的文件夹等等,具...

网友评论

      本文标题:emlog博客站点今日更新,全站资源数量统计美化过的代码

      本文链接:https://www.haomeiwen.com/subject/cbyfdhtx.html