+ ! {_post_is_ad} +
diff --git a/Web/Presenters/WallPresenter.php b/Web/Presenters/WallPresenter.php index 89b1915d..e4d337da 100644 --- a/Web/Presenters/WallPresenter.php +++ b/Web/Presenters/WallPresenter.php @@ -123,6 +123,11 @@ final class WallPresenter extends OpenVKPresenter $this->renderWall($user, true); } + public function renderPostEmbedded(int $wall, int $post_id): void + { + $this->renderPost($wall, $post_id, true); + } + public function renderRSS(int $user): void { $owner = ($user < 0 ? (new Clubs()) : (new Users()))->get(abs($user)); @@ -439,7 +444,7 @@ final class WallPresenter extends OpenVKPresenter } } - public function renderPost(int $wall, int $post_id): void + public function renderPost(int $wall, int $post_id, bool $embedded = false): void { $post = $this->posts->getPostById($wall, $post_id); if (!$post || $post->isDeleted()) { @@ -470,6 +475,9 @@ final class WallPresenter extends OpenVKPresenter $this->template->cCount = $post->getCommentsCount(); $this->template->cPage = (int) ($_GET["p"] ?? 1); $this->template->comments = iterator_to_array($post->getComments($this->template->cPage)); + if ($embedded == true) { + $this->template->_template = "components/post/embeddedpost.xml"; + } } public function renderLike(int $wall, int $post_id): void diff --git a/Web/Presenters/templates/components/post/embeddedpost.xml b/Web/Presenters/templates/components/post/embeddedpost.xml new file mode 100644 index 00000000..3007c216 --- /dev/null +++ b/Web/Presenters/templates/components/post/embeddedpost.xml @@ -0,0 +1,165 @@ +{extends "../../@layout.xml"} + +{block title} + {_post} +{/block} + +{block header} + {_post} +{/block} + + + +{block content} +{var $author = $post->getOwner()} +{var $commentsCount = $post->getCommentsCount()} +{var $platform = $post->getPlatform()} +{var $platformDetails = $post->getPlatformDetails()} +{var $likesCount = $post->getLikesCount()} +{var $repostsCount = $post->getRepostCount()} +{var $canBePinned = $post->canBePinnedBy($thisUser ?? NULL)} +{var $canBeDeleted = $post->canBeDeletedBy($thisUser)} +{var $wallOwner = $post->getWallOwner()} +{if $post->isDeactivationMessage() && $post->getText()} + {var $deac = "post_deact"} +{else} + {var $deac = "post_deact_silent"} +{/if} +{var $compact = isset($compact) ? true : false} +{var $club = isset($club) ? $club} + +{var $commentTextAreaId = $post === NULL ? rand(1,300) : $post->getId()} + + +