Reswitch getting counts

This commit is contained in:
Dmitry Tretyakov 2023-10-25 16:17:50 +07:00
parent 2ee9f5d22c
commit 02b6022cc3
3 changed files with 4 additions and 4 deletions

View file

@ -74,7 +74,7 @@ final class WallPresenter extends OpenVKPresenter
$this->template->paginatorConf = (object) [
"count" => $this->template->count,
"page" => (int) ($_GET["p"] ?? 1),
"amount" => sizeof((array)$this->template->posts),
"amount" => $this->template->posts->count(),
"perPage" => OPENVK_DEFAULT_PER_PAGE,
];
@ -332,7 +332,7 @@ final class WallPresenter extends OpenVKPresenter
foreach($photos as $photo)
$post->attach($photo);
if(sizeof($videos) > 0)
if($videos->count() > 0)
foreach($videos as $vid)
$post->attach($vid);

View file

@ -9,7 +9,7 @@
{/block}
{block content}
{var $amount = sizeof((array)$logs)}
{var $amount = $logs->count()}
<style>
del, ins { text-decoration: none; color: #000; }

View file

@ -142,7 +142,7 @@
{include "../components/paginator.xml", conf => (object) [
"page" => $page,
"count" => $count,
"amount" => sizeof((array)$data),
"amount" => $data->count(),
"perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE,
"atBottom" => false,
]}