diff options
Diffstat (limited to 'templates/actor_profile.php')
| -rw-r--r-- | templates/actor_profile.php | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/templates/actor_profile.php b/templates/actor_profile.php index ca19978..dfb0174 100644 --- a/templates/actor_profile.php +++ b/templates/actor_profile.php @@ -1,7 +1,9 @@ <?php use Digitigrade\Model\UserAccount; +use Digitigrade\UserSettings; $user = UserAccount::findByCurrentSession(); +$actorUser = UserAccount::findByLinkedActor($actor); ?> <div class="fullProfile"> <div class="basicInfo"> @@ -23,11 +25,7 @@ $user = UserAccount::findByCurrentSession(); </div> <div class="profileMiniActions"> - <?php call_template('menu_button', [], function () { - global $actor; - // i don't know why but `global $user` just straight up doesnt work? - $user = UserAccount::findByCurrentSession(); - ?> + <?php call_template('menu_button', [], function () use ($actor, $user, $actorUser) { ?> <?php if (!$actor->isLocal && isset($actor->homepage)): ?> <li> <a href="<?= $actor->homepage ?>" target="_blank"> @@ -36,6 +34,21 @@ $user = UserAccount::findByCurrentSession(); </a> </li> <?php endif; ?> + <?php if ($actorUser != null && (new UserSettings($actorUser))->getBool('profile.rssEnabled')): ?> + <?php $lang = get_ui_language(); ?> + <li> + <a href="<?= "/actor/$actor->id/feed/$lang/feed.rss" ?>" target="_blank" type="application/rss+xml"> + <span class="material-symbols rss-feed"></span> + <span><?= __('user.profile.feed.rss') ?></span> + </a> + </li> + <li> + <a href="<?= "/actor/$actor->id/feed/$lang/feed.atom" ?>" target="_blank" type="application/atom+xml"> + <span class="material-symbols orbit-outline"></span> + <span><?= __('user.profile.feed.atom') ?></span> + </a> + </li> + <?php endif; ?> <?php if ($user != null && $user->actor != $actor): ?> <li><?php call_template('actor_profile_block_button', ['user' => $user, 'actor' => $actor]) ?></li> <?php endif; ?> |
