allow('comment')) echo ""; } /** * 获取上级评论人 */ public static function getParent($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 ""; } } /** * 获取 Cravatar 头像链接 */ public static function gravatar($email, int $size = 100, int $useCDN = NULL) { //MD5 EMail $email = md5($email); $avatar = 'https://cravatar.cn/avatar/' . $email . '?s=' . $size; return $avatar; } /** * 获取评论者头像 */ public static function getAvatar($email, int $size = 100) { //Hash $email_hash = md5(strtolower($email)); //EMail $email = strtolower($email); $avatar = self::gravatar($email, $size); return $avatar; } }