From 28c66af1337e1e0fa65a60d1155116f7763b844f Mon Sep 17 00:00:00 2001 From: Ilya Prokopenko Date: Thu, 14 Apr 2022 18:36:38 +0300 Subject: [PATCH] About: Increase block of top groups & add "Links" Closes #510 Co-authored-by: Celestora --- Web/Models/Repositories/Clubs.php | 2 +- .../templates/About/AboutInstance.xml | 36 ++++++++++++++----- locales/en.strings | 2 ++ locales/ru.strings | 2 ++ openvk-example.yml | 4 +++ 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/Web/Models/Repositories/Clubs.php b/Web/Models/Repositories/Clubs.php index bea73cef..7e813200 100644 --- a/Web/Models/Repositories/Clubs.php +++ b/Web/Models/Repositories/Clubs.php @@ -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) diff --git a/Web/Presenters/templates/About/AboutInstance.xml b/Web/Presenters/templates/About/AboutInstance.xml index af63d9ee..00cddfcc 100644 --- a/Web/Presenters/templates/About/AboutInstance.xml +++ b/Web/Presenters/templates/About/AboutInstance.xml @@ -9,7 +9,7 @@ -
0}style="padding-right: 10px;"{/if}> + 0} style="padding-right: 10px;"{/if}>

{_statistics}

{_on_this_instance_are} @@ -21,6 +21,15 @@
  • {tr("about_wall_posts", $postsCount)|noescape}
  • + {if OPENVK_ROOT_CONF['openvk']['preferences']['about']['links']} +

    {_about_links}

    +
    + {_instance_links} + +
    + {/if}

    {_administrators}

    @@ -44,14 +53,23 @@ {if sizeof($popularClubs) !== 0}

    {_most_popular_groups}

    -
      -
    1. - {$entry->club->getName()} -
      - {tr("participants", $entry->subscriptions)} -
      -
    2. -
    + {var $entries = array_chunk($popularClubs, 10, true)} + + + + + + +
    +
      +
    1. + {$club->club->getName()} +
      + {tr("participants", $club->subscriptions)} +
      +
    2. +
    +
    {/if}

    {_rules}

    diff --git a/locales/en.strings b/locales/en.strings index a305cbdd..800f5ef2 100644 --- a/locales/en.strings +++ b/locales/en.strings @@ -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" = "1 user"; "about_users_other" = "$1 users"; diff --git a/locales/ru.strings b/locales/ru.strings index 0c71d919..b938448e 100644 --- a/locales/ru.strings +++ b/locales/ru.strings @@ -896,6 +896,8 @@ "rules" = "Правила"; "most_popular_groups" = "Самые популярные группы"; "on_this_instance_are" = "На этой инстанции:"; +"about_links" = "Ссылки"; +"instance_links" = "Ссылки инстанции:"; "about_users_one" = "1 пользователь"; "about_users_few" = "$1 пользователя"; diff --git a/openvk-example.yml b/openvk-example.yml index b5ae676b..9e4a5d58 100644 --- a/openvk-example.yml +++ b/openvk-example.yml @@ -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"