diff options
Diffstat (limited to 'templates/actor_atom.php')
| -rw-r--r-- | templates/actor_atom.php | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/templates/actor_atom.php b/templates/actor_atom.php deleted file mode 100644 index 8bd40fb..0000000 --- a/templates/actor_atom.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** @var \Digitigrade\Model\Actor $actor */ -/** @var string $lang */ - -use Digitigrade\GlobalSettings; -use Digitigrade\Model\Note; -use Digitigrade\Model\NotePrivacyScope; - -$selfUri = path_to_uri("/actor/$actor->id/feed/$lang/feed.atom"); -$actorPage = path_to_uri("/@/$actor->handle"); - -echo '<?xml version="1.0" encoding="utf-8"?>'; -?> -<feed xmlns="http://www.w3.org/2005/Atom"> - <id><?= $selfUri ?></id> - <title> - <?= htmlspecialchars($actor->displayName) ?> — <?= GlobalSettings::getInstance()->get('instance.name') ?> - </title> - <updated><?= Note::findAllWithAuthor($actor, 1)[0]->created->format(DateTime::ATOM) ?></updated> - <author> - <name><?= htmlspecialchars($actor->displayName) ?></name> - <uri><?= $actorPage ?></uri> - </author> - <link rel="self" href="<?= $selfUri ?>" /> - <link rel="alternate" type="text/html" href="<?= $actorPage ?>" /> - <generator version="<?= get_version() ?>">Digitigrade</generator> - <?php if (isset($actor->avatar)): ?> - <icon><?= $actor->avatar ?></icon> - <?php endif; ?> - <subtitle><?= __f('user.rss.description', $actor->displayName) ?></subtitle> - - <?php foreach (Note::findAllWithAuthor($actor, limit: 50) as $note): ?> - <?php - /** @var Note $note */ - if ($note->privacy->scope != NotePrivacyScope::PUBLIC || $note->inReplyTo != null) { - continue; - } - ?> - <entry> - <id><?= path_to_uri("/note/$note->id") ?></id> - <title><![CDATA[<?= htmlspecialchars(substr($note->plainContent, 0, 50), double_encode: false) ?>]]></title> - <updated><?= ($note->modified ?? $note->created)->format(DateTime::ATOM) ?></updated> - <link rel="alternate" type="text/html" href="<?= path_to_uri("/@/$actor->handle/note/$note->id") ?>" /> - <content type="html"><![CDATA[<?= $note->getBestContentAsHtml() ?>]]></content> - <?php foreach ($note->attachments as $file): ?> - <link rel="enclosure" title="<?= htmlspecialchars($file->description) ?>" type="<?= $file->type ?>" - href="<?= $file->href ?>" /> - <?php endforeach; ?> - </entry> - <?php endforeach; ?> -</feed>
\ No newline at end of file |
