MENU

Typecho网站页脚显示建站时间

July 2, 2020 • Read: 2084 • 学习充电

页脚显示站点运行时间

修改主题文件夹下./component/footer.php,第 63 起的代码块修改后如下示(注意保留原作者的版权信息):

<?php
    $copyright = 'Copyright &copy; '. date('Y') .' <a href="'. Mirages::$options->siteUrl .'">'. Mirages::$options->title .'</a>'; if (!Device::isPhone()) {$theme = "";}$theme = (Device::isPhone() ? '': 'Powered by <a href="http://typecho.org" target="_blank">Typecho</a> • ') . 'Theme <a href="https://get233.com/archives/mirages-intro.html" target="_blank">Mirages</a>';
    $runtime = '本站已经奋力挣扎了'.floor((time() - 1502694727)/86400).'天';
    if (Utils::hasValue(Mirages::$options->beian)) {
        $beiAn = "<a href=\"http://beian.miit.gov.cn\" target='_blank'> ".Mirages::$options->beian . "</a>";
        $copyright = "<p>{$copyright}</p><p>{$beiAn} • {$theme}</p><p>{$runtime}</p>";
    } else {
        $copyright = "<p>{$copyright} • {$theme}</p><p>{$runtime}</p>";
    }
?>

  注意修改时间戳

---The END---
  • 文章标题:Typecho网站页脚显示建站时间
  • 文章作者:飞进的船
  • 文章链接:https://www.fjdc.xyz/xxcd/148.html
  • 版权声明:本站原创内容均采用《署名-非商业性使用-相同方式共享 4.0 国际》进行许可,转载请注明出处。

  • Archives QR Code Tip
    QR Code for this page
    Tipping QR Code
    Leave a Comment

    2 Comments
    1. 安梓 安梓

      时间戳怎么改的啊

      1. @安梓你可以直接百度搜索“时间戳转换”,根据你的建站时间直接转换对应成对应的时间戳就行了。