From 4b1282c51a607bf7dd17a1a71b5e37a5f38978bc Mon Sep 17 00:00:00 2001 From: veselcraft Date: Fri, 17 Sep 2021 20:17:45 +0300 Subject: [PATCH] Wall: Now you can go to owner's wall (Fixes #123) --- Web/Presenters/WallPresenter.php | 2 ++ Web/Presenters/templates/Wall/Post.xml | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Web/Presenters/WallPresenter.php b/Web/Presenters/WallPresenter.php index 07258877..6dcc70fd 100644 --- a/Web/Presenters/WallPresenter.php +++ b/Web/Presenters/WallPresenter.php @@ -250,6 +250,8 @@ final class WallPresenter extends OpenVKPresenter $this->logPostView($post, $wall); $this->template->post = $post; + if ($post->getTargetWall() > 0) $this->template->wallOwner = (new Users)->get($post->getTargetWall()); + else $this->template->wallOwner = (new Clubs)->get($post->getTargetWall()); $this->template->cCount = $post->getCommentsCount(); $this->template->cPage = (int) ($_GET["p"] ?? 1); $this->template->comments = iterator_to_array($post->getComments($this->template->cPage)); diff --git a/Web/Presenters/templates/Wall/Post.xml b/Web/Presenters/templates/Wall/Post.xml index 3137310d..26db2119 100644 --- a/Web/Presenters/templates/Wall/Post.xml +++ b/Web/Presenters/templates/Wall/Post.xml @@ -2,7 +2,15 @@ {block title}{_"post"}{/block} {block header} - {_"post"} + + {$wallOwner->getCanonicalName()} + + » + + {_wall} + + » + {_"post"} {/block} {block content}