在 functions.php 中写入代码:
function get_comment_at($coid){
$db = Typecho_Db::get();
$prow = $db->fetchRow($db->select('parent,status')->from('table.comments')
->where('coid = ?', $coid));
$mail = "";
$parent = @$prow['parent'];
if ($parent != "0") {
$arow = $db->fetchRow($db->select('author,status,mail')->from('table.comments')
->where('coid = ?', $parent));
@$author = @$arow['author'];
$mail = @$arow['mail'];
if(@$author && $arow['status'] == "approved"){if (@$prow['status'] == "waiting"){echo '<p class="commentReview">(评论正在审核中)</p>';}
echo '<a href="#comment-' . $parent . '" class="comment-at">@' . $author . '</a>';
}else{if (@$prow['status'] == "waiting"){echo '<p class="commentReview">(评论正在审核中)</p>';
}else{echo '';}}} else {if (@$prow['status'] == "waiting"){echo '<p class="commentReview">(评论正在审核中)</p>';}else{echo '';}}
}
在 commentes.php 评论输出位置写入代码:
<?php $parentMail = get_comment_at($comments->coid)?><?php echo $parentMail;?><?php $comments->content(); ?>