From 7aedd748db60150f64a75d9e4c8edf03323a0be1 Mon Sep 17 00:00:00 2001 From: Eltrac <45323514+BigCoke233@users.noreply.github.com> Date: Wed, 22 Jan 2020 17:06:56 +0800 Subject: =?UTF-8?q?=F0=9F=94=96=20Add:=20=E5=8F=8B=E6=83=85=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E6=94=AF=E6=8C=81=E6=B7=BB=E5=8A=A0=E7=AE=80=E4=BB=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/Contents.php | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/libs/Contents.php b/libs/Contents.php index fc8c90b..64186fa 100644 --- a/libs/Contents.php +++ b/libs/Contents.php @@ -39,6 +39,19 @@ class Contents //解析友链盒子 $reg = '/\[links\](.*?)\[\/links\]/s'; $rp = ''; + $text = preg_replace($reg,$rp,$text); + //解析带有简介的友链项目 + $reg = '/\[(.*?)\]\{(.*?)\}\((.*?)\)\+\((.*?)\)/s'; + $rp = ''; $text = preg_replace($reg,$rp,$text); //解析友链项目 $reg = '/\[(.*?)\]\{(.*?)\}\((.*?)\)/s'; @@ -53,30 +66,10 @@ class Contents '; $text = preg_replace($reg,$rp,$text); + } return $text; } - - /** - * 通过查询数据库 - * 获取上级评论人 - */ - public static function commentsParent($comment) - { - $recipients = []; - $db = Typecho_Db::get(); - $widget = new Widget_Abstract_Comments(new Typecho_Request(), new Typecho_Response()); - // 查询 - $select = $widget->select()->where('coid' . ' = ?', $comment->parent)->limit(1); - $parent = $db->fetchRow($select, [$widget, 'push']); // 获取上级评论对象 - if ($parent && $parent['mail']) { - $recipients = [ - 'name' => $parent['author'], - 'mail' => $parent['mail'], - ]; - } - return $recipients; - } //从这里开始的代码来自 熊猫小A (https://imalan.cn) /** -- cgit v1.2.3