Revert Clubs::getPopularClubs change

This functionality is so unstable it causes majority of installations to fail miserably out of the box. The performance also is a major concern. Might re-add later. Sometime.

btw i amended
This commit is contained in:
celestora 2022-09-12 20:46:40 +03:00
parent e28964c813
commit 384c0da78b
2 changed files with 5 additions and 1 deletions

View file

@ -45,6 +45,9 @@ class Clubs
function getPopularClubs(): \Traversable
{
// TODO rewrite
/*
$query = "SELECT ROW_NUMBER() OVER (ORDER BY `subscriptions` DESC) as `place`, `target` as `id`, COUNT(`follower`) as `subscriptions` FROM `subscriptions` WHERE `model` = \"openvk\\\Web\\\Models\\\Entities\\\Club\" GROUP BY `target` ORDER BY `subscriptions` DESC, `id` LIMIT 30;";
$entries = DatabaseConnection::i()->getConnection()->query($query);
@ -54,6 +57,7 @@ class Clubs
"club" => $this->get($entry["id"]),
"subscriptions" => $entry["subscriptions"],
];
*/
}
use \Nette\SmartObject;

View file

@ -64,7 +64,7 @@ final class AboutPresenter extends OpenVKPresenter
$this->template->usersStats = (new Users)->getStatistics();
$this->template->clubsCount = (new Clubs)->getCount();
$this->template->postsCount = (new Posts)->getCount();
$this->template->popularClubs = iterator_to_array((new Clubs)->getPopularClubs());
$this->template->popularClubs = [];
$this->template->admins = iterator_to_array((new Users)->getInstanceAdmins());
}