From 530bbf058781e00e588f1457b6ee589a64b74da1 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 5 Apr 2024 10:46:09 -0400 Subject: i did thing oh god large commit --- src/web/helper/image.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/web/helper/image.php (limited to 'src/web/helper') diff --git a/src/web/helper/image.php b/src/web/helper/image.php new file mode 100644 index 0000000..ac2f808 --- /dev/null +++ b/src/web/helper/image.php @@ -0,0 +1,33 @@ +'; + } else { + $content .= ''; + } + $content .= ''; + if ($link) { + $content .= ''; + } else { + $content .= ''; + } + + return $content; +} + +function pfp( + $user, + $embedLink = TRUE, +): string { + $link = $embedLink ? '/profile?id=' . $user['id'] : NULL; + return image('/api/rpc/profile_avatar?user_id=' . $user['id'], 'pfp', link: $link); +} -- cgit v1.2.3-freya