温馨提示:如果想看速看完文章和评论,请开启弹幕模式

[首发]emlog今日发表文章和总发表文章代码

这个代码是从某大佬的博客主题里面扒下来的,不喜勿喷。

<?php 
    echo _g('inewti');
    ?></span><?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 '<b>都10天,没有更新内容了。</b>';
    } elseif ($threeday_num == '0') {
        echo '<b>连续3天都没有更新文章了。</b>';
    } elseif ($today_num == '0') {
        echo ' <b>今日站长还没更新。</b>';
    } else {
        echo ' <b>今日更新<b style="color:red">' . $today_num . '</b>个资源,</b> ';
    }
    ?><b>本站共分享<b style="color:red"><?php 
    echo $sta_cache['lognum'];
    ?></b>个资源</b>


发表评论

游客 表情
看不清楚?点图切换 送你一朵小花花~

众说纷纭(0)