Typecho显示在线状态
/***
* 在线状态
*/
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));
if ($row) {
echo Typecho_I18n::dateWord($row['activated'], $now);
} else {
echo '博主一直在这里';
}
}
在前台调用
💻️ <?php $this->author();//用户名 ?> <?php get_last_login(1); ?> 在线
0 条评论
暂无评论