Skip to content

Commit

Permalink
✨ 优化评论链接
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed Dec 28, 2022
1 parent b6ac655 commit b4b7c00
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions inc/fun/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,16 @@ function pk_post_style_list()
//评论者链接
function pk_comment_author_url($comment_ID = 0)
{
$url = get_comment_author_url($comment_ID);
global $comment;
$target = '';
if (!empty($comment) && $comment->user_id != 0) {
$url = get_author_posts_url($comment->user_id);
} else {
$url = get_comment_author_url($comment_ID);
$target = "target='_blank'";
}
$author = get_comment_author($comment_ID);
echo empty($url) ? $author : "<a target='_blank' href='" . pk_go_link($url) . "' rel='external nofollow' class='url'>$author</a>";
echo empty($url) ? $author : "<a ".$target." href='" . pk_go_link($url) . "' rel='external nofollow' class='url'>$author</a>";
}

//评论回复通知
Expand Down

0 comments on commit b4b7c00

Please sign in to comment.