优化一下评论列表加上@

This commit is contained in:
浪子
2024-06-13 15:30:11 +08:00
parent e69663dad4
commit a88130d5c5
2 changed files with 8 additions and 2 deletions
+7
View File
@@ -190,6 +190,13 @@ function img_postthumb($cid) {
return ""; // 没有匹配到图片URL,返回空字符串
}
}
//回复加上@
function getPermalinkFromCoid($coid) {
$db = Typecho_Db::get();
$row = $db->fetchRow($db->select('author')->from('table.comments')->where('coid = ? AND status = ?', $coid, 'approved'));
if (empty($row)) return '';
return '<a href="#comment-'.$coid.'" style="text-decoration: none;">@'.$row['author'].'</a>';
}
//开始增加某些奇怪的东西
// 获取月份
function getMonth() {