Handsome主题有的侧边栏显示最后更新那个功能,换成了自己主题以后只能自己实现了,不过也不难
/**
* 获取站点最后更新时间
*
* @return null
* @date 2020-05-01
*/
public function lastUpdate()
{
$db = Typecho_Db::get();
$create = $db->fetchRow($db->select('created')->from('table.contents')->limit(1)->order('created', Typecho_Db::SORT_DESC));
$update = $db->fetchRow($db->select('modified')->from('table.contents')->limit(1)->order('modified', Typecho_Db::SORT_DESC));
if ($create >= $update) {
echo Typecho_I18n::dateWord($create['created'], time());
echo Typecho_I18n::dateWord($update['modified'], time());
}
}
精选留言