About: Increase block of top groups & add "Links"

Closes #510

Co-authored-by: Celestora <kitsuruko@gmail.com>
This commit is contained in:
Ilya Prokopenko 2022-04-14 18:36:38 +03:00
parent 99344c5497
commit 28c66af133
No known key found for this signature in database
GPG key ID: 7736BBBB05F14A56
5 changed files with 36 additions and 10 deletions

View file

@ -45,7 +45,7 @@ class Clubs
function getPopularClubs(): \Traversable
{
$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 10;";
$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 20;";
$entries = DatabaseConnection::i()->getConnection()->query($query);
foreach($entries as $entry)

View file

@ -21,6 +21,15 @@
<li><span>{tr("about_wall_posts", $postsCount)|noescape}</span></li>
</ul>
</div>
{if OPENVK_ROOT_CONF['openvk']['preferences']['about']['links']}
<h4>{_about_links}</h4>
<div style="margin-top: 5px;">
{_instance_links}
<ul>
<li n:foreach="OPENVK_ROOT_CONF['openvk']['preferences']['about']['links'] as $aboutLink"><a href="{$aboutLink['url']}" target="_blank" class="link">{$aboutLink["name"]}</a></li>
</ul>
</div>
{/if}
</td>
<td n:if="sizeof($admins) > 0">
<h4>{_administrators}</h4>
@ -44,14 +53,23 @@
{if sizeof($popularClubs) !== 0}
<h4>{_most_popular_groups}</h4>
{var $entries = array_chunk($popularClubs, 10, true)}
<table width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr valign="top">
<td n:foreach="$entries as $chunk">
<ol>
<li n:foreach="$popularClubs as $entry" style="margin-top: 5px;">
<a href="{$entry->club->getURL()}">{$entry->club->getName()}</a>
<li value="{$num+1}" style="margin-top: 5px;" n:foreach="$chunk as $num => $club">
<a href="{$club->club->getURL()}">{$club->club->getName()}</a>
<div>
{tr("participants", $entry->subscriptions)}
{tr("participants", $club->subscriptions)}
</div>
</li>
</ol>
</td>
</tr>
</tbody>
</table>
{/if}
<h4>{_rules}</h4>

View file

@ -853,6 +853,8 @@
"rules" = "Rules";
"most_popular_groups" = "Most popular groups";
"on_this_instance_are" = "On this instance are:";
"about_links" = "Links";
"instance_links" = "Instance links:";
"about_users_one" = "<b>1</b> user";
"about_users_other" = "<b>$1</b> users";

View file

@ -896,6 +896,8 @@
"rules" = "Правила";
"most_popular_groups" = "Самые популярные группы";
"on_this_instance_are" = "На этой инстанции:";
"about_links" = "Ссылки";
"instance_links" = "Ссылки инстанции:";
"about_users_one" = "<b>1</b> пользователь";
"about_users_few" = "<b>$1</b> пользователя";

View file

@ -57,6 +57,10 @@ openvk:
links:
- name: "@left_menu_donate"
url: "/donate"
about:
links:
- name: "Link caption"
url: "https://example.org/"
adPoster:
enable: false
src: "https://example.org/ad_poster.jpeg"