mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
Patch array objects for PHP 8.1 (#999)
* Patch array objects for PHP 8 * Reswitch getting counts * Update WallPresenter.php * Update WallPresenter.php * Fix
This commit is contained in:
parent
e3b9fb9f41
commit
49a7047773
3 changed files with 8 additions and 8 deletions
|
@ -74,7 +74,7 @@ final class WallPresenter extends OpenVKPresenter
|
||||||
$this->template->paginatorConf = (object) [
|
$this->template->paginatorConf = (object) [
|
||||||
"count" => $this->template->count,
|
"count" => $this->template->count,
|
||||||
"page" => (int) ($_GET["p"] ?? 1),
|
"page" => (int) ($_GET["p"] ?? 1),
|
||||||
"amount" => sizeof($this->template->posts),
|
"amount" => $this->template->posts->getRowCount(),
|
||||||
"perPage" => OPENVK_DEFAULT_PER_PAGE,
|
"perPage" => OPENVK_DEFAULT_PER_PAGE,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -152,9 +152,9 @@ final class WallPresenter extends OpenVKPresenter
|
||||||
->where("deleted", 0)
|
->where("deleted", 0)
|
||||||
->order("created DESC");
|
->order("created DESC");
|
||||||
$this->template->paginatorConf = (object) [
|
$this->template->paginatorConf = (object) [
|
||||||
"count" => sizeof($posts),
|
"count" => $posts->getRowCount(),
|
||||||
"page" => (int) ($_GET["p"] ?? 1),
|
"page" => (int) ($_GET["p"] ?? 1),
|
||||||
"amount" => sizeof($posts->page((int) ($_GET["p"] ?? 1), $perPage)),
|
"amount" => $posts->page((int) ($_GET["p"] ?? 1), $perPage)->getRowCount(),
|
||||||
"perPage" => $perPage,
|
"perPage" => $perPage,
|
||||||
];
|
];
|
||||||
$this->template->posts = [];
|
$this->template->posts = [];
|
||||||
|
@ -182,7 +182,7 @@ final class WallPresenter extends OpenVKPresenter
|
||||||
$this->template->paginatorConf = (object) [
|
$this->template->paginatorConf = (object) [
|
||||||
"count" => $count,
|
"count" => $count,
|
||||||
"page" => (int) ($_GET["p"] ?? 1),
|
"page" => (int) ($_GET["p"] ?? 1),
|
||||||
"amount" => sizeof($posts),
|
"amount" => $posts->getRowCount(),
|
||||||
"perPage" => $pPage,
|
"perPage" => $pPage,
|
||||||
];
|
];
|
||||||
foreach($posts as $post)
|
foreach($posts as $post)
|
||||||
|
@ -332,7 +332,7 @@ final class WallPresenter extends OpenVKPresenter
|
||||||
foreach($photos as $photo)
|
foreach($photos as $photo)
|
||||||
$post->attach($photo);
|
$post->attach($photo);
|
||||||
|
|
||||||
if(sizeof($videos) > 0)
|
if($videos->count() > 0)
|
||||||
foreach($videos as $vid)
|
foreach($videos as $vid)
|
||||||
$post->attach($vid);
|
$post->attach($vid);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block content}
|
{block content}
|
||||||
{var $amount = sizeof($logs)}
|
{var $amount = $logs->getRowCount()}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
del, ins { text-decoration: none; color: #000; }
|
del, ins { text-decoration: none; color: #000; }
|
||||||
|
|
|
@ -142,7 +142,7 @@
|
||||||
{include "../components/paginator.xml", conf => (object) [
|
{include "../components/paginator.xml", conf => (object) [
|
||||||
"page" => $page,
|
"page" => $page,
|
||||||
"count" => $count,
|
"count" => $count,
|
||||||
"amount" => sizeof($data),
|
"amount" => $data->getRowCount(),
|
||||||
"perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE,
|
"perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE,
|
||||||
"atBottom" => false,
|
"atBottom" => false,
|
||||||
]}
|
]}
|
||||||
|
|
Loading…
Reference in a new issue