diff --git a/comments.php b/comments.php index b4c4860..c10cda5 100644 --- a/comments.php +++ b/comments.php @@ -64,7 +64,6 @@ user->screenName(); ?>. »

-

@@ -88,7 +87,6 @@ - have()): ?> listComments(); ?>
+ parent) {echo getPermalinkFromCoid($comments->parent);}?> content(); ?>
diff --git a/functions.php b/functions.php index a438793..d43a3a3 100644 --- a/functions.php +++ b/functions.php @@ -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 '@'.$row['author'].''; +} //开始增加某些奇怪的东西 // 获取月份 function getMonth() {