blob: ac2e640ae41fa622fba2099f8e88eca5467e560d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<?php
use Digitigrade\Model\Note;
use Digitigrade\Model\UserAccount;
call_template('skeleton', [
'pageTitle' => '"' . $note->plainContent . '" - @' . $note->author->getFullHandle(),
'renderTitleHeading' => false,
'ogTitle' => $note->author->displayName,
'ogDesc' => $note->plainContent,
'ogImage' => $note->author->avatar ?? path_to_uri('/static/default-avatar.png'),
'ogType' => 'article',
'ogHandle' => '@' . $note->author->getFullHandle(true)
], function () {
global $note;
$targetNote = $note; // renaming this because my templating system clobbers it. :(
$notes = Note::findAllInThread($targetNote->threadApex ?? $targetNote);
$user = UserAccount::findByCurrentSession();
foreach ($notes as $n) {
if (!($user != null && $user->actor->blocks($n->author)) && $n->isViewableBy($user)) {
call_template('note/note', ['note' => $n, 'selected' => $n == $targetNote]);
}
}
});
|