/***
* 在线状态
*/
function get_last_login($user){
$user = '1';
$now = time();
$db = Typecho_Db::get();
$prefix = $db->getPrefix();
$row = $db->fetchRow(...
在主题的functions.php中加入function onlinePeople() {
// 使用 Helper 类获取主题路径
$theme_dir = Helper::options()->themeFile(Helper::options()->theme);
$filename = $theme_dir . '/online.txt&...
在主题中最后插入// 获取站点统计信息(带缓存)
function getSiteStatsWithCache() {
// 使用文件缓存(兼容性最好)
$cacheFile = __TYPECHO_ROOT_DIR__ . '/usr/cache/site_stats.cache';
$cacheTime = 3600; // 1小时缓存
...
方法1 使用原生js<script>
document.addEventListener('DOMContentLoaded', function() {
// 获取所有图片(如果主题默认输出 src,可以动态替换为 data-src)
const images = document.querySelectorAll('img[src...
在post.php中插入 <script src="https://cdn.imsun.org/highlight/prism.js"></script>
<link rel="stylesheet" href="https://cdn.imsun.org/highlight/prism.css"...