From adc545a0cb55836c92f8e7e31153584c219767aa Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 5 Apr 2024 13:46:33 -0400 Subject: user menu --- src/web/helper/image.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/web/helper') diff --git a/src/web/helper/image.php b/src/web/helper/image.php index ac2f808..8815a6c 100644 --- a/src/web/helper/image.php +++ b/src/web/helper/image.php @@ -1,6 +1,6 @@ '; + } else if ($click) { + $content .= ''; } else { $content .= ''; } @@ -26,8 +30,11 @@ function image($src, $class = NULL, $link = NULL): string { function pfp( $user, - $embedLink = TRUE, + $link = TRUE, + $click = NULL ): string { - $link = $embedLink ? '/profile?id=' . $user['id'] : NULL; - return image('/api/rpc/profile_avatar?user_id=' . $user['id'], 'pfp', link: $link); + if ($link === TRUE) { + $link = '/profile?id=' . $user['id']; + } + return image('/api/rpc/profile_avatar?user_id=' . $user['id'], 'pfp', link: $link, click: $click); } -- cgit v1.2.3-freya