From 4901b642cd90a9124a4ca5732210707caa030290 Mon Sep 17 00:00:00 2001 From: BigCoke233 Date: Fri, 10 Jul 2020 22:58:49 +0800 Subject: =?UTF-8?q?:zap:=20Perf:=20=E5=85=BC=E5=AE=B9=20typecho=20?= =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=8F=8D=E5=9E=83=E5=9C=BE=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/Comments.php | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 libs/Comments.php (limited to 'libs/Comments.php') diff --git a/libs/Comments.php b/libs/Comments.php new file mode 100644 index 0000000..78fd087 --- /dev/null +++ b/libs/Comments.php @@ -0,0 +1,51 @@ +options->switch && in_array('html', $comment->options->switch)) { echo ''; } + echo ''; + if ($comment->options->switch && in_array('html', $comment->options->switch)) { echo ''; } + } + + /** + * 获取上级评论人 + */ + public static function getCommentHF($coid){ + $db = Typecho_Db::get(); + $prow = $db->fetchRow($db->select('parent') + ->from('table.comments') + ->where('coid = ? AND status = ?', $coid, 'approved')); + $parent = $prow['parent']; + if ($parent != "0") { + $arow = $db->fetchRow($db->select('text','author','status') + ->from('table.comments') + ->where('coid = ?', $parent)); + $author = $arow['author']; + $status = $arow['status']; + if($author){ + if($status=='approved'){ + $href = '@'.$author.'';; + }else if($status=='waiting'){ + $href = '评论审核中···'; + } + } + echo $href; + } else { + echo ""; + } + } +} \ No newline at end of file -- cgit v1.2.3