aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/actor_profile_page.php
diff options
context:
space:
mode:
authorwinter2025-03-10 20:13:40 +0000
committerwinter2025-03-10 20:13:40 +0000
commit30fa49bc3fa4f94184d693932e838c0672f24a16 (patch)
treed15bccf49c5c15905bb581e2f394b281ce852ee3 /templates/actor_profile_page.php
parent2bd4a086b0f50b1b88faf846da91267290ca4b07 (diff)
add user rss/atom feeds
Diffstat (limited to 'templates/actor_profile_page.php')
-rw-r--r--templates/actor_profile_page.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/templates/actor_profile_page.php b/templates/actor_profile_page.php
index dbeb86a..1b2981d 100644
--- a/templates/actor_profile_page.php
+++ b/templates/actor_profile_page.php
@@ -2,6 +2,10 @@
use Digitigrade\Model\Note;
use Digitigrade\Model\UserAccount;
+use Digitigrade\UserSettings;
+
+$lang = get_ui_language();
+$actorUser = UserAccount::findByLinkedActor($actor);
call_template('skeleton', [
'pageTitle' => "$actor->displayName - @" . $actor->getFullHandle(),
@@ -10,9 +14,22 @@ call_template('skeleton', [
'ogDesc' => $actor->bio,
'ogImage' => $actor->avatar ?? path_to_uri('/static/default-avatar.png'),
'ogType' => 'profile',
- 'ogHandle' => '@' . $actor->getFullHandle(true)
-], function () {
- global $actor;
+ 'ogHandle' => '@' . $actor->getFullHandle(true),
+ 'headLinks' => ($actorUser != null && (new UserSettings($actorUser))->getBool('profile.rssEnabled')) ? [
+ [
+ 'rel' => 'alternate',
+ 'type' => 'application/rss+xml',
+ 'href' => "/actor/$actor->id/feed/$lang/feed.rss",
+ 'title' => __('user.profile.feed.rss')
+ ],
+ [
+ 'rel' => 'alternate',
+ 'type' => 'application/atom+xml',
+ 'href' => "/actor/$actor->id/feed/$lang/feed.atom",
+ 'title' => __('user.profile.feed.atom')
+ ]
+ ] : []
+], function () use ($actor) {
$user = UserAccount::findByCurrentSession();
call_template('actor_profile', ['actor' => $actor]);