(user): add a way to get the author URI

This commit is contained in:
Kazhnuz 2025-01-19 13:01:57 +01:00
parent ac507092d8
commit 617bbf49f7
2 changed files with 7 additions and 3 deletions

View file

@ -75,6 +75,10 @@ class User
}
}
public function authorUri() {
return DOMAIN_AUTHORS . $this->username();
}
public function displayNameMode()
{
return $this->getValue('displayNameMode');

View file

@ -8,13 +8,13 @@
<?php if (!$page->isStatic() && !$url->notFound()) : ?>
<div class="form-text mb-2">
<!-- Page creation time -->
<span class="pr-3"><i class="bi bi-calendar"></i><?php echo $page->date() ?></span>
<span class="pe-3"><i class="bi bi-calendar"></i><?php echo $page->date() ?></span>
<!-- Page reading time -->
<span class="pr-3"><i class="bi bi-clock"></i><?php echo $page->readingTime() . ' ' . $L->get('minutes') . ' ' . $L->g('read') ?></span>
<span class="pe-3"><i class="bi bi-clock"></i><?php echo $page->readingTime() . ' ' . $L->get('minutes') . ' ' . $L->g('read') ?></span>
<!-- Page author -->
<span><i class="bi bi-person"></i><?php echo $page->user('displayName') ?></span>
<span><a href="<?php echo $page->user('authorUri'); ?>"><i class="bi bi-person"></i><?php echo $page->user('displayName') ?></a></span>
</div>
<?php endif ?>