本文最后更新于2021年8月2日,已超过1年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
在function.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 . '">@' . $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 '';
}
}
}
调用方法:在评论输出内容的地方前面放上就行了
<?php $parentMail = get_comment_at($comments->coid)?><?php echo $parentMail;?>
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
Extended Opportunity46天前0
Hey Guys, Warning: From February 2024, all existing email autoresponders will become obsolete! In fact, if you want to send marketing emails, promotional emails, or any other sort of emails starting in February 2024, you’ll need to comply with Gmail’s and Yahoo’s draconic new directives. They require regular marketers like you and I to setup complex code on sending domains… and existing autoresponders like Aweber and GetResponse are not helping: they’re requesting you do all the work, and their training is filled with complex instructions and flowcharts… How would you like to send unlimited emails at the push of a button all with done-for-you DMARC, DKIM, SPF, custom IPs and dedicated SMTP sending servers? What I mean by all of that tech talk above, is that with ProfitMarc, we give you pre-set, pre-configured, DONE-FOR-YOU email sending addresses you can just load up and mail straight away. We don’t even have any “setup tutorials” like other autoresponders either, because guess what: we already did all the setup for you! All of our built-in sending addresses and servers are already pre-warmed with Gmail and Yahoo and they’re loving us: 99% inbox rate is the average! ⇒ Grab your copy here! ⇒ https://ext-opp.com/ProfitMarc1234567ad5个月前0
66666Andy7个月前0
好可惜......回忆 7个月前0
作者不做了mz7个月前0
购买地址没了,还在维护吗?zhang8个月前0
666666666666666666笨笨9个月前0
图标改为了:https://cdn.mkirin.top/cdn/setting/icon.webp,请修改下,谢谢myrna9个月前5
Exposing my boobs for you always make me happy and gives me confidence http://prephe.ro/Phqn