文章目录

Joe主题footer添加站长最近登录时间

行云流水
2022-06-23 / 1 评论 / 283 阅读 / 正在检测是否收录...

前言

参考别人的博客 尘遇 ,继续优化自己的博客。

优化代码

/** 调用站长最近登录时间 **/
function get_last_login($user){
    $user   = '1';
    $now = time();
    $db     = Typecho_Db::get();
    $prefix = $db->getPrefix();
    $row = $db->fetchRow($db->select('activated')->from('table.users')->where('uid = ?', $user));
    echo Typecho_I18n::dateWord($row['activated'], $now);
}

 <div class="item">
            <?php $this->options->JFooter_Left() ?>
        </div>
        <--! 新增 -->
        <div class = "item">
            <span>【站长 <strong><?php get_last_login(1); ?></strong> 在线】</span>
        </div>
        <?php if ($this->options->JBirthDay) : ?>
            <div class="item run">
                <span>已运行 <strong class="joe_run__day">00</strong> 天 <strong class="joe_run__hour">00</strong> 时 <strong class="joe_run__minute">00</strong> 分 <strong class="joe_run__second">00</strong> 秒</span>
            </div>
        <?php endif; ?>

评论 (1)

取消
只有登录/注册用户才可评论