+ ! {_post_is_ad} +
diff --git a/Web/Presenters/WallPresenter.php b/Web/Presenters/WallPresenter.php index f4a8e898..e5e3b7fc 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..e8a6e2fd --- /dev/null +++ b/Web/Presenters/templates/components/post/embeddedpost.xml @@ -0,0 +1,167 @@ +{var $author = $post->getOwner()} +{var $comments = $post->getLastComments(3)} +{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()} +
+
+ |
+
+
+
+
+
+
+
+ {$post->getText()|noescape}
+
+ {var $width = ($GLOBALS["_bigWall"] ?? false) ? 550 : 320}
+ {if isset($GLOBALS["_nesAttGloCou"])}
+ {var $width = $width - 70 * $GLOBALS["_nesAttGloCou"]}
+ {/if}
+ {var $attachmentsLayout = $post->getChildrenWithLayout($width)}
+
+
+
+
+
+
+
+ + ! {_post_is_ad} +
+ {_source}: {$post->getSource(true)|noescape}
+
+
+ {var $actualAuthor = $post->getOwner(false)}
+
+
+
+ {$actualAuthor->getCanonicalName()}
+
+
+
+
+
+
+
+ |
+
+