Add poster ip address display

This commit is contained in:
Visman 2023-07-04 19:54:35 +07:00
parent 9981a68a7e
commit fedc6be825
5 changed files with 19 additions and 2 deletions

View file

@ -148,6 +148,7 @@ class Topic extends Page
$this->crumbs = $this->crumbs($topic);
$this->online = $this->c->Online->calc($this)->info();
$this->stats = null;
$this->showIpAddrs = $this->c->userRules->viewIP;
if (
$topic->canReply

View file

@ -216,6 +216,19 @@ class Post extends DataModel
);
}
/**
* Ссылка на страницу данных об ip
*/
protected function getlinkGetHost(): string
{
return $this->c->Router->link(
'AdminHost',
[
'ip' => $this->poster_ip,
]
);
}
/**
* HTML код сообщения
*/

View file

@ -28,7 +28,7 @@ msgid "Promote user title"
msgstr "Promote user"
msgid "IP address logged"
msgstr "IP address logged"
msgstr "IP<span> address</span>"
msgid "Note"
msgstr "Note:"

View file

@ -28,7 +28,7 @@ msgid "Promote user title"
msgstr "Продвинуть пользователя"
msgid "IP address logged"
msgstr "IP адрес"
msgstr "IP<span> адрес</span>"
msgid "Note"
msgstr "Замечание"

View file

@ -107,6 +107,9 @@
@if ($post->user->location)
<li class="f-location"><span class="f-psfont">{!! __(['From %s', $post->user->censorLocation]) !!}</span></li>
@endif
@if ($p->showIpAddrs)
<li class="f-poster-ip"><a href="{{ $post->linkGetHost }}" title="{{ $post->poster_ip }}"><span class="f-psfont">{!! __('IP address logged') !!}</span></a></li>
@endif
</ul>
@endif
</div>