-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfooter.page.php
41 lines (28 loc) · 1004 Bytes
/
footer.page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<footer>
<p>
<?php
$author = $page->author;
if (isset($state->x->user) && $author instanceof User) {
$author = '<a href="' . eat($author->link ?? $author->url) . '" rel="author" target="_blank">' . $author . '</a>';
}
if (!$author) {
$author = '<em>' . i('Anonymous') . '</em>';
}
$time = '<time datetime="' . eat($page->time->format('c')) . '">' . $page->time('%I:%M %p') . '</time>';
?>
<?= i('Posted by %s at %s', [$author, $time]); ?>
<?php
if (isset($state->x->tag)) {
echo '<br>';
$tags = [];
if ($tags_data = $page->tags) {
foreach ($tags_data as $tag) {
$tags[$title = $tag->title] = '<a href="' . eat($tag->link) . '" rel="tag">' . $title . '</a>';
}
}
ksort($tags);
echo i('Tag' . (1 === ($count = count($tags)) ? "" : 's')) . ': ' . ($count ? implode(', ', $tags) : '<em>' . i('Untagged') . '</em>');
}
?>
</p>
</footer>